Skip to content

Commit

Permalink
Upgrade: Flutter 3.22.0, Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
AmosHuKe committed May 15, 2024
1 parent 0b2158e commit a03bf32
Show file tree
Hide file tree
Showing 24 changed files with 168 additions and 158 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.9.10
- [升级] Flutter 3.22.0
- [升级] Package 升级及适配

# 1.9.9
- [升级] Flutter 3.19.6
- [升级] Package 升级及适配
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</h1>

<p align="center">
<a href="/CHANGELOG.md"><img alt="Mood-Example v1.9.9" src="https://img.shields.io/badge/Mood--Example-v1.9.9-3e4663"/></a>
<a href="https://flutter.dev/"><img alt="Flutter v3.19.6" src="https://img.shields.io/badge/Flutter-v3.19.6-0468D7"/></a>
<a href="https://dart.dev/"><img alt="Dart v3.3.4" src="https://img.shields.io/badge/Dart-v3.3.4-04599C"/></a>
<a href="/CHANGELOG.md"><img alt="Mood-Example v1.9.10" src="https://img.shields.io/badge/Mood--Example-v1.9.10-3e4663"/></a>
<a href="https://flutter.dev/"><img alt="Flutter v3.22.0" src="https://img.shields.io/badge/Flutter-v3.22.0-0468D7"/></a>
<a href="https://dart.dev/"><img alt="Dart v3.4.0" src="https://img.shields.io/badge/Dart-v3.4.0-04599C"/></a>
<a href="https://github.com/AmosHuKe/Mood-Example/blob/main/LICENSE"><img alt="BSD-3-Clause License" src="https://img.shields.io/badge/License-BSD--3--Clause-green"/></a>
</p>

Expand Down Expand Up @@ -100,27 +100,27 @@

Windows:
```
[√] Flutter (Channel stable, 3.19.6, on Microsoft Windows [版本 10.0.22621.3007], locale zh-CN)
[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [版本 10.0.22621.3007], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6)
[√] Android Studio (version 2023.3)
[√] IntelliJ IDEA Ultimate Edition (version 2024.1)
[√] VS Code (version 1.89.0)
[√] VS Code (version 1.89.1)
```

macOS:
```
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-x64, locale zh-Hans-CN)
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.4.1 23E224 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.88.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.89.1)
```


### 🛠️ i18n l10n

