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.

56 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
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_riverpod/flutter_riverpod.dart';
  4. import 'package:my_flutter_puzzle/res/palette.dart';
  5. import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
  6. import 'package:my_flutter_puzzle/screens/puzzle/puzzle_starter_screen.dart';
  7. import 'package:my_flutter_puzzle/utils/color_brightness.dart';
  8. import 'package:my_flutter_puzzle/utils/extensions/string_extensions.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 MaterialApp(
  24. title: 'Flutter Puzzle',
  25. debugShowCheckedModeBanner: false,
  26. theme: ThemeData(
  27. primarySwatch: Colors.blue,
  28. fontFamily: 'GoogleSans',
  29. backgroundColor: Palette.blue.darken(0.3),
  30. colorScheme: ColorScheme(
  31. brightness: Theme.of(context).brightness,
  32. primary: Palette.blue,
  33. onPrimary: Colors.white,
  34. secondary: Palette.blue.withOpacity(0.6),
  35. onSecondary: Palette.blue.withOpacity(0.3),
  36. error: Theme.of(context).colorScheme.error,
  37. onError: Theme.of(context).colorScheme.onError,
  38. background: Palette.blue.darken(0.3),
  39. onBackground: Colors.white,
  40. surface: Palette.crimson,
  41. onSurface: Colors.white38,
  42. ),
  43. ),
  44. home: PuzzleStarterScreen(
  45. duration: 3,
  46. puzzleSize: 5,
  47. image: 'default_image'.pngPath,
  48. ),
  49. );
  50. }
  51. }