From 91e249b6666c43df048f8163a459a24b7571fd75 Mon Sep 17 00:00:00 2001 From: guoshuyu <359369982@qq.com> Date: Tue, 17 Dec 2024 11:43:09 +0800 Subject: [PATCH] support 3.27 --- README.md | 6 +-- README_EN.md | 6 +-- android/.gitignore | 1 + .../gsygithubappflutter/UpdateAlbumPlugin.kt | 10 +---- android/build.gradle | 1 - .../xcshareddata/xcschemes/Runner.xcscheme | 1 + lib/common/dao/issue_dao.dart | 6 +-- lib/common/dao/repos_dao.dart | 19 ++++----- lib/common/dao/user_dao.dart | 2 +- lib/common/utils/html_utils.dart | 7 ++-- lib/page/debug/debug_label.dart | 2 +- lib/page/notify_page.dart | 9 +--- lib/widget/diff_scale_text.dart | 2 +- lib/widget/gsy_tabs.dart | 8 ++-- lib/widget/pull/nested/nested_refresh.dart | 10 ++--- pubspec.lock | 42 +++++++++---------- pubspec.yaml | 6 +-- 17 files changed, 61 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index 7f5fbd1b..bef22a01 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ ## 编译运行流程 -1、配置好Flutter开发环境(目前Flutter SDK 版本 **3.24**),可参阅 [【搭建环境】](https://flutterchina.club)。 +1、配置好Flutter开发环境(目前Flutter SDK 版本 **3.27**),可参阅 [【搭建环境】](https://flutterchina.club)。 2、clone代码,执行`Packages get`安装第三方包。(因为某些不可抗力原因,国内可能需要设置代理: [代理环境变量](https://flutterchina.club/setup-windows/)) @@ -109,7 +109,7 @@ ### 5、运行之前请注意下 ->### 1、本地 Flutter SDK 版本 3.24 ; 2、是否执行过 `flutter pub get`;3、 网络等问题参考: [如果出现登陆失败或者请求失败 ](https://github.com/CarGuo/gsy_github_app_flutter/issues/643) +>### 1、本地 Flutter SDK 版本 3.27 ; 2、是否执行过 `flutter pub get`;3、 网络等问题参考: [如果出现登陆失败或者请求失败 ](https://github.com/CarGuo/gsy_github_app_flutter/issues/643) ### 下载 @@ -154,7 +154,7 @@ ### 第三方框架 ->当前 Flutter SDK 版本 3.24 +>当前 Flutter SDK 版本 3.27 | 库 | 功能 | | -------------------------- | -------------- | diff --git a/README_EN.md b/README_EN.md index fb27a213..a6043279 100644 --- a/README_EN.md +++ b/README_EN.md @@ -43,7 +43,7 @@ With the use and feedback of the project, will user experience and function opti ### Operation instructions -1. Configure the Flutter development environment (Tag of the current version of Flutter SDK **3.24** ). +1. Configure the Flutter development environment (Tag of the current version of Flutter SDK **3.27** ). 2. Clone code, execute `Packages get'to install third-party packages. @@ -68,7 +68,7 @@ With the use and feedback of the project, will user experience and function opti 4、Be careful ->### Local Flutter SDK version 3.24 or more. 2. Does the third-party package version in pubspec. yaml correspond to the third-party package version in pubspec. lock? +>### Local Flutter SDK version 3.27 or more. 2. Does the third-party package version in pubspec. yaml correspond to the third-party package version in pubspec. lock? ### Download @@ -110,7 +110,7 @@ With the use and feedback of the project, will user experience and function opti ### Third-party framework ->Current Flutter SDK version **3.24** +>Current Flutter SDK version **3.27** | 库 | 功能 | | -------------------------- | -------------- | diff --git a/android/.gitignore b/android/.gitignore index 65b7315a..9a5ff1cb 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -8,3 +8,4 @@ /build /captures GeneratedPluginRegistrant.java +.cxx/ diff --git a/android/app/src/main/kotlin/com/shuyu/gsygithub/gsygithubappflutter/UpdateAlbumPlugin.kt b/android/app/src/main/kotlin/com/shuyu/gsygithub/gsygithubappflutter/UpdateAlbumPlugin.kt index 3214f190..77964522 100644 --- a/android/app/src/main/kotlin/com/shuyu/gsygithub/gsygithubappflutter/UpdateAlbumPlugin.kt +++ b/android/app/src/main/kotlin/com/shuyu/gsygithub/gsygithubappflutter/UpdateAlbumPlugin.kt @@ -5,7 +5,6 @@ import android.provider.MediaStore import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel -import io.flutter.plugin.common.PluginRegistry.Registrar class UpdateAlbumPlugin : FlutterPlugin, MethodChannel.MethodCallHandler { @@ -17,18 +16,11 @@ class UpdateAlbumPlugin : FlutterPlugin, MethodChannel.MethodCallHandler { companion object { private val sChannelName = "com.shuyu.gsygithub.gsygithubflutter/UpdateAlbumPlugin" - - fun registerWith(registrar: Registrar) { - val instance = UpdateAlbumPlugin() - instance.channel = MethodChannel(registrar.messenger(), sChannelName) - instance.context = registrar.context() - instance.channel?.setMethodCallHandler(instance) - } } override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { channel = MethodChannel( - binding.flutterEngine.dartExecutor, sChannelName) + binding.binaryMessenger, sChannelName) context = binding.applicationContext channel!!.setMethodCallHandler(this) } diff --git a/android/build.gradle b/android/build.gradle index 5869be3d..f3843c6f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,7 +1,6 @@ allprojects { repositories { google() - jcenter() } } diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 78795e78..680d8430 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -50,6 +50,7 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/lib/common/dao/issue_dao.dart b/lib/common/dao/issue_dao.dart index 4ce0a048..a258d451 100644 --- a/lib/common/dao/issue_dao.dart +++ b/lib/common/dao/issue_dao.dart @@ -23,7 +23,7 @@ class IssueDao { /// @param direction 正序或者倒序 static getRepositoryIssueDao(userName, repository, state, {sort, direction, page = 0, needDb = false}) async { - String? fullName = userName + "/" + repository; + String? fullName = "$userName/$repository"; String dbState = state ?? "*"; RepositoryIssueDbProvider provider = RepositoryIssueDbProvider(); @@ -101,7 +101,7 @@ class IssueDao { /// issue的详请 static getIssueInfoDao(userName, repository, number, {needDb = true}) async { - String? fullName = userName + "/" + repository; + String? fullName = "$userName/$repository"; IssueDetailDbProvider provider = IssueDetailDbProvider(); @@ -134,7 +134,7 @@ class IssueDao { /// issue的详请列表 static getIssueCommentDao(userName, repository, number, {page = 0, needDb = false}) async { - String? fullName = userName + "/" + repository; + String? fullName = "$userName/$repository"; IssueCommentDbProvider provider = IssueCommentDbProvider(); next() async { diff --git a/lib/common/dao/repos_dao.dart b/lib/common/dao/repos_dao.dart index 85e9a98a..e5006a18 100644 --- a/lib/common/dao/repos_dao.dart +++ b/lib/common/dao/repos_dao.dart @@ -109,7 +109,7 @@ class ReposDao { /// 仓库的详情数据 static getRepositoryDetailDao(userName, reposName, branch, {needDb = true}) async { - String? fullName = userName + "/" + reposName + "v3"; + String? fullName = userName + "/$reposName" + "v3"; RepositoryDetailDbProvider provider = RepositoryDetailDbProvider(); next() async { @@ -144,7 +144,7 @@ class ReposDao { /// 仓库活动事件 static getRepositoryEventDao(userName, reposName, {page = 0, branch = "master", needDb = false}) async { - String? fullName = userName + "/" + reposName; + String? fullName = userName + "/$reposName"; RepositoryEventDbProvider provider = RepositoryEventDbProvider(); next() async { @@ -193,15 +193,14 @@ class ReposDao { /// 获取仓库的提交列表 static getReposCommitsDao(userName, reposName, {page = 0, branch = "master", needDb = false}) async { - String? fullName = userName + "/" + reposName; + String? fullName = userName + "/$reposName"; RepositoryCommitsDbProvider provider = RepositoryCommitsDbProvider(); next() async { String url = Address.getReposCommits(userName, reposName) + Address.getPageParams("?", page) + - "&sha=" + - branch; + "&sha=$branch"; var res = await httpManager.netFetch(url, null, null, null); if (res != null && res.result) { List list = []; @@ -295,7 +294,7 @@ class ReposDao { /// 获取当前仓库所有订阅用户 static getRepositoryWatcherDao(userName, reposName, page, {needDb = false}) async { - String? fullName = userName + "/" + reposName; + String? fullName = "$userName/$reposName"; RepositoryWatcherDbProvider provider = RepositoryWatcherDbProvider(); next() async { @@ -334,7 +333,7 @@ class ReposDao { /// 获取当前仓库所有star用户 static getRepositoryStarDao(userName, reposName, page, {needDb = false}) async { - String? fullName = userName + "/" + reposName; + String? fullName = "$userName/$reposName"; RepositoryStarDbProvider provider = RepositoryStarDbProvider(); next() async { String url = Address.getReposStar(userName, reposName) + @@ -372,7 +371,7 @@ class ReposDao { /// 获取仓库的fork分支 static getRepositoryForksDao(userName, reposName, page, {needDb = false}) async { - String? fullName = userName + "/" + reposName; + String? fullName = "$userName/$reposName"; RepositoryForkDbProvider provider = RepositoryForkDbProvider(); next() async { String url = Address.getReposForks(userName, reposName) + @@ -545,12 +544,12 @@ class ReposDao { /// 详情的remde数据 static getRepositoryDetailReadmeDao(userName, reposName, branch, {needDb = true}) async { - String? fullName = userName + "/" + reposName; + String? fullName = "$userName/$reposName"; RepositoryDetailReadmeDbProvider provider = RepositoryDetailReadmeDbProvider(); next() async { - String url = Address.readmeFile(userName + '/' + reposName, branch); + String url = Address.readmeFile('$userName/$reposName', branch); var res = await httpManager.netFetch( url, null, diff --git a/lib/common/dao/user_dao.dart b/lib/common/dao/user_dao.dart index b1ef1f3a..a65c3909 100644 --- a/lib/common/dao/user_dao.dart +++ b/lib/common/dao/user_dao.dart @@ -59,7 +59,7 @@ class UserDao { } static login(userName, password, store) async { - String type = userName + ":" + password; + String type = "$userName:$password"; var bytes = utf8.encode(type); var base64Str = base64.encode(bytes); if (Config.DEBUG!) { diff --git a/lib/common/utils/html_utils.dart b/lib/common/utils/html_utils.dart index 8f29b1e9..74047aaa 100644 --- a/lib/common/utils/html_utils.dart +++ b/lib/common/utils/html_utils.dart @@ -109,12 +109,11 @@ class HtmlUtils { " " + "\n" + " " + - " " + "\n\n" + + "body{background: $backgroundColor" + };}a {color:$actionColor !important;}.highlight pre, pre { word-wrap: ${wrap ? "break-word" : "normal"}; white-space: ${wrap ? "pre-wrap" : "pre"}; }thead, tr {background:${GSYColors.miWhiteString};}td, th {padding: 5px 10px;font-size: 12px;direction:hor}.highlight {overflow: scroll; background: ${GSYColors.miWhiteString}}tr:nth-child(even) {background:${GSYColors.primaryLightValueString};color:${GSYColors.miWhiteString};}tr:nth-child(odd) {background: ${GSYColors.miWhiteString};color:${GSYColors.primaryLightValueString};}th {font-size: 14px;color:${GSYColors.miWhiteString};background:${GSYColors.primaryLightValueString};}\n\n" + mdHTML}\n"; } diff --git a/lib/page/debug/debug_label.dart b/lib/page/debug/debug_label.dart index 313e4398..6e7095ec 100644 --- a/lib/page/debug/debug_label.dart +++ b/lib/page/debug/debug_label.dart @@ -96,7 +96,7 @@ class _GlobalLabelState extends State { color: Colors.transparent, child: Container( decoration: BoxDecoration( - color: Colors.black.withOpacity(0.6), + color: Colors.black.withValues(alpha: 0.6), borderRadius: const BorderRadius.all( Radius.circular(5), ), diff --git a/lib/page/notify_page.dart b/lib/page/notify_page.dart index ad7e0b44..04864557 100644 --- a/lib/page/notify_page.dart +++ b/lib/page/notify_page.dart @@ -28,7 +28,6 @@ class _NotifyPageState extends State AutomaticKeepAliveClientMixin, GSYListState, SingleTickerProviderStateMixin { - late SlidableController slidableController; int selectIndex = 0; @@ -42,8 +41,8 @@ class _NotifyPageState extends State ///只有未读消息支持 Slidable 滑动效果 return Slidable( key: ValueKey("${index}_$selectIndex"), - controller: slidableController, endActionPane: ActionPane( + dragDismissible: false, motion: const ScrollMotion(), dismissible: DismissiblePane(onDismissed: () { UserDao.setNotificationAsReadDao(notification.id.toString()) @@ -121,12 +120,6 @@ class _NotifyPageState extends State return await _getDataLogic(); } - @override - void initState() { - super.initState(); - slidableController = SlidableController(this); - } - @override Widget build(BuildContext context) { super.build(context); // See AutomaticKeepAliveClientMixin. diff --git a/lib/widget/diff_scale_text.dart b/lib/widget/diff_scale_text.dart index f08d9e8a..23afab36 100644 --- a/lib/widget/diff_scale_text.dart +++ b/lib/widget/diff_scale_text.dart @@ -137,7 +137,7 @@ class _DiffText extends CustomPainter { textPaint.color = textStyle!.color!; } else { textPaint.color = textStyle!.color! - .withAlpha((textStyle!.color!.alpha * alphaFactor).floor()); + .withAlpha((textStyle!.color!.a * alphaFactor).floor()); } var textPainter = TextPainter( text: TextSpan( diff --git a/lib/widget/gsy_tabs.dart b/lib/widget/gsy_tabs.dart index 1d502bb5..03cedc26 100644 --- a/lib/widget/gsy_tabs.dart +++ b/lib/widget/gsy_tabs.dart @@ -138,7 +138,7 @@ class _TabStyle extends AnimatedWidget { @override Widget build(BuildContext context) { final ThemeData themeData = Theme.of(context); - final TabBarTheme tabBarTheme = TabBarTheme.of(context); + final TabBarThemeData tabBarTheme = TabBarTheme.of(context); final Animation animation = listenable as Animation; // To enable TextStyle.lerp(style1, style2, value), both styles must have @@ -736,7 +736,7 @@ class _TabBarState extends State { Decoration? get _indicator { if (widget.indicator != null) return widget.indicator; - final TabBarTheme tabBarTheme = TabBarTheme.of(context); + final TabBarThemeData tabBarTheme = TabBarTheme.of(context); if (tabBarTheme.indicator != null) return tabBarTheme.indicator; Color color = widget.indicatorColor ?? Theme.of(context).indicatorColor; @@ -750,7 +750,7 @@ class _TabBarState extends State { // // The material's color might be null (if it's a transparency). In that case // there's no good way for us to find out what the color is so we don't. - if (color.value == Material.of(context).color?.value) color = Colors.white; + if (color == Material.of(context).color) color = Colors.white; return UnderlineTabIndicator( insets: widget.indicatorPadding, @@ -978,7 +978,7 @@ class _TabBarState extends State { ); } - final TabBarTheme tabBarTheme = TabBarTheme.of(context); + final TabBarThemeData tabBarTheme = TabBarTheme.of(context); diff --git a/lib/widget/pull/nested/nested_refresh.dart b/lib/widget/pull/nested/nested_refresh.dart index 5abe2621..c30abf66 100644 --- a/lib/widget/pull/nested/nested_refresh.dart +++ b/lib/widget/pull/nested/nested_refresh.dart @@ -246,8 +246,8 @@ class NestedScrollViewRefreshIndicatorState final ThemeData theme = Theme.of(context); _valueColor = _positionController.drive( ColorTween( - begin: (widget.color ?? theme.colorScheme.primary).withOpacity(0.0), - end: (widget.color ?? theme.colorScheme.primary).withOpacity(1.0), + begin: (widget.color ?? theme.colorScheme.primary).withValues(alpha: 0.0), + end: (widget.color ?? theme.colorScheme.primary).withValues(alpha: 1.0), ).chain(CurveTween( curve: const Interval(0.0, 1.0 / _kDragSizeFactorLimit), )), @@ -262,8 +262,8 @@ class NestedScrollViewRefreshIndicatorState final ThemeData theme = Theme.of(context); _valueColor = _positionController.drive( ColorTween( - begin: (widget.color ?? theme.colorScheme.primary).withOpacity(0.0), - end: (widget.color ?? theme.colorScheme.primary).withOpacity(1.0), + begin: (widget.color ?? theme.colorScheme.primary).withValues(alpha: 0.0), + end: (widget.color ?? theme.colorScheme.primary).withValues(alpha: 1.0), ).chain(CurveTween( curve: const Interval(0.0, 1.0 / _kDragSizeFactorLimit), )), @@ -399,7 +399,7 @@ class NestedScrollViewRefreshIndicatorState } _positionController.value = newValue.clamp(0.0, 1.0); // this triggers various rebuilds - if (_mode == _RefreshIndicatorMode.drag && _valueColor.value!.alpha == 0xFF) { + if (_mode == _RefreshIndicatorMode.drag && _valueColor.value!.a == 0xFF) { _mode = _RefreshIndicatorMode.armed; } } diff --git a/pubspec.lock b/pubspec.lock index 85752bd0..7dc494b1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.flutter-io.cn" source: hosted - version: "72.0.0" + version: "76.0.0" _macros: dependency: transitive description: dart source: sdk - version: "0.3.2" + version: "0.3.3" analyzer: dependency: transitive description: name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.flutter-io.cn" source: hosted - version: "6.7.0" + version: "6.11.0" android_intent_plus: dependency: "direct main" description: @@ -162,10 +162,10 @@ packages: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.1" + version: "1.1.2" code_builder: dependency: transitive description: @@ -178,10 +178,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.flutter-io.cn" source: hosted - version: "1.18.0" + version: "1.19.0" connectivity_plus: dependency: "direct main" description: @@ -306,8 +306,8 @@ packages: dependency: "direct main" description: path: flare_flutter - ref: ab41281006402485ff7326d0c58134f451a0de3a - resolved-ref: ab41281006402485ff7326d0c58134f451a0de3a + ref: d9c4ca55cbea3f283491679847ff1e9b4bc74192 + resolved-ref: d9c4ca55cbea3f283491679847ff1e9b4bc74192 url: "https://gitee.com/CarGuo/Flare-Flutter.git" source: git version: "3.0.2" @@ -413,10 +413,10 @@ packages: dependency: "direct main" description: name: flutter_slidable - sha256: "2c5611c0b44e20d180e4342318e1bbc28b0a44ad2c442f5df16962606fd3e8e3" + sha256: a857de7ea701f276fd6a6c4c67ae885b60729a3449e42766bb0e655171042801 url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.1" + version: "3.1.2" flutter_spinkit: dependency: "direct main" description: @@ -442,10 +442,10 @@ packages: dependency: "direct main" description: name: fluttertoast - sha256: "95f349437aeebe524ef7d6c9bde3e6b4772717cf46a0eb6a3ceaddc740b297cc" + sha256: "24467dc20bbe49fd63e57d8e190798c4d22cbbdac30e54209d153a15273721d1" url: "https://pub.flutter-io.cn" source: hosted - version: "8.2.8" + version: "8.2.10" frontend_server_client: dependency: transitive description: @@ -634,10 +634,10 @@ packages: dependency: transitive description: name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.2-main.4" + version: "0.1.3-main.0" markdown: dependency: transitive description: @@ -730,10 +730,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.0" + version: "1.9.1" path_parsing: dependency: transitive description: @@ -1034,7 +1034,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -1364,5 +1364,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.7.0-0 <4.0.0" flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index c8d047b2..50613590 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,13 +33,13 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.4 - fluttertoast: 8.2.8 + fluttertoast: 8.2.10 share_plus: 7.1.0 flutter_spinkit: 5.2.1 sqflite: 2.3.3+1 pub_semver: 2.1.4 flutter_svg: 2.0.7 - flutter_slidable: 3.1.1 + flutter_slidable: 3.1.2 dio: 5.6.0 #fconsole: 2.2.1 path_provider: 2.1.4 @@ -50,7 +50,7 @@ dependencies: flare_flutter: git: url: https://gitee.com/CarGuo/Flare-Flutter.git - ref: ab41281006402485ff7326d0c58134f451a0de3a + ref: d9c4ca55cbea3f283491679847ff1e9b4bc74192 path: flare_flutter/ rive: 0.13.13