官方国际化教程:[中文站](https://flutter.cn/docs/ui/accessibility-and-internationalization/internationalization) | [英文站](https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization)
官方国际化教程:[中文站](https://docs.flutter.cn/ui/accessibility-and-internationalization/internationalization) | [英文站](https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization)

```sh
├── lib/
Expand Down
69 changes: 35 additions & 34 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,72 +1,73 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = '1'
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = '1.0'
flutterVersionName = "1.0"
}

android {
namespace "com.example.moodexample"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace = "com.example.moodexample"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "1.8"
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
main.java.srcDirs += "src/main/kotlin"
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.moodexample"
applicationId = "com.example.moodexample"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
minSdkVersion = 21
targetSdkVersion = 34
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
ndk {
abiFilters 'x86','x86_64','armeabi-v7a','arm64-v8a' // 不支持armeabi
abiFilters "x86","x86_64","armeabi-v7a","arm64-v8a" // 不支持armeabi
}
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard.cfg'
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro", "proguard.cfg"
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}

aaptOptions {
additionalParameters '--auto-add-overlay'
//noCompress 'foo', 'bar'
additionalParameters "--auto-add-overlay"
// noCompress "foo", "bar"
ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
}

Expand All @@ -80,25 +81,25 @@ android {
}

flutter {
source '../..'
source "../.."
}

repositories {
flatDir {
dirs 'libs'
dirs "libs"
}
}

dependencies {
// libs UniMPSDK
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ['*.aar'], dir: 'libs')
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.alibaba:fastjson:1.2.83'
implementation 'com.facebook.fresco:fresco:2.5.0'
implementation 'com.facebook.fresco:animated-gif:2.5.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'androidx.webkit:webkit:1.3.0'
implementation fileTree(include: ["*.jar"], dir: "libs")
implementation fileTree(include: ["*.aar"], dir: "libs")
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "com.alibaba:fastjson:1.2.83"
implementation "com.facebook.fresco:fresco:2.5.0"
implementation "com.facebook.fresco:animated-gif:2.5.0"
implementation "com.github.bumptech.glide:glide:4.9.0"
implementation "androidx.webkit:webkit:1.3.0"
}
6 changes: 3 additions & 3 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.moodexample">
<!-- Flutter needs it to communicate with the running application
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
25 changes: 14 additions & 11 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.moodexample">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- 震动 begin-->
<uses-permission android:name="android.permission.VIBRATE"/>
Expand All @@ -17,11 +16,13 @@

<application
android:label="Mood"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand All @@ -34,15 +35,6 @@
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<!-- <meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/> -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand All @@ -54,4 +46,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>
6 changes: 3 additions & 3 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.moodexample">
<!-- Flutter needs it to communicate with the running application
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
10 changes: 6 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ allprojects {
repositories {
// google()
// jcenter()
maven{ url 'https://maven.aliyun.com/repository/public' }
maven{ url 'https://maven.aliyun.com/repository/google' }
maven{ url "https://maven.aliyun.com/repository/public" }
maven{ url "https://maven.aliyun.com/repository/google" }
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
subprojects {
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
11 changes: 5 additions & 6 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ pluginManagement {
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
}()

includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

repositories {
// google()
// mavenCentral()
// gradlePluginPortal()
maven{ url 'https://maven.aliyun.com/repository/public' }
maven{ url 'https://maven.aliyun.com/repository/google' }
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven{ url "https://maven.aliyun.com/repository/public" }
maven{ url "https://maven.aliyun.com/repository/google" }
maven{ url "https://maven.aliyun.com/repository/gradle-plugin" }
}
}

Expand Down
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ SPEC CHECKSUMS:
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb
integration_test: 13825b8a9334a850581300559b8839134b124670
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
IosAwnCore: b8601fbb37f7b3560f31b84ebf55a72f65812e05
local_auth_darwin: c7e464000a6a89e952235699e32b329457608d98
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
local_auth_darwin: 4d56c90c2683319835a61274b57620df9c4520ab
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
sensors_plus: 18a9b346c43e157da17d2c8e99def703f9efb9d8
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:moodexample/common/notification.dart';
import 'application.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();

// shared_preferences 模拟器需要使用(防止异常)
// SharedPreferences.setMockInitialValues({}); 该操作会清空所有SharedPreferences值

Expand Down
8 changes: 4 additions & 4 deletions lib/themes/multiple_themes_mode/theme_cyan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class AppThemeCyan {
const BottomSheetThemeData(modalBackgroundColor: Color(0xFFF6F8FA)),
// Radio
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.all(const Color(0xFF111315)),
overlayColor: MaterialStateProperty.all(const Color(0xFF111315)),
fillColor: WidgetStateProperty.all(const Color(0xFF111315)),
overlayColor: WidgetStateProperty.all(const Color(0xFF111315)),
),
);

Expand Down Expand Up @@ -121,8 +121,8 @@ class AppThemeCyan {
const BottomSheetThemeData(modalBackgroundColor: Color(0xFF111315)),
// Radio
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.all(const Color(0xFFEFEFEF)),
overlayColor: MaterialStateProperty.all(const Color(0xFFEFEFEF)),
fillColor: WidgetStateProperty.all(const Color(0xFFEFEFEF)),
overlayColor: WidgetStateProperty.all(const Color(0xFFEFEFEF)),
),
);
}
8 changes: 4 additions & 4 deletions lib/themes/multiple_themes_mode/theme_default.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class AppThemeDefault {
const BottomSheetThemeData(modalBackgroundColor: Color(0xFFF6F8FA)),
// Radio
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.all(const Color(0xFF111315)),
overlayColor: MaterialStateProperty.all(const Color(0xFF111315)),
fillColor: WidgetStateProperty.all(const Color(0xFF111315)),
overlayColor: WidgetStateProperty.all(const Color(0xFF111315)),
),
);

Expand Down Expand Up @@ -129,8 +129,8 @@ class AppThemeDefault {
const BottomSheetThemeData(modalBackgroundColor: Color(0xFF111315)),
// Radio
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.all(const Color(0xFFEFEFEF)),
overlayColor: MaterialStateProperty.all(const Color(0xFFEFEFEF)),
fillColor: WidgetStateProperty.all(const Color(0xFFEFEFEF)),
overlayColor: WidgetStateProperty.all(const Color(0xFFEFEFEF)),
),
);
}
Loading

0 comments on commit a03bf32

Please sign in to comment.