main.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import 'package:flutter/material.dart';
  2. import 'pages/index_page.dart';
  3. import 'generated/l10n.dart';
  4. import 'package:flutter_localizations/flutter_localizations.dart';
  5. import 'package:flutter/services.dart';
  6. void main() {
  7. WidgetsFlutterBinding.ensureInitialized();
  8. runApp(GameApp());
  9. SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
  10. statusBarColor: Colors.transparent,
  11. statusBarIconBrightness: Brightness.dark,
  12. systemNavigationBarColor: Colors.transparent,
  13. systemNavigationBarIconBrightness: Brightness.dark,
  14. ));
  15. }
  16. class GameApp extends StatefulWidget {
  17. @override
  18. State<StatefulWidget> createState() => _GameAppState();
  19. }
  20. class _GameAppState extends State<GameApp> {
  21. @override
  22. Widget build(BuildContext context) {
  23. return MaterialApp(
  24. localizationsDelegates: [
  25. S.delegate,
  26. GlobalMaterialLocalizations.delegate,
  27. GlobalWidgetsLocalizations.delegate,
  28. GlobalCupertinoLocalizations.delegate,
  29. ],
  30. supportedLocales: S.delegate.supportedLocales,
  31. debugShowCheckedModeBanner: false,
  32. title: "2048",
  33. theme: ThemeData(primaryColor: Colors.orange),
  34. home: Material(
  35. color: Color(0xfffaf8ef),
  36. child: SafeArea(
  37. left: false,
  38. right: false,
  39. child: IndexPage(),
  40. ),
  41. ),
  42. );
  43. }
  44. }