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.

44 lines
1.6 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
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/initializer.dart';
  7. import 'package:my_flutter_puzzle/res/palette.dart';
  8. import 'package:my_flutter_puzzle/screens/level_list/cubit/level_list_cubit.dart';
  9. import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
  10. import 'package:my_flutter_puzzle/screens/splash/screen/splash_screen.dart';
  11. import 'package:my_flutter_puzzle/utils/color_brightness.dart';
  12. void main() async {
  13. WidgetsFlutterBinding.ensureInitialized();
  14. await Initializer.instance.initialHive();
  15. runApp(const ProviderScope(child: MyApp()));
  16. }
  17. class MyApp extends StatelessWidget {
  18. const MyApp({Key? key}) : super(key: key);
  19. @override
  20. Widget build(BuildContext context) {
  21. SystemChrome.setPreferredOrientations([
  22. DeviceOrientation.landscapeLeft,
  23. DeviceOrientation.landscapeRight,
  24. ]);
  25. SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
  26. return MultiBlocProvider(
  27. providers: [
  28. BlocProvider<LevelListCubit>(create: (context) => LevelListCubit()),
  29. BlocProvider<CountDownTimerCubit>(create: (context) => CountDownTimerCubit()),
  30. ],
  31. child: MaterialApp(
  32. debugShowCheckedModeBanner: false,
  33. initialRoute: '/',
  34. routes: {
  35. '/': (context) => const SplashScreen(),
  36. 'level_list': (context) => const LevelListScreen(),
  37. },
  38. ),
  39. );
  40. }
  41. }