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.

54 lines
1.9 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
  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/splash/screen/splash_screen.dart';
  9. import 'package:my_flutter_puzzle/utils/color_brightness.dart';
  10. void main() async {
  11. WidgetsFlutterBinding.ensureInitialized();
  12. await Initializer.instance.initialHive();
  13. runApp(const ProviderScope(child: MyApp()));
  14. }
  15. class MyApp extends StatelessWidget {
  16. const MyApp({Key? key}) : super(key: key);
  17. @override
  18. Widget build(BuildContext context) {
  19. SystemChrome.setPreferredOrientations([
  20. DeviceOrientation.landscapeLeft,
  21. DeviceOrientation.landscapeRight,
  22. ]);
  23. SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
  24. return BlocProvider(
  25. create: (context) => CountDownTimerCubit(),
  26. child: MaterialApp(
  27. title: 'Flutter Puzzle',
  28. debugShowCheckedModeBanner: false,
  29. theme: ThemeData(
  30. primarySwatch: Colors.blue,
  31. fontFamily: 'GoogleSans',
  32. backgroundColor: Palette.blue.darken(0.3),
  33. colorScheme: ColorScheme(
  34. brightness: Theme.of(context).brightness,
  35. primary: Palette.blue,
  36. onPrimary: Colors.white,
  37. secondary: Palette.blue.withOpacity(0.6),
  38. onSecondary: Palette.blue.withOpacity(0.3),
  39. error: Theme.of(context).colorScheme.error,
  40. onError: Theme.of(context).colorScheme.onError,
  41. background: Palette.blue.darken(0.3),
  42. onBackground: Colors.white,
  43. surface: Palette.crimson,
  44. onSurface: Colors.white38,
  45. ),
  46. ),
  47. home: const SplashScreen(),
  48. ),
  49. );
  50. }
  51. }