Open4

初心者がFlutterのmain関数をしらべる

nebokete10minnebokete10min
void main() {
  runApp(MyApp());
}
void main() {
  runApp(const MyApp());
}
void main() => runApp(MyApp());
void main() => runApp(const MyApp());

これと
void main() {
runApp(const MyApp());
}
これがあるのは
const MyApp({Key? key}) : super(key: key);

古いFlutterのソースコード?

nebokete10minnebokete10min
void main(List<String> args) async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(const BilleddelingApp());
}
nebokete10minnebokete10min
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  ).then((value) {
    Get.put(AuthController());
  });
  await Hive.initFlutter();
  runApp(const MyApp());
}