From 2c9d4626d953e341d3f7900ba166abbaeb7c59af Mon Sep 17 00:00:00 2001 From: niuhuan Date: Sun, 5 Dec 2021 21:13:24 +0800 Subject: [PATCH] Fix slider count, engine --- README.md | 2 +- android/app/build.gradle | 4 +- .../kotlin/niuhuan/pikapika/MainActivity.kt | 4 -- lib/basic/config/Themes.dart | 10 ++--- lib/screens/components/ImageReader.dart | 2 +- lib/screens/components/Images.dart | 2 +- linux/flutter/generated_plugin_registrant.cc | 2 + linux/flutter/generated_plugin_registrant.h | 2 + pubspec.lock | 42 ++++++++++++------- .../flutter/generated_plugin_registrant.cc | 2 + windows/flutter/generated_plugin_registrant.h | 2 + 11 files changed, 46 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 690cc59..a8490d0 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ VPN->代理->分流, 这三个功能如果同时设置, 您会在您手机的VPN ### 开发环境准备 - [golang](https://golang.org/) (1.16以上版本) -- [flutter](https://flutter.dev/) (桌面端使用2.2.3) +- [flutter](https://flutter.dev/) (2.5.3)(flutter不同版本api差异较大,建议使用同样版本) ### 环境配置 diff --git a/android/app/build.gradle b/android/app/build.gradle index b472ea1..21eeee5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -36,7 +36,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "niuhuan.pikapika" minSdkVersion 16 - targetSdkVersion 30 + targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/android/app/src/main/kotlin/niuhuan/pikapika/MainActivity.kt b/android/app/src/main/kotlin/niuhuan/pikapika/MainActivity.kt index 6ff55d1..21b1c6c 100644 --- a/android/app/src/main/kotlin/niuhuan/pikapika/MainActivity.kt +++ b/android/app/src/main/kotlin/niuhuan/pikapika/MainActivity.kt @@ -30,10 +30,6 @@ import java.util.concurrent.Executors class MainActivity : FlutterActivity() { - override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { - super.onCreate(savedInstanceState, persistentState) - } - // 为什么换成换成线程池而不继续使用携程 : 下载图片速度慢会占满携程造成拥堵, 接口无法请求 private val pool = Executors.newCachedThreadPool { runnable -> Thread(runnable).also { it.isDaemon = true } diff --git a/lib/basic/config/Themes.dart b/lib/basic/config/Themes.dart index 253930e..0313537 100644 --- a/lib/basic/config/Themes.dart +++ b/lib/basic/config/Themes.dart @@ -90,7 +90,7 @@ class _PinkTheme extends _ThemePackage { secondary: Colors.pink.shade200, ), appBarTheme: AppBarTheme( - brightness: Brightness.dark, + systemOverlayStyle: SystemUiOverlayStyle.light, color: Colors.pink.shade200, iconTheme: IconThemeData( color: Colors.white, @@ -119,7 +119,7 @@ class _BlackTheme extends _ThemePackage { secondary: Colors.pink.shade200, ), appBarTheme: AppBarTheme( - brightness: Brightness.dark, + systemOverlayStyle: SystemUiOverlayStyle.light, color: Colors.grey.shade800, iconTheme: IconThemeData( color: Colors.white, @@ -144,12 +144,12 @@ class _DarkTheme extends _ThemePackage { @override ThemeData themeData(ThemeData rawData) => rawData.copyWith( - brightness: Brightness.dark, + brightness: Brightness.light, colorScheme: ColorScheme.light( secondary: Colors.pink.shade200, ), appBarTheme: AppBarTheme( - brightness: Brightness.dark, + systemOverlayStyle: SystemUiOverlayStyle.light, color: Color(0xFF1E1E1E), iconTheme: IconThemeData( color: Colors.white, @@ -181,7 +181,7 @@ class _DustyBlueTheme extends _ThemePackage { secondary: Colors.blue.shade200, ), appBarTheme: AppBarTheme( - brightness: Brightness.dark, + systemOverlayStyle: SystemUiOverlayStyle.light, color: Color(0xff20253b), iconTheme: IconThemeData( color: Colors.white, diff --git a/lib/screens/components/ImageReader.dart b/lib/screens/components/ImageReader.dart index d125722..ea9486e 100644 --- a/lib/screens/components/ImageReader.dart +++ b/lib/screens/components/ImageReader.dart @@ -382,7 +382,7 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> { axis: Axis.horizontal, values: [_slider.toDouble()], min: 0, - max: widget.struct.images.length.toDouble(), + max: (widget.struct.images.length - 1).toDouble(), onDragging: (handlerIndex, lowerValue, upperValue) { _slider = (lowerValue.toInt()); }, diff --git a/lib/screens/components/Images.dart b/lib/screens/components/Images.dart index 3f12606..b8b8a1c 100644 --- a/lib/screens/components/Images.dart +++ b/lib/screens/components/Images.dart @@ -112,7 +112,7 @@ class ResourceDownloadFileImageProvider ')'; } -// 从远端加载图片 暂时未使用 (现在都是先获取路径然后再通过file显示) +// 从远端加载图片 class ResourceRemoteImageProvider extends ImageProvider { final String fileServer; diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 026851f..f6f23bf 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" #include diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h index 9bf7478..e0f0a47 100644 --- a/linux/flutter/generated_plugin_registrant.h +++ b/linux/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ diff --git a/pubspec.lock b/pubspec.lock index 949a426..b5150e5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.8.1" boolean_selector: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" clipboard: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" event: dependency: "direct main" description: @@ -167,7 +167,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" modal_bottom_sheet: dependency: "direct main" description: @@ -216,21 +216,21 @@ packages: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.1.6" + version: "8.3.0" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.6.1" + version: "3.7.0" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.4.0" photo_view: dependency: "direct main" description: @@ -251,7 +251,7 @@ packages: name: scrollable_positioned_list url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.2.3" sky_engine: dependency: transitive description: flutter @@ -298,7 +298,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.2" typed_data: dependency: transitive description: @@ -312,7 +312,21 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.10" + version: "6.0.17" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.13" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.13" url_launcher_linux: dependency: transitive description: @@ -340,7 +354,7 @@ packages: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" url_launcher_windows: dependency: transitive description: @@ -361,7 +375,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.1.2" + version: "5.3.1" sdks: - dart: ">=2.12.0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 92772e9..4f78848 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" #include diff --git a/windows/flutter/generated_plugin_registrant.h b/windows/flutter/generated_plugin_registrant.h index 9846246..dc139d8 100644 --- a/windows/flutter/generated_plugin_registrant.h +++ b/windows/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_