From 2f48b1187a2795134475d359374c86744fec16b4 Mon Sep 17 00:00:00 2001 From: Roman Cinis <52065414+tsinis@users.noreply.github.com> Date: Fri, 8 Jul 2022 20:25:12 +0200 Subject: [PATCH] Update Dependencies --- lib/about/blocs/about_event.freezed.dart | 2 +- lib/about/blocs/about_state.freezed.dart | 4 +- lib/app/theme/app_theme.dart | 50 +++++++++---------- .../blocs/colorpicker_event.freezed.dart | 2 +- lib/core/ui/view/main_screen.dart | 7 +-- .../blocs/navigation_event.freezed.dart | 2 +- lib/share/blocs/share_event.freezed.dart | 12 ++--- lib/share/blocs/share_state.freezed.dart | 8 +-- pubspec.lock | 10 ++-- pubspec.yaml | 8 ++- snap/snapcraft.yaml | 3 +- 11 files changed, 57 insertions(+), 51 deletions(-) diff --git a/lib/about/blocs/about_event.freezed.dart b/lib/about/blocs/about_event.freezed.dart index 7fe2b14c..1513185a 100644 --- a/lib/about/blocs/about_event.freezed.dart +++ b/lib/about/blocs/about_event.freezed.dart @@ -1071,7 +1071,7 @@ abstract class _AboutStarted implements AboutEvent { const factory _AboutStarted({required final String currentLocale}) = _$_AboutStarted; - String get currentLocale => throw _privateConstructorUsedError; + String get currentLocale; @JsonKey(ignore: true) _$$_AboutStartedCopyWith<_$_AboutStarted> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/about/blocs/about_state.freezed.dart b/lib/about/blocs/about_state.freezed.dart index e19c127b..057d2a89 100644 --- a/lib/about/blocs/about_state.freezed.dart +++ b/lib/about/blocs/about_state.freezed.dart @@ -457,7 +457,7 @@ abstract class _AboutLoaded implements AboutState { const factory _AboutLoaded({required final String appVersion}) = _$_AboutLoaded; - String get appVersion => throw _privateConstructorUsedError; + String get appVersion; @JsonKey(ignore: true) _$$_AboutLoadedCopyWith<_$_AboutLoaded> get copyWith => throw _privateConstructorUsedError; @@ -604,7 +604,7 @@ abstract class _AboutStarted implements AboutState { const factory _AboutStarted({required final String currentLocale}) = _$_AboutStarted; - String get currentLocale => throw _privateConstructorUsedError; + String get currentLocale; @JsonKey(ignore: true) _$$_AboutStartedCopyWith<_$_AboutStarted> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/app/theme/app_theme.dart b/lib/app/theme/app_theme.dart index 654440fa..08232f9e 100644 --- a/lib/app/theme/app_theme.dart +++ b/lib/app/theme/app_theme.dart @@ -4,36 +4,36 @@ import 'package:flutter/scheduler.dart' show SchedulerBinding; class AppTheme { final bool? isDark; - static const Color _grey800 = Color(0xFF424242); // Constant value of Colors.grey[800]. + static const Color _grey800 = Color(0xFF424242); // Constant value of Colors.grey.shade800. static const VisualDensity _visualDensity = VisualDensity.standard; final ThemeData _darkTheme = ThemeData.from( colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.grey, brightness: Brightness.dark).copyWith( error: Colors.red, - secondary: Colors.grey[600], + secondary: Colors.grey.shade600, ), ).copyWith( useMaterial3: true, - scaffoldBackgroundColor: Colors.grey[700], + scaffoldBackgroundColor: Colors.grey.shade700, checkboxTheme: CheckboxThemeData(fillColor: MaterialStateProperty.all(Colors.grey)), focusColor: Colors.grey, - indicatorColor: Colors.teal[200], - disabledColor: Colors.grey[600], + indicatorColor: Colors.teal.shade200, + disabledColor: Colors.grey.shade600, primaryIconTheme: IconThemeData(color: Colors.grey[350]), appBarTheme: const AppBarTheme(shadowColor: Colors.black54, elevation: 2), - radioTheme: RadioThemeData(fillColor: MaterialStateProperty.all(Colors.grey[400])), + radioTheme: RadioThemeData(fillColor: MaterialStateProperty.all(Colors.grey.shade400)), textButtonTheme: TextButtonThemeData(style: TextButton.styleFrom(primary: Colors.grey[350])), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( - primary: Colors.grey[800], + primary: Colors.grey.shade800, onPrimary: Colors.grey[350], visualDensity: _visualDensity, ), ), floatingActionButtonTheme: FloatingActionButtonThemeData( extendedPadding: const EdgeInsets.symmetric(horizontal: 16), - backgroundColor: Colors.grey[600], + backgroundColor: Colors.grey.shade600, foregroundColor: Colors.white, disabledElevation: 0, ), @@ -44,19 +44,19 @@ class AppTheme { ), ), navigationRailTheme: NavigationRailThemeData( - indicatorColor: Colors.grey[600], + indicatorColor: Colors.grey.shade600, backgroundColor: const Color(0xFF585858), - selectedIconTheme: IconThemeData(color: Colors.grey[200]), + selectedIconTheme: IconThemeData(color: Colors.grey.shade200), unselectedIconTheme: IconThemeData(color: Colors.grey[350]), - selectedLabelTextStyle: TextStyle(color: Colors.grey[200]), + selectedLabelTextStyle: TextStyle(color: Colors.grey.shade200), unselectedLabelTextStyle: TextStyle(color: Colors.grey[350]), ), outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( visualDensity: _visualDensity, - primary: Colors.grey[300], + primary: Colors.grey.shade300, backgroundColor: Colors.transparent, - side: BorderSide(color: Colors.grey[400]!), + side: BorderSide(color: Colors.grey.shade400), ), ), ); @@ -64,16 +64,16 @@ class AppTheme { final ThemeData _lightTheme = ThemeData( useMaterial3: true, primarySwatch: Colors.grey, - primaryColor: Colors.grey[400], - disabledColor: Colors.grey[600], - errorColor: Colors.red[900], + primaryColor: Colors.grey.shade400, + disabledColor: Colors.grey.shade600, + errorColor: Colors.red.shade900, scaffoldBackgroundColor: Colors.grey[350], //AAA compliant. primaryIconTheme: IconThemeData(color: Colors.grey[850]), dialogBackgroundColor: Colors.grey[350], - splashColor: Colors.grey[300], - focusColor: Colors.grey[200], + splashColor: Colors.grey.shade300, + focusColor: Colors.grey.shade200, indicatorColor: Colors.teal, - dialogTheme: DialogTheme(backgroundColor: Colors.grey[100]), + dialogTheme: DialogTheme(backgroundColor: Colors.grey.shade100), radioTheme: RadioThemeData(fillColor: MaterialStateProperty.all(Colors.black)), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( @@ -84,7 +84,7 @@ class AppTheme { ), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( - primary: Colors.grey[100], + primary: Colors.grey.shade100, onPrimary: Colors.grey[850], visualDensity: _visualDensity, ), @@ -93,11 +93,11 @@ class AppTheme { elevation: 2, shadowColor: Colors.black45, iconTheme: const IconThemeData(color: _grey800), - backgroundColor: Colors.grey[400], + backgroundColor: Colors.grey.shade400, ), floatingActionButtonTheme: FloatingActionButtonThemeData( extendedPadding: const EdgeInsets.symmetric(horizontal: 16), - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey.shade100, foregroundColor: Colors.grey[850], focusElevation: 10, ), @@ -110,10 +110,10 @@ class AppTheme { ), ), navigationRailTheme: NavigationRailThemeData( - backgroundColor: Colors.grey[400], - selectedIconTheme: IconThemeData(color: Colors.grey[900]), + backgroundColor: Colors.grey.shade400, + selectedIconTheme: IconThemeData(color: Colors.grey.shade900), unselectedIconTheme: IconThemeData(color: Colors.grey[850]), - selectedLabelTextStyle: TextStyle(color: Colors.grey[900]), + selectedLabelTextStyle: TextStyle(color: Colors.grey.shade900), unselectedLabelTextStyle: TextStyle(color: Colors.grey[850]), ), ); diff --git a/lib/color_picker/blocs/colorpicker_event.freezed.dart b/lib/color_picker/blocs/colorpicker_event.freezed.dart index 55e2c851..0294cfe8 100644 --- a/lib/color_picker/blocs/colorpicker_event.freezed.dart +++ b/lib/color_picker/blocs/colorpicker_event.freezed.dart @@ -436,7 +436,7 @@ class _$_ColorPickerCopied implements _ColorPickerCopied { abstract class _ColorPickerCopied implements ColorPickerEvent { const factory _ColorPickerCopied(final Color color) = _$_ColorPickerCopied; - Color get color => throw _privateConstructorUsedError; + Color get color; @JsonKey(ignore: true) _$$_ColorPickerCopiedCopyWith<_$_ColorPickerCopied> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/core/ui/view/main_screen.dart b/lib/core/ui/view/main_screen.dart index 7ca092ea..033d3c05 100644 --- a/lib/core/ui/view/main_screen.dart +++ b/lib/core/ui/view/main_screen.dart @@ -119,7 +119,7 @@ class _NavigationScreenState extends State { listener: (BuildContext context, SnackbarState snackbarState) { if (snackbarState is! SnackbarsInitial) { BlocProvider.of(context).add(const SoundEvent.copied()); - late String message; + String? message; final bool isUrlCopied = snackbarState is UrlCopySuccess; final bool isFileCopied = snackbarState is FileCopySuccess; final bool isShareFailed = snackbarState is ShareAttemptFailure; @@ -133,8 +133,9 @@ class _NavigationScreenState extends State { message = context.l10n.serverMaintenanceMessage; } else if (isShareFailed) { message = context.l10n.shareFailedMessage; - } else { - // TODO: Add Error message. + } + if (message == null) { + return; } ScaffoldMessenger.of(context).showSnackBar( SnackBar( diff --git a/lib/navigation/blocs/navigation_event.freezed.dart b/lib/navigation/blocs/navigation_event.freezed.dart index f421e2c5..4e851b06 100644 --- a/lib/navigation/blocs/navigation_event.freezed.dart +++ b/lib/navigation/blocs/navigation_event.freezed.dart @@ -315,7 +315,7 @@ abstract class _NavigationTabChanged implements NavigationEvent { const factory _NavigationTabChanged(final int newTabIndex) = _$_NavigationTabChanged; - int get newTabIndex => throw _privateConstructorUsedError; + int get newTabIndex; @JsonKey(ignore: true) _$$_NavigationTabChangedCopyWith<_$_NavigationTabChanged> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/share/blocs/share_event.freezed.dart b/lib/share/blocs/share_event.freezed.dart index d67c0e64..46bb61be 100644 --- a/lib/share/blocs/share_event.freezed.dart +++ b/lib/share/blocs/share_event.freezed.dart @@ -400,7 +400,7 @@ class _$_ShareUrlShared implements _ShareUrlShared { abstract class _ShareUrlShared implements ShareEvent { const factory _ShareUrlShared(final ColorPalette palette) = _$_ShareUrlShared; - ColorPalette get palette => throw _privateConstructorUsedError; + ColorPalette get palette; @JsonKey(ignore: true) _$$_ShareUrlSharedCopyWith<_$_ShareUrlShared> get copyWith => throw _privateConstructorUsedError; @@ -566,7 +566,7 @@ class _$_ShareUrlCopied implements _ShareUrlCopied { abstract class _ShareUrlCopied implements ShareEvent { const factory _ShareUrlCopied(final ColorPalette palette) = _$_ShareUrlCopied; - ColorPalette get palette => throw _privateConstructorUsedError; + ColorPalette get palette; @JsonKey(ignore: true) _$$_ShareUrlCopiedCopyWith<_$_ShareUrlCopied> get copyWith => throw _privateConstructorUsedError; @@ -733,7 +733,7 @@ abstract class _ShareFileShared implements ShareEvent { const factory _ShareFileShared(final ColorPalette palette) = _$_ShareFileShared; - ColorPalette get palette => throw _privateConstructorUsedError; + ColorPalette get palette; @JsonKey(ignore: true) _$$_ShareFileSharedCopyWith<_$_ShareFileShared> get copyWith => throw _privateConstructorUsedError; @@ -900,7 +900,7 @@ abstract class _ShareFileCopied implements ShareEvent { const factory _ShareFileCopied(final ColorPalette palette) = _$_ShareFileCopied; - ColorPalette get palette => throw _privateConstructorUsedError; + ColorPalette get palette; @JsonKey(ignore: true) _$$_ShareFileCopiedCopyWith<_$_ShareFileCopied> get copyWith => throw _privateConstructorUsedError; @@ -1068,7 +1068,7 @@ abstract class _ShareFormatSelected implements ShareEvent { const factory _ShareFormatSelected({required final FileFormat? format}) = _$_ShareFormatSelected; - FileFormat? get format => throw _privateConstructorUsedError; + FileFormat? get format; @JsonKey(ignore: true) _$$_ShareFormatSelectedCopyWith<_$_ShareFormatSelected> get copyWith => throw _privateConstructorUsedError; @@ -1240,7 +1240,7 @@ abstract class _ShareUrlProviderSelected implements ShareEvent { {required final ColorsUrlProvider? urlProvider}) = _$_ShareUrlProviderSelected; - ColorsUrlProvider? get urlProvider => throw _privateConstructorUsedError; + ColorsUrlProvider? get urlProvider; @JsonKey(ignore: true) _$$_ShareUrlProviderSelectedCopyWith<_$_ShareUrlProviderSelected> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/share/blocs/share_state.freezed.dart b/lib/share/blocs/share_state.freezed.dart index d0c325b2..0bf93140 100644 --- a/lib/share/blocs/share_state.freezed.dart +++ b/lib/share/blocs/share_state.freezed.dart @@ -508,10 +508,10 @@ abstract class _ShareFormatSelectedInitial implements ShareState { required final bool canSharePdf, required final bool canSharePng}) = _$_ShareFormatSelectedInitial; - ColorsUrlProvider? get selectedProvider => throw _privateConstructorUsedError; - FileFormat? get selectedFormat => throw _privateConstructorUsedError; - bool get canSharePdf => throw _privateConstructorUsedError; - bool get canSharePng => throw _privateConstructorUsedError; + ColorsUrlProvider? get selectedProvider; + FileFormat? get selectedFormat; + bool get canSharePdf; + bool get canSharePng; @JsonKey(ignore: true) _$$_ShareFormatSelectedInitialCopyWith<_$_ShareFormatSelectedInitial> get copyWith => throw _privateConstructorUsedError; diff --git a/pubspec.lock b/pubspec.lock index 2c0f6ffb..220ff12d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "38.0.0" + version: "41.0.0" analyzer: - dependency: transitive + dependency: "direct dev" description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "3.4.1" + version: "4.2.0" analyzer_plugin: dependency: transitive description: @@ -609,14 +609,14 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.5.0" + version: "4.6.0" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "6.2.0" + version: "6.3.0" lints: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 973df7ef..525b1ae5 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,7 +31,7 @@ dependencies: http: ^0.13.0-nullsafety.0 # From Google hydrated_bloc: 7.0.1 intl: ^0.17.0 # From Google - json_annotation: ^4.5.0 # From Google + json_annotation: ^4.6.0 # From Google mdi: ^5.0.0-nullsafety.0 package_info_plus: ^1.4.2 # From Flutter Community (former Google) path_provider: ^2.0.11 # From Google @@ -48,6 +48,7 @@ dependencies: ref: 5c51870ced62a00e809ba4b81a846a052d241c9f dev_dependencies: + analyzer: ^4.2.0 bloc_test: 8.5.0 build_runner: ^2.1.11 # From Google dart_code_metrics: ^4.16.0 # Flutter Favorite @@ -59,10 +60,13 @@ dev_dependencies: hive_generator: ^1.1.3 integration_test: # From Google sdk: flutter - json_serializable: ^6.2.0 # From Google + json_serializable: ^6.3.0 # From Google mockito: ^5.0.0-nullsafety.5 # From Google msix: 2.7.3 # Flutter Favorite (generating from SVG) +dependency_overrides: + analyzer: ">=4.2.0 <5.0.0" # From Google + flutter: generate: true uses-material-design: true diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a9537a6b..d07ba9ac 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -9,7 +9,7 @@ base: core20 grade: stable compression: lzo architectures: - - build-on: [arm64] + - build-on: [amd64] parts: flutter-git: @@ -23,6 +23,7 @@ parts: cp -r $SNAPCRAFT_PART_SRC $SNAPCRAFT_PART_INSTALL/usr/libexec/flutter ln -s $SNAPCRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $SNAPCRAFT_PART_INSTALL/usr/bin/flutter build-packages: + - libblkid1 - libjsoncpp-dev - libsecret-1-dev - cmake