Quellcode durchsuchen

屏蔽夜间模式,修改软件升级代码,修改iOS打包配置

iOS_cz vor 4 Jahren
Ursprung
Commit
c123b64fa8

+ 20 - 20
ios/Flutter/AppFrameworkInfo.plist

@@ -2,25 +2,25 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-  <key>CFBundleDevelopmentRegion</key>
-  <string>$(DEVELOPMENT_LANGUAGE)</string>
-  <key>CFBundleExecutable</key>
-  <string>App</string>
-  <key>CFBundleIdentifier</key>
-  <string>io.flutter.flutter.app</string>
-  <key>CFBundleInfoDictionaryVersion</key>
-  <string>6.0</string>
-  <key>CFBundleName</key>
-  <string>App</string>
-  <key>CFBundlePackageType</key>
-  <string>FMWK</string>
-  <key>CFBundleShortVersionString</key>
-  <string>1.0</string>
-  <key>CFBundleSignature</key>
-  <string>????</string>
-  <key>CFBundleVersion</key>
-  <string>1.0</string>
-  <key>MinimumOSVersion</key>
-  <string>8.0</string>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>$(DEVELOPMENT_LANGUAGE)</string>
+	<key>CFBundleExecutable</key>
+	<string>App</string>
+	<key>CFBundleIdentifier</key>
+	<string>io.flutter.flutter.app</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>App</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+	<key>MinimumOSVersion</key>
+	<string>9.0</string>
 </dict>
 </plist>

+ 2 - 2
ios/Podfile

@@ -1,5 +1,5 @@
 # Uncomment this line to define a global platform for your project
-platform :ios, '9.0'
+platform :ios, '10.0'
 
 
 # ignore all warnings from all pods
@@ -95,7 +95,7 @@ post_install do |installer|
   installer.pods_project.targets.each do |target|
     target.build_configurations.each do |config|
       config.build_settings['ENABLE_BITCODE'] = 'NO'
-      config.build_settings['IPHONES_DEPLOYMENT_TARGET'] = '9.0'
+      config.build_settings['IPHONES_DEPLOYMENT_TARGET'] = '10.0'
     end
   end
 end

+ 12 - 6
ios/Runner.xcodeproj/project.pbxproj

@@ -395,7 +395,7 @@
 				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+				CURRENT_PROJECT_VERSION = 4;
 				DEVELOPMENT_TEAM = H22FLENRG9;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -403,18 +403,20 @@
 					"$(PROJECT_DIR)/Flutter",
 				);
 				INFOPLIST_FILE = Runner/Info.plist;
-				IPHONEOS_DEPLOYMENT_TARGET = 10.1;
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
 				);
+				MARKETING_VERSION = 4.0.8;
 				ONLY_ACTIVE_ARCH = YES;
 				PRODUCT_BUNDLE_IDENTIFIER = com.tyty.lift.managers;
 				PRODUCT_NAME = Runner;
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = 1;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Profile;
@@ -533,7 +535,7 @@
 				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+				CURRENT_PROJECT_VERSION = 4;
 				DEVELOPMENT_TEAM = H22FLENRG9;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -541,12 +543,13 @@
 					"$(PROJECT_DIR)/Flutter",
 				);
 				INFOPLIST_FILE = Runner/Info.plist;
-				IPHONEOS_DEPLOYMENT_TARGET = 10.1;
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
 				);
+				MARKETING_VERSION = 4.0.8;
 				ONLY_ACTIVE_ARCH = YES;
 				PRODUCT_BUNDLE_IDENTIFIER = com.tyty.lift.managers;
 				PRODUCT_NAME = Runner;
@@ -554,6 +557,7 @@
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = 1;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Debug;
@@ -567,7 +571,7 @@
 				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+				CURRENT_PROJECT_VERSION = 4;
 				DEVELOPMENT_TEAM = H22FLENRG9;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -575,18 +579,20 @@
 					"$(PROJECT_DIR)/Flutter",
 				);
 				INFOPLIST_FILE = Runner/Info.plist;
-				IPHONEOS_DEPLOYMENT_TARGET = 10.1;
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Flutter",
 				);
+				MARKETING_VERSION = 4.0.8;
 				ONLY_ACTIVE_ARCH = YES;
 				PRODUCT_BUNDLE_IDENTIFIER = com.tyty.lift.managers;
 				PRODUCT_NAME = Runner;
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = 1;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Release;

