From a895cdeb3acccfd0cadf4e844e151c547964be6c Mon Sep 17 00:00:00 2001 From: goodspeed Date: Sun, 25 Aug 2024 15:34:12 +0800 Subject: [PATCH] update ios app logo size --- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Podfile | 2 +- ios/Runner.xcodeproj/project.pbxproj | 6 ++-- .../features/app_icon/app_icon_ios_view.dart | 28 ++++++++++++------- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 9625e10..7c56964 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/ios/Podfile b/ios/Podfile index fdcc671..d97f17e 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '11.0' +# platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9b4277b..760bf40 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -345,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -472,7 +472,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -521,7 +521,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/lib/src/features/app_icon/app_icon_ios_view.dart b/lib/src/features/app_icon/app_icon_ios_view.dart index cf7c5dc..7eacf21 100644 --- a/lib/src/features/app_icon/app_icon_ios_view.dart +++ b/lib/src/features/app_icon/app_icon_ios_view.dart @@ -116,11 +116,19 @@ class _iOSAppIconEditorPageState extends State { _previewImages = {}; }); + int index = 1; + double lastSize = 0; for (double size in sizeList) { - final resizedImage = - await _resizeImage(result, size.toInt(), size.toInt()); + if (size == lastSize) { + index++; + } else if (size != lastSize) { + index = 1; + } + lastSize = size; + final resizedImage = await _resizeImage( + result, size.toInt() * index, size.toInt() * index); setState(() { - _previewImages[size.toInt()] = resizedImage; + _previewImages[size.toInt() * index] = resizedImage; }); } } @@ -457,14 +465,14 @@ class _iOSAppIconEditorPageState extends State { int index = 1; double lastSize = 0; for (var size in sizeList) { + if (size == lastSize) { + index++; + } else if (size != lastSize) { + index = 1; + } + lastSize = size; for (var entry in _previewImages.entries) { - if (entry.key == size.toInt()) { - if (size == lastSize) { - index++; - } else if (size != lastSize) { - index = 1; - } - lastSize = size; + if (entry.key == size.toInt() * index) { File file = File( '$selectedDirectory/$fileName-${size}x${size}@${index}x.png'); if (size == size.toInt()) {