You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:flutter_bloc/flutter_bloc.dart';
  4. import 'package:flutter_riverpod/flutter_riverpod.dart';
  5. import 'package:my_flutter_puzzle/cubits/count_down_timer_cubit.dart';
  6. import 'package:my_flutter_puzzle/res/palette.dart';
  7. import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
  8. import 'package:my_flutter_puzzle/screens/splash/screen/splash_screen.dart';
  9. import 'package:my_flutter_puzzle/utils/color_brightness.dart';
  10. import 'package:url_strategy/url_strategy.dart';
  11. void main() async {
  12. setPathUrlStrategy();
  13. WidgetsFlutterBinding.ensureInitialized();
  14. runApp(const ProviderScope(child: MyApp()));
  15. }
  16. class MyApp extends StatelessWidget {
  17. const MyApp({Key? key}) : super(key: key);
  18. @override
  19. Widget build(BuildContext context) {
  20. SystemChrome.setPreferredOrientations([
  21. DeviceOrientation.landscapeLeft,
  22. DeviceOrientation.landscapeRight,
  23. ]);
  24. SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
  25. return BlocProvider(
  26. create: (context) => CountDownTimerCubit(),
  27. child: MaterialApp(
  28. title: 'Flutter Puzzle',
  29. debugShowCheckedModeBanner: false,
  30. theme: ThemeData(
  31. primarySwatch: Colors.blue,
  32. fontFamily: 'GoogleSans',
  33. backgroundColor: Palette.blue.darken(0.3),
  34. colorScheme: ColorScheme(
  35. brightness: Theme.of(context).brightness,
  36. primary: Palette.blue,
  37. onPrimary: Colors.white,
  38. secondary: Palette.blue.withOpacity(0.6),
  39. onSecondary: Palette.blue.withOpacity(0.3),
  40. error: Theme.of(context).colorScheme.error,
  41. onError: Theme.of(context).colorScheme.onError,
  42. background: Palette.blue.darken(0.3),
  43. onBackground: Colors.white,
  44. surface: Palette.crimson,
  45. onSurface: Colors.white38,
  46. ),
  47. ),
  48. home: const SplashScreen(),
  49. ),
  50. );
  51. }
  52. }