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.

55 lines
1.8 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
  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/utils/color_brightness.dart';
  9. import 'package:url_strategy/url_strategy.dart';
  10. void main() async {
  11. setPathUrlStrategy();
  12. WidgetsFlutterBinding.ensureInitialized();
  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. return BlocProvider(
  24. create: (context) => CountDownTimerCubit(),
  25. child: MaterialApp(
  26. title: 'Flutter Puzzle',
  27. debugShowCheckedModeBanner: false,
  28. theme: ThemeData(
  29. primarySwatch: Colors.blue,
  30. fontFamily: 'GoogleSans',
  31. backgroundColor: Palette.blue.darken(0.3),
  32. colorScheme: ColorScheme(
  33. brightness: Theme.of(context).brightness,
  34. primary: Palette.blue,
  35. onPrimary: Colors.white,
  36. secondary: Palette.blue.withOpacity(0.6),
  37. onSecondary: Palette.blue.withOpacity(0.3),
  38. error: Theme.of(context).colorScheme.error,
  39. onError: Theme.of(context).colorScheme.onError,
  40. background: Palette.blue.darken(0.3),
  41. onBackground: Colors.white,
  42. surface: Palette.crimson,
  43. onSurface: Colors.white38,
  44. ),
  45. ),
  46. home: const LevelListScreen(),
  47. ),
  48. );
  49. }
  50. }