Skip to content

Commit e8253e2

Browse files
authored
restrict app language support to english only
2 parents fa1b5e2 + 6eedb0d commit e8253e2

File tree

10 files changed

+234
-507
lines changed

10 files changed

+234
-507
lines changed

analysis_options.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include: package:very_good_analysis/analysis_options.5.0.0.yaml
1+
include: package:very_good_analysis/analysis_options.6.0.0.yaml
22
analyzer:
33
exclude:
44
- "**.g.dart"

lib/app/l10n/app_l10n.dart

-7
This file was deleted.

lib/app/l10n/arb/app_de.arb

-175
This file was deleted.

lib/app/l10n/cubit/l10n_cubit.dart

-27
This file was deleted.

lib/app/l10n/cubit/l10n_state.dart

-31
This file was deleted.

lib/app/view/app.dart

+23-31
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_bloc/flutter_bloc.dart';
33
import 'package:flutter_localized_locales/flutter_localized_locales.dart';
4-
import 'package:gpt_detector/app/l10n/cubit/l10n_cubit.dart';
54
import 'package:gpt_detector/app/l10n/extensions/app_l10n_extensions.dart';
65
import 'package:gpt_detector/app/theme/cubit/theme_cubit.dart';
76
import 'package:gpt_detector/app/theme/dark/dark_theme.dart';
@@ -17,46 +16,39 @@ class App extends StatelessWidget {
1716
Widget build(BuildContext context) {
1817
return MultiBlocProvider(
1918
providers: [
20-
BlocProvider(
21-
create: (context) => Locator.instance<L10nCubit>(),
22-
),
2319
BlocProvider(
2420
create: (context) => Locator.instance<ThemeCubit>(),
2521
),
2622
],
2723
child: BlocBuilder<ThemeCubit, ThemeState>(
2824
builder: (context, themeState) {
29-
return BlocBuilder<L10nCubit, L10nState>(
30-
builder: (context, l10nState) {
31-
return MaterialApp(
32-
debugShowCheckedModeBanner: false,
25+
return MaterialApp(
26+
debugShowCheckedModeBanner: false,
3327

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+
),
4337

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,
4842

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+
],
5650

57-
home: const SplashView(),
58-
);
59-
},
51+
home: const SplashView(),
6052
);
6153
},
6254
),

lib/feature/detector/presentation/view/detect_view.dart

-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import 'package:gpt_detector/feature/detector/presentation/cubit/detector_cubit.
1313
import 'package:gpt_detector/feature/detector/presentation/widgets/gpt_card.dart';
1414
import 'package:gpt_detector/feature/detector/presentation/widgets/gpt_drawer.dart';
1515
import 'package:gpt_detector/feature/detector/presentation/widgets/gpt_faq_dialog.dart';
16-
import 'package:gpt_detector/feature/detector/presentation/widgets/gpt_language_dialog.dart';
1716
import 'package:gpt_detector/feature/detector/presentation/widgets/gpt_text_field.dart';
1817
import 'package:gpt_detector/locator.dart';
1918

@@ -33,10 +32,6 @@ class DetectView extends StatelessWidget {
3332
onPressed: () => showDialog<void>(context: context, builder: (context) => const GPTFAQDialog()),
3433
icon: const Icon(Icons.info),
3534
),
36-
IconButton(
37-
onPressed: () => showDialog<void>(context: context, builder: (context) => const GPTLanguageDialog()),
38-
icon: const Icon(Icons.language),
39-
),
4035
],
4136
),
4237
drawer: const GPTDrawer(),

lib/feature/detector/presentation/widgets/gpt_language_dialog.dart

-49
This file was deleted.

0 commit comments

Comments
 (0)