1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter_bloc/flutter_bloc.dart' ;
3
3
import 'package:flutter_localized_locales/flutter_localized_locales.dart' ;
4
- import 'package:gpt_detector/app/l10n/cubit/l10n_cubit.dart' ;
5
4
import 'package:gpt_detector/app/l10n/extensions/app_l10n_extensions.dart' ;
6
5
import 'package:gpt_detector/app/theme/cubit/theme_cubit.dart' ;
7
6
import 'package:gpt_detector/app/theme/dark/dark_theme.dart' ;
@@ -17,46 +16,39 @@ class App extends StatelessWidget {
17
16
Widget build (BuildContext context) {
18
17
return MultiBlocProvider (
19
18
providers: [
20
- BlocProvider (
21
- create: (context) => Locator .instance <L10nCubit >(),
22
- ),
23
19
BlocProvider (
24
20
create: (context) => Locator .instance <ThemeCubit >(),
25
21
),
26
22
],
27
23
child: BlocBuilder <ThemeCubit , ThemeState >(
28
24
builder: (context, themeState) {
29
- return BlocBuilder <L10nCubit , L10nState >(
30
- builder: (context, l10nState) {
31
- return MaterialApp (
32
- debugShowCheckedModeBanner: false ,
25
+ return MaterialApp (
26
+ debugShowCheckedModeBanner: false ,
33
27
34
- builder: (context, child) => MediaQuery (
35
- // Disables font scaling and bold text
36
- data: context.mediaQuery.copyWith (textScaler: TextScaler .noScaling, boldText: false ),
37
- // Dismisses the keyboard globally
38
- child: GestureDetector (
39
- onTap: () => FocusManager .instance.primaryFocus? .unfocus (),
40
- child: child,
41
- ),
42
- ),
28
+ builder: (context, child) => MediaQuery (
29
+ // Disables font scaling and bold text
30
+ data: context.mediaQuery.copyWith (textScaler: TextScaler .noScaling, boldText: false ),
31
+ // Dismisses the keyboard globally
32
+ child: GestureDetector (
33
+ onTap: () => FocusManager .instance.primaryFocus? .unfocus (),
34
+ child: child,
35
+ ),
36
+ ),
43
37
44
- // Theme
45
- themeMode: themeState.themeMode,
46
- theme: Locator .instance <LightTheme >().theme,
47
- darkTheme: Locator .instance <DarkTheme >().theme,
38
+ // Theme
39
+ themeMode: themeState.themeMode,
40
+ theme: Locator .instance <LightTheme >().theme,
41
+ darkTheme: Locator .instance <DarkTheme >().theme,
48
42
49
- // Localization
50
- locale: l10nState.locale ,
51
- supportedLocales: AppLocalizations .supportedLocales,
52
- localizationsDelegates: const [
53
- ...AppLocalizations .localizationsDelegates,
54
- LocaleNamesLocalizationsDelegate (),
55
- ],
43
+ // Localization
44
+ locale: AppLocalizations .supportedLocales.first ,
45
+ supportedLocales: AppLocalizations .supportedLocales,
46
+ localizationsDelegates: const [
47
+ ...AppLocalizations .localizationsDelegates,
48
+ LocaleNamesLocalizationsDelegate (),
49
+ ],
56
50
57
- home: const SplashView (),
58
- );
59
- },
51
+ home: const SplashView (),
60
52
);
61
53
},
62
54
),
0 commit comments