diff --git a/.gitignore b/.gitignore index 570b0d0..b178a0f 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,7 @@ !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + +# IDE +devtools_options.yaml +analysis_options.yaml \ No newline at end of file diff --git a/.metadata b/.metadata index e023651..cad9d3f 100644 --- a/.metadata +++ b/.metadata @@ -4,7 +4,30 @@ # This file should be version controlled and should not be manually edited. version: - revision: 20e59316b8b8474554b38493b8ca888794b0234a - channel: stable + revision: "7482962148e8d758338d8a28f589f317e1e42ba4" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4 + base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4 + - platform: android + create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4 + base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4 + - platform: ios + create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4 + base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..6f56801 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle b/android/app/build.gradle index a5a280a..2c7c3e5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,75 +22,46 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion 31 - ndkVersion "21.1.6352462" + namespace "com.example.eyepetizer" + compileSdk flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } - lintOptions { - disable 'InvalidPackage' + sourceSets { + 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.flutter.flutter_eyepetizer" + applicationId "com.example.eyepetizer" + // 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 29 + targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - signingConfigs { - release { - keyAlias 'eye' - keyPassword 'eye123456' - storeFile file('../eye') - storePassword 'eye123456' - } - } - - buildTypes { - debug { - signingConfig signingConfigs.release - } - release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.release + signingConfig signingConfigs.debug } } - packagingOptions { - // 确保app与speech_plugin都依赖的libflutter.so libapp.so merge时不冲突@https://github.com/card-io/card.io-Android-SDK/issues/186#issuecomment-427552552 - pickFirst 'lib/x86_64/libflutter.so' - pickFirst 'lib/x86_64/libapp.so' - pickFirst 'lib/x86/libflutter.so' - pickFirst 'lib/arm64-v8a/libflutter.so' - pickFirst 'lib/arm64-v8a/libapp.so' - pickFirst 'lib/armeabi-v7a/libapp.so' - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } } flutter { source '../..' } -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' - implementation project(path: ':speech_plugin') -} +dependencies {} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro deleted file mode 100644 index 084c99d..0000000 --- a/android/app/proguard-rules.pro +++ /dev/null @@ -1,23 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile --keep class com.iflytek.**{*;} --keepattributes Signature \ No newline at end of file diff --git a/android/app/release/app-release.apk b/android/app/release/app-release.apk deleted file mode 100644 index 22653eb..0000000 Binary files a/android/app/release/app-release.apk and /dev/null differ diff --git a/android/app/release/output.json b/android/app/release/output.json deleted file mode 100644 index a7b1e07..0000000 --- a/android/app/release/output.json +++ /dev/null @@ -1 +0,0 @@ -[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 28f8ec9..399f698 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 01f54f5..fdd828c 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,34 +1,45 @@ - - - - - - - - + - + android:usesCleartextTraffic="true" + android:label="eyepetizer" + android:name="${applicationName}" + android:icon="@mipmap/ic_launcher"> + + - - + + + + + + + + + + + diff --git a/android/app/src/main/java/com/flutter/flutter_eyepetizer/MainActivity.java b/android/app/src/main/java/com/flutter/flutter_eyepetizer/MainActivity.java deleted file mode 100644 index e981186..0000000 --- a/android/app/src/main/java/com/flutter/flutter_eyepetizer/MainActivity.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.flutter.flutter_eyepetizer; - -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.net.Uri; -import android.os.Bundle; -import android.provider.Settings; - -import androidx.annotation.NonNull; - -import com.flutter.eyepetizer.speech.plugin.SpeechPlugin; -import com.flutter.eyepetizer.speech.plugin.SpeechManager; -import org.devio.flutter.splashscreen.SplashScreen; -import io.flutter.embedding.android.FlutterActivity; -import io.flutter.embedding.engine.FlutterEngine; - -public class MainActivity extends FlutterActivity { - - SpeechPlugin mSpeechPlugin; - - @Override - protected void onCreate(Bundle savedInstanceState) { - SplashScreen.show(this, true); - super.onCreate(savedInstanceState); - SpeechManager.getInstance().init(this); - } - - @Override - public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { - super.configureFlutterEngine(flutterEngine); - mSpeechPlugin = new SpeechPlugin(); - flutterEngine.getPlugins().add(mSpeechPlugin); - } - - @Override - public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { - super.onRequestPermissionsResult(requestCode, permissions, grantResults); - if (requestCode == SpeechPlugin.RECOGNIZER_REQUEST_CODE) { - if (grantResults.length > 0) { - int grantedSize = 0; - for (int grantResult : grantResults) { - if (grantResult == PackageManager.PERMISSION_GRANTED) { - grantedSize++; - } - } - if (grantedSize == grantResults.length) { - mSpeechPlugin.startRecognizer(); - } else { - showWaringDialog(); - } - } else { - showWaringDialog(); - } - } - } - - private void showWaringDialog() { - new AlertDialog.Builder(this, android.R.style.Theme_Material_Light_Dialog_Alert) - .setTitle(R.string.waring) - .setMessage(R.string.permission_waring) - .setPositiveButton(R.string.sure, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - go2AppSettings(); - } - }).setNegativeButton(R.string.cancel, null).show(); - } - - private void go2AppSettings() { - Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); - Uri uri = Uri.fromParts("package", getPackageName(), null); - intent.setData(uri); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - } -} diff --git a/android/app/src/main/kotlin/com/example/eyepetizer/MainActivity.kt b/android/app/src/main/kotlin/com/example/eyepetizer/MainActivity.kt new file mode 100644 index 0000000..a15980a --- /dev/null +++ b/android/app/src/main/kotlin/com/example/eyepetizer/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.eyepetizer + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/android/app/src/main/res/drawable-v21/background.png b/android/app/src/main/res/drawable-v21/background.png new file mode 100644 index 0000000..fb9e6d1 Binary files /dev/null and b/android/app/src/main/res/drawable-v21/background.png differ diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f88598c --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/android/app/src/main/res/drawable/background.png b/android/app/src/main/res/drawable/background.png new file mode 100644 index 0000000..fb9e6d1 Binary files /dev/null and b/android/app/src/main/res/drawable/background.png differ diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 304732f..f88598c 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -1,12 +1,6 @@ - - - - - + + + diff --git a/android/app/src/main/res/layout/launch_screen.xml b/android/app/src/main/res/layout/launch_screen.xml deleted file mode 100644 index 74ab33e..0000000 --- a/android/app/src/main/res/layout/launch_screen.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png old mode 100755 new mode 100644 index 9f7b301..db77bb4 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100755 index a780cc0..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png old mode 100755 new mode 100644 index 81f4585..17987b7 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100755 index 03bb9b9..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png old mode 100755 new mode 100644 index ee835a7..09d4391 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100755 index 9826c87..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png old mode 100755 new mode 100644 index 9684182..d5f1c8d Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100755 index de58ab3..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/launch_screen.jpg b/android/app/src/main/res/mipmap-xxhdpi/launch_screen.jpg deleted file mode 100644 index dd00eec..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/launch_screen.jpg and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png old mode 100755 new mode 100644 index 9485ecc..4d6372e Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100755 index 9ddaa23..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/app/src/main/res/values-night-v31/styles.xml b/android/app/src/main/res/values-night-v31/styles.xml new file mode 100644 index 0000000..eef2690 --- /dev/null +++ b/android/app/src/main/res/values-night-v31/styles.xml @@ -0,0 +1,19 @@ + + + + + + + diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..3c4a1fe --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/android/app/src/main/res/values-v31/styles.xml b/android/app/src/main/res/values-v31/styles.xml new file mode 100644 index 0000000..bd28f18 --- /dev/null +++ b/android/app/src/main/res/values-v31/styles.xml @@ -0,0 +1,19 @@ + + + + + + + diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml deleted file mode 100644 index 613805e..0000000 --- a/android/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #000000 - \ No newline at end of file diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 3df817f..847e1be 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,10 +1,22 @@ - + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 28f8ec9..399f698 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/android/build.gradle b/android/build.gradle index 8de3925..bc157bd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,29 +1,7 @@ -buildscript { - repositories { - //google() - //jcenter() - maven { url 'https://maven.aliyun.com/repository/google' } - maven { url 'https://maven.aliyun.com/repository/jcenter' } - maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.0.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10" - } -} - allprojects { repositories { - //google() - //jcenter() - maven { url 'https://maven.aliyun.com/repository/google' } - maven { url 'https://maven.aliyun.com/repository/jcenter' } - maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } - - maven { - url 'http://download.flutter.io' - } + google() + mavenCentral() } } @@ -35,6 +13,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/android/eye b/android/eye deleted file mode 100644 index f632233..0000000 Binary files a/android/eye and /dev/null differ diff --git a/android/gradle.properties b/android/gradle.properties index 6887749..598d13f 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M - +org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true -android.enableR8=true \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 24903e6..e1ca574 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Sun Dec 15 19:41:54 CST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 287864f..1d6d19b 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +1,26 @@ -include ':app', ':speech_plugin' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false } + +include ":app" diff --git a/android/speech_plugin/.gitignore b/android/speech_plugin/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/android/speech_plugin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/android/speech_plugin/build.gradle b/android/speech_plugin/build.gradle deleted file mode 100644 index 9a63bc5..0000000 --- a/android/speech_plugin/build.gradle +++ /dev/null @@ -1,56 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -apply plugin: 'com.android.library' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 29 - buildToolsVersion "29.0.2" - ndkVersion "21.1.6352462" - - defaultConfig { - minSdkVersion 16 - targetSdkVersion 29 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - sourceSets { - main { - jniLibs.srcDirs = ['libs'] - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - - implementation 'androidx.appcompat:appcompat:1.1.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' -} diff --git a/android/speech_plugin/consumer-rules.pro b/android/speech_plugin/consumer-rules.pro deleted file mode 100644 index e69de29..0000000 diff --git a/android/speech_plugin/libs/Msc.jar b/android/speech_plugin/libs/Msc.jar deleted file mode 100644 index e4ed582..0000000 Binary files a/android/speech_plugin/libs/Msc.jar and /dev/null differ diff --git a/android/speech_plugin/libs/arm64-v8a/libmsc.so b/android/speech_plugin/libs/arm64-v8a/libmsc.so deleted file mode 100644 index a5e6539..0000000 Binary files a/android/speech_plugin/libs/arm64-v8a/libmsc.so and /dev/null differ diff --git a/android/speech_plugin/libs/armeabi-v7a/libmsc.so b/android/speech_plugin/libs/armeabi-v7a/libmsc.so deleted file mode 100644 index 654fda9..0000000 Binary files a/android/speech_plugin/libs/armeabi-v7a/libmsc.so and /dev/null differ diff --git a/android/speech_plugin/proguard-rules.pro b/android/speech_plugin/proguard-rules.pro deleted file mode 100644 index f1b4245..0000000 --- a/android/speech_plugin/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/android/speech_plugin/src/androidTest/java/com/flutter/eyepetizer/speech/plugin/ExampleInstrumentedTest.java b/android/speech_plugin/src/androidTest/java/com/flutter/eyepetizer/speech/plugin/ExampleInstrumentedTest.java deleted file mode 100644 index e71ebb5..0000000 --- a/android/speech_plugin/src/androidTest/java/com/flutter/eyepetizer/speech/plugin/ExampleInstrumentedTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.flutter.eyepetizer.speech.plugin; - -import android.content.Context; - -import androidx.test.platform.app.InstrumentationRegistry; -import androidx.test.ext.junit.runners.AndroidJUnit4; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -/** - * Instrumented test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - - assertEquals("com.flutter.eyepetizer.speech.plugin.test", appContext.getPackageName()); - } -} diff --git a/android/speech_plugin/src/main/AndroidManifest.xml b/android/speech_plugin/src/main/AndroidManifest.xml deleted file mode 100644 index 8255fcf..0000000 --- a/android/speech_plugin/src/main/AndroidManifest.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/speech_plugin/src/main/assets/iflytek/recognize.xml b/android/speech_plugin/src/main/assets/iflytek/recognize.xml deleted file mode 100644 index 78300c1..0000000 Binary files a/android/speech_plugin/src/main/assets/iflytek/recognize.xml and /dev/null differ diff --git a/android/speech_plugin/src/main/assets/iflytek/voice_bg.9.png b/android/speech_plugin/src/main/assets/iflytek/voice_bg.9.png deleted file mode 100644 index 217f9dc..0000000 Binary files a/android/speech_plugin/src/main/assets/iflytek/voice_bg.9.png and /dev/null differ diff --git a/android/speech_plugin/src/main/assets/iflytek/voice_empty.png b/android/speech_plugin/src/main/assets/iflytek/voice_empty.png deleted file mode 100644 index 08ffc43..0000000 Binary files a/android/speech_plugin/src/main/assets/iflytek/voice_empty.png and /dev/null differ diff --git a/android/speech_plugin/src/main/assets/iflytek/voice_full.png b/android/speech_plugin/src/main/assets/iflytek/voice_full.png deleted file mode 100644 index 4bf5bbc..0000000 Binary files a/android/speech_plugin/src/main/assets/iflytek/voice_full.png and /dev/null differ diff --git a/android/speech_plugin/src/main/assets/iflytek/waiting.png b/android/speech_plugin/src/main/assets/iflytek/waiting.png deleted file mode 100644 index d13bb33..0000000 Binary files a/android/speech_plugin/src/main/assets/iflytek/waiting.png and /dev/null differ diff --git a/android/speech_plugin/src/main/assets/iflytek/warning.png b/android/speech_plugin/src/main/assets/iflytek/warning.png deleted file mode 100644 index 48150ff..0000000 Binary files a/android/speech_plugin/src/main/assets/iflytek/warning.png and /dev/null differ diff --git a/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/JsonParser.java b/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/JsonParser.java deleted file mode 100644 index dad8c92..0000000 --- a/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/JsonParser.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.flutter.eyepetizer.speech.plugin; - -import org.json.JSONArray; -import org.json.JSONObject; -import org.json.JSONTokener; - -/** - * Json结果解析类 - */ -public class JsonParser { - - public static String parseIatResult(String json) { - StringBuffer ret = new StringBuffer(); - try { - JSONTokener tokener = new JSONTokener(json); - JSONObject joResult = new JSONObject(tokener); - - JSONArray words = joResult.getJSONArray("ws"); - for (int i = 0; i < words.length(); i++) { - // 转写结果词,默认使用第一个结果 - JSONArray items = words.getJSONObject(i).getJSONArray("cw"); - JSONObject obj = items.getJSONObject(0); - ret.append(obj.getString("w")); -// 如果需要多候选结果,解析数组其他字段 -// for(int j = 0; j < items.length(); j++) -// { -// JSONObject obj = items.getJSONObject(j); -// ret.append(obj.getString("w")); -// } - } - } catch (Exception e) { - e.printStackTrace(); - } - return ret.toString(); - } - - public static String parseGrammarResult(String json) { - StringBuffer ret = new StringBuffer(); - try { - JSONTokener tokener = new JSONTokener(json); - JSONObject joResult = new JSONObject(tokener); - - JSONArray words = joResult.getJSONArray("ws"); - for (int i = 0; i < words.length(); i++) { - JSONArray items = words.getJSONObject(i).getJSONArray("cw"); - for(int j = 0; j < items.length(); j++) - { - JSONObject obj = items.getJSONObject(j); - if(obj.getString("w").contains("nomatch")) - { - ret.append("没有匹配结果."); - return ret.toString(); - } - ret.append("【结果】" + obj.getString("w")); - ret.append("【置信度】" + obj.getInt("sc")); - ret.append("\n"); - } - } - } catch (Exception e) { - e.printStackTrace(); - ret.append("没有匹配结果."); - } - return ret.toString(); - } - - public static String parseLocalGrammarResult(String json) { - StringBuffer ret = new StringBuffer(); - try { - JSONTokener tokener = new JSONTokener(json); - JSONObject joResult = new JSONObject(tokener); - - JSONArray words = joResult.getJSONArray("ws"); - for (int i = 0; i < words.length(); i++) { - JSONArray items = words.getJSONObject(i).getJSONArray("cw"); - for(int j = 0; j < items.length(); j++) - { - JSONObject obj = items.getJSONObject(j); - if(obj.getString("w").contains("nomatch")) - { - ret.append("没有匹配结果."); - return ret.toString(); - } - ret.append("【结果】" + obj.getString("w")); - ret.append("\n"); - } - } - ret.append("【置信度】" + joResult.optInt("sc")); - - } catch (Exception e) { - e.printStackTrace(); - ret.append("没有匹配结果."); - } - return ret.toString(); - } - - public static String parseTransResult(String json,String key) { - StringBuffer ret = new StringBuffer(); - try { - JSONTokener tokener = new JSONTokener(json); - JSONObject joResult = new JSONObject(tokener); - String errorCode = joResult.optString("ret"); - if(!errorCode.equals("0")) { - return joResult.optString("errmsg"); - } - JSONObject transResult = joResult.optJSONObject("trans_result"); - ret.append(transResult.optString(key)); - /*JSONArray words = joResult.getJSONArray("results"); - for (int i = 0; i < words.length(); i++) { - JSONObject obj = words.getJSONObject(i); - ret.append(obj.getString(key)); - }*/ - } catch (Exception e) { - e.printStackTrace(); - } - return ret.toString(); - } -} diff --git a/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/ResultStateful.java b/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/ResultStateful.java deleted file mode 100644 index 7def980..0000000 --- a/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/ResultStateful.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.flutter.eyepetizer.speech.plugin; - -import androidx.annotation.Nullable; - -import io.flutter.plugin.common.MethodChannel; - -/** - * 采用装饰者模式优化回掉方法 - */ -public class ResultStateful implements MethodChannel.Result { - - private MethodChannel.Result result; - private boolean called;//防止语音识别回调多次(由于MethodChannel的通讯是一次性的,即调用和回调是一次性的) - - public static ResultStateful of(MethodChannel.Result result) { - return new ResultStateful(result); - } - - private ResultStateful(MethodChannel.Result result) { - this.result = result; - } - - @Override - public void success(@Nullable Object o) { - if (called) { - return; - } - called = true; - result.success(o); - } - - @Override - public void error(String s, @Nullable String s1, @Nullable Object o) { - if (called) { - return; - } - called = true; - result.error(s, s1, o); - } - - @Override - public void notImplemented() { - if (called) { - return; - } - called = true; - result.notImplemented(); - } -} diff --git a/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/SpeechManager.java b/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/SpeechManager.java deleted file mode 100644 index 1ef4b3c..0000000 --- a/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/SpeechManager.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.flutter.eyepetizer.speech.plugin; - -import android.content.Context; -import android.util.Log; -import com.iflytek.cloud.InitListener; -import com.iflytek.cloud.RecognizerResult; -import com.iflytek.cloud.SpeechError; -import com.iflytek.cloud.SpeechUtility; -import com.iflytek.cloud.ui.RecognizerDialog; -import com.iflytek.cloud.ui.RecognizerDialogListener; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.HashMap; -import java.util.LinkedHashMap; - -public class SpeechManager { - - private static String TAG = SpeechManager.class.getSimpleName(); - - - private RecognizerDialog mIatDialog; - - private HashMap mIatResults = new LinkedHashMap<>(); - - private static SpeechManager speechManager = new SpeechManager(); - - private SpeechManager() { - - } - - public static SpeechManager getInstance() { - return speechManager; - } - - public void init(Context context) { - SpeechUtility.createUtility(context, "appid=5e63940d"); - mIatDialog = new RecognizerDialog(context, mInitListener); - mIatDialog.setListener(mRecognizerDialogListener); - } - - private InitListener mInitListener = code -> Log.d(TAG, "SpeechRecognizer init() code = " + code); - - void recognize(RecognizerResultListener recognizerResultListener) { - if (mResultListener == null) mResultListener = recognizerResultListener; - mIatResults.clear(); - mIatDialog.show(); - } - - private RecognizerDialogListener mRecognizerDialogListener = new RecognizerDialogListener() { - public void onResult(RecognizerResult results, boolean isLast) { - printResult(results); - } - - /** - * 识别回调错误. - */ - public void onError(SpeechError error) { - if (mResultListener != null) { - mResultListener.onError(error.getErrorDescription()); - } - } - - }; - - private void printResult(RecognizerResult results) { - String text = JsonParser.parseIatResult(results.getResultString()); - - String sn = null; - // 读取json结果中的sn字段 - try { - JSONObject resultJson = new JSONObject(results.getResultString()); - sn = resultJson.optString("sn"); - } catch (JSONException e) { - e.printStackTrace(); - } - - mIatResults.put(sn, text); - - StringBuilder stringBuilder = new StringBuilder(); - for (String key : mIatResults.keySet()) { - stringBuilder.append(mIatResults.get(key)); - } - - if (mResultListener != null) { - mResultListener.onResult(stringBuilder.toString()); - } - } - - private RecognizerResultListener mResultListener; - - public interface RecognizerResultListener { - void onResult(String result); - - void onError(String errorMsg); - } - -} diff --git a/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/SpeechPlugin.java b/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/SpeechPlugin.java deleted file mode 100644 index f126ae0..0000000 --- a/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/SpeechPlugin.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.flutter.eyepetizer.speech.plugin; - -import android.Manifest; -import android.app.Activity; -import android.content.pm.PackageManager; -import android.os.Build; -import androidx.annotation.NonNull; -import androidx.core.app.ActivityCompat; -import java.util.ArrayList; -import java.util.List; -import io.flutter.embedding.engine.plugins.FlutterPlugin; -import io.flutter.embedding.engine.plugins.activity.ActivityAware; -import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; - -/** - * Flutter1.12升级后的插件问题可参考以下文章: - * 1.https://www.bookstack.cn/read/flutter-1.2-zh/eee5c807276f94db.md - * 2.https://www.jianshu.com/p/579d94f4ddf5 - * 3.https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects - */ -public class SpeechPlugin implements FlutterPlugin, ActivityAware, MethodChannel.MethodCallHandler { - - public static final int RECOGNIZER_REQUEST_CODE = 0x0010; - private Activity mActivity; - private ResultStateful mResultStateful; - - @Override - public void onMethodCall(MethodCall call, MethodChannel.Result result) { - switch (call.method) { - case "start": - mResultStateful = ResultStateful.of(result); - startRecognizer(); - break; - default: - result.notImplemented(); - break; - } - } - - public void startRecognizer() { - List checkResultList = checkPermissions(); - if (checkResultList.size() > 0) { - ActivityCompat.requestPermissions(mActivity, checkResultList.toArray(new String[0]), RECOGNIZER_REQUEST_CODE); - } else { - SpeechManager.getInstance().recognize(recognizerResultListener); - } - } - - private List checkPermissions() { - List checkResultList = new ArrayList<>(); - - if (Build.VERSION.SDK_INT >= 23) { - String[] permissions = new String[] - {Manifest.permission.WRITE_EXTERNAL_STORAGE, - Manifest.permission.READ_PHONE_STATE, - Manifest.permission.READ_EXTERNAL_STORAGE, - Manifest.permission.RECORD_AUDIO, Manifest.permission.READ_CONTACTS, - Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}; - - for (String permission : permissions) { - if (ActivityCompat.checkSelfPermission(mActivity, - permission) != PackageManager.PERMISSION_GRANTED) { - checkResultList.add(permission); - } - } - } - - return checkResultList; - } - - private SpeechManager.RecognizerResultListener recognizerResultListener = new SpeechManager.RecognizerResultListener() { - @Override - public void onResult(String result) { - if (mResultStateful != null) { - mResultStateful.success(result); - } - } - - @Override - public void onError(String errorMsg) { - if (mResultStateful != null) { - mResultStateful.error(errorMsg, null, null); - } - } - }; - - @Override - public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { - MethodChannel methodChannel = new MethodChannel(binding.getBinaryMessenger(), "speech_plugin"); - methodChannel.setMethodCallHandler(this); - } - - @Override - public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { - - } - - @Override - public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { - mActivity = binding.getActivity(); - } - - @Override - public void onDetachedFromActivityForConfigChanges() { - - } - - @Override - public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) { - } - - @Override - public void onDetachedFromActivity() { - - } -} diff --git a/android/speech_plugin/src/main/res/values/strings.xml b/android/speech_plugin/src/main/res/values/strings.xml deleted file mode 100644 index fc0c8b6..0000000 --- a/android/speech_plugin/src/main/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - speech_plugin - 警告! - 请前往设置->应用->开眼->权限中打开相关权限,否则功能无法正常运行! - 确定 - 取消 - diff --git a/android/speech_plugin/src/test/java/com/flutter/eyepetizer/speech/plugin/ExampleUnitTest.java b/android/speech_plugin/src/test/java/com/flutter/eyepetizer/speech/plugin/ExampleUnitTest.java deleted file mode 100644 index 14c2d86..0000000 --- a/android/speech_plugin/src/test/java/com/flutter/eyepetizer/speech/plugin/ExampleUnitTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.flutter.eyepetizer.speech.plugin; - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() { - assertEquals(4, 2 + 2); - } -} \ No newline at end of file diff --git a/component/lib_cache/lib/cache_manager.dart b/component/lib_cache/lib/cache_manager.dart index f245cb2..58ae619 100644 --- a/component/lib_cache/lib/cache_manager.dart +++ b/component/lib_cache/lib/cache_manager.dart @@ -2,7 +2,7 @@ import 'package:shared_preferences/shared_preferences.dart'; ///本地缓存管理类 class CacheManager { - SharedPreferences _preferences; + late SharedPreferences _preferences; CacheManager._(); @@ -10,13 +10,13 @@ class CacheManager { this._preferences = preferences; } - static CacheManager _instance; + static CacheManager? _instance; static CacheManager getInstance() { if (_instance == null) { _instance = CacheManager._(); } - return _instance; + return _instance!; } //预初始化,防止get时,SharedPreferences还未初始化完毕 @@ -25,7 +25,7 @@ class CacheManager { var preferences = await SharedPreferences.getInstance(); _instance = CacheManager._pre(preferences); } - return _instance; + return _instance!; } set(String key, Object value) { @@ -45,6 +45,6 @@ class CacheManager { } T get(String key) { - return _preferences.get(key); + return _preferences.get(key) as T; } } diff --git a/component/lib_cache/pubspec.yaml b/component/lib_cache/pubspec.yaml index 609f604..be096c9 100644 --- a/component/lib_cache/pubspec.yaml +++ b/component/lib_cache/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none' environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: diff --git a/component/lib_core/lib/model/paging_model.dart b/component/lib_core/lib/model/paging_model.dart index 4e67beb..7123e98 100644 --- a/component/lib_core/lib/model/paging_model.dart +++ b/component/lib_core/lib/model/paging_model.dart @@ -1,6 +1,5 @@ - //通用分页Model class PagingModel { - String nextPageUrl; - List itemList; + String? nextPageUrl; + List itemList = []; } diff --git a/component/lib_core/lib/viewmodel/paging_list_model.dart b/component/lib_core/lib/viewmodel/paging_list_model.dart index 181d52f..3375d53 100644 --- a/component/lib_core/lib/viewmodel/paging_list_model.dart +++ b/component/lib_core/lib/viewmodel/paging_list_model.dart @@ -9,7 +9,7 @@ import 'base_change_notifier_model.dart'; abstract class PagingListModel> extends BaseChangeNotifierModel { List itemList = []; //集合数组 - String nextPageUrl; //下一页请求链接 + String? nextPageUrl; //下一页请求链接 RefreshController refreshController = //上拉加载/下拉刷新控制器 RefreshController(initialRefresh: false); @@ -22,7 +22,7 @@ abstract class PagingListModel> viewState = ViewState.content; nextPageUrl = getNextUrl(model); refreshController.refreshCompleted(); - refreshController.footerMode.value = LoadStatus.canLoading; + refreshController.footerMode!.value = LoadStatus.canLoading; doExtraAfterRefresh(); }, fail: (e) { @@ -40,7 +40,7 @@ abstract class PagingListModel> return; } - HttpManager.getData(nextPageUrl, success: (json) { + HttpManager.getData(nextPageUrl!, success: (json) { M model = getModel(json); doLoadMoreDataProcess(model.itemList); itemList.addAll(model.itemList); @@ -74,7 +74,7 @@ abstract class PagingListModel> String getUrl(); //上拉加载更多请求地址 - String getNextUrl(M model) { + String? getNextUrl(M model) { return model.nextPageUrl; } diff --git a/component/lib_core/lib/widget/provider_widget.dart b/component/lib_core/lib/widget/provider_widget.dart index 1d037a0..0b45bec 100644 --- a/component/lib_core/lib/widget/provider_widget.dart +++ b/component/lib_core/lib/widget/provider_widget.dart @@ -4,15 +4,16 @@ import 'package:provider/provider.dart'; //状态管理组件封装(MVVM),核心组件(基于provider封装) //provider状态管理,可以比喻成电台与听众的关系,电台 --》ChangeNotifierProvider 听众 --》Consumer model -->维护了一系列状态数据 class ProviderWidget extends StatefulWidget { - final T model;//控件对应的数据 - final Widget child; - final Widget Function(BuildContext context, T value, Widget child) builder;//绑定数据的控件 - final Function(T) onModelInit; //数据初始化方法 + final T model; //控件对应的数据 + final Widget? child; + final Widget Function(BuildContext context, T value, Widget? child) + builder; //绑定数据的控件 + final Function(T)? onModelInit; //数据初始化方法 const ProviderWidget( - {Key key, - @required this.model, - @required this.builder, + {Key? key, + required this.model, + required this.builder, this.onModelInit, this.child}) : super(key: key); @@ -23,14 +24,14 @@ class ProviderWidget extends StatefulWidget { class _ProviderWidgetState extends State> { - T model; + T? model; @override void initState() { super.initState(); model = widget.model; if (widget.onModelInit != null && model != null) { - widget.onModelInit(model); + widget.onModelInit!(model!); } } diff --git a/component/lib_core/pubspec.yaml b/component/lib_core/pubspec.yaml index fae29b9..df97613 100644 --- a/component/lib_core/pubspec.yaml +++ b/component/lib_core/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none' environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: @@ -20,7 +20,7 @@ dependencies: lib_net: path: ../lib_net - provider: ^5.0.0 + provider: ^6.1.2 pull_to_refresh: ^2.0.0 dev_dependencies: diff --git a/component/lib_image/lib/lib_image.dart b/component/lib_image/lib/lib_image.dart index 73304c8..9c47816 100644 --- a/component/lib_image/lib/lib_image.dart +++ b/component/lib_image/lib/lib_image.dart @@ -5,12 +5,12 @@ import 'package:flutter/material.dart'; //封装带缓存的Image Widget cacheImage(String url, - {double width, - double height, - BoxFit fit = BoxFit.cover, - BorderRadius borderRadius, - BoxShape shape = BoxShape.rectangle, - bool clearMemoryCacheWhenDispose = false}) { + {double? width, + double? height, + BoxFit fit = BoxFit.cover, + BorderRadius? borderRadius, + BoxShape shape = BoxShape.rectangle, + bool clearMemoryCacheWhenDispose = false}) { return ExtendedImage.network( url, shape: shape, @@ -19,10 +19,10 @@ Widget cacheImage(String url, fit: fit, borderRadius: borderRadius, clearMemoryCacheWhenDispose: - clearMemoryCacheWhenDispose, //图片从 tree 中移除,清掉内存缓存,以减少内存压力 + clearMemoryCacheWhenDispose, //图片从 tree 中移除,清掉内存缓存,以减少内存压力 ); } ImageProvider cachedNetworkImageProvider(String url) { return ExtendedNetworkImageProvider(url); -} \ No newline at end of file +} diff --git a/component/lib_image/pubspec.yaml b/component/lib_image/pubspec.yaml index e199fd4..74ddc9f 100644 --- a/component/lib_image/pubspec.yaml +++ b/component/lib_image/pubspec.yaml @@ -4,14 +4,14 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: flutter: sdk: flutter - extended_image: ^3.0.0 + extended_image: ^8.2.0 dev_dependencies: flutter_test: diff --git a/component/lib_navigator/pubspec.yaml b/component/lib_navigator/pubspec.yaml index 8b4fc05..f33f0d1 100644 --- a/component/lib_navigator/pubspec.yaml +++ b/component/lib_navigator/pubspec.yaml @@ -4,14 +4,14 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: flutter: sdk: flutter - get: ^3.26.0 + get: ^4.6.6 dev_dependencies: flutter_test: diff --git a/component/lib_net/lib/http_manager.dart b/component/lib_net/lib/http_manager.dart index 3fb5a11..9c38c1c 100644 --- a/component/lib_net/lib/http_manager.dart +++ b/component/lib_net/lib/http_manager.dart @@ -7,20 +7,20 @@ class HttpManager { //网络请求封装,通过方法回调执行的结果(成功或失败) //网络请求封装方式一:采用回调函数处理请求结果,类似Android开发 static getData(String url, - {Map headers, - Function success, - Function fail, - Function complete}) async { + {Map? headers, + Function? success, + Function? fail, + Function? complete}) async { try { var response = await http.get(Uri.parse(url), headers: headers); if (response.statusCode == 200) { var result = json.decode(utf8decoder.convert(response.bodyBytes)); - success(result); + success?.call(result); } else { throw Exception('"Request failed with status: ${response.statusCode}"'); } } catch (e) { - fail(e); + fail?.call(e); } finally { if (complete != null) { complete(); @@ -29,7 +29,7 @@ class HttpManager { } //网络请求封装方式二:返回Future,结合 then ==> catchError ==>whenComplete,类似JS - static Future requestData(String url, {Map headers}) async { + static Future requestData(String url, {Map? headers}) async { try { var response = await http.get(Uri.parse(url), headers: headers); if (response.statusCode == 200) { diff --git a/component/lib_net/pubspec.yaml b/component/lib_net/pubspec.yaml index 8d3db39..0c7efd3 100644 --- a/component/lib_net/pubspec.yaml +++ b/component/lib_net/pubspec.yaml @@ -4,14 +4,14 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: flutter: sdk: flutter - http: ^0.13.0 + http: ^1.0.0 dev_dependencies: flutter_test: diff --git a/component/lib_ui/lib/widget/appbar_widget.dart b/component/lib_ui/lib/widget/appbar_widget.dart index 0d46da9..57d785b 100644 --- a/component/lib_ui/lib/widget/appbar_widget.dart +++ b/component/lib_ui/lib/widget/appbar_widget.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -appBar(String title, {bool showBack = true, List actions}) { +appBar(String title, {bool showBack = true, List? actions}) { return AppBar( title: Text(title, style: TextStyle( diff --git a/component/lib_ui/lib/widget/blur_widget.dart b/component/lib_ui/lib/widget/blur_widget.dart index 838371d..a592571 100644 --- a/component/lib_ui/lib/widget/blur_widget.dart +++ b/component/lib_ui/lib/widget/blur_widget.dart @@ -4,11 +4,11 @@ import 'package:flutter/material.dart'; //高斯模糊组件封装 class BlurWidget extends StatelessWidget { - final Widget child; - final Color color; + final Widget? child; + final Color? color; final double sigma; - const BlurWidget({Key key, this.sigma = 10, this.child, this.color}) + const BlurWidget({Key? key, this.sigma = 10, this.child, this.color}) : super(key: key); @override diff --git a/component/lib_ui/lib/widget/load_more_widget.dart b/component/lib_ui/lib/widget/load_more_widget.dart index c4a612a..83bd321 100644 --- a/component/lib_ui/lib/widget/load_more_widget.dart +++ b/component/lib_ui/lib/widget/load_more_widget.dart @@ -8,8 +8,8 @@ class LoadMoreWidget extends StatefulWidget { final String loadMoreText; const LoadMoreWidget( - {Key key, - this.isLoadMore, + {Key? key, + this.isLoadMore = false, this.loadingText = loading_text, this.loadMoreText = load_more_text}) : super(key: key); diff --git a/component/lib_ui/lib/widget/loading_container.dart b/component/lib_ui/lib/widget/loading_container.dart index 1c3e068..93d396b 100644 --- a/component/lib_ui/lib/widget/loading_container.dart +++ b/component/lib_ui/lib/widget/loading_container.dart @@ -12,9 +12,9 @@ class LoadingContainer extends StatelessWidget { final VoidCallback retry; const LoadingContainer( - {Key key, - @required this.child, - @required this.retry, + {Key? key, + required this.child, + required this.retry, this.viewState = ViewState.loading}) : super(key: key); @@ -44,7 +44,7 @@ class LoadingContainer extends StatelessWidget { padding: const EdgeInsets.only(top: 8), child: Text( net_error_tip, - style: TextStyle(color:hitTextColor, fontSize: 18), + style: TextStyle(color: hitTextColor, fontSize: 18), ), ), Padding( diff --git a/component/lib_ui/lib/widget/remod_more_text_widget.dart b/component/lib_ui/lib/widget/remod_more_text_widget.dart index dff2f31..8875cb5 100644 --- a/component/lib_ui/lib/widget/remod_more_text_widget.dart +++ b/component/lib_ui/lib/widget/remod_more_text_widget.dart @@ -11,14 +11,14 @@ class ReadMoreTextWidget extends StatelessWidget { final String text; final String trimCollapsedText; final String trimExpandedText; - final TextStyle style; - final TextStyle moreStyle; - final TextStyle lessStyle; + final TextStyle? style; + final TextStyle? moreStyle; + final TextStyle? lessStyle; final int trimLines; final TrimTypeMode trimMode; const ReadMoreTextWidget(this.text, - {Key key, + {Key? key, this.trimCollapsedText = more_text, this.trimExpandedText = less_text, this.style, diff --git a/component/lib_ui/lib/widget/tab_bar_widget.dart b/component/lib_ui/lib/widget/tab_bar_widget.dart index 582dde6..3590535 100644 --- a/component/lib_ui/lib/widget/tab_bar_widget.dart +++ b/component/lib_ui/lib/widget/tab_bar_widget.dart @@ -4,17 +4,17 @@ import 'package:lib_ui/config/color.dart'; //通用的TabBar封装 class TabBarWidget extends StatelessWidget { final List tabs; - final TabController tabController; + final TabController? tabController; final Color labelColor; final Color unselectedLabelColor; final Color indicatorColor; final double fontSize; final TabBarIndicatorSize indicatorSize; - final ValueChanged onTap; + final ValueChanged? onTap; const TabBarWidget( - {Key key, - this.tabs, + {Key? key, + required this.tabs, this.tabController, this.labelColor = Colors.black, this.unselectedLabelColor = hitTextColor, @@ -35,6 +35,6 @@ class TabBarWidget extends StatelessWidget { indicatorColor: indicatorColor, indicatorSize: indicatorSize, tabs: tabs, - onTap: (index) => onTap(index)); + onTap: (index) => onTap?.call(index)); } } diff --git a/component/lib_ui/pubspec.yaml b/component/lib_ui/pubspec.yaml index 1c660fa..be35998 100644 --- a/component/lib_ui/pubspec.yaml +++ b/component/lib_ui/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: diff --git a/component/lib_utils/lib/event_bus.dart b/component/lib_utils/lib/event_bus.dart index cb32d0c..179e5b1 100644 --- a/component/lib_utils/lib/event_bus.dart +++ b/component/lib_utils/lib/event_bus.dart @@ -3,15 +3,15 @@ import 'package:event_bus/event_bus.dart'; class Bus { Bus._(); - static Bus _bus; - static EventBus _eventBus; + static Bus? _bus; + static late EventBus _eventBus; static Bus getInstance() { if (_bus == null) { _bus = Bus._(); _eventBus = EventBus(); } - return _bus; + return _bus!; } void send(event) { diff --git a/component/lib_utils/pubspec.yaml b/component/lib_utils/pubspec.yaml index 21de23e..7242493 100644 --- a/component/lib_utils/pubspec.yaml +++ b/component/lib_utils/pubspec.yaml @@ -4,16 +4,16 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: flutter: sdk: flutter - fluttertoast: ^8.2.2 + fluttertoast: ^8.2.4 flustars: ^2.0.1 - share: ^0.6.4+3 + share: ^2.0.4 event_bus: ^2.0.0 dev_dependencies: diff --git a/component/lib_video/lib/customer_video_controls.dart b/component/lib_video/lib/customer_video_controls.dart index d365ef8..e4ab83a 100644 --- a/component/lib_video/lib/customer_video_controls.dart +++ b/component/lib_video/lib/customer_video_controls.dart @@ -13,12 +13,12 @@ class MaterialControls extends StatefulWidget { final bool showBigPlayIcon; - final Widget overlayUI; + final Widget? overlayUI; - final Gradient bottomGradient; + final Gradient? bottomGradient; const MaterialControls( - {Key key, + {Key? key, this.showLoadingOnInitialize = true, this.showBigPlayIcon = true, this.overlayUI, @@ -33,29 +33,29 @@ class MaterialControls extends StatefulWidget { class _MaterialControlsState extends State with SingleTickerProviderStateMixin { - VideoPlayerValue _latestValue; - double _latestVolume; + late VideoPlayerValue _latestValue; + double? _latestVolume; bool _hideStuff = true; - Timer _hideTimer; - Timer _initTimer; - Timer _showAfterExpandCollapseTimer; + Timer? _hideTimer; + Timer? _initTimer; + Timer? _showAfterExpandCollapseTimer; bool _dragging = false; bool _displayTapped = false; final barHeight = 48.0; final marginSize = 5.0; - VideoPlayerController controller; - ChewieController chewieController; - AnimationController playPauseIconAnimationController; + late VideoPlayerController controller; + ChewieController? chewieController; + AnimationController? playPauseIconAnimationController; @override Widget build(BuildContext context) { if (_latestValue.hasError) { - return chewieController.errorBuilder != null - ? chewieController.errorBuilder( + return chewieController?.errorBuilder != null + ? chewieController!.errorBuilder!( context, - chewieController.videoPlayerController.value.errorDescription, + chewieController!.videoPlayerController.value.errorDescription!, ) : const Center( child: Icon( @@ -118,7 +118,7 @@ class _MaterialControlsState extends State void didChangeDependencies() { final _oldController = chewieController; chewieController = ChewieController.of(context); - controller = chewieController.videoPlayerController; + controller = chewieController!.videoPlayerController; playPauseIconAnimationController ??= AnimationController( vsync: this, @@ -138,7 +138,7 @@ class _MaterialControlsState extends State AnimatedOpacity _buildBottomBar( BuildContext context, ) { - final iconColor = Theme.of(context).textTheme.button.color; + final iconColor = Theme.of(context).textTheme.labelLarge?.color; return AnimatedOpacity( opacity: _hideStuff ? 0.0 : 1.0, @@ -151,18 +151,18 @@ class _MaterialControlsState extends State child: Row( children: [ _buildPlayPause(controller), - if (chewieController.isLive) + if (chewieController!.isLive) const SizedBox() else _buildProgressBar(), - if (chewieController.isLive) + if (chewieController!.isLive) const Expanded(child: Text('LIVE')) else _buildPosition(iconColor), - if (chewieController.allowPlaybackSpeedChanging) + if (chewieController!.allowPlaybackSpeedChanging) _buildSpeedButton(controller), - if (chewieController.allowMuting) _buildMuteButton(controller), - if (chewieController.allowFullScreen) _buildExpandButton(), + if (chewieController!.allowMuting) _buildMuteButton(controller), + if (chewieController!.allowFullScreen) _buildExpandButton(), ], ), ), @@ -184,7 +184,7 @@ class _MaterialControlsState extends State ), child: Center( child: Icon( - chewieController.isFullScreen + chewieController!.isFullScreen ? Icons.fullscreen_exit_rounded : Icons.fullscreen_rounded, color: Colors.white, @@ -245,7 +245,7 @@ class _MaterialControlsState extends State : AnimatedIcon( icon: AnimatedIcons.play_pause, progress: - playPauseIconAnimationController, + playPauseIconAnimationController!, size: 32.0, ), onPressed: () { @@ -275,7 +275,7 @@ class _MaterialControlsState extends State isScrollControlled: true, useRootNavigator: true, builder: (context) => _PlaybackSpeedDialog( - speeds: chewieController.playbackSpeeds, + speeds: chewieController!.playbackSpeeds, selected: _latestValue.playbackSpeed, ), ); @@ -363,7 +363,7 @@ class _MaterialControlsState extends State } ///播放时间 - Widget _buildPosition(Color iconColor) { + Widget _buildPosition(Color? iconColor) { final position = _latestValue != null && _latestValue.position != null ? _latestValue.position : Duration.zero; @@ -396,11 +396,11 @@ class _MaterialControlsState extends State _updateState(); if ((controller.value != null && controller.value.isPlaying) || - chewieController.autoPlay) { + chewieController!.autoPlay) { _startHideTimer(); } - if (chewieController.showControlsOnInitialize) { + if (chewieController!.showControlsOnInitialize) { _initTimer = Timer(const Duration(milliseconds: 200), () { setState(() { _hideStuff = false; @@ -410,14 +410,14 @@ class _MaterialControlsState extends State } void _onExpandCollapse() { - if (chewieController.videoPlayerController.value.size == null) { + if (chewieController!.videoPlayerController.value.size == null) { print('_onExpandCollapse:videoPlayerController.value.size is null.'); return; } setState(() { _hideStuff = true; - chewieController.toggleFullScreen(); + chewieController!.toggleFullScreen(); _showAfterExpandCollapseTimer = Timer(const Duration(milliseconds: 300), () { setState(() { @@ -437,7 +437,7 @@ class _MaterialControlsState extends State setState(() { if (controller.value.isPlaying) { - playPauseIconAnimationController.reverse(); + playPauseIconAnimationController?.reverse(); _hideStuff = false; _hideTimer?.cancel(); controller.pause(); @@ -447,13 +447,13 @@ class _MaterialControlsState extends State if (!controller.value.isInitialized) { controller.initialize().then((_) { controller.play(); - playPauseIconAnimationController.forward(); + playPauseIconAnimationController?.forward(); }); } else { if (isFinished) { controller.seekTo(const Duration()); } - playPauseIconAnimationController.forward(); + playPauseIconAnimationController?.forward(); controller.play(); } } @@ -495,7 +495,7 @@ class _MaterialControlsState extends State _startHideTimer(); }, - colors: chewieController.materialProgressColors ?? + colors: chewieController?.materialProgressColors ?? ChewieProgressColors( playedColor: Theme.of(context).colorScheme.secondary, handleColor: Theme.of(context).colorScheme.secondary, @@ -525,9 +525,9 @@ class _MaterialControlsState extends State class _PlaybackSpeedDialog extends StatelessWidget { const _PlaybackSpeedDialog({ - Key key, - @required List speeds, - @required double selected, + Key? key, + required List speeds, + required double selected, }) : _speeds = speeds, _selected = selected, super(key: key); diff --git a/component/lib_video/lib/video_widget.dart b/component/lib_video/lib/video_widget.dart index 6a24d98..f18fd92 100644 --- a/component/lib_video/lib/video_widget.dart +++ b/component/lib_video/lib/video_widget.dart @@ -2,7 +2,7 @@ import 'package:chewie/chewie.dart' hide MaterialControls; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:lib_utils/view_util.dart'; -import 'package:orientation/orientation.dart'; +// import 'package:orientation/orientation.dart'; import 'package:video_player/video_player.dart'; import 'customer_video_controls.dart'; @@ -15,11 +15,11 @@ class VideoWidget extends StatefulWidget { final bool allowFullScreen; final bool allowPlaybackSpeedChanging; final double aspectRatio; - final Widget overlayUI; + final Widget? overlayUI; const VideoWidget( - {Key key, - this.url, + {Key? key, + required this.url, this.autoPlay = true, this.looping = false, this.aspectRatio = 16 / 9, @@ -33,13 +33,14 @@ class VideoWidget extends StatefulWidget { } class VideoWidgetState extends State { - VideoPlayerController _videoPlayerController; - ChewieController _cheWieController; + late VideoPlayerController _videoPlayerController; + late ChewieController _cheWieController; @override void initState() { super.initState(); - _videoPlayerController = VideoPlayerController.network(widget.url); + _videoPlayerController = + VideoPlayerController.networkUrl(Uri.parse(widget.url)); _cheWieController = ChewieController( videoPlayerController: _videoPlayerController, autoPlay: widget.autoPlay, @@ -87,7 +88,7 @@ class VideoWidgetState extends State { Size size = MediaQuery.of(context).size; if (size.width > size.height) { //使用Orientation插件解决ios全屏模式无法返回问题 - OrientationPlugin.forceOrientation(DeviceOrientation.portraitUp); + // OrientationPlugin.forceOrientation(DeviceOrientation.portraitUp); } } } diff --git a/component/lib_video/pubspec.yaml b/component/lib_video/pubspec.yaml index 4a4d938..18a8bca 100644 --- a/component/lib_video/pubspec.yaml +++ b/component/lib_video/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none'#如果你想发布到pub.dev,请删除这一行 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: @@ -18,8 +18,11 @@ dependencies: chewie: ^1.2.2 video_player: ^2.2.3 - screen: ^0.0.5 - orientation: ^1.3.0 + screen: + git: + url: https://github.com/daniloapr/flutter_screen.git + ref: master + # orientation: ^1.3.0 dev_dependencies: flutter_test: diff --git a/flutter_native_splash.yaml b/flutter_native_splash.yaml new file mode 100644 index 0000000..ad2b4d9 --- /dev/null +++ b/flutter_native_splash.yaml @@ -0,0 +1,144 @@ +flutter_native_splash: + # This package generates native code to customize Flutter's default white native splash screen + # with background color and splash image. + # Customize the parameters below, and run the following command in the terminal: + # dart run flutter_native_splash:create + # To restore Flutter's default white splash screen, run the following command in the terminal: + # dart run flutter_native_splash:remove + + # IMPORTANT NOTE: These parameter do not affect the configuration of Android 12 and later, which + # handle splash screens differently that prior versions of Android. Android 12 and later must be + # configured specifically in the android_12 section below. + + # color or background_image is the only required parameter. Use color to set the background + # of your splash screen to a solid color. Use background_image to set the background of your + # splash screen to a png image. This is useful for gradients. The image will be stretch to the + # size of the app. Only one parameter can be used, color and background_image cannot both be set. + # color: "#eeeeee" + background_image: "launch_screen.jpg" + + # Optional parameters are listed below. To enable a parameter, uncomment the line by removing + # the leading # character. + + # The image parameter allows you to specify an image used in the splash screen. It must be a + # png file and should be sized for 4x pixel density. + #image: assets/splash.png + + # The branding property allows you to specify an image used as branding in the splash screen. + # It must be a png file. It is supported for Android, iOS and the Web. For Android 12, + # see the Android 12 section below. + #branding: assets/dart.png + + # To position the branding image at the bottom of the screen you can use bottom, bottomRight, + # and bottomLeft. The default values is bottom if not specified or specified something else. + #branding_mode: bottom + + # The color_dark, background_image_dark, image_dark, branding_dark are parameters that set the background + # and image when the device is in dark mode. If they are not specified, the app will use the + # parameters from above. If the image_dark parameter is specified, color_dark or + # background_image_dark must be specified. color_dark and background_image_dark cannot both be + # set. + #color_dark: "#042a49" + #background_image_dark: "assets/dark-background.png" + #image_dark: assets/splash-invert.png + #branding_dark: assets/dart_dark.png + + # From Android 12 onwards, the splash screen is handled differently than in previous versions. + # Please visit https://developer.android.com/guide/topics/ui/splash-screen + # Following are specific parameters for Android 12+. + android_12: + # The image parameter sets the splash screen icon image. If this parameter is not specified, + # the app's launcher icon will be used instead. + # Please note that the splash screen will be clipped to a circle on the center of the screen. + # App icon with an icon background: This should be 960×960 pixels, and fit within a circle + # 640 pixels in diameter. + # App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle + # 768 pixels in diameter. + #image: assets/android12splash.png + + # Splash screen background color. + #color: "#42a5f5" + + # App icon background color. + #icon_background_color: "#111111" + + # The branding property allows you to specify an image used as branding in the splash screen. + #branding: assets/dart.png + + # The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that + # apply when the device is in dark mode. If they are not specified, the app will use the + # parameters from above. + #image_dark: assets/android12splash-invert.png + #color_dark: "#042a49" + #icon_background_color_dark: "#eeeeee" + + # The android, ios and web parameters can be used to disable generating a splash screen on a given + # platform. + #android: false + #ios: false + #web: false + + # Platform specific images can be specified with the following parameters, which will override + # the respective parameter. You may specify all, selected, or none of these parameters: + #color_android: "#42a5f5" + #color_dark_android: "#042a49" + #color_ios: "#42a5f5" + #color_dark_ios: "#042a49" + #color_web: "#42a5f5" + #color_dark_web: "#042a49" + #image_android: assets/splash-android.png + #image_dark_android: assets/splash-invert-android.png + #image_ios: assets/splash-ios.png + #image_dark_ios: assets/splash-invert-ios.png + #image_web: assets/splash-web.gif + #image_dark_web: assets/splash-invert-web.gif + #background_image_android: "assets/background-android.png" + #background_image_dark_android: "assets/dark-background-android.png" + #background_image_ios: "assets/background-ios.png" + #background_image_dark_ios: "assets/dark-background-ios.png" + #background_image_web: "assets/background-web.png" + #background_image_dark_web: "assets/dark-background-web.png" + #branding_android: assets/brand-android.png + #branding_dark_android: assets/dart_dark-android.png + #branding_ios: assets/brand-ios.png + #branding_dark_ios: assets/dart_dark-ios.png + #branding_web: assets/brand-web.gif + #branding_dark_web: assets/dart_dark-web.gif + + # The position of the splash image can be set with android_gravity, ios_content_mode, and + # web_image_mode parameters. All default to center. + # + # android_gravity can be one of the following Android Gravity (see + # https://developer.android.com/reference/android/view/Gravity): bottom, center, + # center_horizontal, center_vertical, clip_horizontal, clip_vertical, end, fill, fill_horizontal, + # fill_vertical, left, right, start, or top. + #android_gravity: center + # + # ios_content_mode can be one of the following iOS UIView.ContentMode (see + # https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill, + # scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight, + # bottomLeft, or bottomRight. + #ios_content_mode: center + # + # web_image_mode can be one of the following modes: center, contain, stretch, and cover. + #web_image_mode: center + + # The screen orientation can be set in Android with the android_screen_orientation parameter. + # Valid parameters can be found here: + # https://developer.android.com/guide/topics/manifest/activity-element#screen + #android_screen_orientation: sensorLandscape + + # To hide the notification bar, use the fullscreen parameter. Has no effect in web since web + # has no notification bar. Defaults to false. + # NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads. + # To show the notification bar, add the following code to your Flutter app: + # WidgetsFlutterBinding.ensureInitialized(); + # SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top], ); + fullscreen: true + + # If you have changed the name(s) of your info.plist file(s), you can specify the filename(s) + # with the info_plist_files parameter. Remove only the # characters in the three lines below, + # do not remove any spaces: + #info_plist_files: + # - 'ios/Runner/Info-Debug.plist' + # - 'ios/Runner/Info-Release.plist' \ No newline at end of file diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 4f8d4d2..7c56964 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) + en CFBundleExecutable App CFBundleIdentifier @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index e8efba1..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,2 +1,2 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 399e934..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1,2 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh index a014013..a478e24 100755 --- a/ios/Flutter/flutter_export_environment.sh +++ b/ios/Flutter/flutter_export_environment.sh @@ -1,14 +1,13 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/heytea/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/heytea/FlutterProject/Flutter_Eyepetizer" +export "FLUTTER_ROOT=/Users/gk/development/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/gk/Projects/eyepetizer" export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_TARGET=/Users/heytea/FlutterProject/Flutter_Eyepetizer/lib/main.dart" +export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_NAME=2.0.3" export "FLUTTER_BUILD_NUMBER=1" -export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==" export "DART_OBFUSCATION=false" export "TRACK_WIDGET_CREATION=true" export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=/Users/heytea/FlutterProject/Flutter_Eyepetizer/.dart_tool/package_config.json" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/ios/Podfile b/ios/Podfile index 3a63fff..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' @@ -28,7 +28,13 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe flutter_ios_podfile_setup target 'Runner' do + use_frameworks! + use_modular_headers! + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end end post_install do |installer| @@ -36,4 +42,3 @@ post_install do |installer| flutter_additional_ios_build_settings(target) end end - diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 8d31884..0000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,82 +0,0 @@ -PODS: - - Flutter (1.0.0) - - flutter_splash_screen (0.0.1): - - Flutter - - flutter_webview_plugin (0.0.1): - - Flutter - - fluttertoast (0.0.2): - - Flutter - - image_picker (0.0.1): - - Flutter - - orientation (0.0.1): - - Flutter - - path_provider (0.0.1): - - Flutter - - screen (0.0.1): - - Flutter - - share (0.0.1): - - Flutter - - shared_preferences (0.0.1): - - Flutter - - video_player (0.0.1): - - Flutter - - wakelock (0.0.1): - - Flutter - -DEPENDENCIES: - - Flutter (from `Flutter`) - - flutter_splash_screen (from `.symlinks/plugins/flutter_splash_screen/ios`) - - flutter_webview_plugin (from `.symlinks/plugins/flutter_webview_plugin/ios`) - - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - - image_picker (from `.symlinks/plugins/image_picker/ios`) - - orientation (from `.symlinks/plugins/orientation/ios`) - - path_provider (from `.symlinks/plugins/path_provider/ios`) - - screen (from `.symlinks/plugins/screen/ios`) - - share (from `.symlinks/plugins/share/ios`) - - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - - video_player (from `.symlinks/plugins/video_player/ios`) - - wakelock (from `.symlinks/plugins/wakelock/ios`) - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - flutter_splash_screen: - :path: ".symlinks/plugins/flutter_splash_screen/ios" - flutter_webview_plugin: - :path: ".symlinks/plugins/flutter_webview_plugin/ios" - fluttertoast: - :path: ".symlinks/plugins/fluttertoast/ios" - image_picker: - :path: ".symlinks/plugins/image_picker/ios" - orientation: - :path: ".symlinks/plugins/orientation/ios" - path_provider: - :path: ".symlinks/plugins/path_provider/ios" - screen: - :path: ".symlinks/plugins/screen/ios" - share: - :path: ".symlinks/plugins/share/ios" - shared_preferences: - :path: ".symlinks/plugins/shared_preferences/ios" - video_player: - :path: ".symlinks/plugins/video_player/ios" - wakelock: - :path: ".symlinks/plugins/wakelock/ios" - -SPEC CHECKSUMS: - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a - flutter_splash_screen: 0323a1080aa7853a0f0af4491dc29d034be61746 - flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694 - fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b - image_picker: 50e7c7ff960e5f58faa4d1f4af84a771c671bc4a - orientation: 6c9203efe86ce4cff379756910f18b2d745628c3 - path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c - screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 - share: 0b2c3e82132f5888bccca3351c504d0003b3b410 - shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d - video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e - wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f - -PODFILE CHECKSUM: d31fe2f16d9c804eff3c31c1ccc4fd8120b3d1db - -COCOAPODS: 1.9.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index dc57aa8..20d6bfd 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,16 +8,24 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3F08BBDA9548C2D0ECC404A3 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CEB4F2D45C0386482533F69 /* libPods-Runner.a */; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; @@ -34,22 +42,19 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 39E96B01B84B4A7D4159648F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3CEB4F2D45C0386482533F69 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C0D916D2C7F9C7D3450872FF /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - FEA0C245EB2114685F449075 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -57,29 +62,18 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3F08BBDA9548C2D0ECC404A3 /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 58964756FC7EC14A6DE7B982 /* Pods */ = { + 331C8082294A63A400263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( - FEA0C245EB2114685F449075 /* Pods-Runner.debug.xcconfig */, - 39E96B01B84B4A7D4159648F /* Pods-Runner.release.xcconfig */, - C0D916D2C7F9C7D3450872FF /* Pods-Runner.profile.xcconfig */, + 331C807B294A618700263BE5 /* RunnerTests.swift */, ); - path = Pods; - sourceTree = ""; - }; - 65D5FB7C0E38DB12259E7F3A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3CEB4F2D45C0386482533F69 /* libPods-Runner.a */, - ); - name = Frameworks; + path = RunnerTests; sourceTree = ""; }; 9740EEB11CF90186004384FC /* Flutter */ = { @@ -99,8 +93,7 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 58964756FC7EC14A6DE7B982 /* Pods */, - 65D5FB7C0E38DB12259E7F3A /* Frameworks */, + 331C8082294A63A400263BE5 /* RunnerTests */, ); sourceTree = ""; }; @@ -108,6 +101,7 @@ isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, ); name = Products; sourceTree = ""; @@ -115,35 +109,42 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 2897078CBDB35B6A184E41B2 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -166,16 +167,22 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = "The Chromium Authors"; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; + compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -188,18 +195,25 @@ projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); @@ -208,28 +222,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 2897078CBDB35B6A184E41B2 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -237,6 +229,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -263,18 +256,33 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -299,6 +307,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -328,6 +337,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -336,9 +346,10 @@ 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; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -349,29 +360,74 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = S8QB4VV633; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Flutter", + "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.flutter.flutterEyepetizer; + PRODUCT_BUNDLE_IDENTIFIER = com.example.eyepetizer; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Profile; }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.eyepetizer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.eyepetizer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.eyepetizer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -401,6 +457,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -415,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; @@ -427,6 +484,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -456,6 +514,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -464,9 +523,12 @@ 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; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -477,20 +539,19 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Flutter", + "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.flutter.flutterEyepetizer; + PRODUCT_BUNDLE_IDENTIFIER = com.example.eyepetizer; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -500,20 +561,18 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Flutter", + "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.flutter.flutterEyepetizer; + PRODUCT_BUNDLE_IDENTIFIER = com.example.eyepetizer; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; @@ -521,6 +580,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 3db53b6..8e3ca5d 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - - - + + + + + + - - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.h b/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bb..0000000 --- a/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e9..0000000 --- a/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png index 3d43d11..dc9ada4 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf0..7353c41 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd9..797d452 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b..6ed2d93 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde121..4cd7b00 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e..fe73094 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc230..321773c 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd9..797d452 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8..502f463 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b86..0ec3034 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b86..0ec3034 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d16..e9f5fea 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d..84ac32a 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41..8953cba 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f58..0467bf1 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/Contents.json b/ios/Runner/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164..0000000 --- a/ios/Runner/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/launch_screen.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json similarity index 73% rename from ios/Runner/Assets.xcassets/launch_screen.imageset/Contents.json rename to ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json index 3d3ddfe..9f447e1 100644 --- a/ios/Runner/Assets.xcassets/launch_screen.imageset/Contents.json +++ b/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json @@ -1,12 +1,12 @@ { "images" : [ { + "filename" : "background.png", "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "launch_screen.jpg", "scale" : "2x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png b/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png new file mode 100644 index 0000000..fb9e6d1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json index 0bedcf2..00cabce 100644 --- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -1,23 +1,23 @@ { "images" : [ { - "idiom" : "universal", "filename" : "LaunchImage.png", + "idiom" : "universal", "scale" : "1x" }, { - "idiom" : "universal", "filename" : "LaunchImage@2x.png", + "idiom" : "universal", "scale" : "2x" }, { - "idiom" : "universal", "filename" : "LaunchImage@3x.png", + "idiom" : "universal", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } } diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png index 9da19ea..71e9c81 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png index 9da19ea..71e9c81 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png index 9da19ea..71e9c81 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/landing_background.imageset/Contents.json b/ios/Runner/Assets.xcassets/landing_background.imageset/Contents.json deleted file mode 100644 index 47214eb..0000000 --- a/ios/Runner/Assets.xcassets/landing_background.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "landing_background.jpg", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/landing_background.imageset/landing_background.jpg b/ios/Runner/Assets.xcassets/landing_background.imageset/landing_background.jpg deleted file mode 100644 index d092326..0000000 Binary files a/ios/Runner/Assets.xcassets/landing_background.imageset/landing_background.jpg and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/Contents.json b/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/Contents.json deleted file mode 100644 index 78d3f7d..0000000 --- a/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "launch_screen.jpeg", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/launch_screen.jpeg b/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/launch_screen.jpeg deleted file mode 100644 index dd00eec..0000000 Binary files a/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/launch_screen.jpeg and /dev/null differ diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard index 0815594..55c0cae 100644 --- a/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -1,12 +1,8 @@ - - - - - + + - - + @@ -18,31 +14,31 @@ - - - - + + - - - - - - + + + + + + + + - + - - + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index b01126d..f43ec62 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -1,60 +1,53 @@ - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - flutter_eyepetizer - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - NSCameraUsageDescription - Used to demonstrate image picker plugin - NSMicrophoneUsageDescription - Used to capture audio for image picker plugin - NSPhotoLibraryUsageDescription - Used to demonstrate image picker plugin - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Eyepetizer + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + eyepetizer + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + UIStatusBarHidden + + UIViewControllerBasedStatusBarAppearance + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/Runner/main.m b/ios/Runner/main.m deleted file mode 100644 index dff6597..0000000 --- a/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/ios/Runner/Assets.xcassets/launch_screen.imageset/launch_screen.jpg b/launch_screen.jpg similarity index 100% rename from ios/Runner/Assets.xcassets/launch_screen.imageset/launch_screen.jpg rename to launch_screen.jpg diff --git a/lib/app_initialize.dart b/lib/app_initialize.dart index f1e0f31..b5883a8 100644 --- a/lib/app_initialize.dart +++ b/lib/app_initialize.dart @@ -1,4 +1,6 @@ -import 'package:flutter_splash_screen/flutter_splash_screen.dart'; +import 'dart:io'; +import 'package:flutter/services.dart'; +import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:lib_cache/cache_manager.dart'; import 'package:module_common/constant/http_constant.dart'; @@ -9,7 +11,12 @@ class AppInitialize { static Future init() async { await CacheManager.preInit(); HttpConstant.baseUrl = 'http://baobab.kaiyanapp.com/api/'; - Future.delayed( - Duration(milliseconds: 2000), () => FlutterSplashScreen.hide()); + Future.delayed(Duration(milliseconds: 2000), () { + FlutterNativeSplash.remove(); + if (Platform.isIOS) { + SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, + overlays: [SystemUiOverlay.top, SystemUiOverlay.bottom]); + } + }); } } diff --git a/lib/main.dart b/lib/main.dart index b56f49f..9d65611 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,5 @@ -import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; +import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_eyepetizer/navigation/tab_navigation.dart'; import 'package:flutter_eyepetizer/app_initialize.dart'; import 'package:lib_navigator/lib_navigator.dart'; @@ -8,39 +7,28 @@ import 'package:module_detail/page/video_detail_page.dart'; import 'package:module_author/page/author_page.dart'; void main() { - //Flutter沉浸式状态栏 - if (Platform.isAndroid) { - SystemChrome.setSystemUIOverlayStyle( - SystemUiOverlayStyle.dark.copyWith(statusBarColor: Colors.transparent)); - } + WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); + FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); runApp(App()); } class App extends StatelessWidget { @override Widget build(BuildContext context) { - return FutureBuilder( - future: AppInitialize.init(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - var widget = snapshot.connectionState == ConnectionState.done - ? TabNavigation() - : Scaffold( - body: Center( - child: CircularProgressIndicator(), - ), - ); - return GetMaterialAppWidget( - child: widget, - ); - }, + return GetMaterialApp( + title: 'Eyepetizer', + initialRoute: '/', + getPages: [ + GetPage(name: '/', page: () => GetMaterialAppWidget()), + GetPage(name: '/detail', page: () => VideoDetailPage()), + GetPage(name: '/author', page: () => AuthorPage()), + ], ); } } class GetMaterialAppWidget extends StatefulWidget { - final Widget child; - - const GetMaterialAppWidget({Key key, this.child}) : super(key: key); + const GetMaterialAppWidget({Key? key}) : super(key: key); @override _GetMaterialAppWidgetState createState() => _GetMaterialAppWidgetState(); @@ -49,14 +37,17 @@ class GetMaterialAppWidget extends StatefulWidget { class _GetMaterialAppWidgetState extends State { @override Widget build(BuildContext context) { - return GetMaterialApp( - title: 'Eyepetizer', - initialRoute: '/', - getPages: [ - GetPage(name: '/', page: () => widget.child), - GetPage(name: '/detail', page: () => VideoDetailPage()), - GetPage(name: '/author', page: () => AuthorPage()), - ], + return FutureBuilder( + future: AppInitialize.init(), + builder: (BuildContext context, AsyncSnapshot snapshot) { + return snapshot.connectionState == ConnectionState.done + ? TabNavigation() + : Scaffold( + body: Center( + child: CircularProgressIndicator(), + ), + ); + }, ); } } diff --git a/lib/navigation/tab_navigation.dart b/lib/navigation/tab_navigation.dart index 8369091..034810d 100644 --- a/lib/navigation/tab_navigation.dart +++ b/lib/navigation/tab_navigation.dart @@ -16,11 +16,11 @@ class TabNavigation extends StatefulWidget { class _TabNavigationState extends State { PageController _pageController = PageController(); - DateTime lastTime; + DateTime? lastTime; @override Widget build(BuildContext context) { - return WillPopScope( + return PopScope( child: Scaffold( body: PageView( controller: _pageController, @@ -64,12 +64,13 @@ class _TabNavigationState extends State { ); }), ), - onWillPop: _onWillPop); + canPop: true, + onPopInvoked: _onWillPop); } - Future _onWillPop() async { + Future _onWillPop(didPop) async { if (lastTime == null || - DateTime.now().difference(lastTime) > Duration(seconds: 2)) { + DateTime.now().difference(lastTime!) > Duration(seconds: 2)) { lastTime = DateTime.now(); showTip(DString.exit_tip); return false; diff --git a/module/module_author/lib/delegate/sticky_tabbar_delegate.dart b/module/module_author/lib/delegate/sticky_tabbar_delegate.dart index a517f02..48ac20f 100644 --- a/module/module_author/lib/delegate/sticky_tabbar_delegate.dart +++ b/module/module_author/lib/delegate/sticky_tabbar_delegate.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; + //自定义SliverPersistentHeaderDelegate保证child滑动顶部时吸顶 class StickyTabBarDelegate extends SliverPersistentHeaderDelegate { final TabBar child; - StickyTabBarDelegate({@required this.child}); + StickyTabBarDelegate({required this.child}); @override Widget build( diff --git a/module/module_author/lib/page/all_tab_page.dart b/module/module_author/lib/page/all_tab_page.dart index a86cf62..f0bbafb 100644 --- a/module/module_author/lib/page/all_tab_page.dart +++ b/module/module_author/lib/page/all_tab_page.dart @@ -7,7 +7,7 @@ import 'package:module_common/model/common_item_model.dart'; class AllTabPage extends StatefulWidget { final apiUrl; - const AllTabPage({Key key, this.apiUrl}) : super(key: key); + const AllTabPage({Key? key, this.apiUrl}) : super(key: key); @override _AllTabPageState createState() => _AllTabPageState(); diff --git a/module/module_author/lib/page/author_page.dart b/module/module_author/lib/page/author_page.dart index 4ec81a1..702ae46 100644 --- a/module/module_author/lib/page/author_page.dart +++ b/module/module_author/lib/page/author_page.dart @@ -15,7 +15,7 @@ import 'package:module_common/model/tab_info_model.dart'; import 'special_tab_page.dart'; class AuthorPage extends StatefulWidget { - const AuthorPage({Key key}) : super(key: key); + const AuthorPage({Key? key}) : super(key: key); @override _AuthorPageState createState() => _AuthorPageState(); @@ -23,11 +23,11 @@ class AuthorPage extends StatefulWidget { class _AuthorPageState extends BaseState with TickerProviderStateMixin { - ScrollController _scrollController; - int authorId; + late ScrollController _scrollController; + late int authorId; ViewState viewState = ViewState.loading; - PgcInfo pgcInfo; - TabController _tabController; + late PgcInfo? pgcInfo; + late TabController _tabController; List tabList = []; List pageList = []; @@ -67,7 +67,7 @@ class _AuthorPageState extends BaseState TabInfoModel tabInfoModel = TabInfoModel.fromJson(result); setState(() { viewState = ViewState.content; - tabList = tabInfoModel.tabInfo.tabList; + tabList = tabInfoModel.tabInfo?.tabList ?? []; if (tabList.length == 2) { pageList = [ HomeTabPage(apiUrl: tabList[0].apiUrl), @@ -82,7 +82,7 @@ class _AuthorPageState extends BaseState } pgcInfo = tabInfoModel.pgcInfo; _tabController = TabController( - length: tabInfoModel.tabInfo.tabList.length, vsync: this); + length: tabInfoModel.tabInfo?.tabList?.length ?? 0, vsync: this); }); }, fail: (e) { viewState = ViewState.error; @@ -126,7 +126,7 @@ class _AuthorPageState extends BaseState color: isShrink ? Colors.black : Colors.white), ), title: Text( - pgcInfo.name, + pgcInfo?.name ?? '', style: TextStyle( color: isShrink ? Colors.black : Colors.white, ), @@ -136,11 +136,11 @@ class _AuthorPageState extends BaseState decoration: BoxDecoration( image: DecorationImage( fit: BoxFit.cover, - image: pgcInfo.cover == null + image: pgcInfo?.cover == null ? AssetImage('images/ic_default_header_bg.png', package: 'module_author') : cachedNetworkImageProvider( - pgcInfo.cover, + pgcInfo?.cover ?? '', ))), padding: EdgeInsets.only( top: MediaQuery.of(context).padding.top + kToolbarHeight), @@ -151,7 +151,8 @@ class _AuthorPageState extends BaseState Padding( padding: EdgeInsets.all(15), child: ClipOval( - child: cacheImage(pgcInfo.icon, height: 40, width: 40), + child: + cacheImage(pgcInfo?.icon ?? '', height: 40, width: 40), ), ), Expanded( @@ -159,13 +160,13 @@ class _AuthorPageState extends BaseState crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - pgcInfo.description, + pgcInfo?.description ?? '', style: TextStyle(fontSize: 14, color: Colors.white), maxLines: 1, overflow: TextOverflow.ellipsis, ), Text( - pgcInfo.brief, + pgcInfo?.brief ?? '', style: TextStyle(fontSize: 12, color: Colors.white), maxLines: 1, overflow: TextOverflow.ellipsis, @@ -179,9 +180,9 @@ class _AuthorPageState extends BaseState child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - _infoWidget('${pgcInfo.videoCount}', author_works), - _infoWidget('${pgcInfo.followCount}', author_flows), - _infoWidget('${pgcInfo.shareCount}', author_share), + _infoWidget('${pgcInfo?.videoCount}', author_works), + _infoWidget('${pgcInfo?.followCount}', author_flows), + _infoWidget('${pgcInfo?.shareCount}', author_share), ], ), ) diff --git a/module/module_author/lib/page/home_tab_page.dart b/module/module_author/lib/page/home_tab_page.dart index 777c789..ef4be1e 100644 --- a/module/module_author/lib/page/home_tab_page.dart +++ b/module/module_author/lib/page/home_tab_page.dart @@ -17,7 +17,7 @@ const VIDEO_COLLECTION_WITH_BRIEF = "videoCollectionWithBrief"; class HomeTabPage extends StatefulWidget { final apiUrl; - const HomeTabPage({Key key, this.apiUrl}) : super(key: key); + const HomeTabPage({Key? key, this.apiUrl}) : super(key: key); @override _HomeTabPageState createState() => _HomeTabPageState(); @@ -33,7 +33,7 @@ class _HomeTabPageState case VIDEO_COLLECTION_OF_HORIZONTAL_SCROLL_CARD: return _horizontalScrollCardItem(item); case TEXT_HEADER: - return _titleItem(item.data.text); + return _titleItem(item.data?.text ?? ''); case VIDEO: return VideoRelateWidgetItem( data: item.data, @@ -71,7 +71,7 @@ class _HomeTabPageState mainAxisAlignment: MainAxisAlignment.end, children: [ Text( - item.data.text, + item.data?.text ?? '', style: TextStyle( color: Colors.blueAccent, fontWeight: FontWeight.bold), ), @@ -88,7 +88,7 @@ class _HomeTabPageState return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - _titleItem(item.data.header.title), + _titleItem(item.data?.header?.title ?? ''), AuthorCommonHorizontalWidgetItem( item: item, ), diff --git a/module/module_author/lib/page/special_tab_page.dart b/module/module_author/lib/page/special_tab_page.dart index 8b35121..65a4916 100644 --- a/module/module_author/lib/page/special_tab_page.dart +++ b/module/module_author/lib/page/special_tab_page.dart @@ -7,7 +7,7 @@ import 'package:module_common/model/common_item_model.dart'; class SpecialTabPage extends StatefulWidget { final apiUrl; - const SpecialTabPage({Key key, this.apiUrl}) : super(key: key); + const SpecialTabPage({Key? key, this.apiUrl}) : super(key: key); @override _SpecialTabPageState createState() => _SpecialTabPageState(); diff --git a/module/module_author/lib/widget/all_widget_item.dart b/module/module_author/lib/widget/all_widget_item.dart index 817b4cb..714544a 100644 --- a/module/module_author/lib/widget/all_widget_item.dart +++ b/module/module_author/lib/widget/all_widget_item.dart @@ -9,7 +9,7 @@ import 'package:lib_utils/share_util.dart'; class AllWidgetItem extends StatelessWidget { final Item item; - const AllWidgetItem({Key key, this.item}) : super(key: key); + const AllWidgetItem({Key? key, required this.item}) : super(key: key); @override Widget build(BuildContext context) { @@ -21,10 +21,10 @@ class AllWidgetItem extends StatelessWidget { Row( children: [ InkWell( - onTap: () => toNamed('/author', item.data.author.id), + onTap: () => toNamed('/author', item.data?.author?.id), child: ClipOval( child: cacheImage( - item.data.author.icon, + item.data?.author?.icon ?? '', width: 40, height: 40, ), @@ -37,14 +37,14 @@ class AllWidgetItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - item.data.author.name, + item.data?.author?.name ?? '', style: const TextStyle(color: Colors.black87, fontSize: 14), ), Padding( padding: EdgeInsets.only(top: 3), child: Text( - item.data.author.description, + item.data?.author?.description ?? '', style: const TextStyle( color: Colors.black38, fontSize: 12, @@ -62,11 +62,11 @@ class AllWidgetItem extends StatelessWidget { InkWell( onTap: () => toNamed("/detail", item.data), child: Hero( - tag: '${item.data.id}${item.data.time}', + tag: '${item.data?.id}${item.data?.time}', child: ClipRRect( borderRadius: BorderRadius.circular(4), child: cacheImage( - item.data.cover.feed, + item.data?.cover?.feed ?? '', width: MediaQuery.of(context).size.width, height: 180, ), @@ -86,7 +86,7 @@ class AllWidgetItem extends StatelessWidget { return Padding( padding: EdgeInsets.only(top: 10, bottom: 10), child: ReadMoreTextWidget( - item.data.description, + item.data?.description ?? '', style: TextStyle(fontSize: 14, color: Colors.black54), moreStyle: textStyle, lessStyle: textStyle, @@ -105,7 +105,7 @@ class AllWidgetItem extends StatelessWidget { } List _getTagWidgetList() { - List widgetList = item.data.tags.map((tag) { + List? widgetList = item.data?.tags?.map((tag) { return Container( margin: EdgeInsets.only(right: 5), alignment: Alignment.center, @@ -114,11 +114,13 @@ class AllWidgetItem extends StatelessWidget { decoration: BoxDecoration( color: tabBgColor, borderRadius: BorderRadius.circular(4)), child: Text( - tag.name, + tag.name ?? '', style: TextStyle(fontSize: 12, color: Colors.blue), )); }).toList(); - return widgetList.length > 3 ? widgetList.sublist(0, 3) : widgetList; + return (widgetList != null && widgetList.length > 3) + ? widgetList.sublist(0, 3) + : widgetList!; } Widget _consumptionWidget() { @@ -130,7 +132,7 @@ class AllWidgetItem extends StatelessWidget { Icon(Icons.favorite_border, size: 20, color: Colors.black54), Padding( padding: EdgeInsets.only(left: 10), - child: Text('${item.data.consumption.collectionCount}', + child: Text('${item.data?.consumption?.collectionCount}', style: TextStyle(fontSize: 12, color: Colors.black54)), ) ], @@ -140,7 +142,7 @@ class AllWidgetItem extends StatelessWidget { Icon(Icons.star_border, size: 20, color: Colors.black54), Padding( padding: EdgeInsets.only(left: 10), - child: Text('${item.data.consumption.realCollectionCount}', + child: Text('${item.data?.consumption?.realCollectionCount}', style: TextStyle(fontSize: 12, color: Colors.black54)), ) ], @@ -150,14 +152,15 @@ class AllWidgetItem extends StatelessWidget { Icon(Icons.mode_comment_outlined, size: 20, color: Colors.black54), Padding( padding: EdgeInsets.only(left: 10), - child: Text('${item.data.consumption.replyCount}', + child: Text('${item.data?.consumption?.replyCount}', style: TextStyle(fontSize: 12, color: Colors.black54)), ) ], ), IconButton( icon: Icon(Icons.share_outlined, color: Colors.black54), - onPressed: () => share(item.data.title, item.data.playUrl)) + onPressed: () => + share(item.data?.title ?? '', item.data?.playUrl ?? '')) ], ); } diff --git a/module/module_author/lib/widget/author_common_horizontal_widget_item.dart b/module/module_author/lib/widget/author_common_horizontal_widget_item.dart index ebfda94..284b763 100644 --- a/module/module_author/lib/widget/author_common_horizontal_widget_item.dart +++ b/module/module_author/lib/widget/author_common_horizontal_widget_item.dart @@ -3,9 +3,9 @@ import 'package:module_author/widget/special_horizontal_widget_item.dart'; import 'package:module_common/model/common_item_model.dart'; class AuthorCommonHorizontalWidgetItem extends StatelessWidget { - final Item item; + final Item? item; - const AuthorCommonHorizontalWidgetItem({Key key, this.item}) + const AuthorCommonHorizontalWidgetItem({Key? key, this.item}) : super(key: key); @override @@ -15,12 +15,12 @@ class AuthorCommonHorizontalWidgetItem extends StatelessWidget { child: ListView.builder( itemBuilder: (context, index) { return SpecialHorizontalWidgetItem( - item: item.data.itemList[index], - isLast: index == item.data.itemList.length - 1, + item: item?.data?.itemList?[index], + isLast: index == (item?.data?.itemList?.length ?? 0) - 1, ); }, scrollDirection: Axis.horizontal, - itemCount: item.data.itemList.length, + itemCount: item?.data?.itemList?.length, ), ); } diff --git a/module/module_author/lib/widget/special_horizontal_widget_item.dart b/module/module_author/lib/widget/special_horizontal_widget_item.dart index 60dfc3f..fd1014a 100644 --- a/module/module_author/lib/widget/special_horizontal_widget_item.dart +++ b/module/module_author/lib/widget/special_horizontal_widget_item.dart @@ -5,10 +5,10 @@ import 'package:lib_utils/date_util.dart'; import 'package:module_common/model/common_item_model.dart'; class SpecialHorizontalWidgetItem extends StatelessWidget { - final Item item; + final Item? item; final isLast; - const SpecialHorizontalWidgetItem({Key key, this.isLast, this.item}) + const SpecialHorizontalWidgetItem({Key? key, this.isLast, this.item}) : super(key: key); @override @@ -19,15 +19,15 @@ class SpecialHorizontalWidgetItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ InkWell( - onTap: () => toNamed("/detail", item.data), + onTap: () => toNamed("/detail", item?.data), child: Hero( - tag: '${item.data.id}${item.data.time}', + tag: '${item?.data?.id}${item?.data?.time}', child: Stack( children: [ ClipRRect( borderRadius: BorderRadius.circular(4), child: cacheImage( - item.data.cover.feed, + item?.data?.cover?.feed ?? '', width: 300, height: 180, ), @@ -43,7 +43,7 @@ class SpecialHorizontalWidgetItem extends StatelessWidget { topRight: Radius.circular(15), bottomRight: Radius.circular(15))), child: Text( - item.data.category, + item?.data?.category ?? '', style: TextStyle(color: Colors.white, fontSize: 12), ), )), @@ -56,7 +56,7 @@ class SpecialHorizontalWidgetItem extends StatelessWidget { color: Colors.black26, borderRadius: BorderRadius.circular(4)), child: Text( - formatDateMsByMS(item.data.duration * 1000), + formatDateMsByMS(item?.data?.duration ?? 0 * 1000), style: TextStyle(color: Colors.white, fontSize: 12), ), )) @@ -67,12 +67,12 @@ class SpecialHorizontalWidgetItem extends StatelessWidget { Padding( padding: EdgeInsets.only(top: 5, bottom: 5), child: Text( - item.data.title, + item?.data?.title ?? '', style: const TextStyle(color: Colors.black87, fontSize: 14), ), ), Text( - formatDateMsByYMDHM(item.data.author.latestReleaseTime), + formatDateMsByYMDHM(item?.data?.author?.latestReleaseTime ?? 0), style: const TextStyle(color: Colors.black38, fontSize: 12), ), ], diff --git a/module/module_author/lib/widget/special_widget_item.dart b/module/module_author/lib/widget/special_widget_item.dart index 4b4d132..d15d0cb 100644 --- a/module/module_author/lib/widget/special_widget_item.dart +++ b/module/module_author/lib/widget/special_widget_item.dart @@ -5,9 +5,9 @@ import 'package:module_common/model/common_item_model.dart'; import 'author_common_horizontal_widget_item.dart'; class SpecialWidgetItem extends StatelessWidget { - final Item item; + final Item? item; - const SpecialWidgetItem({Key key, this.item}) : super(key: key); + const SpecialWidgetItem({Key? key, required this.item}) : super(key: key); @override Widget build(BuildContext context) { @@ -22,12 +22,11 @@ class SpecialWidgetItem extends StatelessWidget { children: [ InkWell( onTap: () { - print("点了"); - toNamed('/author', item.data.header.id); + toNamed('/author', item?.data?.header?.id); }, child: ClipOval( child: cacheImage( - item.data.header.icon, + item?.data?.header?.icon ?? '', width: 40, height: 40, ), @@ -35,26 +34,26 @@ class SpecialWidgetItem extends StatelessWidget { ), Expanded( child: Padding( - padding: EdgeInsets.only(left: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.data.header.title, - style: const TextStyle( - color: Colors.black87, fontSize: 14), - ), - Padding( - padding: EdgeInsets.only(top: 3), - child: Text( - item.data.header.description, - style: const TextStyle( - color: Colors.black38, fontSize: 12), - ), - ) - ], + padding: EdgeInsets.only(left: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item?.data?.header?.title ?? '', + style: const TextStyle( + color: Colors.black87, fontSize: 14), ), - )) + Padding( + padding: EdgeInsets.only(top: 3), + child: Text( + item?.data?.header?.description ?? '', + style: const TextStyle( + color: Colors.black38, fontSize: 12), + ), + ) + ], + ), + )) ], ), ), diff --git a/module/module_author/pubspec.yaml b/module/module_author/pubspec.yaml index 423d349..1d97042 100644 --- a/module/module_author/pubspec.yaml +++ b/module/module_author/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none'#如果你想发布到pub.dev,请删除这一行 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: diff --git a/module/module_common/lib/model/common_item_model.dart b/module/module_common/lib/model/common_item_model.dart index 872203e..ac56d83 100644 --- a/module/module_common/lib/model/common_item_model.dart +++ b/module/module_common/lib/model/common_item_model.dart @@ -1,12 +1,12 @@ import 'package:lib_core/model/paging_model.dart'; class Issue extends PagingModel { - int total; - int date; - int publishTime; - int releaseTime; - int count; - String type; + int? total; + int? date; + int? publishTime; + int? releaseTime; + int? count; + String? type; Issue( {this.total, @@ -25,7 +25,7 @@ class Issue extends PagingModel { if (json['itemList'] != null) { itemList = []; (json['itemList'] as List).forEach((v) { - itemList.add(new Item.fromJson(v)); + itemList!.add(new Item.fromJson(v)); }); } type = json['type']; @@ -40,7 +40,7 @@ class Issue extends PagingModel { data['releaseTime'] = this.releaseTime; data['count'] = this.count; if (this.itemList != null) { - data['itemList'] = this.itemList.map((v) => v.toJson()).toList(); + data['itemList'] = this.itemList!.map((v) => v.toJson()).toList(); } data['type'] = this.type; data['nextPageUrl'] = this.nextPageUrl; @@ -49,10 +49,10 @@ class Issue extends PagingModel { } class Item { - Data data; - int adIndex; - int id; - String type; + Data? data; + int? adIndex; + int? id; + String? type; Item({this.data, this.adIndex, this.id, this.type}); @@ -66,7 +66,7 @@ class Item { Map toJson() { final Map data = new Map(); if (this.data != null) { - data['data'] = this.data.toJson(); + data['data'] = this.data!.toJson(); } data['adIndex'] = this.adIndex; data['id'] = this.id; @@ -76,37 +76,37 @@ class Item { } class Data { - int date; - int releaseTime; - String description; - bool collected; - String remark; - String title; - String type; - String playUrl; - Cover cover; - int duration; - String descriptionEditor; - String xLibrary; - Provide provider; - int id; - bool ad; - Author author; - String dataType; - int searchWeight; - Consumption consumption; - bool played; - List tags; - List playInfo; - bool ifLimitVideo; - WebUrl webUrl; - String category; - int idx; - String resourceType; - String text; - Header header; - List itemList; - String time = DateTime.now().toString(); + int? date; + int? releaseTime; + String? description; + bool? collected; + String? remark; + String? title; + String? type; + String? playUrl; + Cover? cover; + int? duration; + String? descriptionEditor; + String? xLibrary; + Provide? provider; + int? id; + bool? ad; + Author? author; + String? dataType; + int? searchWeight; + Consumption? consumption; + bool? played; + List? tags; + List? playInfo; + bool? ifLimitVideo; + WebUrl? webUrl; + String? category; + int? idx; + String? resourceType; + String? text; + Header? header; + List? itemList; + String? time = DateTime.now().toString(); Data( {this.date, @@ -169,13 +169,13 @@ class Data { if (json['tags'] != null) { tags = []; (json['tags'] as List).forEach((v) { - tags.add(new Tag.fromJson(v)); + tags!.add(new Tag.fromJson(v)); }); } if (json['playInfo'] != null) { playInfo = []; (json['playInfo'] as List).forEach((v) { - playInfo.add(new PlayInfo.fromJson(v)); + playInfo!.add(new PlayInfo.fromJson(v)); }); } ifLimitVideo = json['ifLimitVideo']; @@ -190,7 +190,7 @@ class Data { if (json['itemList'] != null) { itemList = []; (json['itemList'] as List).forEach((v) { - itemList.add(new Item.fromJson(v)); + itemList!.add(new Item.fromJson(v)); }); } } @@ -206,54 +206,54 @@ class Data { data['type'] = this.type; data['playUrl'] = this.playUrl; if (this.cover != null) { - data['cover'] = this.cover.toJson(); + data['cover'] = this.cover!.toJson(); } data['duration'] = this.duration; data['descriptionEditor'] = this.descriptionEditor; data['library'] = this.xLibrary; if (this.provider != null) { - data['provider'] = this.provider.toJson(); + data['provider'] = this.provider!.toJson(); } data['id'] = this.id; data['ad'] = this.ad; if (this.author != null) { - data['author'] = this.author.toJson(); + data['author'] = this.author!.toJson(); } data['dataType'] = this.dataType; data['searchWeight'] = this.searchWeight; if (this.consumption != null) { - data['consumption'] = this.consumption.toJson(); + data['consumption'] = this.consumption!.toJson(); } data['played'] = this.played; if (this.tags != null) { - data['tags'] = this.tags.map((v) => v.toJson()).toList(); + data['tags'] = this.tags!.map((v) => v.toJson()).toList(); } if (this.playInfo != null) { - data['playInfo'] = this.playInfo.map((v) => v.toJson()).toList(); + data['playInfo'] = this.playInfo!.map((v) => v.toJson()).toList(); } data['ifLimitVideo'] = this.ifLimitVideo; if (this.webUrl != null) { - data['webUrl'] = this.webUrl.toJson(); + data['webUrl'] = this.webUrl!.toJson(); } data['category'] = this.category; data['idx'] = this.idx; data['resourceType'] = this.resourceType; data['text'] = this.text; if (this.header != null) { - data['header'] = this.header.toJson(); + data['header'] = this.header!.toJson(); } if (this.itemList != null) { - data['itemList'] = this.itemList.map((v) => v.toJson()).toList(); + data['itemList'] = this.itemList!.map((v) => v.toJson()).toList(); } return data; } } class Cover { - String feed; - String detail; - String blurred; - String homepage; + String? feed; + String? detail; + String? blurred; + String? homepage; Cover({this.feed, this.detail, this.blurred, this.homepage}); @@ -275,8 +275,8 @@ class Cover { } class WebUrl { - String forWeibo; - String raw; + String? forWeibo; + String? raw; WebUrl({this.forWeibo, this.raw}); @@ -294,12 +294,12 @@ class WebUrl { } class PlayInfo { - String name; - int width; - List urlList; - String type; - String url; - int height; + String? name; + int? width; + late List? urlList; + String? type; + String? url; + int? height; PlayInfo( {this.name, this.width, this.urlList, this.type, this.url, this.height}); @@ -310,7 +310,7 @@ class PlayInfo { if (json['urlList'] != null) { urlList = []; (json['urlList'] as List).forEach((v) { - urlList.add(new IssueIssuelistItemlistDataPlayinfoUrllist.fromJson(v)); + urlList!.add(new IssueIssuelistItemlistDataPlayinfoUrllist.fromJson(v)); }); } type = json['type']; @@ -323,7 +323,7 @@ class PlayInfo { data['name'] = this.name; data['width'] = this.width; if (this.urlList != null) { - data['urlList'] = this.urlList.map((v) => v.toJson()).toList(); + data['urlList'] = this.urlList!.map((v) => v.toJson()).toList(); } data['type'] = this.type; data['url'] = this.url; @@ -333,19 +333,19 @@ class PlayInfo { } class Author { - IssueIssuelistItemlistDataAuthorShield shield; - bool expert; - int approvedNotReadyVideoCount; - String icon; - String link; - String description; - int videoNum; - IssueIssuelistItemlistDataAuthorFollow follow; - int recSort; - bool ifPgc; - String name; - int latestReleaseTime; - int id; + IssueIssuelistItemlistDataAuthorShield? shield; + bool? expert; + int? approvedNotReadyVideoCount; + String? icon; + String? link; + String? description; + int? videoNum; + IssueIssuelistItemlistDataAuthorFollow? follow; + int? recSort; + bool? ifPgc; + String? name; + int? latestReleaseTime; + int? id; Author( {this.shield, @@ -385,7 +385,7 @@ class Author { Map toJson() { final Map data = new Map(); if (this.shield != null) { - data['shield'] = this.shield.toJson(); + data['shield'] = this.shield!.toJson(); } data['expert'] = this.expert; data['approvedNotReadyVideoCount'] = this.approvedNotReadyVideoCount; @@ -394,7 +394,7 @@ class Author { data['description'] = this.description; data['videoNum'] = this.videoNum; if (this.follow != null) { - data['follow'] = this.follow.toJson(); + data['follow'] = this.follow!.toJson(); } data['recSort'] = this.recSort; data['ifPgc'] = this.ifPgc; @@ -406,9 +406,9 @@ class Author { } class IssueIssuelistItemlistDataPlayinfoUrllist { - int size; - String name; - String url; + int? size; + String? name; + String? url; IssueIssuelistItemlistDataPlayinfoUrllist({this.size, this.name, this.url}); @@ -429,9 +429,9 @@ class IssueIssuelistItemlistDataPlayinfoUrllist { } class IssueIssuelistItemlistDataAuthorShield { - int itemId; - String itemType; - bool shielded; + int? itemId; + String? itemType; + bool? shielded; IssueIssuelistItemlistDataAuthorShield( {this.itemId, this.itemType, this.shielded}); @@ -452,9 +452,9 @@ class IssueIssuelistItemlistDataAuthorShield { } class IssueIssuelistItemlistDataAuthorFollow { - int itemId; - String itemType; - bool followed; + int? itemId; + String? itemType; + bool? followed; IssueIssuelistItemlistDataAuthorFollow( {this.itemId, this.itemType, this.followed}); @@ -475,13 +475,13 @@ class IssueIssuelistItemlistDataAuthorFollow { } class Tag { - String tagRecType; - String headerImage; - String actionUrl; - int communityIndex; - String name; - int id; - String bgPicture; + String? tagRecType; + String? headerImage; + String? actionUrl; + int? communityIndex; + String? name; + int? id; + String? bgPicture; Tag( {this.tagRecType, @@ -516,16 +516,16 @@ class Tag { } class Header { - String actionUrl; - String description; - bool expert; - String icon; - String iconType; - int id; - bool ifPgc; - bool ifShowNotificationIcon; - String title; - int uid; + String? actionUrl; + String? description; + bool? expert; + String? icon; + String? iconType; + int? id; + bool? ifPgc; + bool? ifShowNotificationIcon; + String? title; + int? uid; Header( {this.actionUrl, @@ -569,10 +569,10 @@ class Header { } class Consumption { - int shareCount; - int replyCount; - int collectionCount; - int realCollectionCount; + int? shareCount; + int? replyCount; + int? collectionCount; + int? realCollectionCount; Consumption( {this.shareCount, @@ -598,9 +598,9 @@ class Consumption { } class Provide { - String icon; - String name; - String alias; + String? icon; + String? name; + String? alias; Provide({this.icon, this.name, this.alias}); diff --git a/module/module_common/lib/model/tab_info_model.dart b/module/module_common/lib/model/tab_info_model.dart index 0aaf137..107254e 100644 --- a/module/module_common/lib/model/tab_info_model.dart +++ b/module/module_common/lib/model/tab_info_model.dart @@ -1,28 +1,28 @@ class TabInfoModel { - TabInfo tabInfo; - PgcInfo pgcInfo; + TabInfo? tabInfo; + PgcInfo? pgcInfo; - TabInfoModel({this.tabInfo,this.pgcInfo}); + TabInfoModel({this.tabInfo, this.pgcInfo}); TabInfoModel.fromJson(Map json) { tabInfo = json['tabInfo'] != null ? new TabInfo.fromJson(json['tabInfo']) : null; pgcInfo = - json['pgcInfo'] != null ? new PgcInfo.fromJson(json['pgcInfo']) : null; + json['pgcInfo'] != null ? new PgcInfo.fromJson(json['pgcInfo']) : null; } Map toJson() { final Map data = new Map(); if (this.tabInfo != null) { - data['tabInfo'] = this.tabInfo.toJson(); + data['tabInfo'] = this.tabInfo!.toJson(); } return data; } } class TabInfo { - List tabList; - int defaultIdx; + List? tabList; + int? defaultIdx; TabInfo({this.tabList, this.defaultIdx}); @@ -30,7 +30,7 @@ class TabInfo { if (json['tabList'] != null) { tabList = []; (json['tabList'] as List).forEach((v) { - tabList.add(new TabInfoItem.fromJson(v)); + tabList!.add(new TabInfoItem.fromJson(v)); }); } defaultIdx = json['defaultIdx']; @@ -39,7 +39,7 @@ class TabInfo { Map toJson() { final Map data = new Map(); if (this.tabList != null) { - data['tabList'] = this.tabList.map((v) => v.toJson()).toList(); + data['tabList'] = this.tabList!.map((v) => v.toJson()).toList(); } data['defaultIdx'] = this.defaultIdx; return data; @@ -47,11 +47,11 @@ class TabInfo { } class TabInfoItem { - int nameType; - String apiUrl; - String name; - int tabType; - int id; + int? nameType; + String? apiUrl; + String? name; + int? tabType; + int? id; dynamic adTrack; TabInfoItem( @@ -84,66 +84,66 @@ class TabInfoItem { } class PgcInfo { - String dataType; - int id; - String icon; - String name; - String brief; - String description; - String actionUrl; - String area; - String gender; - int registDate; - int followCount; - Follow follow; - bool self; - String cover; - int videoCount; - int shareCount; - int collectCount; - int myFollowCount; - String videoCountActionUrl; - String myFollowCountActionUrl; - String followCountActionUrl; - String privateMessageActionUrl; - int medalsNum; - String medalsActionUrl; - String tagNameExport; - int worksRecCount; - int worksSelectedCount; - Shield shield; - bool expert; + String? dataType; + int? id; + String? icon; + String? name; + String? brief; + String? description; + String? actionUrl; + String? area; + String? gender; + int? registDate; + int? followCount; + Follow? follow; + bool? self; + String? cover; + int? videoCount; + int? shareCount; + int? collectCount; + int? myFollowCount; + String? videoCountActionUrl; + String? myFollowCountActionUrl; + String? followCountActionUrl; + String? privateMessageActionUrl; + int? medalsNum; + String? medalsActionUrl; + String? tagNameExport; + int? worksRecCount; + int? worksSelectedCount; + Shield? shield; + bool? expert; PgcInfo( {this.dataType, - this.id, - this.icon, - this.name, - this.brief, - this.description, - this.actionUrl, - this.area, - this.gender, - this.registDate, - this.followCount, - this.follow, - this.self, - this.cover, - this.videoCount, - this.shareCount, - this.collectCount, - this.myFollowCount, - this.videoCountActionUrl, - this.myFollowCountActionUrl, - this.followCountActionUrl, - this.privateMessageActionUrl, - this.medalsNum, - this.medalsActionUrl, - this.tagNameExport, - this.worksRecCount, - this.worksSelectedCount, - this.shield, - this.expert}); + this.id, + this.icon, + this.name, + this.brief, + this.description, + this.actionUrl, + this.area, + this.gender, + this.registDate, + this.followCount, + this.follow, + this.self, + this.cover, + this.videoCount, + this.shareCount, + this.collectCount, + this.myFollowCount, + this.videoCountActionUrl, + this.myFollowCountActionUrl, + this.followCountActionUrl, + this.privateMessageActionUrl, + this.medalsNum, + this.medalsActionUrl, + this.tagNameExport, + this.worksRecCount, + this.worksSelectedCount, + this.shield, + this.expert}); PgcInfo.fromJson(Map json) { dataType = json['dataType']; @@ -158,7 +158,7 @@ class PgcInfo { registDate = json['registDate']; followCount = json['followCount']; follow = - json['follow'] != null ? new Follow.fromJson(json['follow']) : null; + json['follow'] != null ? new Follow.fromJson(json['follow']) : null; self = json['self']; cover = json['cover']; videoCount = json['videoCount']; @@ -175,7 +175,7 @@ class PgcInfo { worksRecCount = json['worksRecCount']; worksSelectedCount = json['worksSelectedCount']; shield = - json['shield'] != null ? new Shield.fromJson(json['shield']) : null; + json['shield'] != null ? new Shield.fromJson(json['shield']) : null; expert = json['expert']; } @@ -193,7 +193,7 @@ class PgcInfo { data['registDate'] = this.registDate; data['followCount'] = this.followCount; if (this.follow != null) { - data['follow'] = this.follow.toJson(); + data['follow'] = this.follow!.toJson(); } data['self'] = this.self; data['cover'] = this.cover; @@ -211,7 +211,7 @@ class PgcInfo { data['worksRecCount'] = this.worksRecCount; data['worksSelectedCount'] = this.worksSelectedCount; if (this.shield != null) { - data['shield'] = this.shield.toJson(); + data['shield'] = this.shield!.toJson(); } data['expert'] = this.expert; return data; @@ -219,9 +219,9 @@ class PgcInfo { } class Follow { - String itemType; - int itemId; - bool followed; + String? itemType; + int? itemId; + bool? followed; Follow({this.itemType, this.itemId, this.followed}); @@ -241,9 +241,9 @@ class Follow { } class Shield { - String itemType; - int itemId; - bool shielded; + String? itemType; + int? itemId; + bool? shielded; Shield({this.itemType, this.itemId, this.shielded}); diff --git a/module/module_common/lib/repository/history_repository.dart b/module/module_common/lib/repository/history_repository.dart index f4501da..74c6147 100644 --- a/module/module_common/lib/repository/history_repository.dart +++ b/module/module_common/lib/repository/history_repository.dart @@ -18,8 +18,8 @@ class HistoryRepository { } static List loadHistoryData() { - List originList = - CacheManager.getInstance().get>(watch_history_list_key); + List? originList = + CacheManager.getInstance().get?>(watch_history_list_key); List watchList; diff --git a/module/module_common/lib/widget/rank_widget_item.dart b/module/module_common/lib/widget/rank_widget_item.dart index 742a02b..ad97801 100644 --- a/module/module_common/lib/widget/rank_widget_item.dart +++ b/module/module_common/lib/widget/rank_widget_item.dart @@ -11,7 +11,10 @@ class RankWidgetItem extends StatelessWidget { final bool showDivider; const RankWidgetItem( - {Key key, this.item, this.showCategory = true, this.showDivider = true}) + {Key? key, + required this.item, + this.showCategory = true, + this.showDivider = true}) : super(key: key); @override @@ -28,8 +31,8 @@ class RankWidgetItem extends StatelessWidget { children: [ ClipRRect( child: Hero( - tag: '${item.data.id}${item.data.time}', - child: cacheImage(item.data.cover.feed, + tag: '${item.data?.id}${item.data?.time}', + child: cacheImage(item.data?.cover?.feed ?? '', width: MediaQuery.of(context).size.width, height: 200)), //充满容器,可能会被截断 borderRadius: BorderRadius.circular(4)), @@ -45,7 +48,7 @@ class RankWidgetItem extends StatelessWidget { height: 44, width: 44, alignment: AlignmentDirectional.center, - child: Text(item.data.category, + child: Text(item.data?.category ?? '', style: TextStyle( fontSize: 14, color: Colors.white)))))), Positioned( @@ -57,7 +60,7 @@ class RankWidgetItem extends StatelessWidget { decoration: BoxDecoration(color: Colors.black54), padding: EdgeInsets.all(5), child: Text( - formatDateMsByMS(item.data.duration * 1000), + formatDateMsByMS(item.data?.duration ?? 0 * 1000), style: TextStyle( color: Colors.white, fontSize: 12, @@ -80,7 +83,7 @@ class RankWidgetItem extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(item.data.title, + Text(item.data?.title ?? '', style: TextStyle( color: Colors.black, fontSize: 14, @@ -89,16 +92,18 @@ class RankWidgetItem extends StatelessWidget { Padding( padding: EdgeInsets.only(top: 2), child: Text( - item.data.author == null - ? item.data.description - : item.data.author.name, + (item.data?.author == null + ? item.data?.description + : item.data?.author?.name) ?? + "", style: TextStyle( color: Color(0xff9a9a9a), fontSize: 12))) ], ))), IconButton( icon: Icon(Icons.share, color: Colors.black38), - onPressed: () => share(item.data.title, item.data.playUrl)) + onPressed: () => + share(item.data?.title ?? '', item.data?.playUrl ?? '')) ], ), ), @@ -117,12 +122,13 @@ class RankWidgetItem extends StatelessWidget { child: ClipOval( clipBehavior: Clip.antiAlias, child: cacheImage( - item.data.author == null - ? item.data.provider.icon - : item.data.author.icon, + (item.data?.author == null + ? item.data?.provider?.icon + : item.data?.author?.icon) ?? + "", width: 40, height: 40)), - onTap: () => toNamed('/author', item.data.author.id), + onTap: () => toNamed('/author', item.data?.author?.id), ); } } diff --git a/module/module_common/lib/widget/video_relate_widget_item.dart b/module/module_common/lib/widget/video_relate_widget_item.dart index 51fe382..12f233f 100644 --- a/module/module_common/lib/widget/video_relate_widget_item.dart +++ b/module/module_common/lib/widget/video_relate_widget_item.dart @@ -4,16 +4,16 @@ import 'package:lib_utils/date_util.dart'; import 'package:module_common/model/common_item_model.dart'; class VideoRelateWidgetItem extends StatelessWidget { - final Data data; + final Data? data; final VoidCallback callBack; final Color titleColor; final Color categoryColor; final bool openHero; const VideoRelateWidgetItem( - {Key key, + {Key? key, this.data, - this.callBack, + required this.callBack, this.titleColor = Colors.white, this.categoryColor = Colors.white, this.openHero = false}) @@ -44,7 +44,7 @@ class VideoRelateWidgetItem extends StatelessWidget { decoration: BoxDecoration(color: Colors.black54), padding: EdgeInsets.all(3), child: Text( - formatDateMsByMS(data.duration * 1000), + formatDateMsByMS(data?.duration ?? 0 * 1000), style: TextStyle( color: Colors.white, fontSize: 10, @@ -59,7 +59,7 @@ class VideoRelateWidgetItem extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(data.title, + Text(data?.title ?? '', style: TextStyle( color: titleColor, fontSize: 14, @@ -68,7 +68,7 @@ class VideoRelateWidgetItem extends StatelessWidget { Padding( padding: EdgeInsets.only(top: 15), child: - Text('#${data.category} / ${data.author?.name}', + Text('#${data?.category} / ${data?.author?.name}', style: TextStyle( color: categoryColor, fontSize: 12, @@ -84,7 +84,7 @@ class VideoRelateWidgetItem extends StatelessWidget { Widget _coverWidget() { if (openHero) { - return Hero(tag: '${data.id}${data.time}', child: _imageWidget()); + return Hero(tag: '${data?.id}${data?.time}', child: _imageWidget()); } else { return _imageWidget(); } @@ -92,7 +92,7 @@ class VideoRelateWidgetItem extends StatelessWidget { Widget _imageWidget() { return cacheImage( - data.cover.detail, + data?.cover?.detail ?? '', width: 135, height: 80, ); diff --git a/module/module_common/pubspec.yaml b/module/module_common/pubspec.yaml index fb30629..888cb6d 100644 --- a/module/module_common/pubspec.yaml +++ b/module/module_common/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none' environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: diff --git a/module/module_detail/lib/page/video_detail_page.dart b/module/module_detail/lib/page/video_detail_page.dart index 9b863c0..030272a 100644 --- a/module/module_detail/lib/page/video_detail_page.dart +++ b/module/module_detail/lib/page/video_detail_page.dart @@ -18,9 +18,9 @@ import 'package:module_detail/widget/appbar_widget.dart'; const VIDEO_SMALL_CARD_TYPE = 'videoSmallCard'; class VideoDetailPage extends StatefulWidget { - final Data videoDta; + final Data? videoDta; - const VideoDetailPage({Key key, this.videoDta}) : super(key: key); + const VideoDetailPage({Key? key, this.videoDta}) : super(key: key); @override _VideoDetailPageState createState() => _VideoDetailPageState(); @@ -30,7 +30,7 @@ class _VideoDetailPageState extends State with WidgetsBindingObserver { final GlobalKey videoKey = GlobalKey(); - Data data; + late Data data; @override void initState() { @@ -47,9 +47,9 @@ class _VideoDetailPageState extends State //AppLifecycleState当前页面的状态(是否可见) if (state == AppLifecycleState.paused) { //页面不可见时,暂停视频 - videoKey.currentState.pause(); + videoKey.currentState?.pause(); } else if (state == AppLifecycleState.resumed) { - videoKey.currentState.play(); + videoKey.currentState?.play(); } } @@ -65,7 +65,7 @@ class _VideoDetailPageState extends State return ProviderWidget( model: VideoDetailPageModel(), onModelInit: (model) { - model.loadVideoRelateData(data.id); + model.loadVideoRelateData(data.id ?? 0); }, builder: (context, model, child) { return AnnotatedRegion( @@ -77,7 +77,7 @@ class _VideoDetailPageState extends State tag: '${data.id}${data.time}', child: VideoWidget( key: videoKey, - url: data.playUrl, + url: data.playUrl ?? '', overlayUI: videoAppBar(), )), Expanded( @@ -91,7 +91,7 @@ class _VideoDetailPageState extends State //背景图片 fit: BoxFit.cover, image: cachedNetworkImageProvider( - '${data.cover.blurred}}/thumbnail/${MediaQuery.of(context).size.height}x${MediaQuery.of(context).size.width}'))), + '${data.cover?.blurred}}/thumbnail/${MediaQuery.of(context).size.height}x${MediaQuery.of(context).size.width}'))), child: CustomScrollView( //CustomScrollView结合Sliver可以防止滚动冲突 slivers: [ @@ -104,7 +104,7 @@ class _VideoDetailPageState extends State padding: EdgeInsets.only( left: 10, top: 10), child: Text( - data.title, + data.title ?? '', style: TextStyle( fontSize: 18, color: Colors.white, @@ -114,14 +114,14 @@ class _VideoDetailPageState extends State padding: EdgeInsets.only( left: 10, top: 10), child: Text( - '#${data.category} / ${formatDateMsByYMDHM(data.author.latestReleaseTime)}', + '#${data.category} / ${formatDateMsByYMDHM(data.author?.latestReleaseTime ?? 0)}', style: TextStyle( color: Colors.white, fontSize: 12))), Padding( padding: EdgeInsets.only( left: 10, top: 10, right: 10), - child: Text(data.description, + child: Text(data.description ?? '', style: TextStyle( color: Colors.white, fontSize: 14))), @@ -142,7 +142,7 @@ class _VideoDetailPageState extends State padding: EdgeInsets.only( left: 3), child: Text( - '${data.consumption.collectionCount}', + '${data.consumption?.collectionCount}', style: TextStyle( color: Colors.white, fontSize: 13), @@ -166,7 +166,7 @@ class _VideoDetailPageState extends State EdgeInsets.only( left: 3), child: Text( - '${data.consumption.shareCount}', + '${data.consumption?.shareCount}', style: TextStyle( color: Colors.white, @@ -192,7 +192,7 @@ class _VideoDetailPageState extends State EdgeInsets.only( left: 3), child: Text( - '${data.consumption.replyCount}', + '${data.consumption?.replyCount}', style: TextStyle( color: Colors.white, @@ -214,7 +214,7 @@ class _VideoDetailPageState extends State padding: EdgeInsets.all(10), child: ClipOval( child: cacheImage( - data.author.icon, + data.author?.icon ?? '', height: 40, width: 40), )), @@ -224,7 +224,7 @@ class _VideoDetailPageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(data.author.name, + Text(data.author?.name ?? '', style: TextStyle( fontSize: 15, color: Colors.white)), @@ -233,7 +233,8 @@ class _VideoDetailPageState extends State top: 3), child: Text( data.author - .description, + ?.description ?? + '', style: TextStyle( fontSize: 13, color: Colors @@ -269,7 +270,7 @@ class _VideoDetailPageState extends State return VideoRelateWidgetItem( data: model.itemList[index].data, callBack: () { - videoKey.currentState.pause(); + videoKey.currentState?.pause(); toPage( VideoDetailPage( videoDta: model @@ -280,7 +281,7 @@ class _VideoDetailPageState extends State return Padding( padding: EdgeInsets.all(10), child: Text( - model.itemList[index].data.text, + model.itemList[index].data?.text ?? '', style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, diff --git a/module/module_detail/lib/viewmodel/video_detail_page_model.dart b/module/module_detail/lib/viewmodel/video_detail_page_model.dart index 74fde81..4a66b35 100644 --- a/module/module_detail/lib/viewmodel/video_detail_page_model.dart +++ b/module/module_detail/lib/viewmodel/video_detail_page_model.dart @@ -7,7 +7,7 @@ import 'package:module_detail/constant/api_service.dart'; class VideoDetailPageModel extends BaseChangeNotifierModel { List itemList = []; - int _videoId; + late int _videoId; void loadVideoRelateData(int id) { _videoId = id; diff --git a/module/module_detail/pubspec.yaml b/module/module_detail/pubspec.yaml index 6c399a3..4cb3ee8 100644 --- a/module/module_detail/pubspec.yaml +++ b/module/module_detail/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none' environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: diff --git a/module/module_discover/lib/model/category_model.dart b/module/module_discover/lib/model/category_model.dart index b3f4d10..01df2ef 100644 --- a/module/module_discover/lib/model/category_model.dart +++ b/module/module_discover/lib/model/category_model.dart @@ -1,24 +1,24 @@ class CategoryModel { - int id; - String name; + int? id; + String? name; Null alias; - String description; - String bgPicture; - String bgColor; - String headerImage; - int defaultAuthorId; - int tagId; + String? description; + String? bgPicture; + String? bgColor; + String? headerImage; + int? defaultAuthorId; + int? tagId; CategoryModel( {this.id, - this.name, - this.alias, - this.description, - this.bgPicture, - this.bgColor, - this.headerImage, - this.defaultAuthorId, - this.tagId}); + this.name, + this.alias, + this.description, + this.bgPicture, + this.bgColor, + this.headerImage, + this.defaultAuthorId, + this.tagId}); CategoryModel.fromJson(Map json) { id = json['id']; @@ -45,4 +45,4 @@ class CategoryModel { data['tagId'] = this.tagId; return data; } -} \ No newline at end of file +} diff --git a/module/module_discover/lib/model/news_model.dart b/module/module_discover/lib/model/news_model.dart index 3ce7322..b966481 100644 --- a/module/module_discover/lib/model/news_model.dart +++ b/module/module_discover/lib/model/news_model.dart @@ -1,10 +1,9 @@ - import 'package:lib_core/model/paging_model.dart'; class NewsModel extends PagingModel { - int count; - int total; - bool adExist; + int? count; + int? total; + bool? adExist; NewsModel({this.count, this.total, this.adExist}); @@ -35,10 +34,10 @@ class NewsModel extends PagingModel { } class NewsItemModel { - String type; - Data data; - int id; - int adIndex; + String? type; + Data? data; + int? id; + int? adIndex; NewsItemModel({this.type, this.data, this.id, this.adIndex}); @@ -53,7 +52,7 @@ class NewsItemModel { final Map data = new Map(); data['type'] = this.type; if (this.data != null) { - data['data'] = this.data.toJson(); + data['data'] = this.data!.toJson(); } data['id'] = this.id; data['adIndex'] = this.adIndex; @@ -62,13 +61,13 @@ class NewsItemModel { } class Data { - String dataType; - int id; - String type; - String text; - String actionUrl; - List titleList; - String backgroundImage; + String? dataType; + int? id; + String? type; + String? text; + String? actionUrl; + List? titleList; + String? backgroundImage; Data( {this.dataType, @@ -85,7 +84,7 @@ class Data { type = json['type']; text = json['text']; actionUrl = json['actionUrl']; - if(json['titleList'] !=null){ + if (json['titleList'] != null) { titleList = json['titleList'].cast(); } backgroundImage = json['backgroundImage']; diff --git a/module/module_discover/lib/model/recommend_model.dart b/module/module_discover/lib/model/recommend_model.dart index 8005cbd..6e656bf 100644 --- a/module/module_discover/lib/model/recommend_model.dart +++ b/module/module_discover/lib/model/recommend_model.dart @@ -1,13 +1,11 @@ - import 'package:lib_core/model/paging_model.dart'; -class RecommendModel extends PagingModel{ - int count; - int total; - bool adExist; +class RecommendModel extends PagingModel { + int? count; + int? total; + bool? adExist; - RecommendModel( - {this.count, this.total, this.adExist}); + RecommendModel({this.count, this.total, this.adExist}); RecommendModel.fromJson(Map json) { if (json['itemList'] != null) { @@ -36,8 +34,8 @@ class RecommendModel extends PagingModel{ } class RecommendItem { - String type; - Data data; + String? type; + Data? data; RecommendItem({this.type, this.data}); RecommendItem.fromJson(Map json) { @@ -49,21 +47,18 @@ class RecommendItem { final Map data = new Map(); data['type'] = this.type; if (this.data != null) { - data['data'] = this.data.toJson(); + data['data'] = this.data?.toJson(); } return data; } } class Data { - String dataType; - Header header; - CommunityModel content; + String? dataType; + Header? header; + CommunityModel? content; - Data( - {this.dataType, - this.header, - this.content}); + Data({this.dataType, this.header, this.content}); Data.fromJson(Map json) { dataType = json['dataType']; @@ -78,24 +73,24 @@ class Data { final Map data = new Map(); data['dataType'] = this.dataType; if (this.header != null) { - data['header'] = this.header.toJson(); + data['header'] = this.header?.toJson(); } if (this.content != null) { - data['content'] = this.content.toJson(); + data['content'] = this.content?.toJson(); } return data; } } class Header { - int id; - String actionUrl; - String icon; - String iconType; - bool showHateVideo; - String followType; - String issuerName; - bool topShow; + int? id; + String? actionUrl; + String? icon; + String? iconType; + bool? showHateVideo; + String? followType; + String? issuerName; + bool? topShow; Header( {this.id, @@ -133,8 +128,8 @@ class Header { } class CommunityModel { - String type; - ContentData data; + String? type; + ContentData? data; CommunityModel({this.type, this.data}); @@ -147,39 +142,39 @@ class CommunityModel { final Map data = new Map(); data['type'] = this.type; if (this.data != null) { - data['data'] = this.data.toJson(); + data['data'] = this.data?.toJson(); } return data; } } class ContentData { - String dataType; - int id; - String title; - String description; - String library; - List tags; - Consumption consumption; - String resourceType; - int uid; - bool collected; - bool reallyCollected; - Owner owner; - Cover cover; - String checkStatus; - String area; - String city; - bool ifMock; - String validateStatus; - String validateResult; - bool addWatermark; - String url; - String playUrl; - int width; - int height; - List urls; - List urlsWithWatermark; + String? dataType; + int? id; + String? title; + String? description; + String? library; + List? tags; + Consumption? consumption; + String? resourceType; + int? uid; + bool? collected; + bool? reallyCollected; + Owner? owner; + Cover? cover; + String? checkStatus; + String? area; + String? city; + bool? ifMock; + String? validateStatus; + String? validateResult; + bool? addWatermark; + String? url; + String? playUrl; + int? width; + int? height; + List? urls; + List? urlsWithWatermark; ContentData( {this.dataType, @@ -203,9 +198,9 @@ class ContentData { this.validateResult, this.addWatermark, this.url, - this.playUrl, - this.width, - this.height, + this.playUrl, + this.width, + this.height, this.urls, this.urlsWithWatermark}); @@ -218,7 +213,7 @@ class ContentData { if (json['tags'] != null) { tags = []; json['tags'].forEach((v) { - tags.add(new Tags.fromJson(v)); + tags?.add(new Tags.fromJson(v)); }); } consumption = json['consumption'] != null @@ -240,9 +235,11 @@ class ContentData { url = json['url']; width = json['width']; height = json['height']; - playUrl = json['playUrl'] != null ?json['playUrl']:null; - urls = json['urls'] != null ?json['urls'].cast():null; - urlsWithWatermark = json['urlsWithWatermark'] != null ?json['urlsWithWatermark'].cast():null; + playUrl = json['playUrl'] != null ? json['playUrl'] : null; + urls = json['urls'] != null ? json['urls'].cast() : null; + urlsWithWatermark = json['urlsWithWatermark'] != null + ? json['urlsWithWatermark'].cast() + : null; } Map toJson() { @@ -253,23 +250,23 @@ class ContentData { data['description'] = this.description; data['library'] = this.library; if (this.tags != null) { - data['tags'] = this.tags.map((v) => v.toJson()).toList(); + data['tags'] = this.tags!.map((v) => v.toJson()).toList(); } if (this.consumption != null) { - data['consumption'] = this.consumption.toJson(); + data['consumption'] = this.consumption!.toJson(); } data['resourceType'] = this.resourceType; data['uid'] = this.uid; data['collected'] = this.collected; data['reallyCollected'] = this.reallyCollected; if (this.owner != null) { - data['owner'] = this.owner.toJson(); + data['owner'] = this.owner!.toJson(); } if (this.playUrl != null) { data['playUrl'] = this.playUrl; } if (this.cover != null) { - data['cover'] = this.cover.toJson(); + data['cover'] = this.cover!.toJson(); } data['checkStatus'] = this.checkStatus; data['area'] = this.area; @@ -281,10 +278,10 @@ class ContentData { data['url'] = this.url; data['width'] = this.width; data['height'] = this.height; - if(this.urls !=null){ + if (this.urls != null) { data['urls'] = this.urls; } - if(this.urlsWithWatermark !=null){ + if (this.urlsWithWatermark != null) { data['urlsWithWatermark'] = this.urlsWithWatermark; } return data; @@ -292,15 +289,15 @@ class ContentData { } class Tags { - int id; - String name; - String actionUrl; - String desc; - String bgPicture; - String headerImage; - String tagRecType; - bool haveReward; - bool ifNewest; + int? id; + String? name; + String? actionUrl; + String? desc; + String? bgPicture; + String? headerImage; + String? tagRecType; + bool? haveReward; + bool? ifNewest; Tags( {this.id, @@ -341,10 +338,10 @@ class Tags { } class Consumption { - int collectionCount; - int shareCount; - int replyCount; - int realCollectionCount; + int? collectionCount; + int? shareCount; + int? replyCount; + int? realCollectionCount; Consumption( {this.collectionCount, @@ -370,22 +367,21 @@ class Consumption { } class Owner { - String nickname; - String avatar; - String userType; - bool ifPgc; - String description; - String area; - String gender; - String cover; - String actionUrl; - bool followed; - bool limitVideoOpen; - bool expert; + String? nickname; + String? avatar; + String? userType; + bool? ifPgc; + String? description; + String? area; + String? gender; + String? cover; + String? actionUrl; + bool? followed; + bool? limitVideoOpen; + bool? expert; Owner( - { - this.nickname, + {this.nickname, this.avatar, this.userType, this.ifPgc, @@ -432,8 +428,8 @@ class Owner { } class Cover { - String feed; - String detail; + String? feed; + String? detail; Cover({this.feed, this.detail}); diff --git a/module/module_discover/lib/model/topic_detail_model.dart b/module/module_discover/lib/model/topic_detail_model.dart index 912edfc..4ebc17c 100644 --- a/module/module_discover/lib/model/topic_detail_model.dart +++ b/module/module_discover/lib/model/topic_detail_model.dart @@ -1,13 +1,13 @@ import 'package:module_common/model/common_item_model.dart'; class TopicDetailModel { - int id; - String headerImage; - String brief; - String text; - String shareLink; - List itemList; - int count; + int? id; + String? headerImage; + String? brief; + String? text; + String? shareLink; + List? itemList; + int? count; TopicDetailModel( {this.id, @@ -27,7 +27,7 @@ class TopicDetailModel { if (json['itemList'] != null) { itemList = []; json['itemList'].forEach((v) { - itemList.add(new TopicDetailItemData.fromJson(v)); + itemList!.add(new TopicDetailItemData.fromJson(v)); }); } count = json['count']; @@ -41,7 +41,7 @@ class TopicDetailModel { data['text'] = this.text; data['shareLink'] = this.shareLink; if (this.itemList != null) { - data['itemList'] = this.itemList.map((v) => v.toJson()).toList(); + data['itemList'] = this.itemList!.map((v) => v.toJson()).toList(); } data['count'] = this.count; return data; @@ -49,10 +49,10 @@ class TopicDetailModel { } class TopicDetailItemData { - String type; - ContentDataModel data; - int id; - int adIndex; + String? type; + ContentDataModel? data; + int? id; + int? adIndex; TopicDetailItemData({this.type, this.data, this.id, this.adIndex}); @@ -69,7 +69,7 @@ class TopicDetailItemData { final Map data = new Map(); data['type'] = this.type; if (this.data != null) { - data['data'] = this.data.toJson(); + data['data'] = this.data!.toJson(); } data['id'] = this.id; data['adIndex'] = this.adIndex; @@ -78,9 +78,9 @@ class TopicDetailItemData { } class ContentDataModel { - String dataType; - Header header; - ContentModel content; + String? dataType; + Header? header; + ContentModel? content; ContentDataModel({this.dataType, this.header, this.content}); @@ -97,27 +97,27 @@ class ContentDataModel { final Map data = new Map(); data['dataType'] = this.dataType; if (this.header != null) { - data['header'] = this.header.toJson(); + data['header'] = this.header!.toJson(); } if (this.content != null) { - data['content'] = this.content.toJson(); + data['content'] = this.content!.toJson(); } return data; } } class Header { - int id; - String actionUrl; + int? id; + String? actionUrl; Null labelList; - String icon; - String iconType; - int time; - bool showHateVideo; - String followType; - int tagId; - String issuerName; - bool topShow; + String? icon; + String? iconType; + int? time; + bool? showHateVideo; + String? followType; + int? tagId; + String? issuerName; + bool? topShow; Header( {this.id, @@ -164,8 +164,8 @@ class Header { } class ContentModel { - String type; - Data data; + String? type; + Data? data; ContentModel({this.type, this.data}); @@ -178,7 +178,7 @@ class ContentModel { final Map data = new Map(); data['type'] = this.type; if (this.data != null) { - data['header'] = this.data.toJson(); + data['header'] = this.data!.toJson(); } return data; } diff --git a/module/module_discover/lib/model/topic_model.dart b/module/module_discover/lib/model/topic_model.dart index 00f4612..cec59e8 100644 --- a/module/module_discover/lib/model/topic_model.dart +++ b/module/module_discover/lib/model/topic_model.dart @@ -1,14 +1,11 @@ - - import 'package:lib_core/model/paging_model.dart'; -class TopicModel extends PagingModel{ - int count; - int total; - bool adExist; +class TopicModel extends PagingModel { + int? count; + int? total; + bool? adExist; - TopicModel( - {this.count, this.total, this.adExist}); + TopicModel({this.count, this.total, this.adExist}); TopicModel.fromJson(Map json) { if (json['itemList'] != null) { @@ -37,8 +34,8 @@ class TopicModel extends PagingModel{ } class TopicItemModel { - String type; - Data data; + String? type; + Data? data; TopicItemModel({this.type, this.data}); @@ -51,35 +48,35 @@ class TopicItemModel { final Map data = new Map(); data['type'] = this.type; if (this.data != null) { - data['data'] = this.data.toJson(); + data['data'] = this.data!.toJson(); } return data; } } class Data { - String dataType; - int id; - String title; - String description; - String image; - String actionUrl; - bool shade; - Label label; + String? dataType; + int? id; + String? title; + String? description; + String? image; + String? actionUrl; + bool? shade; + Label? label; Null header; - bool autoPlay; + bool? autoPlay; Data( {this.dataType, - this.id, - this.title, - this.description, - this.image, - this.actionUrl, - this.shade, - this.label, - this.header, - this.autoPlay}); + this.id, + this.title, + this.description, + this.image, + this.actionUrl, + this.shade, + this.label, + this.header, + this.autoPlay}); Data.fromJson(Map json) { dataType = json['dataType']; @@ -104,7 +101,7 @@ class Data { data['actionUrl'] = this.actionUrl; data['shade'] = this.shade; if (this.label != null) { - data['label'] = this.label.toJson(); + data['label'] = this.label!.toJson(); } data['header'] = this.header; data['autoPlay'] = this.autoPlay; @@ -113,8 +110,8 @@ class Data { } class Label { - String text; - String card; + String? text; + String? card; Null detail; Label({this.text, this.card, this.detail}); @@ -132,4 +129,4 @@ class Label { data['detail'] = this.detail; return data; } -} \ No newline at end of file +} diff --git a/module/module_discover/lib/page/category_detail_page.dart b/module/module_discover/lib/page/category_detail_page.dart index b1eba6c..4268df0 100644 --- a/module/module_discover/lib/page/category_detail_page.dart +++ b/module/module_discover/lib/page/category_detail_page.dart @@ -12,7 +12,8 @@ import 'package:lib_navigator/lib_navigator.dart'; class CategoryDetailPage extends StatefulWidget { final CategoryModel categoryModel; - const CategoryDetailPage({Key key, this.categoryModel}) : super(key: key); + const CategoryDetailPage({Key? key, required this.categoryModel}) + : super(key: key); @override _CategoryDetailPageState createState() => _CategoryDetailPageState(); @@ -24,7 +25,7 @@ class _CategoryDetailPageState extends State { return Scaffold( backgroundColor: Colors.white, body: ProviderWidget( - model: CategoryDetailModel(widget.categoryModel.id), + model: CategoryDetailModel(widget.categoryModel.id ?? 0), onModelInit: (model) { model.loadMore(loadMore: false); }, @@ -52,7 +53,7 @@ class _CategoryDetailPageState extends State { return FlexibleSpaceBar( //可折叠状态栏 title: Text( - widget.categoryModel.name, + widget.categoryModel.name ?? '', style: TextStyle( color: model.expend ? Colors.white @@ -60,7 +61,7 @@ class _CategoryDetailPageState extends State { ), centerTitle: false, background: cacheImage( - widget.categoryModel.bgPicture)); + widget.categoryModel.bgPicture ?? '')); })) ]; }, diff --git a/module/module_discover/lib/page/discovery_page.dart b/module/module_discover/lib/page/discovery_page.dart index 2dd1872..49e018d 100644 --- a/module/module_discover/lib/page/discovery_page.dart +++ b/module/module_discover/lib/page/discovery_page.dart @@ -18,8 +18,8 @@ class DiscoveryPage extends StatefulWidget { class _DiscoveryPageState extends State with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { - TabController _tabController; - PageController _pageController; + late TabController _tabController; + late PageController _pageController; @override void initState() { diff --git a/module/module_discover/lib/page/recommend_page.dart b/module/module_discover/lib/page/recommend_page.dart index fd6ec15..41a0eec 100644 --- a/module/module_discover/lib/page/recommend_page.dart +++ b/module/module_discover/lib/page/recommend_page.dart @@ -52,7 +52,7 @@ class _RecommendPageState extends State _recommendRepository.dispose(); } - Future _refresh() async { + Future _refresh() async { return _recommendRepository.refresh().whenComplete(() => null); } diff --git a/module/module_discover/lib/page/recommend_photo_gallery_page.dart b/module/module_discover/lib/page/recommend_photo_gallery_page.dart index e207842..9efb881 100644 --- a/module/module_discover/lib/page/recommend_photo_gallery_page.dart +++ b/module/module_discover/lib/page/recommend_photo_gallery_page.dart @@ -10,7 +10,7 @@ import 'package:lib_navigator/lib_navigator.dart'; class RecommendPhotoGalleryPage extends StatelessWidget { final List galleryItems; - const RecommendPhotoGalleryPage({Key key, this.galleryItems}) + const RecommendPhotoGalleryPage({Key? key, required this.galleryItems}) : super(key: key); @override @@ -29,8 +29,8 @@ class RecommendPhotoGalleryPage extends StatelessWidget { PhotoViewGallery.builder( builder: (BuildContext context, int index) => PhotoViewGalleryPageOptions( - imageProvider: - cachedNetworkImageProvider(galleryItems[index]), + imageProvider: cachedNetworkImageProvider( + galleryItems[index]), initialScale: PhotoViewComputedScale.contained * 1, minScale: diff --git a/module/module_discover/lib/page/recommend_video_play_page.dart b/module/module_discover/lib/page/recommend_video_play_page.dart index d3fefee..d00b36b 100644 --- a/module/module_discover/lib/page/recommend_video_play_page.dart +++ b/module/module_discover/lib/page/recommend_video_play_page.dart @@ -7,7 +7,8 @@ import 'package:module_discover/model/recommend_model.dart'; class RecommendVideoPlayPage extends StatefulWidget { final RecommendItem item; - const RecommendVideoPlayPage({Key key, this.item}) : super(key: key); + const RecommendVideoPlayPage({Key? key, required this.item}) + : super(key: key); @override _RecommendVideoPlayPageState createState() => _RecommendVideoPlayPageState(); @@ -26,9 +27,9 @@ class _RecommendVideoPlayPageState extends State @override void didChangeAppLifecycleState(AppLifecycleState state) { if (state == AppLifecycleState.paused) { - videoKey.currentState.pause(); + videoKey.currentState?.pause(); } else if (state == AppLifecycleState.resumed) { - videoKey.currentState.play(); + videoKey.currentState?.play(); } } @@ -44,10 +45,9 @@ class _RecommendVideoPlayPageState extends State Align( child: VideoWidget( key: videoKey, - url: widget.item.data.content.data.playUrl, + url: widget.item.data?.content?.data?.playUrl ?? '', aspectRatio: _getAspectRatio(), - allowFullScreen: !(widget.item.data.content.data.height > - widget.item.data.content.data.width), + allowFullScreen: !allowFullScreen(), )), Positioned( left: 10, @@ -73,11 +73,18 @@ class _RecommendVideoPlayPageState extends State ); } + bool allowFullScreen() { + var height = widget.item.data?.content?.data?.height; + var width = widget.item.data?.content?.data?.width; + if (height != null && width != null && height > width) { + return true; + } + return false; + } + double _getAspectRatio() { double aspectRatio = 16 / 9; - bool allowFullScreen = widget.item.data.content.data.height > - widget.item.data.content.data.width; - if (allowFullScreen) { + if (allowFullScreen()) { final size = MediaQuery.of(context).size; final width = size.width; final height = size.height; diff --git a/module/module_discover/lib/page/topics_detail_page.dart b/module/module_discover/lib/page/topics_detail_page.dart index 0c37623..399fc07 100644 --- a/module/module_discover/lib/page/topics_detail_page.dart +++ b/module/module_discover/lib/page/topics_detail_page.dart @@ -10,7 +10,7 @@ import 'package:module_discover/widget/topic_detail_widget_item.dart'; class TopicDetailPage extends StatefulWidget { final int detailId; - const TopicDetailPage({Key key, this.detailId}) : super(key: key); + const TopicDetailPage({Key? key, required this.detailId}) : super(key: key); @override _TopicDetailPageState createState() => _TopicDetailPageState(); @@ -27,7 +27,7 @@ class _TopicDetailPageState extends State { builder: (context, model, child) { return Scaffold( backgroundColor: Colors.white, - appBar: appBar(model.topicDetailModel.brief), + appBar: appBar(model.topicDetailModel.brief ?? ''), body: LoadingContainer( viewState: model.viewState, child: CustomScrollView( @@ -37,8 +37,8 @@ class _TopicDetailPageState extends State { delegate: SliverChildBuilderDelegate((context, index) { return TopicDetailWidgetItem( - model: model.itemList[index]); - }, childCount: model.itemList.length)) + model: model.itemList?[index]); + }, childCount: model.itemList?.length)) ], ), retry: model.retry)); @@ -52,14 +52,14 @@ class _TopicDetailPageState extends State { Column( children: [ cacheImage( - topicDetailModel.headerImage, + topicDetailModel.headerImage ?? '', width: MediaQuery.of(context).size.width, height: 250, ), Padding( padding: EdgeInsets.fromLTRB(20, 40, 20, 10), child: Text( - topicDetailModel.text, + topicDetailModel.text ?? '', style: TextStyle(fontSize: 12, color: Color(0xff9a9a9a)), ), ), @@ -78,7 +78,7 @@ class _TopicDetailPageState extends State { height: 50, alignment: Alignment.center, child: Text( - topicDetailModel.brief, + topicDetailModel.brief ?? '', style: TextStyle( fontSize: 14, color: Colors.black, diff --git a/module/module_discover/lib/page/topics_page.dart b/module/module_discover/lib/page/topics_page.dart index e35b09e..06d687c 100644 --- a/module/module_discover/lib/page/topics_page.dart +++ b/module/module_discover/lib/page/topics_page.dart @@ -19,7 +19,7 @@ class _TopicsPageState return OpenContainer(closedBuilder: (context, action) { return TopicWidgetItem(itemModel: model.itemList[index]); }, openBuilder: (context, action) { - return TopicDetailPage(detailId: model.itemList[index].data.id); + return TopicDetailPage(detailId: model.itemList[index].data?.id ?? 0); }); }, itemCount: model.itemList.length); diff --git a/module/module_discover/lib/page/web_page.dart b/module/module_discover/lib/page/web_page.dart index 6c52c07..b4167c6 100644 --- a/module/module_discover/lib/page/web_page.dart +++ b/module/module_discover/lib/page/web_page.dart @@ -7,7 +7,7 @@ import 'package:module_discover/constant/string.dart'; class WebPage extends StatefulWidget { final String url; - const WebPage({Key key, this.url}) : super(key: key); + const WebPage({Key? key, required this.url}) : super(key: key); @override _State createState() => _State(); @@ -55,7 +55,7 @@ class _State extends State { }); } - Widget _appBar() { + PreferredSizeWidget _appBar() { return AppBar( leading: GestureDetector( onTap: () { diff --git a/module/module_discover/lib/repository/recommend_repository.dart b/module/module_discover/lib/repository/recommend_repository.dart index 8423f3e..7890f33 100644 --- a/module/module_discover/lib/repository/recommend_repository.dart +++ b/module/module_discover/lib/repository/recommend_repository.dart @@ -8,7 +8,7 @@ import 'package:module_discover/constant/api_service.dart'; import 'package:module_discover/model/recommend_model.dart'; class RecommendRepository extends LoadingMoreBase { - String nextPageUrl; + String? nextPageUrl; bool _hasMore = true; bool forceRefresh = false; Utf8Decoder utf8decoder = Utf8Decoder(); @@ -29,7 +29,7 @@ class RecommendRepository extends LoadingMoreBase { Future loadData([bool isloadMoreAction = false]) async { String url = ''; if (isloadMoreAction) { - url = nextPageUrl; + url = nextPageUrl ?? ''; } else { url = URLs.communityUrl; } diff --git a/module/module_discover/lib/viewmodel/category_detail_model.dart b/module/module_discover/lib/viewmodel/category_detail_model.dart index 8863374..15acb41 100644 --- a/module/module_discover/lib/viewmodel/category_detail_model.dart +++ b/module/module_discover/lib/viewmodel/category_detail_model.dart @@ -9,7 +9,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; class CategoryDetailModel extends BaseChangeNotifierModel { int category; List itemList = []; - String _nextPageUrl; + String? _nextPageUrl; bool loading = true; bool error = false; RefreshController refreshController = @@ -26,8 +26,9 @@ class CategoryDetailModel extends BaseChangeNotifierModel { refreshController.loadNoData(); return; } - url = _nextPageUrl + - "&udid=d2807c895f0348a180148c9dfa6f2feeac0781b5&deviceModel=Android"; + url = _nextPageUrl ?? + '' + + "&udid=d2807c895f0348a180148c9dfa6f2feeac0781b5&deviceModel=Android"; getData(url, loadMore); } else { url = URLs.categoryVideoUrl + @@ -55,7 +56,7 @@ class CategoryDetailModel extends BaseChangeNotifierModel { complete: () => notifyListeners()); } - retry(){ + retry() { loading = true; notifyListeners(); loadMore(loadMore: false); diff --git a/module/module_discover/lib/viewmodel/topic_detail_page_model.dart b/module/module_discover/lib/viewmodel/topic_detail_page_model.dart index cf801d8..4602130 100644 --- a/module/module_discover/lib/viewmodel/topic_detail_page_model.dart +++ b/module/module_discover/lib/viewmodel/topic_detail_page_model.dart @@ -7,9 +7,9 @@ import 'package:module_discover/model/topic_detail_model.dart'; class TopicDetailPageModel extends BaseChangeNotifierModel { TopicDetailModel topicDetailModel = TopicDetailModel(); - List itemList = []; + List? itemList = []; - int _id; + late int _id; void loadTopicDetailData(int id) { _id = id; diff --git a/module/module_discover/lib/viewmodel/video_detail_page_model.dart b/module/module_discover/lib/viewmodel/video_detail_page_model.dart index 274e6f5..d71ceac 100644 --- a/module/module_discover/lib/viewmodel/video_detail_page_model.dart +++ b/module/module_discover/lib/viewmodel/video_detail_page_model.dart @@ -7,7 +7,7 @@ import 'package:module_discover/constant/api_service.dart'; class VideoDetailPageModel extends BaseChangeNotifierModel { List itemList = []; - int _videoId; + late int _videoId; void loadVideoRelateData(int id) { _videoId = id; diff --git a/module/module_discover/lib/widget/category_widget_item.dart b/module/module_discover/lib/widget/category_widget_item.dart index 3b87ec2..5974789 100644 --- a/module/module_discover/lib/widget/category_widget_item.dart +++ b/module/module_discover/lib/widget/category_widget_item.dart @@ -5,14 +5,15 @@ import 'package:module_discover/model/category_model.dart'; class CategoryWidgetItem extends StatelessWidget { final CategoryModel categoryModel; - const CategoryWidgetItem({Key key, this.categoryModel}) : super(key: key); + const CategoryWidgetItem({Key? key, required this.categoryModel}) + : super(key: key); @override Widget build(BuildContext context) { return Stack(children: [ ClipRRect( borderRadius: BorderRadius.circular(4), - child: cacheImage(categoryModel.bgPicture)), + child: cacheImage(categoryModel.bgPicture ?? '')), Center( child: Text('#${categoryModel.name}', style: TextStyle( diff --git a/module/module_discover/lib/widget/follow_page_item.dart b/module/module_discover/lib/widget/follow_page_item.dart index 9041844..25d09aa 100644 --- a/module/module_discover/lib/widget/follow_page_item.dart +++ b/module/module_discover/lib/widget/follow_page_item.dart @@ -8,7 +8,7 @@ import 'follow_widget_item.dart'; class FollowPageItem extends StatelessWidget { final Item item; - const FollowPageItem({Key key, this.item}) : super(key: key); + const FollowPageItem({Key? key, required this.item}) : super(key: key); @override Widget build(BuildContext context) { @@ -22,11 +22,11 @@ class FollowPageItem extends StatelessWidget { children: [ InkWell( onTap: () { - toNamed('/author', item.data.header.id); + toNamed('/author', item.data?.header?.id); }, child: ClipOval( child: cacheImage( - item.data.header.icon, + item.data?.header?.icon ?? '', width: 40, height: 40, )), @@ -38,12 +38,12 @@ class FollowPageItem extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(item.data.header.title, + Text(item.data?.header?.title ?? '', style: TextStyle( color: Colors.black, fontSize: 14)), Padding( padding: EdgeInsets.only(top: 3), - child: Text(item.data.header.description, + child: Text(item.data?.header?.description ?? '', style: TextStyle( color: Colors.black26, fontSize: 12), maxLines: 1, @@ -68,12 +68,12 @@ class FollowPageItem extends StatelessWidget { Container( height: 230, child: ListView.builder( - itemCount: item.data.itemList.length, + itemCount: item.data?.itemList?.length, scrollDirection: Axis.horizontal, itemBuilder: (context, index) { return FollowWidgetItem( - item: item.data.itemList[index], - last: index == item.data.itemList.length - 1); + item: item.data?.itemList?[index], + last: index == (item.data?.itemList?.length ?? 0) - 1); }), ) ], diff --git a/module/module_discover/lib/widget/follow_widget_item.dart b/module/module_discover/lib/widget/follow_widget_item.dart index f71240d..452cee6 100644 --- a/module/module_discover/lib/widget/follow_widget_item.dart +++ b/module/module_discover/lib/widget/follow_widget_item.dart @@ -5,15 +5,16 @@ import 'package:lib_utils/date_util.dart'; import 'package:module_common/model/common_item_model.dart'; class FollowWidgetItem extends StatelessWidget { - final Item item; + final Item? item; final bool last; - const FollowWidgetItem({Key key, this.item, this.last}) : super(key: key); + const FollowWidgetItem({Key? key, this.item, required this.last}) + : super(key: key); @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => toNamed('/detail', item.data), + onTap: () => toNamed('/detail', item?.data), child: Container( padding: EdgeInsets.only(left: 15, right: last ? 15 : 0), child: Column( @@ -24,9 +25,9 @@ class FollowWidgetItem extends StatelessWidget { ClipRRect( borderRadius: BorderRadius.circular(4), child: Hero( - tag: '${item.data.id}${item.data.time}', + tag: '${item?.data?.id}${item?.data?.time}', child: cacheImage( - item.data.cover.feed, + item?.data?.cover?.feed ?? '', width: 300, height: 180, )), @@ -41,7 +42,7 @@ class FollowWidgetItem extends StatelessWidget { decoration: BoxDecoration(color: Colors.white54), alignment: AlignmentDirectional.center, child: Text( - item.data.category, + item?.data?.category ?? '', style: TextStyle( fontSize: 13, color: Colors.black, @@ -52,7 +53,7 @@ class FollowWidgetItem extends StatelessWidget { Container( width: 300, padding: EdgeInsets.only(top: 3), - child: Text(item.data.title, + child: Text(item?.data?.title ?? '', style: TextStyle( fontSize: 14, color: Colors.black, @@ -63,7 +64,8 @@ class FollowWidgetItem extends StatelessWidget { Container( padding: EdgeInsets.only(top: 3), child: Text( - formatDateMsByYMDHM(item.data.author.latestReleaseTime), + formatDateMsByYMDHM( + item?.data?.author?.latestReleaseTime ?? 0), style: TextStyle(fontSize: 12, color: Colors.black26)), ) ], diff --git a/module/module_discover/lib/widget/news_widget_item.dart b/module/module_discover/lib/widget/news_widget_item.dart index 9bd4d3f..7353a03 100644 --- a/module/module_discover/lib/widget/news_widget_item.dart +++ b/module/module_discover/lib/widget/news_widget_item.dart @@ -8,13 +8,14 @@ import 'package:module_discover/page/web_page.dart'; class NewsTitleWidgetItem extends StatelessWidget { final NewsItemModel newsItemModel; - const NewsTitleWidgetItem({Key key, this.newsItemModel}) : super(key: key); + const NewsTitleWidgetItem({Key? key, required this.newsItemModel}) + : super(key: key); @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.only(left: 10, top: 5), - child: Text(newsItemModel.data.text, + child: Text(newsItemModel.data?.text ?? '', style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, @@ -26,16 +27,19 @@ class NewsTitleWidgetItem extends StatelessWidget { class NewsContentWidgetItem extends StatelessWidget { final NewsItemModel newsItemModel; - const NewsContentWidgetItem({Key key, this.newsItemModel}) : super(key: key); + const NewsContentWidgetItem({Key? key, required this.newsItemModel}) + : super(key: key); @override Widget build(BuildContext context) { return GestureDetector( onTap: () { - String url = Uri.decodeComponent(newsItemModel.data.actionUrl - .substring(newsItemModel.data.actionUrl.indexOf("url"))); - url = url.substring(4, url.length); - toPage(WebPage(url: url)); + if (newsItemModel.data?.actionUrl != null) { + String url = Uri.decodeComponent(newsItemModel.data!.actionUrl! + .substring(newsItemModel.data!.actionUrl!.indexOf("url"))); + url = url.substring(4, url.length); + toPage(WebPage(url: url)); + } }, child: Padding( padding: EdgeInsets.all(10), @@ -50,14 +54,16 @@ class NewsContentWidgetItem extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only(bottom: 10), - child: cacheImage(newsItemModel.data.backgroundImage, + child: cacheImage( + newsItemModel.data?.backgroundImage ?? '', width: MediaQuery.of(context).size.width, height: 140, fit: BoxFit.fill), ), Column( crossAxisAlignment: CrossAxisAlignment.start, - children: _getTitleList(newsItemModel.data.titleList), + children: + _getTitleList(newsItemModel.data?.titleList ?? []), ) ], )), diff --git a/module/module_discover/lib/widget/recommend_widget_item.dart b/module/module_discover/lib/widget/recommend_widget_item.dart index bb500be..68e03d5 100644 --- a/module/module_discover/lib/widget/recommend_widget_item.dart +++ b/module/module_discover/lib/widget/recommend_widget_item.dart @@ -10,17 +10,17 @@ const VIDEO_TYPE = 'video'; class RecommendWidgetItem extends StatelessWidget { final RecommendItem item; - const RecommendWidgetItem({Key key, this.item}) : super(key: key); + const RecommendWidgetItem({Key? key, required this.item}) : super(key: key); @override Widget build(BuildContext context) { return GestureDetector( onTap: () { - if (item.data.content.type == VIDEO_TYPE) { + if (item.data?.content?.type == VIDEO_TYPE) { toPage(RecommendVideoPlayPage(item: item)); } else { toPage(RecommendPhotoGalleryPage( - galleryItems: item.data.content.data.urls, + galleryItems: item.data?.content?.data?.urls ?? [], )); } }, @@ -39,17 +39,19 @@ class RecommendWidgetItem extends StatelessWidget { _imageItem(BuildContext context) { var maxWidth = MediaQuery.of(context).size.width; - var width = item.data.content.data.width == 0 - ? maxWidth - : item.data.content.data.width; - var height = item.data.content.data.height == 0 - ? maxWidth - : item.data.content.data.height; + var width = (item.data?.content?.data?.width == 0 + ? maxWidth + : item.data?.content?.data?.width) ?? + 0; + var height = (item.data?.content?.data?.height == 0 + ? maxWidth + : item.data?.content?.data?.height) ?? + 0; Widget image = Stack( children: [ cacheImage( - item.data.content.data.cover.feed, + item.data?.content?.data?.cover?.feed ?? '', shape: BoxShape.rectangle, width: maxWidth, fit: BoxFit.cover, @@ -61,10 +63,10 @@ class RecommendWidgetItem extends StatelessWidget { top: 5, right: 5, child: Offstage( - offstage: item.data.content.data.urls != null && - item.data.content.data.urls.length == 1, + offstage: item.data?.content?.data?.urls != null && + item.data?.content?.data?.urls?.length == 1, child: Icon( - item.data.content.type == VIDEO_TYPE + item.data?.content?.type == VIDEO_TYPE ? Icons.play_circle_outline : Icons.photo_library, color: Colors.white, @@ -85,7 +87,7 @@ class RecommendWidgetItem extends StatelessWidget { return Container( padding: EdgeInsets.fromLTRB(6, 10, 6, 10), child: Text( - item.data.content.data.description, + item.data?.content?.data?.description ?? '', maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle(fontSize: 14, color: Colors.black87), @@ -107,7 +109,7 @@ class RecommendWidgetItem extends StatelessWidget { clipBehavior: Clip.antiAlias, borderRadius: BorderRadius.circular(12), child: cacheImage( - item.data.content.data.owner.avatar, + item.data?.content?.data?.owner?.avatar ?? '', width: 24, height: 24, ), @@ -116,7 +118,7 @@ class RecommendWidgetItem extends StatelessWidget { padding: EdgeInsets.all(5), width: 80, child: Text( - item.data.content.data.owner.nickname, + item.data?.content?.data?.owner?.nickname ?? '', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(fontSize: 12), @@ -134,7 +136,7 @@ class RecommendWidgetItem extends StatelessWidget { Padding( padding: EdgeInsets.only(left: 3), child: Text( - '${item.data.content.data.consumption.collectionCount}', + '${item.data?.content?.data?.consumption?.collectionCount}', style: TextStyle(fontSize: 12), ), ) diff --git a/module/module_discover/lib/widget/topic_detail_widget_item.dart b/module/module_discover/lib/widget/topic_detail_widget_item.dart index e9eba18..8f4cefd 100644 --- a/module/module_discover/lib/widget/topic_detail_widget_item.dart +++ b/module/module_discover/lib/widget/topic_detail_widget_item.dart @@ -10,14 +10,14 @@ import 'package:module_discover/constant/string.dart'; import 'package:module_discover/model/topic_detail_model.dart'; class TopicDetailWidgetItem extends StatelessWidget { - final TopicDetailItemData model; + final TopicDetailItemData? model; - const TopicDetailWidgetItem({Key key, this.model}) : super(key: key); + const TopicDetailWidgetItem({Key? key, this.model}) : super(key: key); @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => toNamed('/detail', model.data.content.data), + onTap: () => toNamed('/detail', model?.data?.content?.data), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -38,7 +38,10 @@ class TopicDetailWidgetItem extends StatelessWidget { padding: EdgeInsets.fromLTRB(20, 20, 10, 0), child: ClipOval( child: cacheImage( - model.data.header.icon == null ? '' : model.data.header.icon, + (model?.data?.header?.icon == null + ? '' + : model?.data?.header?.icon) ?? + '', width: 45, height: 45, ))), @@ -49,9 +52,7 @@ class TopicDetailWidgetItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - model.data.header.issuerName == null - ? '' - : model.data.header.issuerName, + '${model?.data?.header?.issuerName == null ? '' : model?.data?.header?.issuerName}', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, @@ -60,12 +61,12 @@ class TopicDetailWidgetItem extends StatelessWidget { Row( children: [ Text( - '${formatDateMsByYMD(model.data.header.time)}发布:', + '${formatDateMsByYMD(model?.data?.header?.time ?? 0)}发布:', style: TextStyle(color: hitTextColor, fontSize: 12), ), Expanded( child: Text( - model.data.content.data.title, + model?.data?.content?.data?.title ?? '', style: TextStyle( color: Colors.black, fontSize: 12, @@ -87,7 +88,7 @@ class TopicDetailWidgetItem extends StatelessWidget { return Padding( padding: EdgeInsets.fromLTRB(20, 0, 20, 10), child: ReadMoreTextWidget( - model.data.content.data.description, + model?.data?.content?.data?.description ?? '', style: TextStyle(fontSize: 14, color: desTextColor), moreStyle: textStyle, lessStyle: textStyle, @@ -111,9 +112,9 @@ class TopicDetailWidgetItem extends StatelessWidget { ClipRRect( child: Hero( tag: - '${model.data.content.data.id}${model.data.content.data.time}', + '${model?.data?.content?.data?.id}${model?.data?.content?.data?.time}', child: cacheImage( - model.data.content.data.cover.feed, + model?.data?.content?.data?.cover?.feed ?? '', width: MediaQuery.of(context).size.width, height: 200, )), //充满容器,可能会被截断 @@ -128,7 +129,7 @@ class TopicDetailWidgetItem extends StatelessWidget { padding: EdgeInsets.all(5), child: Text( formatDateMsByMS( - model.data.content.data.duration * 1000), + model?.data?.content?.data?.duration ?? 0 * 1000), style: TextStyle( color: Colors.white, fontSize: 12, @@ -149,7 +150,7 @@ class TopicDetailWidgetItem extends StatelessWidget { Padding( padding: EdgeInsets.only(left: 10), child: Text( - '${model.data.content.data.consumption.collectionCount}', + '${model?.data?.content?.data?.consumption?.collectionCount}', style: TextStyle(fontSize: 12, color: hitTextColor)), ) ], @@ -159,7 +160,8 @@ class TopicDetailWidgetItem extends StatelessWidget { Icon(Icons.message, size: 20, color: hitTextColor), Padding( padding: EdgeInsets.only(left: 10), - child: Text('${model.data.content.data.consumption.replyCount}', + child: Text( + '${model?.data?.content?.data?.consumption?.replyCount}', style: TextStyle(fontSize: 12, color: hitTextColor)), ) ], @@ -176,8 +178,8 @@ class TopicDetailWidgetItem extends StatelessWidget { ), IconButton( icon: Icon(Icons.share, color: hitTextColor), - onPressed: () => share(model.data.content.data.title, - model.data.content.data.webUrl.forWeibo)) + onPressed: () => share(model?.data?.content?.data?.title ?? '', + model?.data?.content?.data?.webUrl?.forWeibo ?? '')) ], ); } @@ -191,8 +193,8 @@ class TopicDetailWidgetItem extends StatelessWidget { ); } - List _getTagWidgetList(TopicDetailItemData itemData) { - List widgetList = itemData.data.content.data.tags.map((tag) { + List _getTagWidgetList(TopicDetailItemData? itemData) { + List? widgetList = itemData?.data?.content?.data?.tags?.map((tag) { return Container( margin: EdgeInsets.only(right: 5), alignment: Alignment.center, @@ -201,10 +203,12 @@ class TopicDetailWidgetItem extends StatelessWidget { decoration: BoxDecoration( color: tabBgColor, borderRadius: BorderRadius.circular(4)), child: Text( - tag.name, + tag.name ?? '', style: TextStyle(fontSize: 12, color: Colors.blue), )); }).toList(); - return widgetList.length > 3 ? widgetList.sublist(0, 3) : widgetList; + return (widgetList != null && widgetList.length > 3) + ? widgetList!.sublist(0, 3) + : widgetList!; } } diff --git a/module/module_discover/lib/widget/topic_widget_item.dart b/module/module_discover/lib/widget/topic_widget_item.dart index 9d15b9d..0b914b1 100644 --- a/module/module_discover/lib/widget/topic_widget_item.dart +++ b/module/module_discover/lib/widget/topic_widget_item.dart @@ -5,7 +5,7 @@ import 'package:module_discover/model/topic_model.dart'; class TopicWidgetItem extends StatelessWidget { final TopicItemModel itemModel; - const TopicWidgetItem({Key key, this.itemModel}) : super(key: key); + const TopicWidgetItem({Key? key, required this.itemModel}) : super(key: key); @override Widget build(BuildContext context) { @@ -15,7 +15,7 @@ class TopicWidgetItem extends StatelessWidget { padding: EdgeInsets.all(10), child: ClipRRect( child: cacheImage( - itemModel.data.image, + itemModel.data?.image ?? '', width: MediaQuery.of(context).size.width, height: 200, ), //充满容器,可能会被截断 diff --git a/module/module_discover/pubspec.yaml b/module/module_discover/pubspec.yaml index 4c0392e..1b658cc 100644 --- a/module/module_discover/pubspec.yaml +++ b/module/module_discover/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none' environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: @@ -25,9 +25,9 @@ dependencies: path: ../module_common flutter_webview_plugin: ^0.4.0 - photo_view: ^0.9.2 - loading_more_list: ^3.0.0 - animations: ^1.1.1 + photo_view: ^0.14.0 + loading_more_list: ^6.0.0 + animations: ^2.0.11 dev_dependencies: flutter_test: diff --git a/module/module_home/lib/model/issue_model.dart b/module/module_home/lib/model/issue_model.dart index 78fe2f4..f342808 100644 --- a/module/module_home/lib/model/issue_model.dart +++ b/module/module_home/lib/model/issue_model.dart @@ -2,9 +2,9 @@ import 'package:lib_core/model/paging_model.dart'; import 'package:module_common/model/common_item_model.dart'; class IssueEntity extends PagingModel { - int nextPublishTime; - String newestIssueType; - List issueList; + int? nextPublishTime; + String? newestIssueType; + List issueList = []; IssueEntity({this.nextPublishTime, this.newestIssueType}); @@ -28,7 +28,7 @@ class IssueEntity extends PagingModel { data['newestIssueType'] = this.newestIssueType; data['nextPageUrl'] = this.nextPageUrl; if (this.issueList != null) { - data['issueList'] = this.issueList.map((v) => v.toJson()).toList(); + data['issueList'] = this.issueList!.map((v) => v.toJson()).toList(); } return data; } diff --git a/module/module_home/lib/page/home_tab_page.dart b/module/module_home/lib/page/home_tab_page.dart index 2603f14..acf9108 100644 --- a/module/module_home/lib/page/home_tab_page.dart +++ b/module/module_home/lib/page/home_tab_page.dart @@ -60,7 +60,7 @@ class _HomeTabPageState decoration: BoxDecoration(color: Colors.white24), padding: EdgeInsets.only(top: 15, bottom: 5), child: Center( - child: Text(item.data.text, + child: Text(item.data?.text ?? '', style: TextStyle( fontSize: 18, color: Colors.black87, diff --git a/module/module_home/lib/viewmodel/video_search_model.dart b/module/module_home/lib/viewmodel/video_search_model.dart index 32cfb60..393f9c0 100644 --- a/module/module_home/lib/viewmodel/video_search_model.dart +++ b/module/module_home/lib/viewmodel/video_search_model.dart @@ -10,7 +10,7 @@ class VideoSearchModel extends BaseChangeNotifierModel { bool hideKeyWord = false; bool hideEmpty = true; List dataList = []; - String _nextPageUrl; + String? _nextPageUrl; List keyWords = []; String query = ''; int total = 0; @@ -37,7 +37,7 @@ class VideoSearchModel extends BaseChangeNotifierModel { refreshController.loadNoData(); return; } - url = _nextPageUrl; + url = _nextPageUrl!; getData(loadMore, url); } else { _reset(); @@ -52,7 +52,7 @@ class VideoSearchModel extends BaseChangeNotifierModel { Issue issue = Issue.fromJson(result); viewState = ViewState.content; - total = issue.total; + total = issue.total ?? 0; if (!loadMore) { dataList.clear(); dataList.addAll(issue.itemList); @@ -62,7 +62,7 @@ class VideoSearchModel extends BaseChangeNotifierModel { hideEmpty = true; } dataList.removeWhere((item) { - return item.data.cover == null; + return item.data?.cover == null; }); _nextPageUrl = issue.nextPageUrl; hideKeyWord = true; diff --git a/module/module_home/lib/widget/banner_widget.dart b/module/module_home/lib/widget/banner_widget.dart index d59718d..69a2362 100644 --- a/module/module_home/lib/widget/banner_widget.dart +++ b/module/module_home/lib/widget/banner_widget.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart'; import 'package:lib_image/lib_image.dart'; import 'package:lib_navigator/lib_navigator.dart'; import 'package:module_home/viewmodel/home_page_model.dart'; @@ -7,7 +7,7 @@ import 'package:module_home/viewmodel/home_page_model.dart'; class BannerWidget extends StatelessWidget { final HomePageModel model; - const BannerWidget({Key key, this.model}) : super(key: key); + const BannerWidget({Key? key, required this.model}) : super(key: key); @override Widget build(BuildContext context) { @@ -20,7 +20,7 @@ class BannerWidget extends StatelessWidget { decoration: BoxDecoration( image: DecorationImage( image: cachedNetworkImageProvider( - model.bannerList[index].data.cover.feed), + model.bannerList[index].data?.cover?.feed ?? ''), fit: BoxFit.cover)), ), Positioned( @@ -29,7 +29,7 @@ class BannerWidget extends StatelessWidget { child: Container( padding: EdgeInsets.fromLTRB(15, 10, 0, 10), decoration: BoxDecoration(color: Colors.black12), - child: Text(model.bannerList[index].data.title, + child: Text(model.bannerList[index].data?.title ?? '', style: TextStyle(color: Colors.white, fontSize: 12)))) ], ); diff --git a/module/module_home/lib/widget/search_video_widget_item.dart b/module/module_home/lib/widget/search_video_widget_item.dart index 5f00d18..3d7bbed 100644 --- a/module/module_home/lib/widget/search_video_widget_item.dart +++ b/module/module_home/lib/widget/search_video_widget_item.dart @@ -7,7 +7,7 @@ import 'package:module_common/model/common_item_model.dart'; class SearchVideoWidgetItem extends StatelessWidget { final Item item; - const SearchVideoWidgetItem({Key key, this.item}) : super(key: key); + const SearchVideoWidgetItem({Key? key, required this.item}) : super(key: key); @override Widget build(BuildContext context) { @@ -18,16 +18,16 @@ class SearchVideoWidgetItem extends StatelessWidget { child: Container( child: Stack(alignment: Alignment.center, children: [ Hero( - tag: '${item.data.id}${item.data.time}', + tag: '${item.data?.id}${item.data?.time}', child: cacheImage( - item.data.cover.feed, + item.data?.cover?.feed ?? '', width: double.infinity, //撑满整个屏幕 height: 220, )), Positioned( child: Column(children: [ Text( - item.data.title, + item.data?.title ?? '', maxLines: 1, style: TextStyle( fontSize: 14, @@ -42,7 +42,7 @@ class SearchVideoWidgetItem extends StatelessWidget { decoration: BoxDecoration(color: Colors.black54), padding: EdgeInsets.all(5), child: Text( - formatDateMsByMS(item.data.duration * 1000), + formatDateMsByMS(item.data?.duration ?? 0 * 1000), style: TextStyle( color: Colors.white, fontSize: 12, diff --git a/module/module_home/pubspec.yaml b/module/module_home/pubspec.yaml index 19c46ba..5bc7c88 100644 --- a/module/module_home/pubspec.yaml +++ b/module/module_home/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none' environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: @@ -22,8 +22,8 @@ dependencies: module_common: path: ../module_common - flutter_swiper: ^1.1.6 - animations: ^1.1.1 + flutter_swiper_null_safety: ^1.0.2 + animations: ^2.0.11 dev_dependencies: flutter_test: diff --git a/module/module_hot/lib/page/rank_list_page.dart b/module/module_hot/lib/page/rank_list_page.dart index 7a8c5ba..c36ec45 100644 --- a/module/module_hot/lib/page/rank_list_page.dart +++ b/module/module_hot/lib/page/rank_list_page.dart @@ -8,7 +8,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; class RankListPage extends StatefulWidget { final String apiUrl; - const RankListPage({Key key, this.apiUrl}) : super(key: key); + const RankListPage({Key? key, required this.apiUrl}) : super(key: key); @override _RankListPageState createState() => _RankListPageState(); @@ -50,5 +50,4 @@ class _RankListPageState extends State @override bool get wantKeepAlive => true; //设置页面缓存 - } diff --git a/module/module_hot/lib/page/rank_page.dart b/module/module_hot/lib/page/rank_page.dart index 46fd5b5..34851af 100644 --- a/module/module_hot/lib/page/rank_page.dart +++ b/module/module_hot/lib/page/rank_page.dart @@ -16,8 +16,8 @@ class RankPage extends StatefulWidget { class _RankPageState extends BaseState with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { - TabController _tabController; - PageController _pageController; + late TabController _tabController; + late PageController _pageController; List _tabList = []; @override @@ -55,7 +55,7 @@ class _RankPageState extends BaseState controller: _pageController, onPageChanged: (index) => _tabController.index = index, children: _tabList.map((TabInfoItem tabInfoItem) { - return RankListPage(apiUrl: tabInfoItem.apiUrl); + return RankListPage(apiUrl: tabInfoItem.apiUrl ?? ''); }).toList())), ], )); @@ -65,8 +65,11 @@ class _RankPageState extends BaseState await HttpManager.getData(URLs.rankUrl, success: (result) { TabInfoModel tabInfoModel = TabInfoModel.fromJson(result); setState(() { - _tabList = tabInfoModel.tabInfo.tabList; - _tabController = TabController(length: _tabList.length, vsync: this); + if (tabInfoModel.tabInfo != null && + tabInfoModel.tabInfo?.tabList != null) { + _tabList = tabInfoModel.tabInfo!.tabList!; + _tabController = TabController(length: _tabList.length, vsync: this); + } }); }, fail: (e) { showError(e.toString()); diff --git a/module/module_hot/lib/viewmodel/rank_list_page_model.dart b/module/module_hot/lib/viewmodel/rank_list_page_model.dart index ead5edb..4618637 100644 --- a/module/module_hot/lib/viewmodel/rank_list_page_model.dart +++ b/module/module_hot/lib/viewmodel/rank_list_page_model.dart @@ -7,7 +7,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; class RankListPageModel extends BaseChangeNotifierModel { List itemList = []; - String apiUrl; + late String apiUrl; RefreshController refreshController = RefreshController(initialRefresh: false); diff --git a/module/module_hot/pubspec.yaml b/module/module_hot/pubspec.yaml index f07ece0..df2a784 100644 --- a/module/module_hot/pubspec.yaml +++ b/module/module_hot/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none' environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: diff --git a/module/module_person/lib/page/mine_page.dart b/module/module_person/lib/page/mine_page.dart index 9120b60..2363008 100644 --- a/module/module_person/lib/page/mine_page.dart +++ b/module/module_person/lib/page/mine_page.dart @@ -113,9 +113,9 @@ class _MinePageState extends State } ImageProvider get avatarImage { - return _imageFile == null + return (_imageFile == null ? AssetImage('images/ic_img_avatar.png', package: 'module_person') - : FileImage(_imageFile); + : FileImage(_imageFile)) as ImageProvider; } Widget _operateWidget(String image, String text) { @@ -145,7 +145,7 @@ class _MinePageState extends State ]; } - Widget _settingWidget(String text, {VoidCallback callback}) { + Widget _settingWidget(String text, {VoidCallback? callback}) { return InkWell( onTap: callback, child: Container( @@ -193,9 +193,9 @@ class _MinePageState extends State //模拟头像选择修改,目前存储在本地,实际开发应当上传到云存储平台 _getImage(ImageSource source) async { - var imageFile = await picker.getImage(source: source); + var imageFile = await picker.pickImage(source: source); setState(() { - _imageFile = File(imageFile.path); + _imageFile = File(imageFile?.path ?? ''); }); MineRepository.saveAvatarPath(_imageFile); } diff --git a/module/module_person/lib/page/watch_history_page.dart b/module/module_person/lib/page/watch_history_page.dart index f8920ab..bcdba87 100644 --- a/module/module_person/lib/page/watch_history_page.dart +++ b/module/module_person/lib/page/watch_history_page.dart @@ -19,7 +19,7 @@ class WatchHistoryPage extends StatefulWidget { class _WatchHistoryPageState extends State { EventBus eventBus = EventBus(); - StreamSubscription _subscription; + StreamSubscription? _subscription; @override Widget build(BuildContext context) { @@ -46,7 +46,18 @@ class _WatchHistoryPageState extends State { child: ListView.separated( itemBuilder: (context, index) { return Slidable( - actionPane: SlidableDrawerActionPane(), + startActionPane: ActionPane( + motion: const DrawerMotion(), + extentRatio: 0.25, + children: [ + SlidableAction( + label: 'Archive', + backgroundColor: Colors.blue, + icon: Icons.archive, + onPressed: (context) {}, + ), + ], + ), child: VideoRelateWidgetItem( data: model.itemList[index], callBack: () { @@ -56,13 +67,18 @@ class _WatchHistoryPageState extends State { categoryColor: Colors.black26, openHero: true, ), - secondaryActions: [ - IconSlideAction( - color: Colors.red, - icon: Icons.delete, - onTap: () => model.remove(index), - ) - ], + endActionPane: ActionPane( + motion: const DrawerMotion(), + extentRatio: 0.25, + children: [ + SlidableAction( + label: 'Delete', + backgroundColor: Colors.red, + icon: Icons.delete, + onPressed: (context) => model.remove(index), + ), + ], + ), ); }, separatorBuilder: (context, index) { @@ -90,7 +106,7 @@ class _WatchHistoryPageState extends State { @override void dispose() { - _subscription.cancel(); + _subscription?.cancel(); super.dispose(); } } diff --git a/module/module_person/lib/repository/mine_repository.dart b/module/module_person/lib/repository/mine_repository.dart index 4741208..23a27da 100644 --- a/module/module_person/lib/repository/mine_repository.dart +++ b/module/module_person/lib/repository/mine_repository.dart @@ -5,8 +5,8 @@ import 'package:lib_cache/cache_manager.dart'; class MineRepository { static const String user_avatar_path = "user_avatar_path"; - static String getAvatarPath() { - return CacheManager.getInstance().get(user_avatar_path); + static String? getAvatarPath() { + return CacheManager.getInstance().get(user_avatar_path); } static saveAvatarPath(File file) async { diff --git a/module/module_person/pubspec.yaml b/module/module_person/pubspec.yaml index 9fd1f3b..e7f4616 100644 --- a/module/module_person/pubspec.yaml +++ b/module/module_person/pubspec.yaml @@ -6,7 +6,7 @@ homepage: publish_to: 'none' environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.19.2 <4.0.0" flutter: ">=1.17.0" dependencies: @@ -24,9 +24,9 @@ dependencies: module_common: path: ../module_common - image_picker: ^0.7.2+1 - flutter_slidable: ^0.5.4 - provider: ^5.0.0 + image_picker: ^1.0.7 + flutter_slidable: ^3.0.1 + provider: ^6.1.2 dev_dependencies: diff --git a/pubspec.lock b/pubspec.lock index d7d9d96..72fae55 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,176 +5,248 @@ packages: dependency: transitive description: name: animations - sha256: "1344704523bf3dfdfc2c9816ab58e61542fc1d3e0120e0b7b39f47b98b3b287c" - url: "https://pub.flutter-io.cn" + sha256: d3d6dcfb218225bbe68e87ccf6378bbb2e32a94900722c5f81611dad089911cb + url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.11" + ansicolor: + dependency: transitive + description: + name: ansicolor + sha256: "8bf17a8ff6ea17499e40a2d2542c2f481cd7615760c6d34065cb22bfd22e6880" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + archive: + dependency: transitive + description: + name: archive + sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" + url: "https://pub.dev" + source: hosted + version: "3.4.10" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" async: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 - url: "https://pub.flutter-io.cn" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.1" characters: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c - url: "https://pub.flutter-io.cn" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" - charcode: - dependency: transitive - description: - name: charcode - sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.3.1" + version: "1.3.0" chewie: dependency: transitive description: name: chewie - sha256: da986fc618e01f22fa39da99da42152d8e0b572c767f8a6db9beaa3f6853d386 - url: "https://pub.flutter-io.cn" + sha256: "8bc4ac4cf3f316e50a25958c0f5eb9bb12cf7e8308bb1d74a43b230da2cfc144" + url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.7.5" clock: dependency: transitive description: name: clock sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 - url: "https://pub.flutter-io.cn" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.0" common_utils: dependency: transitive description: name: common_utils - sha256: "6e2572428197581f3847f4cb4b6ffc84e1005d8246aef920894c8b5dcea6f799" - url: "https://pub.flutter-io.cn" + sha256: c26884339b13ff99b0739e56f4b02090c84054ed9dd3a045435cd24e7b99c2c1 + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" convert: dependency: transitive description: name: convert - sha256: df567b950053d83b4dba3e8c5799c411895d146f82b2147114b666a4fd9a80dd - url: "https://pub.flutter-io.cn" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e + url: "https://pub.dev" + source: hosted + version: "0.3.3+8" crypto: dependency: transitive description: name: crypto - sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c - url: "https://pub.flutter-io.cn" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" + source: hosted + version: "1.0.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: "486b7bc707424572cdf7bd7e812a0c146de3fd47ecadf070254cc60383f21dd8" - url: "https://pub.flutter-io.cn" + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.6" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" + source: hosted + version: "0.7.10" decimal: dependency: transitive description: name: decimal - sha256: dad78e5dc23b193c2572b2e597d1850b3078b73b039fae7b9b1cc13ddb618fc0 - url: "https://pub.flutter-io.cn" + sha256: "24a261d5d5c87e86c7651c417a5dbdf8bcd7080dd592533910e8d0505a279f21" + url: "https://pub.dev" source: hosted - version: "1.0.0+1" + version: "2.3.3" event_bus: dependency: transitive description: name: event_bus sha256: "44baa799834f4c803921873e7446a2add0f3efa45e101a054b1f0ab9b95f8edc" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.0" extended_image: dependency: transitive description: name: extended_image - sha256: ee25c713f24fbd58bed4db12efea450853dfd7f1c0cc7b8c6ceab42db075cc93 - url: "https://pub.flutter-io.cn" + sha256: d7f091d068fcac7246c4b22a84b8dac59a62e04d29a5c172710c696e67a22f94 + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "8.2.0" extended_image_library: dependency: transitive description: name: extended_image_library - sha256: b99caafd877faf71fceef22607f9fbe314604bc56eba42ca89fc5dcecefc08dc - url: "https://pub.flutter-io.cn" + sha256: a7cc0270299589ba12b21152abd8ac7287ac8e1997c7ce1a26c337bac4429208 + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "4.0.2" extended_list: dependency: transitive description: name: extended_list - sha256: e15aca6dd4adc71f4c28ebd7b11e3d4b2801784a0ad6b094e78e5cfa1d248dee - url: "https://pub.flutter-io.cn" + sha256: b27a2f0f55dadbf5b273bdaaf9307a7e0098a9fc0c4b8eb60ae98c319af596bc + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.1" extended_list_library: dependency: transitive description: name: extended_list_library - sha256: "50ca4fee8eafd321b7488d08fd283e911b9224a5280366517c82d6cf573acf7b" - url: "https://pub.flutter-io.cn" + sha256: cb424a04464e89bd6737f9ae025029bd8e913c7bf37101ad10c2defe0238d842 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.0.0" fake_async: dependency: transitive description: name: fake_async sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - sha256: d97fffd9d86f3dccc7a9059128b468a99320c69007cc9d41a3a1bda07d4e86dc - url: "https://pub.flutter-io.cn" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.1.2" file: dependency: "direct main" description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.flutter-io.cn" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" + source: hosted + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 + url: "https://pub.dev" + source: hosted + version: "0.9.3+1" flustars: dependency: transitive description: name: flustars sha256: "7019ab8d68c0d4759ee122644d91a165d450b0492717f9e7e9d0ce277dcf664b" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.1" flutter: @@ -182,46 +254,38 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_page_indicator: - dependency: transitive + flutter_native_splash: + dependency: "direct main" description: - name: flutter_page_indicator - sha256: a5b2992228c2827b69faed3977681a3f5c313c7f13d72272decbb2923d1d7176 - url: "https://pub.flutter-io.cn" + name: flutter_native_splash + sha256: "558f10070f03ee71f850a78f7136ab239a67636a294a44a06b6b7345178edb1e" + url: "https://pub.dev" source: hosted - version: "0.0.3" + version: "2.3.10" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "6f25e9e30df26b3971041847c9106c5a037e72517c8e6514ada99ca42e07e2c7" - url: "https://pub.flutter-io.cn" + sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.17" flutter_slidable: dependency: transitive description: name: flutter_slidable - sha256: dbf3673590a4231ca6b288ec759f99ae3534bcabca9f5b571e223f62ce627c37 - url: "https://pub.flutter-io.cn" + sha256: "19ed4813003a6ff4e9c6bcce37e792a2a358919d7603b2b31ff200229191e44c" + url: "https://pub.dev" source: hosted - version: "0.5.7" - flutter_splash_screen: - dependency: "direct main" - description: - name: flutter_splash_screen - sha256: ac0f4d20261001135d01147789ded2690618c6dd6badafa69e39238f9d38fcab - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.1.0" - flutter_swiper: + version: "3.0.1" + flutter_swiper_null_safety: dependency: transitive description: - name: flutter_swiper - sha256: e52a0e894abfa4099a5d4e5098a00597f3b55e25617cdd19e6fe6be5d24858c7 - url: "https://pub.flutter-io.cn" + name: flutter_swiper_null_safety + sha256: "5a855e0080d035c08e82f8b7fd2f106344943a30c9ab483b2584860a2f22eaaf" + url: "https://pub.dev" source: hosted - version: "1.1.6" + version: "1.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -237,81 +301,161 @@ packages: description: name: flutter_webview_plugin sha256: ec410b10822b06432e11f9680b319609d6f34bcdabb31fcc4990ac8a2aaf9ff0 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.4.0" fluttertoast: dependency: transitive description: name: fluttertoast - sha256: "474f7d506230897a3cd28c965ec21c5328ae5605fc9c400cd330e9e9d6ac175c" - url: "https://pub.flutter-io.cn" + sha256: dfdde255317af381bfc1c486ed968d5a43a2ded9c931e87cbecd88767d6a71c1 + url: "https://pub.dev" source: hosted - version: "8.2.2" + version: "8.2.4" get: dependency: transitive description: name: get - sha256: e476dffba6f181fd7f48e9785fe000923392644ecd2b10365b631eef440ee833 - url: "https://pub.flutter-io.cn" + sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e + url: "https://pub.dev" source: hosted - version: "3.26.0" + version: "4.6.6" + html: + dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" http: dependency: transitive description: name: http - sha256: "0a48a4e44ec1b6a52eb93b12d129f5b74ee6dbb27703439c965f1bd86f7be59f" - url: "https://pub.flutter-io.cn" + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + url: "https://pub.dev" source: hosted - version: "0.13.0" + version: "1.2.0" http_client_helper: dependency: transitive description: name: http_client_helper - sha256: f707a6a0d0a22683ad32861c2acc14ce11547ad09eb016d7e7b6cfeb9f348e23 - url: "https://pub.flutter-io.cn" + sha256: "8a9127650734da86b5c73760de2b404494c968a3fd55602045ffec789dac3cb1" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.0" http_parser: dependency: transitive description: name: http_parser - sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 - url: "https://pub.flutter-io.cn" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" + image: + dependency: transitive + description: + name: image + sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e" + url: "https://pub.dev" + source: hosted + version: "4.1.7" image_picker: dependency: transitive description: name: image_picker - sha256: "5c18ae74741cd5f4d474314e6022184e270181a29cfb51b77c1abdfad89e2a1c" - url: "https://pub.flutter-io.cn" + sha256: "26222b01a0c9a2c8fe02fc90b8208bd3325da5ed1f4a2acabf75939031ac0bdd" + url: "https://pub.dev" + source: hosted + version: "1.0.7" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "39f2bfe497e495450c81abcd44b62f56c2a36a37a175da7d137b4454977b51b1" + url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.8.9+3" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "3a19a450114c989183d82345afdfb570056cdffe889f4e75539d558382f7bdbc" - url: "https://pub.flutter-io.cn" + sha256: e2423c53a68b579a7c37a1eda967b8ae536c3d98518e5db95ca1fe5719a730a3 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.0.2" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: fadafce49e8569257a0cad56d24438a6fa1f0cbd7ee0af9b631f7492818a4ca3 + url: "https://pub.dev" + source: hosted + version: "0.8.9+1" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - sha256: a215b240f605e616c76ce8ee3ac792726238a4b416c4b7f5c596f72bdb6e8df1 - url: "https://pub.flutter-io.cn" + sha256: "3d2c323daea9d60608f1caf30be32a938916f4975434b8352e6f73dae496da38" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.9.4" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" js: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" - url: "https://pub.flutter-io.cn" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "2.0.1" lib_cache: dependency: transitive description: @@ -372,50 +516,50 @@ packages: dependency: transitive description: name: loading_more_list - sha256: "07a002e7e3b65211b442d74fa07b057019ee69a18278a9e5085971ae5d60a707" - url: "https://pub.flutter-io.cn" + sha256: "6b49eb935345d6cf291e0367d3c238ef0a525a08b671ee41e09ee67d41888a7a" + url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "6.0.0" loading_more_list_library: dependency: transitive description: name: loading_more_list_library - sha256: "433623b862d51ea7905d7de34e49a9797259ad122bf94a485c31349ec336aa9d" - url: "https://pub.flutter-io.cn" + sha256: de6b57edbab83022180f053ec3f598dd5e1192cfd6a285882b8155e3cb5dc581 + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "3.0.0" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" - url: "https://pub.flutter-io.cn" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.flutter-io.cn" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" - url: "https://pub.flutter-io.cn" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.11.0" mime: dependency: transitive description: name: mime - sha256: "5041f313f4e30fbd70dee7c0403785a4ee270f75830f590e5983960fddf743e4" - url: "https://pub.flutter-io.cn" + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" + url: "https://pub.dev" source: hosted - version: "0.9.7" + version: "1.0.5" module_author: dependency: "direct main" description: @@ -470,209 +614,226 @@ packages: description: name: nested sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.0" - open_iconic_flutter: - dependency: "direct main" + package_info_plus: + dependency: transitive description: - name: open_iconic_flutter - sha256: "9baf38b03474effaa9b9c1719220ab09cc52bbe8a39b54e017333ab772ffe467" - url: "https://pub.flutter-io.cn" + name: package_info_plus + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + url: "https://pub.dev" source: hosted - version: "0.3.0" - orientation: + version: "4.2.0" + package_info_plus_platform_interface: dependency: transitive description: - name: orientation - sha256: "16f229c87220a897db803456e0709364ffb25fc4405df0e3214bef99fa91d81c" - url: "https://pub.flutter-io.cn" + name: package_info_plus_platform_interface + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "2.0.1" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b - url: "https://pub.flutter-io.cn" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.0" path_provider: dependency: transitive description: name: path_provider - sha256: aa1b3572707c240d72569ce01756728cf0c8dca0cc381253d8ca2858c13edfe4 - url: "https://pub.flutter-io.cn" + sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b + url: "https://pub.dev" source: hosted - version: "2.0.1" - path_provider_linux: + version: "2.1.2" + path_provider_android: dependency: transitive description: - name: path_provider_linux - sha256: "938d2b6591587bcb009d2109a6ea464fd8fb2a75dc6423171b0d0afb1d27c708" - url: "https://pub.flutter-io.cn" + name: path_provider_android + sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + url: "https://pub.dev" source: hosted - version: "2.0.0" - path_provider_macos: + version: "2.2.2" + path_provider_foundation: dependency: transitive description: - name: path_provider_macos - sha256: eb58b896ea3a504f0b0fa7870646bda6935a6f752b2a54df33f97070dacca8d4 - url: "https://pub.flutter-io.cn" + name: path_provider_foundation + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.3.2" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: c2af5a8a6369992d915f8933dfc23172071001359d17896e83db8be57db8a397 - url: "https://pub.flutter-io.cn" + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.2" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: ecd4d04c225596bcf0fbb86408a1f40084a02dfa412e60172ad52a7f12a781ef - url: "https://pub.flutter-io.cn" + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" source: hosted - version: "2.0.0" - pedantic: + version: "2.2.1" + petitparser: dependency: transitive description: - name: pedantic - sha256: "8f6460c77a98ad2807cd3b98c67096db4286f56166852d0ce5951bb600a63594" - url: "https://pub.flutter-io.cn" + name: petitparser + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "6.0.2" photo_view: dependency: transitive description: name: photo_view - sha256: "396ba0623d054764e8a621b7e67cba274240af397e188e885ff6339908792747" - url: "https://pub.flutter-io.cn" + sha256: "8036802a00bae2a78fc197af8a158e3e2f7b500561ed23b4c458107685e645bb" + url: "https://pub.dev" source: hosted - version: "0.9.2" + version: "0.14.0" platform: dependency: "direct overridden" description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.flutter-io.cn" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: c2c49e16d42fd6983eb55e44b7f197fdf16b4da7aab7f8e1d21da307cad3fb02 - url: "https://pub.flutter-io.cn" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" source: hosted - version: "2.0.0" - process: + version: "2.1.8" + pointycastle: dependency: transitive description: - name: process - sha256: c7b9f7d8a6ee4407ab4f8a7d4a951f8f5659c40df14c0924e2e97c32372e9b14 - url: "https://pub.flutter-io.cn" + name: pointycastle + sha256: "43ac87de6e10afabc85c445745a7b799e04de84cebaa4fd7bf55a5e1e9604d29" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "3.7.4" provider: dependency: transitive description: name: provider - sha256: "59471e0a4595e264625d3496af567ac85bdae1148ec985aff1e0555786f53ecf" - url: "https://pub.flutter-io.cn" + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.1.2" pull_to_refresh: dependency: transitive description: name: pull_to_refresh sha256: bbadd5a931837b57739cf08736bea63167e284e71fb23b218c8c9a6e042aad12 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.0" rational: dependency: transitive description: name: rational - sha256: "02619cc7ef57027af859d3a97945727a6eb185b4765cc5c8082dc53d62dd5966" - url: "https://pub.flutter-io.cn" + sha256: ba58e9e18df9abde280e8b10051e4bce85091e41e8e7e411b6cde2e738d357cf + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.2.2" readmore: dependency: transitive description: name: readmore - sha256: "3de39b1a413e9df001933d9f39bd34de83186328bd790bf11a550e9176ced721" - url: "https://pub.flutter-io.cn" + sha256: "99c2483202f7c7e98c50834d72be2b119aefecf4497ca1960ae9d5f418eb1481" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.2.0" screen: dependency: transitive description: - name: screen - sha256: f953f9f906b15b971597acadad16b5ab1d3912cbb325e807416f223313ce8ed6 - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.0.5" + path: "." + ref: master + resolved-ref: e4eb9e5d7613ca994dcab4eb8ac8715d3c86ffd6 + url: "https://github.com/daniloapr/flutter_screen.git" + source: git + version: "0.0.7" share: dependency: transitive description: name: share - sha256: fc1647d0c3a8eb648dc6d91d2207e7976c1d941e2165a09cba7c805b0c24467e - url: "https://pub.flutter-io.cn" + sha256: "97e6403f564ed1051a01534c2fc919cb6e40ea55e60a18ec23cee6e0ce19f4be" + url: "https://pub.dev" source: hosted - version: "0.6.5+4" + version: "2.0.4" shared_preferences: dependency: transitive description: name: shared_preferences - sha256: "82c1ae2a70b5b0236bab13dcad98bc1c0c88ddfb4ef2b7b8080b55868404b8c3" - url: "https://pub.flutter-io.cn" + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" + url: "https://pub.dev" source: hosted - version: "2.0.4" - shared_preferences_linux: + version: "2.2.2" + shared_preferences_android: dependency: transitive description: - name: shared_preferences_linux - sha256: "33fc7c6ced70d226645a9612132fbff9890805df4edd34f30840e7e738866fee" - url: "https://pub.flutter-io.cn" + name: shared_preferences_android + sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" + url: "https://pub.dev" source: hosted - version: "2.0.0" - shared_preferences_macos: + version: "2.2.1" + shared_preferences_foundation: dependency: transitive description: - name: shared_preferences_macos - sha256: "5d2bad07b196b6ad4cf21af6f7197a87264ef569199502b9352f76e5054f06ae" - url: "https://pub.flutter-io.cn" + name: shared_preferences_foundation + sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.3.5" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + url: "https://pub.dev" + source: hosted + version: "2.3.2" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "992f0fdc46d0a3c0ac2e5859f2de0e577bbe51f78a77ee8f357cbe626a2ad32d" - url: "https://pub.flutter-io.cn" + sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.3.2" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: "09b72ec530a1b1f26cdbec6b138f980d97d4d86ebb86dbf6365369fbd4bb05c8" - url: "https://pub.flutter-io.cn" + sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.2.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "76c54a0148780d779a3fe332ece9ba8ad2c9dd0bc717ee7fce58bd06b5e8118f" - url: "https://pub.flutter-io.cn" + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.3.2" sky_engine: dependency: transitive description: flutter @@ -682,178 +843,202 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.flutter-io.cn" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sp_util: dependency: transitive description: name: sp_util sha256: "9da43dce5de79c17a787d0626bf01538d63090ca32521200d22a232171c495dc" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.3" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.flutter-io.cn" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.flutter-io.cn" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" synchronized: dependency: transitive description: name: synchronized - sha256: "271977ff1e9e82ceefb4f08424b8839f577c1852e0726b5ce855311b46d3ef83" - url: "https://pub.flutter-io.cn" + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0+1" term_glyph: dependency: transitive description: name: term_glyph sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 - url: "https://pub.flutter-io.cn" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.16" - transformer_page_view: + version: "0.6.1" + typed_data: dependency: transitive description: - name: transformer_page_view - sha256: "2210531bc4148831061c575070173f32693415be8bbbf5bd2159a38f2adff61c" - url: "https://pub.flutter-io.cn" + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "0.1.6" - typed_data: + version: "1.3.2" + universal_io: dependency: transitive description: - name: typed_data - sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" - url: "https://pub.flutter-io.cn" + name: universal_io + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "2.2.2" vector_math: dependency: transitive description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.4" video_player: dependency: transitive description: name: video_player - sha256: "706f282bc42fe51c9735ba82a62f7de2e3123b9bbcc90cb1829b822a55dab165" - url: "https://pub.flutter-io.cn" + sha256: fbf28ce8bcfe709ad91b5789166c832cb7a684d14f571a81891858fefb5bb1c2 + url: "https://pub.dev" source: hosted - version: "2.2.3" - video_player_platform_interface: + version: "2.8.2" + video_player_android: dependency: transitive description: - name: video_player_platform_interface - sha256: a1d56477752271a7a0de872d8962bce1dd5fecf463beaf66da417ebebb9ba0f7 - url: "https://pub.flutter-io.cn" + name: video_player_android + sha256: "4dd9b8b86d70d65eecf3dcabfcdfbb9c9115d244d022654aba49a00336d540c2" + url: "https://pub.dev" source: hosted - version: "4.2.0" - video_player_web: + version: "2.4.12" + video_player_avfoundation: dependency: transitive description: - name: video_player_web - sha256: c806616ed30a9e9d4007c9a1749221ef384ebab8312438273e02b7c629ad91ce - url: "https://pub.flutter-io.cn" + name: video_player_avfoundation + sha256: "309e3962795e761be010869bae65c0b0e45b5230c5cee1bec72197ca7db040ed" + url: "https://pub.dev" source: hosted - version: "2.0.0" - wakelock: + version: "2.5.6" + video_player_platform_interface: dependency: transitive description: - name: wakelock - sha256: da22c0789e1f849bec43688a52f2290f4e66268056f7cd77cb71245aef4917a0 - url: "https://pub.flutter-io.cn" + name: video_player_platform_interface + sha256: "236454725fafcacf98f0f39af0d7c7ab2ce84762e3b63f2cbb3ef9a7e0550bc6" + url: "https://pub.dev" source: hosted - version: "0.5.6" - wakelock_macos: + version: "6.2.2" + video_player_web: dependency: transitive description: - name: wakelock_macos - sha256: "047c6be2f88cb6b76d02553bca5a3a3b95323b15d30867eca53a19a0a319d4cd" - url: "https://pub.flutter-io.cn" + name: video_player_web + sha256: "8e9cb7fe94e49490e67bbc15149691792b58a0ade31b32e3f3688d104a0e057b" + url: "https://pub.dev" source: hosted - version: "0.4.0" - wakelock_platform_interface: + version: "2.2.0" + vm_service: dependency: transitive description: - name: wakelock_platform_interface - sha256: "1f4aeb81fb592b863da83d2d0f7b8196067451e4df91046c26b54a403f9de621" - url: "https://pub.flutter-io.cn" + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" source: hosted - version: "0.3.0" - wakelock_web: + version: "13.0.0" + wakelock_plus: dependency: transitive description: - name: wakelock_web - sha256: "1b256b811ee3f0834888efddfe03da8d18d0819317f20f6193e2922b41a501b5" - url: "https://pub.flutter-io.cn" + name: wakelock_plus + sha256: f268ca2116db22e57577fb99d52515a24bdc1d570f12ac18bb762361d43b043d + url: "https://pub.dev" source: hosted - version: "0.4.0" - wakelock_windows: + version: "1.1.4" + wakelock_plus_platform_interface: dependency: transitive description: - name: wakelock_windows - sha256: "108b1b73711f1664ee462e73af34a9286ff496e27d4d8371e2fb4da8fde4cdac" - url: "https://pub.flutter-io.cn" + name: wakelock_plus_platform_interface + sha256: "40fabed5da06caff0796dc638e1f07ee395fb18801fbff3255a2372db2d80385" + url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "1.1.0" waterfall_flow: dependency: transitive description: name: waterfall_flow - sha256: "56c2e3bc7be09554544729eacfa5863117b9d711b16145ef64e2982b880e51b0" - url: "https://pub.flutter-io.cn" + sha256: "11538b0d890458e55e6248b177732495d20893cfc7e85d7e8dbf4fdce61c9f10" + url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "3.0.3" + web: + dependency: transitive + description: + name: web + sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05" + url: "https://pub.dev" + source: hosted + version: "0.4.2" win32: dependency: transitive description: name: win32 - sha256: "172d21a88b25a4216e1c0deff84bb42102dc2e30d8fd2e663500a148ae87fc10" - url: "https://pub.flutter-io.cn" + sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "5.2.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "0186b3f2d66be9a12b0295bddcf8b6f8c0b0cc2f85c6287344e2a6366bc28457" - url: "https://pub.flutter-io.cn" + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" + source: hosted + version: "1.0.4" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "3.1.2" sdks: - dart: ">=2.18.0 <3.0.0" - flutter: ">=2.0.1" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6a6932c..aa873e9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ version: 2.0.3+1 publish_to: 'none' environment: - sdk: ">=2.2.2 <3.0.0" + sdk: ">=2.19.2 <4.0.0" dependencies: flutter: @@ -40,10 +40,9 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.0 - open_iconic_flutter: ^0.3.0 - flutter_splash_screen: ^0.1.0 - file: ^6.1.4 + cupertino_icons: ^1.0.6 + flutter_native_splash: ^2.3.10 + file: ^7.0.0 dependency_overrides: platform: ^3.1.0