Обновлен проект. Добавлена БД
This commit is contained in:
62
lib/app.dart
62
lib/app.dart
@@ -8,6 +8,7 @@ import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:fps_widget/fps_widget.dart';
|
||||
import 'package:oktoast/oktoast.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:remever/common/events/common_events.dart';
|
||||
import 'package:remever/common/events/events.dart';
|
||||
@@ -137,7 +138,7 @@ class _MyAppState extends State<MyApp>
|
||||
///
|
||||
Widget _buildMaterialApp(ThemeMode themeMode) {
|
||||
return MaterialApp.router(
|
||||
title: 'Who Will Win',
|
||||
title: 'Remever',
|
||||
theme: CustomTheme.lightTheme,
|
||||
darkTheme: CustomTheme.darkTheme,
|
||||
themeMode: themeMode,
|
||||
@@ -147,35 +148,44 @@ class _MyAppState extends State<MyApp>
|
||||
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
||||
routerConfig: globalRouter.config(),
|
||||
builder: (BuildContext context, Widget? child) {
|
||||
return ChangeNotifierProvider<AppSettingsNotifier>(
|
||||
create: (_) => settingsNotifier,
|
||||
builder: (BuildContext context, Widget? nchild) {
|
||||
if (nchild != null) return nchild;
|
||||
return OKToast(
|
||||
position: ToastPosition.bottom,
|
||||
backgroundColor: Colors.black.withOpacity(0.7),
|
||||
child: MediaQuery(
|
||||
data: MediaQuery.of(
|
||||
context,
|
||||
).copyWith(textScaler: TextScaler.noScaling),
|
||||
child: ChangeNotifierProvider<AppSettingsNotifier>(
|
||||
create: (_) => settingsNotifier,
|
||||
builder: (BuildContext context, Widget? nchild) {
|
||||
if (nchild != null) return nchild;
|
||||
|
||||
return Consumer<AppSettingsNotifier>(
|
||||
// TIP: должно убрать мерцание
|
||||
key: const Key('consumer AppSettingsNotifier'),
|
||||
child: child,
|
||||
builder: (
|
||||
BuildContext context,
|
||||
AppSettingsNotifier value,
|
||||
Widget? nchild,
|
||||
) {
|
||||
final Widget result = nchild ?? const SizedBox();
|
||||
return Consumer<AppSettingsNotifier>(
|
||||
// TIP: должно убрать мерцание
|
||||
key: const Key('consumer AppSettingsNotifier'),
|
||||
child: child,
|
||||
builder: (
|
||||
BuildContext context,
|
||||
AppSettingsNotifier value,
|
||||
Widget? nchild,
|
||||
) {
|
||||
final Widget result = nchild ?? const SizedBox();
|
||||
|
||||
if (value.showFps) {
|
||||
return Material(
|
||||
child: FPSWidget(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: result,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (value.showFps) {
|
||||
return Material(
|
||||
child: FPSWidget(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: result,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user