+ 0 - 64
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -125,70 +125,6 @@
       "idiom" : "ios-marketing",
       "scale" : "1x",
       "size" : "1024x1024"
-    },
-    {
-      "filename" : "ic_launcher.png",
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "Icon-iPadPro@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "Icon-Spotlight-40.png",
-      "idiom" : "universal",
-      "scale" : "1x",
-      "size" : "40x40"
-    },
-    {
-      "filename" : "Icon-Small-50.png",
-      "idiom" : "universal",
-      "scale" : "1x",
-      "size" : "50x50"
-    },
-    {
-      "filename" : "Icon-Small-50@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x",
-      "size" : "50x50"
-    },
-    {
-      "filename" : "Icon-60.png",
-      "idiom" : "universal",
-      "scale" : "1x",
-      "size" : "60x60"
-    },
-    {
-      "filename" : "Icon-72.png",
-      "idiom" : "universal",
-      "scale" : "1x",
-      "size" : "72x72"
-    },
-    {
-      "filename" : "Icon-72@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x",
-      "size" : "72x72"
-    },
-    {
-      "filename" : "Icon-76.png",
-      "idiom" : "universal",
-      "scale" : "1x",
-      "size" : "76x76"
-    },
-    {
-      "filename" : "Icon-76@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x",
-      "size" : "76x76"
-    },
-    {
-      "filename" : "Icon-76@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x",
-      "size" : "76x76"
     }
   ],
   "info" : {

BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-72.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76@3x.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png


BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/ic_launcher.png


+ 2 - 5
ios/Runner/Info.plist

@@ -19,7 +19,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>$(FLUTTER_BUILD_NAME)</string>
+	<string>$(MARKETING_VERSION)</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>
@@ -60,7 +60,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>$(FLUTTER_BUILD_NUMBER)</string>
+	<string>$(CURRENT_PROJECT_VERSION)</string>
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
 		<string>iosamap</string>
@@ -155,7 +155,6 @@
 	<key>UIBackgroundModes</key>
 	<array>
 		<string>fetch</string>
-		<string>location</string>
 		<string>remote-notification</string>
 	</array>
 	<key>UILaunchStoryboardName</key>
@@ -165,8 +164,6 @@
 	<key>UISupportedInterfaceOrientations</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationLandscapeLeft</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
 	<key>UISupportedInterfaceOrientations~ipad</key>
 	<array>

+ 23 - 2
lib/internal/home/home_page.dart

@@ -67,8 +67,7 @@ class _HomeState extends State<HomePage> {
             versionItem = res;
             int versionCode = FlutterStars.SpUtil.getInt("version_code") ?? 0;
 
-            if (versionItem.code > versionCode &&
-                versionItem.code > int.parse(packageInfo.buildNumber)) {
+            if (hasNewVersion(packageInfo.version, versionItem.version)) {
               _showUpdateDialog();
             }
             setState(() {});
@@ -77,6 +76,28 @@ class _HomeState extends State<HomePage> {
         onError: (code, msg) {});
   }
 
+  bool hasNewVersion(version, newversion) {
+    try {
+      var currentVersionArr =
+          version.version.split('.').map((e) => int.parse(e)).toList();
+      var newVersionArr =
+          newversion.split('.').map((e) => int.parse(e)).toList();
+
+      if (currentVersionArr[0] < newVersionArr[0]) {
+        return true;
+      }
+      if (currentVersionArr[1] < newVersionArr[1]) {
+        return true;
+      }
+      if (currentVersionArr[2] < newVersionArr[2]) {
+        return true;
+      }
+    } catch (e) {
+      return false;
+    }
+    return false;
+  }
+
   void _showUpdateDialog() {
     showDialog(
         context: context,

+ 28 - 6
lib/internal/wode/page/setting_page.dart

@@ -340,16 +340,16 @@ class SettingPageState extends State<SettingPage> {
                     );
                   },
                 )),
-            ClickItem(
-                title: "夜间模式",
-                content: themeMode,
-                onTap: () =>
-                    NavigatorUtils.push(context, WodeRouter.themePage)),
+            // ClickItem(
+            //     title: "夜间模式",
+            //     content: themeMode,
+            //     onTap: () =>
+            //         NavigatorUtils.push(context, WodeRouter.themePage)),
             ClickItem(
               title: "版本",
               content: packageInfo?.version ?? "",
               onTap: () {
-                if (versionItem.code > int.parse(packageInfo?.buildNumber)) {
+                if (hasNewVersion(packageInfo?.version, versionItem.version)) {
                   _showUpdateDialog();
                 } else {
                   toasts("已是最新版本。");
@@ -439,4 +439,26 @@ class SettingPageState extends State<SettingPage> {
             //   ])
             ));
   }
+
+  bool hasNewVersion(version, newversion) {
+    try {
+      var currentVersionArr =
+          version.version.split('.').map((e) => int.parse(e)).toList();
+      var newVersionArr =
+          newversion.split('.').map((e) => int.parse(e)).toList();
+
+      if (currentVersionArr[0] < newVersionArr[0]) {
+        return true;
+      }
+      if (currentVersionArr[1] < newVersionArr[1]) {
+        return true;
+      }
+      if (currentVersionArr[2] < newVersionArr[2]) {
+        return true;
+      }
+    } catch (e) {
+      return false;
+    }
+    return false;
+  }
 }

+ 18 - 15
lib/provider/theme_provider.dart

@@ -7,16 +7,16 @@ import 'package:liftmanager/common/common.dart';
 import 'package:liftmanager/common/themes.dart';
 import 'package:liftmanager/res/resources.dart';
 
-
 class ThemeProvider extends ChangeNotifier {
-
   static const Map<Themes, String> themes = {
-    Themes.DARK: "Dark", Themes.LIGHT : "Light", Themes.SYSTEM : "System"
+    Themes.DARK: "Dark",
+    Themes.LIGHT: "Light",
+    Themes.SYSTEM: "System"
   };
 
-  void syncTheme(){
+  void syncTheme() {
     String theme = SpUtil.getString(Constant.theme);
-    if (theme.isNotEmpty && theme != themes[Themes.SYSTEM]){
+    if (theme.isNotEmpty && theme != themes[Themes.SYSTEM]) {
       notifyListeners();
     }
   }
@@ -28,7 +28,8 @@ class ThemeProvider extends ChangeNotifier {
 
   getTheme({bool isDarkMode: false}) {
     String theme = SpUtil.getString(Constant.theme);
-    switch(theme){
+
+    switch (theme) {
       case "Dark":
         isDarkMode = true;
         break;
@@ -39,6 +40,8 @@ class ThemeProvider extends ChangeNotifier {
         break;
     }
 
+    ///取消暗黑模式,因为全局未适配
+    isDarkMode = false;
     return ThemeData(
         errorColor: isDarkMode ? Colours.dark_red : Colours.red,
         brightness: isDarkMode ? Brightness.dark : Brightness.light,
@@ -47,7 +50,8 @@ class ThemeProvider extends ChangeNotifier {
         // Tab指示器颜色
         indicatorColor: isDarkMode ? Colours.dark_app_main : Colours.app_main,
         // 页面背景色
-        scaffoldBackgroundColor: isDarkMode ? Colours.dark_bg_color : Colors.white,
+        scaffoldBackgroundColor:
+            isDarkMode ? Colours.dark_bg_color : Colors.white,
         // 主要用于Material背景色
         canvasColor: isDarkMode ? Colours.dark_material_bg : Colors.white,
         // 文字选择色(输入框复制粘贴菜单)
@@ -58,10 +62,12 @@ class ThemeProvider extends ChangeNotifier {
           subhead: isDarkMode ? TextStyles.textDark : TextStyles.text,
           // Text文字样式
           body1: isDarkMode ? TextStyles.textDark : TextStyles.text,
-          subtitle: isDarkMode ? TextStyles.textDarkGray12 : TextStyles.textGray12,
+          subtitle:
+              isDarkMode ? TextStyles.textDarkGray12 : TextStyles.textGray12,
         ),
         inputDecorationTheme: InputDecorationTheme(
-          hintStyle: isDarkMode ? TextStyles.textHint14 : TextStyles.textDarkGray14,
+          hintStyle:
+              isDarkMode ? TextStyles.textHint14 : TextStyles.textDarkGray14,
         ),
         appBarTheme: AppBarTheme(
           elevation: 0.0,
@@ -71,12 +77,9 @@ class ThemeProvider extends ChangeNotifier {
         dividerTheme: DividerThemeData(
             color: isDarkMode ? Colours.dark_line : Colours.line,
             space: 0.6,
-            thickness: 0.6
-        ),
+            thickness: 0.6),
         cupertinoOverrideTheme: CupertinoThemeData(
           brightness: isDarkMode ? Brightness.dark : Brightness.light,
-        )
-    );
+        ));
   }
-
-}
+}