|
|
@ -8,7 +8,6 @@
|
|
|
|
// import 'firebase_options.dart';
|
|
|
|
// import 'firebase_options.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
|
|
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import 'package:go_router/go_router.dart';
|
|
|
@ -64,16 +63,6 @@ Future<void> main() async {
|
|
|
|
|
|
|
|
|
|
|
|
/// Without logging and crash reporting, this would be `void main()`.
|
|
|
|
/// Without logging and crash reporting, this would be `void main()`.
|
|
|
|
void guardedMain() {
|
|
|
|
void guardedMain() {
|
|
|
|
if (kReleaseMode) {
|
|
|
|
|
|
|
|
// Don't log anything below warnings in production.
|
|
|
|
|
|
|
|
Logger.root.level = Level.WARNING;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Logger.root.onRecord.listen((record) {
|
|
|
|
|
|
|
|
debugPrint('${record.level.name}: ${record.time}: '
|
|
|
|
|
|
|
|
'${record.loggerName}: '
|
|
|
|
|
|
|
|
'${record.message}');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
|
|
|
|
|
|
|
_log.info('Going full screen');
|
|
|
|
_log.info('Going full screen');
|
|
|
@ -134,8 +123,10 @@ class MyApp extends StatelessWidget {
|
|
|
|
GoRoute(
|
|
|
|
GoRoute(
|
|
|
|
path: 'play',
|
|
|
|
path: 'play',
|
|
|
|
pageBuilder: (context, state) => buildMyTransition<void>(
|
|
|
|
pageBuilder: (context, state) => buildMyTransition<void>(
|
|
|
|
|
|
|
|
key: ValueKey('play'),
|
|
|
|
child: const LevelSelectionScreen(
|
|
|
|
child: const LevelSelectionScreen(
|
|
|
|
key: Key('level selection')),
|
|
|
|
key: Key('level selection'),
|
|
|
|
|
|
|
|
),
|
|
|
|
color: context.watch<Palette>().backgroundLevelSelection,
|
|
|
|
color: context.watch<Palette>().backgroundLevelSelection,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
routes: [
|
|
|
|
routes: [
|
|
|
@ -147,6 +138,7 @@ class MyApp extends StatelessWidget {
|
|
|
|
final level = gameLevels
|
|
|
|
final level = gameLevels
|
|
|
|
.singleWhere((e) => e.number == levelNumber);
|
|
|
|
.singleWhere((e) => e.number == levelNumber);
|
|
|
|
return buildMyTransition<void>(
|
|
|
|
return buildMyTransition<void>(
|
|
|
|
|
|
|
|
key: ValueKey('level'),
|
|
|
|
child: PlaySessionScreen(
|
|
|
|
child: PlaySessionScreen(
|
|
|
|
level,
|
|
|
|
level,
|
|
|
|
key: const Key('play session'),
|
|
|
|
key: const Key('play session'),
|
|
|
@ -172,6 +164,7 @@ class MyApp extends StatelessWidget {
|
|
|
|
final score = map['score'] as Score;
|
|
|
|
final score = map['score'] as Score;
|
|
|
|
|
|
|
|
|
|
|
|
return buildMyTransition<void>(
|
|
|
|
return buildMyTransition<void>(
|
|
|
|
|
|
|
|
key: ValueKey('won'),
|
|
|
|
child: WinGameScreen(
|
|
|
|
child: WinGameScreen(
|
|
|
|
score: score,
|
|
|
|
score: score,
|
|
|
|
key: const Key('win game'),
|
|
|
|
key: const Key('win game'),
|
|
|
|