Skip to content

Commit

Permalink
#349: fixed injectable issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jorre127 committed Oct 10, 2024
1 parent 571a4ff commit f7b2f3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/repository/remote_config/remote_config_repository.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter_template/di/injectable.dart';
import 'package:flutter_template/repository/remote_config/base_remote_config_repository.dart';
import 'package:flutter_template/styles/theme_durations.dart';
import 'package:flutter_template/util/locale/localization_overrides.dart';
Expand All @@ -22,7 +23,7 @@ class RemoteConfigRepository extends BaseRemoteConfigRepo {
);
try {
await _remoteConfig.fetchAndActivate();
await GetIt.I<LocalizationOverrides>().refreshOverrideLocalizations();
await getIt.get<LocalizationOverrides>().refreshOverrideLocalizations();
} catch (error, trace) {
logger.error('Unable to fetch remote config. Cached or default values will be used', error: error, stackTrace: trace);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/util/locale/localization_overrides_impl.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'dart:ui';

import 'package:flutter_template/di/injectable.dart';
import 'package:flutter_template/util/extension/localized_message_extension.dart';
import 'package:flutter_template/util/extension/remote_config_extension.dart';
import 'package:flutter_template/util/locale/localization_overrides.dart';
import 'package:flutter_template/viewmodel/global/global_viewmodel.dart';
import 'package:get_it/get_it.dart';
import 'package:injectable/injectable.dart';

@LazySingleton(as: LocalizationOverrides)
Expand All @@ -16,6 +16,6 @@ class LocalizationOverridesImpl extends LocalizationOverrides {

@override
Future<void> refreshOverrideLocalizations() async {
GetIt.I<GlobalViewModel>().overrideLocalizations();
getIt.get<GlobalViewModel>().overrideLocalizations();
}
}

0 comments on commit f7b2f3e

Please sign in to comment.