diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d8771..b93da83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [2.2.17] - (2023-Jan-15) +- Updated image dependency to v4.0.10. Fixes [#497](https://github.com/jonbhanson/flutter_native_splash/issues/497). +- Changed image processing from linear to cubic to improve image quality. Fixes [#472](https://github.com/jonbhanson/flutter_native_splash/issues/472). + ## [2.2.16] - (2022-Nov-27) - Update documentation on Android 12. diff --git a/README.md b/README.md index 319cfc8..f18ec64 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ First, add `flutter_native_splash` as a dependency in your pubspec.yaml file. ```yaml dependencies: - flutter_native_splash: ^2.2.16 + flutter_native_splash: ^2.2.17 ``` Don't forget to `flutter pub get`. diff --git a/example/pubspec.lock b/example/pubspec.lock index 1728af7..af4ee6f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -96,7 +96,7 @@ packages: path: ".." relative: true source: path - version: "2.2.15" + version: "2.2.17" flutter_test: dependency: "direct dev" description: flutter @@ -120,7 +120,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "3.2.2" + version: "4.0.10" js: dependency: transitive description: diff --git a/lib/android.dart b/lib/android.dart index 6277da5..5359e34 100644 --- a/lib/android.dart +++ b/lib/android.dart @@ -272,7 +272,7 @@ void _saveImageAndroid({ image, width: image.width * template.pixelDensity ~/ 4, height: image.height * template.pixelDensity ~/ 4, - interpolation: Interpolation.linear, + interpolation: Interpolation.cubic, ); // Whne the flavor value is not specified we will place all the data inside the main directory. diff --git a/lib/ios.dart b/lib/ios.dart index be8f92e..b04497e 100644 --- a/lib/ios.dart +++ b/lib/ios.dart @@ -68,7 +68,7 @@ void _createiOSSplash({ if (imagePath != null) { _applyImageiOS(imagePath: imagePath, list: _iOSSplashImages); } else { - final splashImage = Image(1, 1); + final splashImage = Image(width: 1, height: 1); for (final template in _iOSSplashImages) { final file = File(_flavorHelper.iOSAssetsLaunchImageFolder + template.fileName); @@ -200,7 +200,7 @@ void _saveImageiOS({ image, width: image.width * template.pixelDensity ~/ 4, height: image.height * template.pixelDensity ~/ 4, - interpolation: Interpolation.linear, + interpolation: Interpolation.cubic, ); final file = File(targetPath + template.fileName); @@ -422,12 +422,12 @@ void _createBackground({ required String darkBackgroundImageDestination, }) { if (colorString != null) { - final background = Image(1, 1); + final background = Image(width: 1, height: 1); final redChannel = int.parse(colorString.substring(0, 2), radix: 16); final greenChannel = int.parse(colorString.substring(2, 4), radix: 16); final blueChannel = int.parse(colorString.substring(4, 6), radix: 16); - background.fill( - 0xFF000000 + (blueChannel << 16) + (greenChannel << 8) + redChannel, + background.clear( + ColorRgb8(redChannel, greenChannel, blueChannel), ); final file = File(backgroundImageDestination); file.createSync(recursive: true); @@ -442,13 +442,11 @@ void _createBackground({ } if (darkColorString != null) { - final background = Image(1, 1); + final background = Image(height: 1, width: 1); final redChannel = int.parse(darkColorString.substring(0, 2), radix: 16); final greenChannel = int.parse(darkColorString.substring(2, 4), radix: 16); final blueChannel = int.parse(darkColorString.substring(4, 6), radix: 16); - background.fill( - 0xFF000000 + (blueChannel << 16) + (greenChannel << 8) + redChannel, - ); + background.clear(ColorRgb8(redChannel, greenChannel, blueChannel)); final file = File(darkBackgroundImageDestination); file.createSync(recursive: true); file.writeAsBytesSync(encodePng(background)); diff --git a/lib/web.dart b/lib/web.dart index 65ef6fa..4956d4b 100644 --- a/lib/web.dart +++ b/lib/web.dart @@ -159,7 +159,7 @@ void _saveImageWeb({ image, width: image.width * template.pixelDensity ~/ 4, height: image.height * template.pixelDensity ~/ 4, - interpolation: Interpolation.linear, + interpolation: Interpolation.cubic, ); final file = File(_webSplashImagesFolder + template.fileName); diff --git a/pubspec.yaml b/pubspec.yaml index ec377d5..4986cc4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_native_splash description: Customize Flutter's default white native splash screen with background color and splash image. Supports dark mode, full screen, and more. -version: 2.2.16 +version: 2.2.17 repository: https://github.com/jonbhanson/flutter_native_splash issue_tracker: https://github.com/jonbhanson/flutter_native_splash/issues @@ -17,7 +17,7 @@ dependencies: sdk: flutter js: ^0.6.4 html: ^0.15.1 - image: ^3.2.2 + image: ^4.0.10 meta: ^1.8.0 path: ^1.8.2 universal_io: ^2.0.4