Skip to content

Commit

Permalink
fix: deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ilteoood committed Aug 15, 2023
1 parent 535cf30 commit a134a55
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,5 @@ Support for Dart 3 and Flutter 3.10
Fix for #204

## [0.34.0]
Upgrade http@1.1.0, logging@1.2.0, xml2json@6.2.0, yaml@3.1.2, path@1.8.3
Upgrade http@1.1.0, logging@1.2.0, xml2json@6.2.0, yaml@3.1.2, path@1.8.3
Fix: deprecation warnings
5 changes: 2 additions & 3 deletions lib/loaders/translation_loader.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:ui' as ui;

import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_i18n/utils/message_printer.dart';

Expand All @@ -23,7 +22,7 @@ abstract class TranslationLoader {

/// Return the device current locale
Future<Locale> findDeviceLocale() async {
final systemLocale = ui.window.locale;
final systemLocale = PlatformDispatcher.instance.locale;
MessagePrinter.info("The system locale is $systemLocale");
return Future.value(systemLocale);
}
Expand Down
6 changes: 4 additions & 2 deletions test/flutter_i18n_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized();

setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, (MethodCall methodCall) async {
return '42';
});
});

tearDown(() {
channel.setMockMethodCallHandler(null);
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, null);
});
}

0 comments on commit a134a55

Please sign in to comment.