Flutter como carregar uma função de futuro em função principal

Exemplos de código

0
0

flutter como carregar uma função de futuro em função principal

Add this:

WidgetsFlutterBinding.ensureInitialized();
Before every single future functions in your main function

Example:
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await FutureFunction();

  runApp(
    MaterialApp(
      home: MyApp(),
    ),
  );
}

Páginas relacionadas

Páginas semelhantes com exemplos

Em outros idiomas

Esta página está em outros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................