Skip to content

Commit

Permalink
Get rid of flutter_localizations (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
alesiaradkevich authored Aug 11, 2023
1 parent d151d41 commit b5edfdb
Show file tree
Hide file tree
Showing 35 changed files with 380 additions and 1,256 deletions.
1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class MyApp extends StatelessWidget {
),
),
),
localizationsDelegates: const [SuggestionsLocalizations.delegate],
);
}
}
Expand Down
5 changes: 0 additions & 5 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.1"
flutter_localizations:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_svg:
dependency: transitive
description:
Expand Down
8 changes: 8 additions & 0 deletions lib/src/presentation/di/injector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:suggest_a_feature/src/data/interfaces/suggestions_data_source.da
import 'package:suggest_a_feature/src/data/repositories/suggestion_repository.dart';
import 'package:suggest_a_feature/src/domain/data_interfaces/suggestion_repository.dart';
import 'package:suggest_a_feature/src/domain/entities/admin_settings.dart';
import 'package:suggest_a_feature/src/presentation/localization/localization_extensions.dart';
import 'package:suggest_a_feature/src/presentation/localization/localization_options.dart';
import 'package:suggest_a_feature/src/presentation/pages/theme/suggestions_theme.dart';

// ignore: library_private_types_in_public_api
Expand All @@ -22,6 +24,7 @@ class _Injector {
required SuggestionsTheme theme,
required String userId,
required SuggestionsDataSource suggestionsDataSource,
required String locale,
AdminSettings? adminSettings,
bool isAdmin = false,
Map<String, String>? imageHeaders,
Expand All @@ -41,6 +44,7 @@ class _Injector {
);
_adminSettings = adminSettings;
_isAdmin = isAdmin;
_localization = locale.localizationOptions;
}

AdminSettings? _adminSettings;
Expand Down Expand Up @@ -72,4 +76,8 @@ class _Injector {
late SuggestionRepository _suggestionRepository;

SuggestionRepository get suggestionRepository => _suggestionRepository;

late LocalizationOptions _localization;

LocalizationOptions get localizations => _localization;
}
55 changes: 0 additions & 55 deletions lib/src/presentation/l10n/app_en.arb

This file was deleted.

55 changes: 0 additions & 55 deletions lib/src/presentation/l10n/app_ru.arb

This file was deleted.

55 changes: 0 additions & 55 deletions lib/src/presentation/l10n/app_uk.arb

This file was deleted.

Loading

0 comments on commit b5edfdb

Please sign in to comment.