From 427b43fcb8428fd9165a24740996a85d92d940fa Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Sat, 14 Jan 2023 01:53:38 +0800 Subject: [PATCH] Update dependency --- app/lib/bloc/settings/expert.dart | 4 +-- app/lib/bloc/settings/expert.g.dart | 28 ++++++++++++++------ app/lib/bloc/settings/theme.dart | 2 +- app/lib/bloc/settings/theme.g.dart | 41 ++++++++++++++++++----------- app/pubspec.lock | 12 ++++----- app/pubspec.yaml | 4 +-- 6 files changed, 57 insertions(+), 34 deletions(-) diff --git a/app/lib/bloc/settings/expert.dart b/app/lib/bloc/settings/expert.dart index 53deb132..ade8f1f6 100644 --- a/app/lib/bloc/settings/expert.dart +++ b/app/lib/bloc/settings/expert.dart @@ -10,7 +10,7 @@ import 'package:to_string/to_string.dart'; part 'expert.g.dart'; -@autoCopyWith +@genCopyWith @toString class ExpertSettingsState { const ExpertSettingsState({ @@ -67,7 +67,7 @@ class ExpertSettingsBloc await db.insertAccountOf(a); } }); - emit(state.copyWith(lastSuccessful: Nullable(ev))); + emit(state.copyWith(lastSuccessful: ev)); } catch (e, stackTrace) { _log.shout("[_onClearCacheDatabase] Uncaught exception", e, stackTrace); _errorStream.add(ExpertSettingsError(ev, e, stackTrace)); diff --git a/app/lib/bloc/settings/expert.g.dart b/app/lib/bloc/settings/expert.g.dart index b8ccd958..eb5583f6 100644 --- a/app/lib/bloc/settings/expert.g.dart +++ b/app/lib/bloc/settings/expert.g.dart @@ -6,17 +6,29 @@ part of 'expert.dart'; // CopyWithGenerator // ************************************************************************** -extension $ExpertSettingsStateCopyWith on ExpertSettingsState { - ExpertSettingsState copyWith( - {Nullable? lastSuccessful}) => - _$copyWith(lastSuccessful: lastSuccessful); +abstract class $ExpertSettingsStateCopyWithWorker { + ExpertSettingsState call({ExpertSettingsEvent? lastSuccessful}); +} - ExpertSettingsState _$copyWith( - {Nullable? lastSuccessful}) { +class _$ExpertSettingsStateCopyWithWorkerImpl + implements $ExpertSettingsStateCopyWithWorker { + _$ExpertSettingsStateCopyWithWorkerImpl(this.that); + + @override + ExpertSettingsState call({dynamic lastSuccessful = copyWithNull}) { return ExpertSettingsState( - lastSuccessful: - lastSuccessful != null ? lastSuccessful.obj : this.lastSuccessful); + lastSuccessful: lastSuccessful == copyWithNull + ? that.lastSuccessful + : lastSuccessful as ExpertSettingsEvent?); } + + final ExpertSettingsState that; +} + +extension $ExpertSettingsStateCopyWith on ExpertSettingsState { + $ExpertSettingsStateCopyWithWorker get copyWith => _$copyWith; + $ExpertSettingsStateCopyWithWorker get _$copyWith => + _$ExpertSettingsStateCopyWithWorkerImpl(this); } // ************************************************************************** diff --git a/app/lib/bloc/settings/theme.dart b/app/lib/bloc/settings/theme.dart index e835e1d3..4f858f49 100644 --- a/app/lib/bloc/settings/theme.dart +++ b/app/lib/bloc/settings/theme.dart @@ -14,7 +14,7 @@ import 'package:to_string/to_string.dart'; part 'theme.g.dart'; -@autoCopyWith +@genCopyWith @toString class ThemeSettingsState { const ThemeSettingsState({ diff --git a/app/lib/bloc/settings/theme.g.dart b/app/lib/bloc/settings/theme.g.dart index 2d62caef..108f9a46 100644 --- a/app/lib/bloc/settings/theme.g.dart +++ b/app/lib/bloc/settings/theme.g.dart @@ -6,26 +6,37 @@ part of 'theme.dart'; // CopyWithGenerator // ************************************************************************** -extension $ThemeSettingsStateCopyWith on ThemeSettingsState { - ThemeSettingsState copyWith( - {bool? isFollowSystemTheme, - bool? isUseBlackInDarkTheme, - Color? seedColor}) => - _$copyWith( - isFollowSystemTheme: isFollowSystemTheme, - isUseBlackInDarkTheme: isUseBlackInDarkTheme, - seedColor: seedColor); - - ThemeSettingsState _$copyWith( +abstract class $ThemeSettingsStateCopyWithWorker { + ThemeSettingsState call( {bool? isFollowSystemTheme, bool? isUseBlackInDarkTheme, - Color? seedColor}) { + Color? seedColor}); +} + +class _$ThemeSettingsStateCopyWithWorkerImpl + implements $ThemeSettingsStateCopyWithWorker { + _$ThemeSettingsStateCopyWithWorkerImpl(this.that); + + @override + ThemeSettingsState call( + {dynamic isFollowSystemTheme, + dynamic isUseBlackInDarkTheme, + dynamic seedColor}) { return ThemeSettingsState( - isFollowSystemTheme: isFollowSystemTheme ?? this.isFollowSystemTheme, + isFollowSystemTheme: + isFollowSystemTheme as bool? ?? that.isFollowSystemTheme, isUseBlackInDarkTheme: - isUseBlackInDarkTheme ?? this.isUseBlackInDarkTheme, - seedColor: seedColor ?? this.seedColor); + isUseBlackInDarkTheme as bool? ?? that.isUseBlackInDarkTheme, + seedColor: seedColor as Color? ?? that.seedColor); } + + final ThemeSettingsState that; +} + +extension $ThemeSettingsStateCopyWith on ThemeSettingsState { + $ThemeSettingsStateCopyWithWorker get copyWith => _$copyWith; + $ThemeSettingsStateCopyWithWorker get _$copyWith => + _$ThemeSettingsStateCopyWithWorkerImpl(this); } // ************************************************************************** diff --git a/app/pubspec.lock b/app/pubspec.lock index 355cbaac..b264e96c 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -301,20 +301,20 @@ packages: dependency: "direct main" description: path: copy_with - ref: "copy_with-1.0.0" - resolved-ref: c3ef6b3b5337f99ee7c0e1fb655bacf635d8b072 + ref: "copy_with-1.2.0" + resolved-ref: c7522d73c206268302dca99b092e59e49b4fc085 url: "https://gitlab.com/nkming2/dart-copy-with" source: git - version: "1.0.0" + version: "1.2.0" copy_with_build: dependency: "direct dev" description: path: copy_with_build - ref: "copy_with_build-1.0.0" - resolved-ref: "8303676d56dc16bc2fb1e38ad95c5d97b493e613" + ref: "copy_with_build-1.2.0" + resolved-ref: c7522d73c206268302dca99b092e59e49b4fc085 url: "https://gitlab.com/nkming2/dart-copy-with" source: git - version: "1.0.0" + version: "1.2.0" coverage: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 9197d336..198e2076 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -44,7 +44,7 @@ dependencies: git: url: https://gitlab.com/nkming2/dart-copy-with path: copy_with - ref: copy_with-1.0.0 + ref: copy_with-1.2.0 devicelocale: ^0.5.0 device_info_plus: ^4.0.0 draggable_scrollbar: @@ -133,7 +133,7 @@ dev_dependencies: git: url: https://gitlab.com/nkming2/dart-copy-with path: copy_with_build - ref: copy_with_build-1.0.0 + ref: copy_with_build-1.2.0 drift_dev: ^1.7.0 flutter_lints: ^2.0.1 flutter_test: