From c112a920ec994c94dba8d6e2e041c7df3a036978 Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Sat, 14 Dec 2024 13:48:24 +0800 Subject: [PATCH] bump: flutter:3.27.0 rust:1.83.0 --- lib/app.dart | 11 ++++---- lib/common/io/doh_client.dart | 4 +-- lib/common/rust/api/asar_api.dart | 2 +- lib/common/rust/api/http_api.dart | 2 +- lib/common/rust/api/rs_process.dart | 2 +- lib/common/rust/api/win32_api.dart | 2 +- lib/common/rust/frb_generated.dart | 4 +-- lib/common/rust/frb_generated.io.dart | 10 +++---- lib/common/rust/http_package.dart | 2 +- lib/common/utils/base_utils.dart | 2 +- lib/data/app_torrent_data.dart | 12 ++++---- lib/data/doh_client_response_data.dart | 1 - lib/main.dart | 2 +- lib/provider/aria2c.freezed.dart | 8 +++--- lib/provider/unp4kc.freezed.dart | 4 +-- lib/ui/about/about_ui.dart | 27 ++++++++++-------- lib/ui/guide/guide_ui.dart | 3 +- .../dialogs/home_countdown_dialog_ui.dart | 7 +++-- .../dialogs/home_md_content_dialog_ui.dart | 5 ++-- .../home/downloader/home_downloader_ui.dart | 4 +-- .../downloader/home_downloader_ui_model.dart | 10 ++++--- .../home_downloader_ui_model.freezed.dart | 6 ++-- lib/ui/home/game_doctor/game_doctor_ui.dart | 5 ++-- lib/ui/home/home_ui.dart | 28 ++++++++++--------- lib/ui/home/home_ui_model.dart | 4 ++- .../input_method/input_method_dialog_ui.dart | 6 ++-- .../input_method_dialog_ui_model.g.dart | 2 +- lib/ui/home/input_method/server.dart | 2 +- .../input_method/server_qr_dialog_ui.dart | 8 +++--- .../advanced_localization_ui.dart | 8 +++--- .../advanced_localization_ui_model.dart | 4 +-- .../localization/localization_dialog_ui.dart | 27 ++++++++++-------- .../localization_form_file_dialog_ui.dart | 11 ++++---- .../localization/localization_ui_model.dart | 16 ++++++----- lib/ui/home/performance/performance_ui.dart | 11 ++++---- lib/ui/index_ui.dart | 2 +- lib/ui/settings/settings_ui.dart | 3 +- lib/ui/settings/settings_ui_model.g.dart | 2 +- lib/ui/settings/upgrade_dialog.dart | 5 ++-- .../rsi_launcher_enhance_dialog_ui.dart | 21 +++++++------- lib/ui/tools/tools_ui.dart | 5 ++-- lib/ui/tools/unp4kc/unp4kc_ui.dart | 16 +++++++---- packages/sct_dev_tools/bin/auto_l10n.dart | 14 ++++------ pubspec.yaml | 7 +++-- rust/Cargo.toml | 2 +- rust/src/frb_generated.rs | 6 ++-- test/widget_test.dart | 2 -- 47 files changed, 187 insertions(+), 160 deletions(-) diff --git a/lib/app.dart b/lib/app.dart index 03a3e9e..5cd2b8b 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -284,9 +284,10 @@ class AppGlobalModel extends _$AppGlobalModel { final colorCfg = networkVersionData.activityColors; state = state.copyWith( themeConf: ThemeConf( - backgroundColor: - HexColor(colorCfg?.background ?? "#132431").withOpacity(.75), - menuColor: HexColor(colorCfg?.menu ?? "#132431").withOpacity(.95), + backgroundColor: HexColor(colorCfg?.background ?? "#132431") + .withValues(alpha: .75), + menuColor: + HexColor(colorCfg?.menu ?? "#132431").withValues(alpha: .95), micaColor: HexColor(colorCfg?.mica ?? "#0A3142"), ), ); @@ -298,8 +299,8 @@ class AppGlobalModel extends _$AppGlobalModel { dPrint("reset Color ...."); state = state.copyWith( themeConf: ThemeConf( - backgroundColor: HexColor("#132431").withOpacity(.75), - menuColor: HexColor("#132431").withOpacity(.95), + backgroundColor: HexColor("#132431").withValues(alpha: .75), + menuColor: HexColor("#132431").withValues(alpha: .95), micaColor: HexColor("#0A3142"), ), ); diff --git a/lib/common/io/doh_client.dart b/lib/common/io/doh_client.dart index 0c54b2d..9c6a28c 100644 --- a/lib/common/io/doh_client.dart +++ b/lib/common/io/doh_client.dart @@ -35,10 +35,10 @@ class DohClient { // data demo: {"data":"\"https://git.scbox.xkeyc.cn,https://gitapi.scbox.org\""} if (data == null) return ""; data = data.trim(); - if (data.startsWith("\"")){ + if (data.startsWith("\"")) { data = data.substring(1); } - if (data.endsWith("\"")){ + if (data.endsWith("\"")) { data = data.substring(0, data.length - 1); } return data; diff --git a/lib/common/rust/api/asar_api.dart b/lib/common/rust/api/asar_api.dart index f4697d6..719ec7d 100644 --- a/lib/common/rust/api/asar_api.dart +++ b/lib/common/rust/api/asar_api.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.6.0. +// @generated by `flutter_rust_bridge`@ 2.7.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/lib/common/rust/api/http_api.dart b/lib/common/rust/api/http_api.dart index 5e3f748..6024305 100644 --- a/lib/common/rust/api/http_api.dart +++ b/lib/common/rust/api/http_api.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.6.0. +// @generated by `flutter_rust_bridge`@ 2.7.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/lib/common/rust/api/rs_process.dart b/lib/common/rust/api/rs_process.dart index f153135..60afc52 100644 --- a/lib/common/rust/api/rs_process.dart +++ b/lib/common/rust/api/rs_process.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.6.0. +// @generated by `flutter_rust_bridge`@ 2.7.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/lib/common/rust/api/win32_api.dart b/lib/common/rust/api/win32_api.dart index c3faa95..bbab3bf 100644 --- a/lib/common/rust/api/win32_api.dart +++ b/lib/common/rust/api/win32_api.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.6.0. +// @generated by `flutter_rust_bridge`@ 2.7.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/lib/common/rust/frb_generated.dart b/lib/common/rust/frb_generated.dart index f20f230..b643a55 100644 --- a/lib/common/rust/frb_generated.dart +++ b/lib/common/rust/frb_generated.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.6.0. +// @generated by `flutter_rust_bridge`@ 2.7.0. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field @@ -67,7 +67,7 @@ class RustLib extends BaseEntrypoint { kDefaultExternalLibraryLoaderConfig; @override - String get codegenVersion => '2.6.0'; + String get codegenVersion => '2.7.0'; @override int get rustContentHash => 1832496273; diff --git a/lib/common/rust/frb_generated.io.dart b/lib/common/rust/frb_generated.io.dart index 7f0a667..a97489d 100644 --- a/lib/common/rust/frb_generated.io.dart +++ b/lib/common/rust/frb_generated.io.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.6.0. +// @generated by `flutter_rust_bridge`@ 2.7.0. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field @@ -931,14 +931,14 @@ class RustLibWire implements BaseWire { _dummy_method_to_enforce_bundlingPtr.asFunction(); } -typedef DartPostCObjectFnType - = ffi.Pointer>; +typedef DartPort = ffi.Int64; +typedef DartDartPort = int; typedef DartPostCObjectFnTypeFunction = ffi.Bool Function( DartPort port_id, ffi.Pointer message); typedef DartDartPostCObjectFnTypeFunction = bool Function( DartDartPort port_id, ffi.Pointer message); -typedef DartPort = ffi.Int64; -typedef DartDartPort = int; +typedef DartPostCObjectFnType + = ffi.Pointer>; final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external ffi.Pointer ptr; diff --git a/lib/common/rust/http_package.dart b/lib/common/rust/http_package.dart index 60a0b89..24c8ad5 100644 --- a/lib/common/rust/http_package.dart +++ b/lib/common/rust/http_package.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.6.0. +// @generated by `flutter_rust_bridge`@ 2.7.0. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/lib/common/utils/base_utils.dart b/lib/common/utils/base_utils.dart index ff2cee8..e180355 100644 --- a/lib/common/utils/base_utils.dart +++ b/lib/common/utils/base_utils.dart @@ -79,7 +79,7 @@ Future showInputDialogs(BuildContext context, if (content.isNotEmpty) Text( content, - style: TextStyle(color: Colors.white.withOpacity(.6)), + style: TextStyle(color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 8), TextFormBox( diff --git a/lib/data/app_torrent_data.dart b/lib/data/app_torrent_data.dart index f83e4d3..b273b8c 100644 --- a/lib/data/app_torrent_data.dart +++ b/lib/data/app_torrent_data.dart @@ -5,10 +5,11 @@ class AppTorrentData { AppTorrentData({ - this.name, - this.updateAt, - this.url, - this.info,}); + this.name, + this.updateAt, + this.url, + this.info, + }); AppTorrentData.fromJson(dynamic json) { name = json['name']; @@ -29,5 +30,4 @@ class AppTorrentData { map['info'] = info; return map; } - -} \ No newline at end of file +} diff --git a/lib/data/doh_client_response_data.dart b/lib/data/doh_client_response_data.dart index d804125..b222d4c 100644 --- a/lib/data/doh_client_response_data.dart +++ b/lib/data/doh_client_response_data.dart @@ -85,7 +85,6 @@ class DohClientResponseAnswerData { } } - class DohClientResponseQuestionData { DohClientResponseQuestionData({ this.name, diff --git a/lib/main.dart b/lib/main.dart index 7420cae..f2cb9c1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -70,7 +70,7 @@ class App extends HookConsumerWidget { defaultButtonStyle: ButtonStyle( shape: WidgetStateProperty.all(RoundedRectangleBorder( borderRadius: BorderRadius.circular(4), - side: BorderSide(color: Colors.white.withOpacity(.01)))), + side: BorderSide(color: Colors.white.withValues(alpha: .01)))), ))), locale: appState.appLocale, debugShowCheckedModeBanner: false, diff --git a/lib/provider/aria2c.freezed.dart b/lib/provider/aria2c.freezed.dart index 45b3696..98689ba 100644 --- a/lib/provider/aria2c.freezed.dart +++ b/lib/provider/aria2c.freezed.dart @@ -157,13 +157,13 @@ class _$Aria2cModelStateImpl (identical(other.aria2cDir, aria2cDir) || other.aria2cDir == aria2cDir) && (identical(other.aria2c, aria2c) || other.aria2c == aria2c) && - const DeepCollectionEquality() - .equals(other.aria2globalStat, aria2globalStat)); + (identical(other.aria2globalStat, aria2globalStat) || + other.aria2globalStat == aria2globalStat)); } @override - int get hashCode => Object.hash(runtimeType, aria2cDir, aria2c, - const DeepCollectionEquality().hash(aria2globalStat)); + int get hashCode => + Object.hash(runtimeType, aria2cDir, aria2c, aria2globalStat); /// Create a copy of Aria2cModelState /// with the given fields replaced by the non-null parameter values. diff --git a/lib/provider/unp4kc.freezed.dart b/lib/provider/unp4kc.freezed.dart index 1cacb5e..5940016 100644 --- a/lib/provider/unp4kc.freezed.dart +++ b/lib/provider/unp4kc.freezed.dart @@ -240,7 +240,7 @@ class _$Unp4kcStateImpl with DiagnosticableTreeMixin implements _Unp4kcState { other is _$Unp4kcStateImpl && (identical(other.startUp, startUp) || other.startUp == startUp) && const DeepCollectionEquality().equals(other._files, _files) && - const DeepCollectionEquality().equals(other.fs, fs) && + (identical(other.fs, fs) || other.fs == fs) && (identical(other.curPath, curPath) || other.curPath == curPath) && (identical(other.endMessage, endMessage) || other.endMessage == endMessage) && @@ -255,7 +255,7 @@ class _$Unp4kcStateImpl with DiagnosticableTreeMixin implements _Unp4kcState { runtimeType, startUp, const DeepCollectionEquality().hash(_files), - const DeepCollectionEquality().hash(fs), + fs, curPath, endMessage, tempOpenFile, diff --git a/lib/ui/about/about_ui.dart b/lib/ui/about/about_ui.dart index 9da7529..ad5a4e0 100644 --- a/lib/ui/about/about_ui.dart +++ b/lib/ui/about/about_ui.dart @@ -49,7 +49,8 @@ class AboutUI extends HookConsumerWidget { Text( S.current.about_app_description, style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.9)), + fontSize: 14, + color: Colors.white.withValues(alpha: .9)), ), ], ), @@ -68,7 +69,9 @@ class AboutUI extends HookConsumerWidget { child: Container( width: MediaQuery.of(context).size.width * .35, decoration: BoxDecoration( - color: FluentTheme.of(context).cardColor.withOpacity(.06), + color: FluentTheme.of(context) + .cardColor + .withValues(alpha: .06), borderRadius: BorderRadius.circular(12)), child: IconButton( icon: Padding( @@ -77,7 +80,8 @@ class AboutUI extends HookConsumerWidget { isTipTextCn.value ? tipTextCN : tipTextEN, textAlign: TextAlign.start, style: TextStyle( - fontSize: 12, color: Colors.white.withOpacity(.9)), + fontSize: 12, + color: Colors.white.withValues(alpha: .9)), ), ), onPressed: () { @@ -107,7 +111,7 @@ class AboutUI extends HookConsumerWidget { Text( S.current.about_action_btn_faq, style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.6)), + fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -124,7 +128,7 @@ class AboutUI extends HookConsumerWidget { Text( S.current.about_online_feedback, style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.6)), + fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -141,7 +145,7 @@ class AboutUI extends HookConsumerWidget { Text( S.current.about_action_qq_group, style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.6)), + fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -159,7 +163,7 @@ class AboutUI extends HookConsumerWidget { Text( S.current.about_action_email, style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.6)), + fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -176,7 +180,7 @@ class AboutUI extends HookConsumerWidget { Text( S.current.about_action_open_source, style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.6)), + fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -239,13 +243,14 @@ class AboutUI extends HookConsumerWidget { padding: const EdgeInsets.all(12), margin: const EdgeInsets.only(left: 18, right: 18), decoration: BoxDecoration( - color: FluentTheme.of(context).cardColor.withOpacity(.06), + color: FluentTheme.of(context).cardColor.withValues(alpha: .06), borderRadius: BorderRadius.circular(12)), child: Column( children: [ Text( names[name] ?? name, - style: TextStyle(fontSize: 13, color: Colors.white.withOpacity(.6)), + style: TextStyle( + fontSize: 13, color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 4), Row( @@ -279,4 +284,4 @@ class AboutUI extends HookConsumerWidget { } } } -} \ No newline at end of file +} diff --git a/lib/ui/guide/guide_ui.dart b/lib/ui/guide/guide_ui.dart index f76d813..2bc2bcd 100644 --- a/lib/ui/guide/guide_ui.dart +++ b/lib/ui/guide/guide_ui.dart @@ -101,7 +101,8 @@ class GuideUI extends HookConsumerWidget { child: Text( S.current.guide_info_game_download_note, style: TextStyle( - fontSize: 12, color: Colors.white.withOpacity(.6)), + fontSize: 12, + color: Colors.white.withValues(alpha: .6)), textAlign: TextAlign.end, ), ), diff --git a/lib/ui/home/dialogs/home_countdown_dialog_ui.dart b/lib/ui/home/dialogs/home_countdown_dialog_ui.dart index 2852a77..64968d9 100644 --- a/lib/ui/home/dialogs/home_countdown_dialog_ui.dart +++ b/lib/ui/home/dialogs/home_countdown_dialog_ui.dart @@ -24,7 +24,7 @@ class HomeCountdownDialogUI extends HookConsumerWidget { Navigator.of(context).pop(); }), const SizedBox(width: 12), - Text(S.current.home_holiday_countdown), + Text(S.current.home_holiday_countdown), ], ), content: homeState.countdownFestivalListData == null @@ -87,7 +87,8 @@ class HomeCountdownDialogUI extends HookConsumerWidget { Text( S.current.home_holiday_countdown_disclaimer, style: TextStyle( - fontSize: 13, color: Colors.white.withOpacity(.3)), + fontSize: 13, + color: Colors.white.withValues(alpha: .3)), ) ], ), @@ -95,4 +96,4 @@ class HomeCountdownDialogUI extends HookConsumerWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/ui/home/dialogs/home_md_content_dialog_ui.dart b/lib/ui/home/dialogs/home_md_content_dialog_ui.dart index decad33..bf8655f 100644 --- a/lib/ui/home/dialogs/home_md_content_dialog_ui.dart +++ b/lib/ui/home/dialogs/home_md_content_dialog_ui.dart @@ -37,7 +37,8 @@ class HomeMdContentDialogUI extends HookConsumerWidget { actions: [ FilledButton( child: Padding( - padding: const EdgeInsets.only(left: 8, right: 8, top: 2, bottom: 2), + padding: + const EdgeInsets.only(left: 8, right: 8, top: 2, bottom: 2), child: Text(S.current.action_close), ), onPressed: () { @@ -52,4 +53,4 @@ class HomeMdContentDialogUI extends HookConsumerWidget { final r = await RSHttp.getText(url); return r; } -} \ No newline at end of file +} diff --git a/lib/ui/home/downloader/home_downloader_ui.dart b/lib/ui/home/downloader/home_downloader_ui.dart index 5df51c9..2f28826 100644 --- a/lib/ui/home/downloader/home_downloader_ui.dart +++ b/lib/ui/home/downloader/home_downloader_ui.dart @@ -105,7 +105,7 @@ class HomeDownloaderUI extends HookConsumerWidget { decoration: BoxDecoration( color: FluentTheme.of(context) .cardColor - .withOpacity(.06), + .withValues(alpha: .06), borderRadius: BorderRadius.circular(7), ), child: Row( @@ -232,7 +232,7 @@ class HomeDownloaderUI extends HookConsumerWidget { itemCount: model.getTasksLen(), )), Container( - color: FluentTheme.of(context).cardColor.withOpacity(.06), + color: FluentTheme.of(context).cardColor.withValues(alpha: .06), child: Padding( padding: const EdgeInsets.only(left: 12, bottom: 3, top: 3), child: Row( diff --git a/lib/ui/home/downloader/home_downloader_ui_model.dart b/lib/ui/home/downloader/home_downloader_ui_model.dart index 5e2aaf0..1e4bdce 100644 --- a/lib/ui/home/downloader/home_downloader_ui_model.dart +++ b/lib/ui/home/downloader/home_downloader_ui_model.dart @@ -255,7 +255,7 @@ class HomeDownloaderUIModel extends _$HomeDownloaderUIModel { S.current.downloader_info_p2p_network_note, style: TextStyle( fontSize: 14, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ), const SizedBox(height: 24), @@ -266,7 +266,8 @@ class HomeDownloaderUIModel extends _$HomeDownloaderUIModel { TextFormBox( placeholder: "1、100k、10m、0", controller: upCtrl, - placeholderStyle: TextStyle(color: Colors.white.withOpacity(.6)), + placeholderStyle: + TextStyle(color: Colors.white.withValues(alpha: .6)), inputFormatters: [ifr], ), const SizedBox(height: 12), @@ -275,7 +276,8 @@ class HomeDownloaderUIModel extends _$HomeDownloaderUIModel { TextFormBox( placeholder: "1、100k、10m、0", controller: downCtrl, - placeholderStyle: TextStyle(color: Colors.white.withOpacity(.6)), + placeholderStyle: + TextStyle(color: Colors.white.withValues(alpha: .6)), inputFormatters: [ifr], ), const SizedBox(height: 24), @@ -283,7 +285,7 @@ class HomeDownloaderUIModel extends _$HomeDownloaderUIModel { S.current.downloader_input_info_p2p_upload_note, style: TextStyle( fontSize: 13, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ) ], diff --git a/lib/ui/home/downloader/home_downloader_ui_model.freezed.dart b/lib/ui/home/downloader/home_downloader_ui_model.freezed.dart index 8160928..88957e1 100644 --- a/lib/ui/home/downloader/home_downloader_ui_model.freezed.dart +++ b/lib/ui/home/downloader/home_downloader_ui_model.freezed.dart @@ -196,8 +196,8 @@ class _$HomeDownloaderUIStateImpl implements _HomeDownloaderUIState { .equals(other._waitingTasks, _waitingTasks) && const DeepCollectionEquality() .equals(other._stoppedTasks, _stoppedTasks) && - const DeepCollectionEquality() - .equals(other.globalStat, globalStat)); + (identical(other.globalStat, globalStat) || + other.globalStat == globalStat)); } @override @@ -206,7 +206,7 @@ class _$HomeDownloaderUIStateImpl implements _HomeDownloaderUIState { const DeepCollectionEquality().hash(_tasks), const DeepCollectionEquality().hash(_waitingTasks), const DeepCollectionEquality().hash(_stoppedTasks), - const DeepCollectionEquality().hash(globalStat)); + globalStat); /// Create a copy of HomeDownloaderUIState /// with the given fields replaced by the non-null parameter values. diff --git a/lib/ui/home/game_doctor/game_doctor_ui.dart b/lib/ui/home/game_doctor/game_doctor_ui.dart index 84017be..d6b1f4b 100644 --- a/lib/ui/home/game_doctor/game_doctor_ui.dart +++ b/lib/ui/home/game_doctor/game_doctor_ui.dart @@ -223,7 +223,7 @@ class HomeGameDoctorUI extends HookConsumerWidget { errorNames[item.key]?.value ?? S.current.doctor_info_result_no_solution), style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.7)), + fontSize: 14, color: Colors.white.withValues(alpha: .7)), ), ], ), @@ -264,7 +264,8 @@ class HomeGameDoctorUI extends HookConsumerWidget { Text( item.value, style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.7)), + fontSize: 14, + color: Colors.white.withValues(alpha: .7)), ), ], ), diff --git a/lib/ui/home/home_ui.dart b/lib/ui/home/home_ui.dart index 2788951..223082d 100644 --- a/lib/ui/home/home_ui.dart +++ b/lib/ui/home/home_ui.dart @@ -172,7 +172,7 @@ class HomeUI extends HookConsumerWidget { ? FluentIcons.stop_solid : FluentIcons.play_solid, color: homeState.isCurGameRunning - ? Colors.red.withOpacity(.8) + ? Colors.red.withValues(alpha: .8) : Colors.white, ), )), @@ -215,7 +215,7 @@ class HomeUI extends HookConsumerWidget { Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: FluentTheme.of(context).cardColor.withOpacity(.03), + color: FluentTheme.of(context).cardColor.withValues(alpha: .03), ), child: Padding( padding: const EdgeInsets.all(12), @@ -331,7 +331,7 @@ class HomeUI extends HookConsumerWidget { Positioned.fill( child: Container( decoration: BoxDecoration( - color: Colors.black.withOpacity(.3), + color: Colors.black.withValues(alpha: .3), borderRadius: BorderRadius.circular(12)), child: const Center( child: ProgressRing(), @@ -349,7 +349,7 @@ class HomeUI extends HookConsumerWidget { width: 316, height: 386, decoration: BoxDecoration( - color: Colors.white.withOpacity(.1), + color: Colors.white.withValues(alpha: .1), borderRadius: BorderRadius.circular(12)), child: SingleChildScrollView( child: Column( @@ -366,7 +366,7 @@ class HomeUI extends HookConsumerWidget { child: homeState.rssVideoItems == null ? Container( decoration: BoxDecoration( - color: Colors.white.withOpacity(.1)), + color: Colors.white.withValues(alpha: .1)), child: makeLoading(context), ) : Swiper( @@ -427,7 +427,7 @@ class HomeUI extends HookConsumerWidget { Icon( FluentIcons.chevron_right, size: 12, - color: Colors.white.withOpacity(.4), + color: Colors.white.withValues(alpha: .4), ) ], ), @@ -497,7 +497,9 @@ class HomeUI extends HookConsumerWidget { decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: states.isHovered - ? FluentTheme.of(context).cardColor.withOpacity(.1) + ? FluentTheme.of(context) + .cardColor + .withValues(alpha: .1) : FluentTheme.of(context).cardColor, ), child: Padding( @@ -506,7 +508,7 @@ class HomeUI extends HookConsumerWidget { children: [ Container( decoration: BoxDecoration( - color: Colors.white.withOpacity(.2), + color: Colors.white.withValues(alpha: .2), borderRadius: BorderRadius.circular(1000)), child: Padding( padding: const EdgeInsets.all(12), @@ -531,7 +533,7 @@ class HomeUI extends HookConsumerWidget { item.infoString, style: TextStyle( fontSize: 14, - color: Colors.white.withOpacity(.6)), + color: Colors.white.withValues(alpha: .6)), ), ], )), @@ -610,7 +612,7 @@ class HomeUI extends HookConsumerWidget { maxLines: 1, style: TextStyle( fontSize: 12, - color: Colors.white.withOpacity(.6)), + color: Colors.white.withValues(alpha: .6)), ), ) ], @@ -620,7 +622,7 @@ class HomeUI extends HookConsumerWidget { Icon( FluentIcons.chevron_right, size: 14, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ) ], ), @@ -691,7 +693,7 @@ class HomeUI extends HookConsumerWidget { Icon( FluentIcons.chevron_right, size: 12, - color: Colors.white.withOpacity(.4), + color: Colors.white.withValues(alpha: .4), ) ], ) @@ -766,7 +768,7 @@ class HomeUI extends HookConsumerWidget { Icon( FluentIcons.chevron_right, size: 14, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ) ], ); diff --git a/lib/ui/home/home_ui_model.dart b/lib/ui/home/home_ui_model.dart index e6cc447..98259fc 100644 --- a/lib/ui/home/home_ui_model.dart +++ b/lib/ui/home/home_ui_model.dart @@ -338,7 +338,9 @@ class HomeUIModel extends _$HomeUIModel { void onChangeInstallPath(String? value) { if (value == null) return; state = state.copyWith(scInstalledPath: value); - ref.read(localizationUIModelProvider.notifier).onChangeGameInstallPath(value); + ref + .read(localizationUIModelProvider.notifier) + .onChangeGameInstallPath(value); } doLaunchGame( diff --git a/lib/ui/home/input_method/input_method_dialog_ui.dart b/lib/ui/home/input_method/input_method_dialog_ui.dart index 1779c7d..7150e05 100644 --- a/lib/ui/home/input_method/input_method_dialog_ui.dart +++ b/lib/ui/home/input_method/input_method_dialog_ui.dart @@ -68,7 +68,7 @@ class InputMethodDialogUI extends HookConsumerWidget { controller: srcTextCtrl, maxLines: 5, placeholderStyle: - TextStyle(color: Colors.white.withOpacity(.6)), + TextStyle(color: Colors.white.withValues(alpha: .6)), style: TextStyle(fontSize: 16, color: Colors.white), onChanged: (str) async { final text = model.onTextChange("src", str); @@ -99,7 +99,7 @@ class InputMethodDialogUI extends HookConsumerWidget { controller: destTextCtrl, maxLines: 5, placeholderStyle: - TextStyle(color: Colors.white.withOpacity(.6)), + TextStyle(color: Colors.white.withValues(alpha: .6)), style: TextStyle(fontSize: 16, color: Colors.white), enabled: true, onChanged: (str) { @@ -163,7 +163,7 @@ class InputMethodDialogUI extends HookConsumerWidget { S.current.input_method_disclaimer, style: TextStyle( fontSize: 13, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ), ) diff --git a/lib/ui/home/input_method/input_method_dialog_ui_model.g.dart b/lib/ui/home/input_method/input_method_dialog_ui_model.g.dart index 01e5417..9e8c840 100644 --- a/lib/ui/home/input_method/input_method_dialog_ui_model.g.dart +++ b/lib/ui/home/input_method/input_method_dialog_ui_model.g.dart @@ -7,7 +7,7 @@ part of 'input_method_dialog_ui_model.dart'; // ************************************************************************** String _$inputMethodDialogUIModelHash() => - r'ec8d0bb5118b74fa12341ed8048dde9335f57878'; + r'397b36296183404c07298d83c14f4bce590375fc'; /// See also [InputMethodDialogUIModel]. @ProviderFor(InputMethodDialogUIModel) diff --git a/lib/ui/home/input_method/server.dart b/lib/ui/home/input_method/server.dart index 18105fa..f157039 100644 --- a/lib/ui/home/input_method/server.dart +++ b/lib/ui/home/input_method/server.dart @@ -214,4 +214,4 @@ class InputMethodServer extends _$InputMethodServer { return Response.notFound("Not Found"); } } -} \ No newline at end of file +} diff --git a/lib/ui/home/input_method/server_qr_dialog_ui.dart b/lib/ui/home/input_method/server_qr_dialog_ui.dart index e2bd596..f5d4cbc 100644 --- a/lib/ui/home/input_method/server_qr_dialog_ui.dart +++ b/lib/ui/home/input_method/server_qr_dialog_ui.dart @@ -10,7 +10,6 @@ import 'server.dart'; part 'server_qr_dialog_ui.g.dart'; - @riverpod class ServerQrState extends _$ServerQrState { @override @@ -62,7 +61,7 @@ class ServerQrDialogUI extends HookConsumerWidget { ] else Text( S.current.input_method_scan_qr_code, - style: TextStyle(color: Colors.white.withOpacity(.8)), + style: TextStyle(color: Colors.white.withValues(alpha: .8)), ), SizedBox(height: 24), Row( @@ -97,7 +96,8 @@ class ServerQrDialogUI extends HookConsumerWidget { hasMultipleUrls ? "${urls[index.value]} (${index.value + 1} / ${urls.length})" : urls[index.value], - style: TextStyle(fontSize: 13, color: Colors.white.withOpacity(.6)), + style: TextStyle( + fontSize: 13, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -120,4 +120,4 @@ class ServerQrDialogUI extends HookConsumerWidget { ], ); } -} \ No newline at end of file +} diff --git a/lib/ui/home/localization/advanced_localization_ui.dart b/lib/ui/home/localization/advanced_localization_ui.dart index 06c7276..6236734 100644 --- a/lib/ui/home/localization/advanced_localization_ui.dart +++ b/lib/ui/home/localization/advanced_localization_ui.dart @@ -137,7 +137,7 @@ class AdvancedLocalizationUI extends HookConsumerWidget { return Container( padding: const EdgeInsets.only(top: 6, bottom: 12), decoration: BoxDecoration( - color: Colors.white.withOpacity(.05), + color: Colors.white.withValues(alpha: .05), borderRadius: BorderRadius.circular(4), ), child: Column( @@ -161,13 +161,13 @@ class AdvancedLocalizationUI extends HookConsumerWidget { "${item.valuesMap.length}", style: TextStyle( fontSize: 14, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ), const SizedBox(width: 6), Icon( FluentIcons.chevron_right, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), size: 16, ), ], @@ -178,7 +178,7 @@ class AdvancedLocalizationUI extends HookConsumerWidget { margin: const EdgeInsets.only(top: 6, bottom: 12), width: MediaQuery.of(context).size.width, height: 1, - color: Colors.white.withOpacity(.1), + color: Colors.white.withValues(alpha: .1), ), if (item.isWorking) Column( diff --git a/lib/ui/home/localization/advanced_localization_ui_model.dart b/lib/ui/home/localization/advanced_localization_ui_model.dart index a959ced..31656ea 100644 --- a/lib/ui/home/localization/advanced_localization_ui_model.dart +++ b/lib/ui/home/localization/advanced_localization_ui_model.dart @@ -321,8 +321,8 @@ class AdvancedLocalizationUIModel extends _$AdvancedLocalizationUIModel { // ignore: avoid_build_context_in_providers Future onInstall(BuildContext context) async { var isEnableCommunityInputMethod = true; - final userOK = await showConfirmDialogs(context, - S.current.input_method_confirm_install_advanced_localization, + final userOK = await showConfirmDialogs( + context, S.current.input_method_confirm_install_advanced_localization, HookConsumer( builder: (BuildContext context, WidgetRef ref, Widget? child) { final globalIni = useState(null); diff --git a/lib/ui/home/localization/localization_dialog_ui.dart b/lib/ui/home/localization/localization_dialog_ui.dart index c6d99f8..4196769 100644 --- a/lib/ui/home/localization/localization_dialog_ui.dart +++ b/lib/ui/home/localization/localization_dialog_ui.dart @@ -158,7 +158,7 @@ class LocalizationDialogUI extends HookConsumerWidget { ), const SizedBox(height: 12), Container( - color: Colors.white.withOpacity(.1), + color: Colors.white.withValues(alpha: .1), height: 1, ), const SizedBox(height: 12), @@ -171,7 +171,7 @@ class LocalizationDialogUI extends HookConsumerWidget { .localization_info_no_translation_available, style: TextStyle( fontSize: 13, - color: Colors.white.withOpacity(.8)), + color: Colors.white.withValues(alpha: .8)), ), ) else @@ -217,7 +217,7 @@ class LocalizationDialogUI extends HookConsumerWidget { child: Container( padding: const EdgeInsets.all(12), decoration: BoxDecoration( - color: Colors.white.withOpacity(tapDisabled ? .03 : .05), + color: Colors.white.withValues(alpha: tapDisabled ? .03 : .05), borderRadius: BorderRadius.circular(7), ), child: Column( @@ -237,19 +237,22 @@ class LocalizationDialogUI extends HookConsumerWidget { Text( S.current.localization_info_version_number( item.value.versionName ?? ""), - style: TextStyle(color: Colors.white.withOpacity(.6)), + style: TextStyle( + color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 4), Text( S.current.localization_info_channel( item.value.gameChannel ?? ""), - style: TextStyle(color: Colors.white.withOpacity(.6)), + style: TextStyle( + color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 4), Text( S.current.localization_info_update_time( item.value.updateAt ?? ""), - style: TextStyle(color: Colors.white.withOpacity(.6)), + style: TextStyle( + color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -266,7 +269,7 @@ class LocalizationDialogUI extends HookConsumerWidget { : isItemEnabled ? FluentIcons.download : FluentIcons.disable_updates, - color: Colors.white.withOpacity(.8), + color: Colors.white.withValues(alpha: .8), size: 18, ), const SizedBox(width: 6), @@ -277,7 +280,7 @@ class LocalizationDialogUI extends HookConsumerWidget { ? S.current.localization_action_install : S.current.localization_info_unavailable), style: TextStyle( - color: Colors.white.withOpacity(.8), + color: Colors.white.withValues(alpha: .8), ), ), const SizedBox(width: 6), @@ -285,7 +288,7 @@ class LocalizationDialogUI extends HookConsumerWidget { Icon( FluentIcons.chevron_right, size: 14, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ) ] ], @@ -297,7 +300,7 @@ class LocalizationDialogUI extends HookConsumerWidget { maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( - color: Colors.white.withOpacity(.4), + color: Colors.white.withValues(alpha: .4), fontSize: 13, ), ), @@ -342,7 +345,7 @@ class LocalizationDialogUI extends HookConsumerWidget { height: 6, ), Container( - color: Colors.white.withOpacity(.1), + color: Colors.white.withValues(alpha: .1), height: 1, ), const SizedBox(height: 12), @@ -496,7 +499,7 @@ class LocalizationDialogUI extends HookConsumerWidget { Icon( FluentIcons.chevron_right, size: 14, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ) ], ), diff --git a/lib/ui/home/localization/localization_form_file_dialog_ui.dart b/lib/ui/home/localization/localization_form_file_dialog_ui.dart index 487309b..23192ed 100644 --- a/lib/ui/home/localization/localization_form_file_dialog_ui.dart +++ b/lib/ui/home/localization/localization_form_file_dialog_ui.dart @@ -90,7 +90,7 @@ class LocalizationFromFileDialogUI extends HookConsumerWidget { Center( child: Container( decoration: BoxDecoration( - color: Colors.white.withOpacity(.05), + color: Colors.white.withValues(alpha: .05), borderRadius: BorderRadius.circular(7), ), padding: const EdgeInsets.all(12), @@ -104,7 +104,7 @@ class LocalizationFromFileDialogUI extends HookConsumerWidget { Icon( FluentIcons.file_code, size: 32, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), const SizedBox(height: 12), Text(S.current @@ -122,7 +122,7 @@ class LocalizationFromFileDialogUI extends HookConsumerWidget { Expanded( child: Container( decoration: BoxDecoration( - color: Colors.white.withOpacity(.05), + color: Colors.white.withValues(alpha: .05), borderRadius: BorderRadius.circular(7), ), padding: const EdgeInsets.all(6), @@ -138,7 +138,8 @@ class LocalizationFromFileDialogUI extends HookConsumerWidget { Row( children: [ Text( - S.current.input_method_install_community_input_method_support, + S.current + .input_method_install_community_input_method_support, ), Spacer(), ToggleSwitch( @@ -160,4 +161,4 @@ class LocalizationFromFileDialogUI extends HookConsumerWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/ui/home/localization/localization_ui_model.dart b/lib/ui/home/localization/localization_ui_model.dart index 474d9a8..28cfd5d 100644 --- a/lib/ui/home/localization/localization_ui_model.dart +++ b/lib/ui/home/localization/localization_ui_model.dart @@ -1,5 +1,6 @@ // ignore_for_file: avoid_build_context_in_providers import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:archive/archive_io.dart'; @@ -421,13 +422,14 @@ class LocalizationUIModel extends _$LocalizationUIModel { static StringBuffer readArchive(String savePath) { final inputStream = InputFileStream(savePath); - final archive = - TarDecoder().decodeBytes(GZipDecoder().decodeBuffer(inputStream)); + final output = GZipDecoder().decodeBytes(inputStream.toUint8List()); + final archive = TarDecoder().decodeBytes(output); StringBuffer globalIni = StringBuffer(""); for (var element in archive.files) { if (element.name.contains("global.ini")) { - for (var value - in (element.rawContent?.readString() ?? "").split("\n")) { + if (element.rawContent == null) continue; + final stringContent = utf8.decode(element.rawContent!.readBytes()); + for (var value in (stringContent).split("\n")) { final tv = value.trim(); if (tv.isNotEmpty) globalIni.writeln(value); } @@ -642,19 +644,19 @@ class LocalizationUIModel extends _$LocalizationUIModel { Text( S.current.localization_info_version_number( item.value.versionName ?? ""), - style: TextStyle(color: Colors.white.withOpacity(.6)), + style: TextStyle(color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 4), Text( S.current .localization_info_channel(item.value.gameChannel ?? ""), - style: TextStyle(color: Colors.white.withOpacity(.6)), + style: TextStyle(color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 4), Text( S.current .localization_info_update_time(item.value.updateAt ?? ""), - style: TextStyle(color: Colors.white.withOpacity(.6)), + style: TextStyle(color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 12), ], diff --git a/lib/ui/home/performance/performance_ui.dart b/lib/ui/home/performance/performance_ui.dart index b598765..381165a 100644 --- a/lib/ui/home/performance/performance_ui.dart +++ b/lib/ui/home/performance/performance_ui.dart @@ -171,7 +171,8 @@ class HomePerformanceUI extends HookConsumerWidget { ), const SizedBox(height: 6), Container( - color: FluentTheme.of(context).cardColor.withOpacity(.2), + color: + FluentTheme.of(context).cardColor.withValues(alpha: .2), height: 1), const SizedBox(height: 6), for (final item in group.value) makeItem(context, item, model) @@ -259,8 +260,8 @@ class HomePerformanceUI extends HookConsumerWidget { const SizedBox(height: 12), Text( "${item.info}", - style: - TextStyle(fontSize: 14, color: Colors.white.withOpacity(.6)), + style: TextStyle( + fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], const SizedBox(height: 12), @@ -271,13 +272,13 @@ class HomePerformanceUI extends HookConsumerWidget { Text( S.current.performance_info_min_max_values( item.key ?? "", item.min ?? "", item.max ?? ""), - style: TextStyle(color: Colors.white.withOpacity(.6)), + style: TextStyle(color: Colors.white.withValues(alpha: .6)), ) ], ), const SizedBox(height: 6), Container( - color: FluentTheme.of(context).cardColor.withOpacity(.1), + color: FluentTheme.of(context).cardColor.withValues(alpha: .1), height: 1), ], ), diff --git a/lib/ui/index_ui.dart b/lib/ui/index_ui.dart index b86ca16..ef033c4 100644 --- a/lib/ui/index_ui.dart +++ b/lib/ui/index_ui.dart @@ -60,7 +60,7 @@ class IndexUI extends HookConsumerWidget { child: Icon( FluentIcons.installation, size: 22, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ), _makeAria2TaskNumWidget() diff --git a/lib/ui/settings/settings_ui.dart b/lib/ui/settings/settings_ui.dart index 4c4ec47..579aca7 100644 --- a/lib/ui/settings/settings_ui.dart +++ b/lib/ui/settings/settings_ui.dart @@ -136,7 +136,8 @@ class SettingsUI extends HookConsumerWidget { subTitle, textAlign: TextAlign.start, style: TextStyle( - fontSize: 12, color: Colors.white.withOpacity(.6)), + fontSize: 12, + color: Colors.white.withValues(alpha: .6)), ), ), ] diff --git a/lib/ui/settings/settings_ui_model.g.dart b/lib/ui/settings/settings_ui_model.g.dart index 674d917..759f19f 100644 --- a/lib/ui/settings/settings_ui_model.g.dart +++ b/lib/ui/settings/settings_ui_model.g.dart @@ -6,7 +6,7 @@ part of 'settings_ui_model.dart'; // RiverpodGenerator // ************************************************************************** -String _$settingsUIModelHash() => r'00662390cfeab943929fe4820665de211f9ec8ef'; +String _$settingsUIModelHash() => r'4b7900c3f77f4d5ff1836cbf700af374b62c943f'; /// See also [SettingsUIModel]. @ProviderFor(SettingsUIModel) diff --git a/lib/ui/settings/upgrade_dialog.dart b/lib/ui/settings/upgrade_dialog.dart index 9042759..5d5f33a 100644 --- a/lib/ui/settings/upgrade_dialog.dart +++ b/lib/ui/settings/upgrade_dialog.dart @@ -84,12 +84,13 @@ class UpgradeDialogUI extends HookConsumerWidget { child: Container( padding: const EdgeInsets.all(12), decoration: BoxDecoration( - color: Colors.white.withOpacity(.1), + color: Colors.white.withValues(alpha: .1), borderRadius: BorderRadius.circular(7)), child: Text( S.current.app_upgrade_info_update_server_tip, style: TextStyle( - fontSize: 14, color: Colors.white.withOpacity(.7)), + fontSize: 14, + color: Colors.white.withValues(alpha: .7)), ), ), ), diff --git a/lib/ui/tools/dialogs/rsi_launcher_enhance_dialog_ui.dart b/lib/ui/tools/dialogs/rsi_launcher_enhance_dialog_ui.dart index 065a6f6..ff2989f 100644 --- a/lib/ui/tools/dialogs/rsi_launcher_enhance_dialog_ui.dart +++ b/lib/ui/tools/dialogs/rsi_launcher_enhance_dialog_ui.dart @@ -155,7 +155,7 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget { S.current.tools_rsi_launcher_enhance_msg_version( assarState.value?.version ?? ""), style: TextStyle( - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ), ), @@ -165,7 +165,7 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget { ? S.current.localization_info_installed : S.current.tools_action_info_not_installed), style: TextStyle( - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ) ], @@ -196,7 +196,7 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget { .tools_rsi_launcher_enhance_subtitle_localization, style: TextStyle( fontSize: 13, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ), ], @@ -283,7 +283,7 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget { .tools_rsi_launcher_enhance_subtitle_download_booster, style: TextStyle( fontSize: 13, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ), ), ], @@ -313,7 +313,7 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget { Text( S.current.tools_rsi_launcher_enhance_msg_uninstall, style: TextStyle( - color: Colors.white.withOpacity(.6), fontSize: 13), + color: Colors.white.withValues(alpha: .6), fontSize: 13), ), ], ], @@ -414,13 +414,14 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget { static StringBuffer _readArchive((String savePath, String fileName) data) { final inputStream = InputFileStream(data.$1); - final archive = - TarDecoder().decodeBytes(GZipDecoder().decodeBuffer(inputStream)); + final output = GZipDecoder().decodeBytes(inputStream.toUint8List()); + final archive = TarDecoder().decodeBytes(output); StringBuffer dataBuffer = StringBuffer(""); for (var element in archive.files) { + if (element.rawContent == null) continue; + final stringContent = utf8.decode(element.rawContent!.readBytes()); if (element.name.endsWith(data.$2)) { - for (var value - in (element.rawContent?.readString() ?? "").split("\n")) { + for (var value in (stringContent).split("\n")) { final tv = value; if (tv.isNotEmpty) dataBuffer.writeln(tv); } @@ -479,4 +480,4 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget { } return scriptBuffer.toString(); } -} \ No newline at end of file +} diff --git a/lib/ui/tools/tools_ui.dart b/lib/ui/tools/tools_ui.dart index f089143..a34cfc7 100644 --- a/lib/ui/tools/tools_ui.dart +++ b/lib/ui/tools/tools_ui.dart @@ -106,7 +106,8 @@ class ToolsUI extends HookConsumerWidget { children: [ Container( decoration: BoxDecoration( - color: Colors.white.withOpacity(.2), + color: + Colors.white.withValues(alpha: .2), borderRadius: BorderRadius.circular(1000)), child: Padding( @@ -128,7 +129,7 @@ class ToolsUI extends HookConsumerWidget { item.infoString, style: TextStyle( fontSize: 14, - color: Colors.white.withOpacity(.6)), + color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 12), Row( diff --git a/lib/ui/tools/unp4kc/unp4kc_ui.dart b/lib/ui/tools/unp4kc/unp4kc_ui.dart index d4acc6e..3956fd2 100644 --- a/lib/ui/tools/unp4kc/unp4kc_ui.dart +++ b/lib/ui/tools/unp4kc/unp4kc_ui.dart @@ -59,7 +59,9 @@ class UnP4kcUI extends HookConsumerWidget { children: [ Container( decoration: BoxDecoration( - color: FluentTheme.of(context).cardColor.withOpacity(.06)), + color: FluentTheme.of(context) + .cardColor + .withValues(alpha: .06)), height: 36, padding: const EdgeInsets.only(left: 12, right: 12), child: SuperListView.builder( @@ -95,7 +97,9 @@ class UnP4kcUI extends HookConsumerWidget { Container( width: MediaQuery.of(context).size.width * .3, decoration: BoxDecoration( - color: FluentTheme.of(context).cardColor.withOpacity(.01), + color: FluentTheme.of(context) + .cardColor + .withValues(alpha: .01), ), child: SuperListView.builder( padding: const EdgeInsets.only( @@ -110,7 +114,7 @@ class UnP4kcUI extends HookConsumerWidget { decoration: BoxDecoration( color: FluentTheme.of(context) .cardColor - .withOpacity(.05), + .withValues(alpha: .05), ), child: IconButton( onPressed: () { @@ -164,7 +168,7 @@ class UnP4kcUI extends HookConsumerWidget { style: TextStyle( fontSize: 10, color: Colors.white - .withOpacity(.6)), + .withValues(alpha: .6)), ), const SizedBox(width: 12), Text( @@ -172,7 +176,7 @@ class UnP4kcUI extends HookConsumerWidget { style: TextStyle( fontSize: 10, color: Colors.white - .withOpacity(.6)), + .withValues(alpha: .6)), ), ], ), @@ -184,7 +188,7 @@ class UnP4kcUI extends HookConsumerWidget { Icon( FluentIcons.chevron_right, size: 14, - color: Colors.white.withOpacity(.6), + color: Colors.white.withValues(alpha: .6), ) ], ), diff --git a/packages/sct_dev_tools/bin/auto_l10n.dart b/packages/sct_dev_tools/bin/auto_l10n.dart index 215bc42..29f0295 100644 --- a/packages/sct_dev_tools/bin/auto_l10n.dart +++ b/packages/sct_dev_tools/bin/auto_l10n.dart @@ -48,8 +48,7 @@ class AutoL10nTools { final j = json.encode(outputMap); File("./lib/generated/l10n_temp.json").writeAsStringSync(j); print( - "output to json file (length: ${outputMap - .length}): ./lib/generated/l10n_temp.json"); + "output to json file (length: ${outputMap.length}): ./lib/generated/l10n_temp.json"); } } @@ -76,10 +75,9 @@ class AutoL10nTools { // sort map with value length final newMap = Map.fromEntries( jsonMap.entries.toList() - ..sort((a, b) => - (b.value.toString()) - .length - .compareTo((a.value.toString()).length)), + ..sort((a, b) => (b.value.toString()) + .length + .compareTo((a.value.toString()).length)), ); _replaceDartFile(entity, newMap); } @@ -91,9 +89,9 @@ class AutoL10nTools { final toFile = File("./lib/l10n/intl_$to.arb"); final translator = GoogleTranslator(); final formMap = - json.decode(formFile.readAsStringSync()) as Map; + json.decode(formFile.readAsStringSync()) as Map; final toMap = - json.decode(toFile.readAsStringSync()) as Map; + json.decode(toFile.readAsStringSync()) as Map; final formLocaleCode = formMap["@@auto_translate_locale"].toString(); final toLocaleCode = toMap["@@auto_translate_locale"].toString(); diff --git a/pubspec.yaml b/pubspec.yaml index 88a41a8..1e7427b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,6 +10,7 @@ environment: dependencies: flutter: sdk: flutter + flutter_localizations: sdk: flutter flutter_riverpod: ^2.6.1 @@ -36,13 +37,13 @@ dependencies: file_sizes: ^1.0.6 desktop_webview_window: ^0.2.3 flutter_svg: ^2.0.7 - archive: ^3.4.4 + archive: ^4.0.1 jwt_decode: ^0.3.1 uuid: ^4.1.0 flutter_tilt: ^3.0.0 card_swiper: ^3.0.1 ffi: ^2.1.0 - flutter_rust_bridge: 2.6.0 + flutter_rust_bridge: ^2.7.0 freezed_annotation: ^2.4.1 meta: ^1.9.1 hexcolor: ^3.0.1 @@ -80,7 +81,7 @@ dev_dependencies: riverpod_generator: ^2.6.2 custom_lint: ^0.7.0 riverpod_lint: ^2.6.2 - ffigen: ^15.0.0 + ffigen: ^16.0.0 sct_dev_tools: path: ./packages/sct_dev_tools diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 160d59d..78b4ebf 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -11,7 +11,7 @@ strip = "debuginfo" crate-type = ["cdylib", "staticlib"] [dependencies] -flutter_rust_bridge = "=2.6.0" +flutter_rust_bridge = "=2.7.0" tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "process"] } futures = { version = "0.3", default-features = false, features = ["executor"] } url = "2.5" diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 2be8edc..1c71df7 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.6.0. +// @generated by `flutter_rust_bridge`@ 2.7.0. #![allow( non_camel_case_types, @@ -36,7 +36,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_opaque = RustOpaqueNom, default_rust_auto_opaque = RustAutoOpaqueNom, ); -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.6.0"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.7.0"; pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1832496273; // Section: executor @@ -1144,7 +1144,7 @@ impl SseEncode for () { #[cfg(not(target_family = "wasm"))] mod io { // This file is automatically generated, so please do not edit it. - // @generated by `flutter_rust_bridge`@ 2.6.0. + // @generated by `flutter_rust_bridge`@ 2.7.0. // Section: imports diff --git a/test/widget_test.dart b/test/widget_test.dart index e21f854..a411608 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -5,8 +5,6 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. - - void main() { // testWidgets('Counter increments smoke test', (WidgetTester tester) async { // // Build our app and trigger a frame.