From c917141350b247cc13cd8a3a244f09938a82fb26 Mon Sep 17 00:00:00 2001 From: sjoulbak Date: Wed, 8 Jun 2022 12:09:10 +0200 Subject: [PATCH] Removed unnecessary imports and casts --- bin/flutter_i18n.dart | 2 -- example/lib/basic_example.dart | 2 -- example/lib/local_example.dart | 1 - example/lib/namespace_example.dart | 1 - example/lib/network_example.dart | 1 - example/test/namespace_example_test.dart | 1 - lib/flutter_i18n.dart | 3 --- lib/flutter_i18n_delegate.dart | 1 - lib/loaders/e2e_file_translation_loader.dart | 1 - lib/loaders/file_translation_loader.dart | 5 ++--- lib/loaders/namespace_file_translation_loader.dart | 1 - test/loaders/file_translation_loader_test.dart | 2 -- test/loaders/network_file_translation_loader_test.dart | 2 -- 13 files changed, 2 insertions(+), 21 deletions(-) diff --git a/bin/flutter_i18n.dart b/bin/flutter_i18n.dart index bc42297..591cbae 100644 --- a/bin/flutter_i18n.dart +++ b/bin/flutter_i18n.dart @@ -1,5 +1,3 @@ -import 'package:flutter_i18n/utils/message_printer.dart'; - import 'actions/ActionInterface.dart'; import 'actions/DiffAction.dart'; import 'actions/ValidateAction.dart'; diff --git a/example/lib/basic_example.dart b/example/lib/basic_example.dart index f8afd96..095dcf4 100644 --- a/example/lib/basic_example.dart +++ b/example/lib/basic_example.dart @@ -2,8 +2,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; -import 'package:flutter_i18n/widgets/I18nPlural.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; Future main() async { diff --git a/example/lib/local_example.dart b/example/lib/local_example.dart index 0c5f923..0441fda 100644 --- a/example/lib/local_example.dart +++ b/example/lib/local_example.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:io'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n_delegate.dart'; import 'package:flutter_i18n/loaders/decoders/json_decode_strategy.dart'; diff --git a/example/lib/namespace_example.dart b/example/lib/namespace_example.dart index c16e944..9ae43cd 100644 --- a/example/lib/namespace_example.dart +++ b/example/lib/namespace_example.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; Future main() async { diff --git a/example/lib/network_example.dart b/example/lib/network_example.dart index 094b77c..dd6c2bc 100644 --- a/example/lib/network_example.dart +++ b/example/lib/network_example.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_i18n/loaders/decoders/json_decode_strategy.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; class CustomNetworkFileTranslationLoader extends NetworkFileTranslationLoader { diff --git a/example/test/namespace_example_test.dart b/example/test/namespace_example_test.dart index 67acbe7..b12a429 100644 --- a/example/test/namespace_example_test.dart +++ b/example/test/namespace_example_test.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_i18n_example/main.dart' as appmain; import 'package:flutter_test/flutter_test.dart'; diff --git a/lib/flutter_i18n.dart b/lib/flutter_i18n.dart index f43ed8e..4ff4ae6 100644 --- a/lib/flutter_i18n.dart +++ b/lib/flutter_i18n.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:flutter/foundation.dart' as Foundation; import 'package:flutter/widgets.dart'; import 'package:flutter_i18n/loaders/file_translation_loader.dart'; import 'package:flutter_i18n/loaders/translation_loader.dart'; @@ -9,8 +8,6 @@ import 'package:flutter_i18n/utils/plural_translator.dart'; import 'package:flutter_i18n/utils/simple_translator.dart'; import 'package:intl/intl.dart' as intl; -import 'utils/message_printer.dart'; - export 'flutter_i18n_delegate.dart'; export 'loaders/e2e_file_translation_loader.dart'; export 'loaders/file_translation_loader.dart'; diff --git a/lib/flutter_i18n_delegate.dart b/lib/flutter_i18n_delegate.dart index 46d8230..e6363da 100644 --- a/lib/flutter_i18n_delegate.dart +++ b/lib/flutter_i18n_delegate.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:flutter_i18n/loaders/translation_loader.dart'; import 'package:flutter_i18n/utils/message_printer.dart'; import 'flutter_i18n.dart'; diff --git a/lib/loaders/e2e_file_translation_loader.dart b/lib/loaders/e2e_file_translation_loader.dart index e0c5ebe..2d514d9 100644 --- a/lib/loaders/e2e_file_translation_loader.dart +++ b/lib/loaders/e2e_file_translation_loader.dart @@ -1,6 +1,5 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:typed_data'; import 'package:flutter/services.dart'; diff --git a/lib/loaders/file_translation_loader.dart b/lib/loaders/file_translation_loader.dart index b284b4e..27565eb 100644 --- a/lib/loaders/file_translation_loader.dart +++ b/lib/loaders/file_translation_loader.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'package:flutter/services.dart'; -import 'package:flutter/services.dart' show rootBundle; import 'package:flutter/widgets.dart'; import 'package:flutter_i18n/loaders/decoders/base_decode_strategy.dart'; import 'package:flutter_i18n/loaders/decoders/json_decode_strategy.dart'; @@ -87,8 +86,8 @@ class FileTranslationLoader extends TranslationLoader implements IFileContent { V mapResult; if (result.containsKey(key)) { if (p1 is Map && p2 is Map) { - Map map1 = p1 as Map; - Map map2 = p2 as Map; + Map map1 = p1; + Map map2 = p2; mapResult = _deepMergeMaps(map1, map2) as V; } else { mapResult = p2; diff --git a/lib/loaders/namespace_file_translation_loader.dart b/lib/loaders/namespace_file_translation_loader.dart index 60eae3a..7665b58 100644 --- a/lib/loaders/namespace_file_translation_loader.dart +++ b/lib/loaders/namespace_file_translation_loader.dart @@ -1,5 +1,4 @@ import 'package:flutter/services.dart'; -import 'package:flutter/services.dart' show rootBundle; import 'package:flutter_i18n/loaders/file_translation_loader.dart'; import 'package:flutter_i18n/utils/message_printer.dart'; diff --git a/test/loaders/file_translation_loader_test.dart b/test/loaders/file_translation_loader_test.dart index 3df7bac..3333cac 100644 --- a/test/loaders/file_translation_loader_test.dart +++ b/test/loaders/file_translation_loader_test.dart @@ -1,5 +1,3 @@ -import 'dart:math'; - import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/test/loaders/network_file_translation_loader_test.dart b/test/loaders/network_file_translation_loader_test.dart index f2acfd9..695a9ce 100644 --- a/test/loaders/network_file_translation_loader_test.dart +++ b/test/loaders/network_file_translation_loader_test.dart @@ -1,8 +1,6 @@ import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_test/flutter_test.dart'; -import '../test_asset_bundle.dart'; - class CustomNetworkFileTranslationLoader extends NetworkFileTranslationLoader { CustomNetworkFileTranslationLoader({required baseUri}) : super(baseUri: baseUri);