From cdc4242aedea4bdf403020c82c163996f6df561e Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Wed, 2 Jun 2021 19:15:52 -0500 Subject: [PATCH] chore(photobooth): upgrade dependencies (#645) --- lib/app/app.dart | 2 +- lib/footer/widgets/footer.dart | 44 ++++----- lib/footer/widgets/icon_link.dart | 8 +- lib/landing/loading_indicator_web.dart | 1 + lib/main.dart | 1 + lib/share/view/share_bottom_sheet.dart | 8 +- lib/share/view/share_dialog.dart | 10 +-- lib/share/view/share_error_dialog.dart | 4 +- .../widgets/animated_photobooth_photo.dart | 2 +- lib/share/widgets/share_background.dart | 2 +- lib/share/widgets/share_body.dart | 12 +-- lib/share/widgets/share_progress_overlay.dart | 24 ++--- lib/stickers/view/stickers_page.dart | 8 +- .../clear_stickers_button_layer.dart | 3 +- .../clear_stickers/clear_stickers_dialog.dart | 6 +- .../stickers_drawer_layer.dart | 3 +- lib/stickers/widgets/stickers_tabs.dart | 12 +-- packages/analytics/analysis_options.yaml | 3 + packages/analytics/pubspec.yaml | 2 +- .../authentication_repository/pubspec.yaml | 2 +- packages/camera/camera/example/pubspec.yaml | 4 +- packages/camera/camera/pubspec.yaml | 4 +- .../camera/test/src/controller_test.dart | 2 +- .../camera_platform_interface/pubspec.yaml | 4 +- .../camera_web/lib/src/browser_detection.dart | 1 + packages/camera/camera_web/pubspec.yaml | 4 +- .../image_compositor/analysis_options.yaml | 3 + packages/image_compositor/pubspec.yaml | 2 +- .../lib/src/widgets/animated_pulse.dart | 2 +- .../lib/src/widgets/animated_sprite.dart | 2 +- .../lib/src/widgets/app_tooltip_button.dart | 2 +- .../widgets/responsive_layout_builder.dart | 9 +- packages/photobooth_ui/pubspec.yaml | 4 +- packages/photos_repository/pubspec.yaml | 4 +- .../platform_helper/analysis_options.yaml | 3 + packages/platform_helper/pubspec.yaml | 2 +- pubspec.lock | 89 ++++++++++--------- pubspec.yaml | 4 +- test/helpers/pump_app.dart | 2 +- .../photobooth/bloc/photobooth_bloc_test.dart | 27 +++--- .../photobooth/view/photobooth_page_test.dart | 24 +++-- .../widgets/characters_layer_test.dart | 6 +- .../widgets/shutter_button_test.dart | 18 ++-- .../widgets/stickers_layer_test.dart | 4 +- test/share/bloc/share_bloc_test.dart | 12 +-- test/share/widgets/download_button_test.dart | 2 +- .../stickers_drawer_layer_test.dart | 24 +++-- 47 files changed, 228 insertions(+), 193 deletions(-) diff --git a/lib/app/app.dart b/lib/app/app.dart index 2da58fac..a14f1618 100644 --- a/lib/app/app.dart +++ b/lib/app/app.dart @@ -45,7 +45,7 @@ class _App extends StatelessWidget { return MaterialApp( title: 'I/O Photo Booth', theme: theme, - localizationsDelegates: [ + localizationsDelegates: const [ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate, ], diff --git a/lib/footer/widgets/footer.dart b/lib/footer/widgets/footer.dart index bd9e4d73..b80cba18 100644 --- a/lib/footer/widgets/footer.dart +++ b/lib/footer/widgets/footer.dart @@ -32,8 +32,8 @@ class Footer extends StatelessWidget { child: Padding( padding: const EdgeInsets.fromLTRB(50, 0, 50, 32), child: ResponsiveLayoutBuilder( - small: (_, __) => _ColumnFooter(key: const Key('footer_column')), - large: (_, __) => _RowFooter(key: const Key('footer_row')), + small: (_, __) => const _ColumnFooter(key: Key('footer_column')), + large: (_, __) => const _RowFooter(key: Key('footer_row')), ), ), ); @@ -41,7 +41,7 @@ class Footer extends StatelessWidget { } class _ColumnFooter extends StatelessWidget { - _ColumnFooter({Key? key}) : super(key: key); + const _ColumnFooter({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -55,22 +55,22 @@ class _ColumnFooter extends StatelessWidget { Wrap( alignment: WrapAlignment.center, runSpacing: 16, - children: [ - const FooterGoogleIOLink(), - const SizedBox(width: 30), - const FooterCodelabLink(), - const SizedBox(width: 30), - const FooterHowItsMadeLink(), + children: const [ + FooterGoogleIOLink(), + SizedBox(width: 30), + FooterCodelabLink(), + SizedBox(width: 30), + FooterHowItsMadeLink(), ], ), gap, Wrap( alignment: WrapAlignment.center, runSpacing: 16, - children: [ - const FooterTermsOfServiceLink(), - const SizedBox(width: 30), - const FooterPrivacyPolicyLink(), + children: const [ + FooterTermsOfServiceLink(), + SizedBox(width: 30), + FooterPrivacyPolicyLink(), ], ), ], @@ -79,24 +79,24 @@ class _ColumnFooter extends StatelessWidget { } class _RowFooter extends StatelessWidget { - _RowFooter({Key? key}) : super(key: key); + const _RowFooter({Key? key}) : super(key: key); @override Widget build(BuildContext context) { const gap = SizedBox(width: 32); return Row( - children: [ - const FooterMadeWithLink(), - const Spacer(), - const FooterGoogleIOLink(), + children: const [ + FooterMadeWithLink(), + Spacer(), + FooterGoogleIOLink(), gap, - const FooterCodelabLink(), + FooterCodelabLink(), gap, - const FooterHowItsMadeLink(), + FooterHowItsMadeLink(), gap, - const FooterTermsOfServiceLink(), + FooterTermsOfServiceLink(), gap, - const FooterPrivacyPolicyLink(), + FooterPrivacyPolicyLink(), ], ); } diff --git a/lib/footer/widgets/icon_link.dart b/lib/footer/widgets/icon_link.dart index fee38f4c..4aa2a2bc 100644 --- a/lib/footer/widgets/icon_link.dart +++ b/lib/footer/widgets/icon_link.dart @@ -56,10 +56,10 @@ class MadeWithIconLinks extends StatelessWidget { Widget build(BuildContext context) { return Row( mainAxisSize: MainAxisSize.min, - children: [ - const FlutterIconLink(), - const SizedBox(width: 8), - const FirebaseIconLink(), + children: const [ + FlutterIconLink(), + SizedBox(width: 8), + FirebaseIconLink(), ], ); } diff --git a/lib/landing/loading_indicator_web.dart b/lib/landing/loading_indicator_web.dart index d005b04e..0b78155d 100644 --- a/lib/landing/loading_indicator_web.dart +++ b/lib/landing/loading_indicator_web.dart @@ -1,3 +1,4 @@ +// ignore: avoid_web_libraries_in_flutter import 'dart:html' as html; /// Removes the handed-coded piece of HTML used as the app loading diff --git a/lib/main.dart b/lib/main.dart index 10df9fbd..1bc87a37 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +// ignore_for_file: avoid_print import 'dart:async'; import 'package:authentication_repository/authentication_repository.dart'; diff --git a/lib/share/view/share_bottom_sheet.dart b/lib/share/view/share_bottom_sheet.dart index def095bd..4e3d40e2 100644 --- a/lib/share/view/share_bottom_sheet.dart +++ b/lib/share/view/share_bottom_sheet.dart @@ -54,10 +54,10 @@ class ShareBottomSheet extends StatelessWidget { ), const SizedBox(height: 42), Column( - children: [ - const TwitterButton(), - const SizedBox(height: 18), - const FacebookButton(), + children: const [ + TwitterButton(), + SizedBox(height: 18), + FacebookButton(), ], ), const SizedBox(height: 42), diff --git a/lib/share/view/share_dialog.dart b/lib/share/view/share_dialog.dart index 34f5ea10..53805336 100644 --- a/lib/share/view/share_dialog.dart +++ b/lib/share/view/share_dialog.dart @@ -28,7 +28,7 @@ class ShareDialog extends StatelessWidget { child: Stack( children: [ SingleChildScrollView( - child: Container( + child: SizedBox( width: 900, child: Padding( padding: const EdgeInsets.symmetric( @@ -57,10 +57,10 @@ class ShareDialog extends StatelessWidget { const SizedBox(height: 30), Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ - const TwitterButton(), - const SizedBox(width: 36), - const FacebookButton(), + children: const [ + TwitterButton(), + SizedBox(width: 36), + FacebookButton(), ], ), const SizedBox(height: 30), diff --git a/lib/share/view/share_error_dialog.dart b/lib/share/view/share_error_dialog.dart index 75588ea1..c2a18089 100644 --- a/lib/share/view/share_error_dialog.dart +++ b/lib/share/view/share_error_dialog.dart @@ -24,7 +24,7 @@ class ShareErrorDialog extends StatelessWidget { child: Stack( children: [ SingleChildScrollView( - child: Container( + child: SizedBox( width: 900, child: Padding( padding: const EdgeInsets.symmetric( @@ -35,7 +35,7 @@ class ShareErrorDialog extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( + SizedBox( height: 300, child: Image.asset( 'assets/images/error_photo_desktop.png', diff --git a/lib/share/widgets/animated_photobooth_photo.dart b/lib/share/widgets/animated_photobooth_photo.dart index 80681fff..0ac62bd7 100644 --- a/lib/share/widgets/animated_photobooth_photo.dart +++ b/lib/share/widgets/animated_photobooth_photo.dart @@ -228,7 +228,7 @@ class _AnimatedPhotoboothPhoto extends StatelessWidget { @override Widget build(BuildContext context) { final _image = image; - return Container( + return SizedBox( height: sprite.sprites.size.height * scale, width: sprite.sprites.size.width * scale, child: Stack( diff --git a/lib/share/widgets/share_background.dart b/lib/share/widgets/share_background.dart index 9a0c75b2..ef79868e 100644 --- a/lib/share/widgets/share_background.dart +++ b/lib/share/widgets/share_background.dart @@ -8,7 +8,7 @@ class ShareBackground extends StatelessWidget { Widget build(BuildContext context) { return Stack( children: [ - Container( + SizedBox( width: double.infinity, height: double.infinity, child: Image.asset( diff --git a/lib/share/widgets/share_body.dart b/lib/share/widgets/share_body.dart index 60be4fc5..37ad6c7f 100644 --- a/lib/share/widgets/share_body.dart +++ b/lib/share/widgets/share_body.dart @@ -83,12 +83,12 @@ class ShareBody extends StatelessWidget { AnimatedFadeIn( child: Column( mainAxisSize: MainAxisSize.min, - children: [ - const SizedBox(height: 20), - const ShareErrorHeading(), - const SizedBox(height: 20), - const ShareErrorSubheading(), - const SizedBox(height: 30), + children: const [ + SizedBox(height: 20), + ShareErrorHeading(), + SizedBox(height: 20), + ShareErrorSubheading(), + SizedBox(height: 30), ], ), ) diff --git a/lib/share/widgets/share_progress_overlay.dart b/lib/share/widgets/share_progress_overlay.dart index 2831d865..289c76a5 100644 --- a/lib/share/widgets/share_progress_overlay.dart +++ b/lib/share/widgets/share_progress_overlay.dart @@ -18,8 +18,8 @@ class ShareProgressOverlay extends StatelessWidget { return BlocBuilder( builder: (context, state) => state.uploadStatus.isLoading || (state.compositeStatus.isLoading && state.isUploadRequested) - ? _ShareProgressOverlay( - key: const Key('shareProgressOverlay_loading'), + ? const _ShareProgressOverlay( + key: Key('shareProgressOverlay_loading'), ) : const SizedBox(key: Key('shareProgressOverlay_nothing')), ); @@ -27,9 +27,7 @@ class ShareProgressOverlay extends StatelessWidget { } class _ShareProgressOverlay extends StatelessWidget { - _ShareProgressOverlay({ - Key? key, - }) : super(key: key); + const _ShareProgressOverlay({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -39,11 +37,11 @@ class _ShareProgressOverlay extends StatelessWidget { filter: ImageFilter.blur(sigmaX: 6, sigmaY: 6), child: Center( child: ResponsiveLayoutBuilder( - small: (_, __) => _MobileShareProgressOverlay( - key: const Key('shareProgressOverlay_mobile'), + small: (_, __) => const _MobileShareProgressOverlay( + key: Key('shareProgressOverlay_mobile'), ), - large: (_, __) => _DesktopShareProgressOverlay( - key: const Key('shareProgressOverlay_desktop'), + large: (_, __) => const _DesktopShareProgressOverlay( + key: Key('shareProgressOverlay_desktop'), ), ), ), @@ -53,9 +51,7 @@ class _ShareProgressOverlay extends StatelessWidget { } class _DesktopShareProgressOverlay extends StatelessWidget { - _DesktopShareProgressOverlay({ - Key? key, - }) : super(key: key); + const _DesktopShareProgressOverlay({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -92,9 +88,7 @@ class _DesktopShareProgressOverlay extends StatelessWidget { } class _MobileShareProgressOverlay extends StatelessWidget { - _MobileShareProgressOverlay({ - Key? key, - }) : super(key: key); + const _MobileShareProgressOverlay({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/stickers/view/stickers_page.dart b/lib/stickers/view/stickers_page.dart index f4c75ac6..39fb981b 100644 --- a/lib/stickers/view/stickers_page.dart +++ b/lib/stickers/view/stickers_page.dart @@ -64,9 +64,9 @@ class StickersView extends StatelessWidget { left: 15, top: 15, child: Row( - children: [ - const _RetakeButton(), - const ClearStickersButtonLayer(), + children: const [ + _RetakeButton(), + ClearStickersButtonLayer(), ], ), ), @@ -154,7 +154,7 @@ class _DraggableStickers extends StatelessWidget { .add(const PhotoDeleteSelectedStickerTapped()), size: sticker.asset.size * _initialStickerScale, constraints: sticker.getImageConstraints(), - child: Container( + child: SizedBox( width: double.infinity, height: double.infinity, child: Image.asset( diff --git a/lib/stickers/widgets/clear_stickers/clear_stickers_button_layer.dart b/lib/stickers/widgets/clear_stickers/clear_stickers_button_layer.dart index 657dd2a9..e42601ac 100644 --- a/lib/stickers/widgets/clear_stickers/clear_stickers_button_layer.dart +++ b/lib/stickers/widgets/clear_stickers/clear_stickers_button_layer.dart @@ -21,8 +21,9 @@ class ClearStickersButtonLayer extends StatelessWidget { context: context, child: const ClearStickersDialog(), ); - if (confirmed) + if (confirmed) { context.read().add(const PhotoClearStickersTapped()); + } }, ); } diff --git a/lib/stickers/widgets/clear_stickers/clear_stickers_dialog.dart b/lib/stickers/widgets/clear_stickers/clear_stickers_dialog.dart index 79033a69..f08921e9 100644 --- a/lib/stickers/widgets/clear_stickers/clear_stickers_dialog.dart +++ b/lib/stickers/widgets/clear_stickers/clear_stickers_dialog.dart @@ -39,9 +39,9 @@ class ClearStickersDialog extends StatelessWidget { alignment: WrapAlignment.center, spacing: 30, runSpacing: 15, - children: [ - const ClearStickersCancelButton(), - const ClearStickersConfirmButton(), + children: const [ + ClearStickersCancelButton(), + ClearStickersConfirmButton(), ], ), ], diff --git a/lib/stickers/widgets/stickers_drawer_layer/stickers_drawer_layer.dart b/lib/stickers/widgets/stickers_drawer_layer/stickers_drawer_layer.dart index 1615a6f1..fd533365 100644 --- a/lib/stickers/widgets/stickers_drawer_layer/stickers_drawer_layer.dart +++ b/lib/stickers/widgets/stickers_drawer_layer/stickers_drawer_layer.dart @@ -46,7 +46,7 @@ class _StickersDrawerLayerState extends State { buildWhen: (previous, current) => current != previous, builder: (context, state) { if (state.isDrawerActive && - MediaQuery.of(context).size.width >= PhotoboothBreakpoints.small) + MediaQuery.of(context).size.width >= PhotoboothBreakpoints.small) { return Positioned( right: 0, top: 0, @@ -68,6 +68,7 @@ class _StickersDrawerLayerState extends State { .add(const StickersDrawerToggled()), ), ); + } return const SizedBox(); }, ); diff --git a/lib/stickers/widgets/stickers_tabs.dart b/lib/stickers/widgets/stickers_tabs.dart index 8b1a9ffd..2a3a7821 100644 --- a/lib/stickers/widgets/stickers_tabs.dart +++ b/lib/stickers/widgets/stickers_tabs.dart @@ -51,24 +51,24 @@ class _StickersTabsState extends State TabBar( onTap: widget.onTabChanged, controller: _tabController, - tabs: [ - const StickersTab( + tabs: const [ + StickersTab( key: Key('stickersTabs_googleTab'), assetPath: 'assets/icons/google_icon.png', ), - const StickersTab( + StickersTab( key: Key('stickersTabs_hatsTab'), assetPath: 'assets/icons/hats_icon.png', ), - const StickersTab( + StickersTab( key: Key('stickersTabs_eyewearTab'), assetPath: 'assets/icons/eyewear_icon.png', ), - const StickersTab( + StickersTab( key: Key('stickersTabs_foodTab'), assetPath: 'assets/icons/food_icon.png', ), - const StickersTab( + StickersTab( key: Key('stickersTabs_shapesTab'), assetPath: 'assets/icons/shapes_icon.png', ), diff --git a/packages/analytics/analysis_options.yaml b/packages/analytics/analysis_options.yaml index 9df80aa4..dd23f8dd 100644 --- a/packages/analytics/analysis_options.yaml +++ b/packages/analytics/analysis_options.yaml @@ -1 +1,4 @@ include: package:very_good_analysis/analysis_options.yaml +linter: + rules: + avoid_web_libraries_in_flutter: false diff --git a/packages/analytics/pubspec.yaml b/packages/analytics/pubspec.yaml index c7923d2a..723b436e 100644 --- a/packages/analytics/pubspec.yaml +++ b/packages/analytics/pubspec.yaml @@ -12,4 +12,4 @@ dev_dependencies: flutter_test: sdk: flutter mocktail: ^0.1.1 - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 diff --git a/packages/authentication_repository/pubspec.yaml b/packages/authentication_repository/pubspec.yaml index 86bb4dcc..d709828e 100644 --- a/packages/authentication_repository/pubspec.yaml +++ b/packages/authentication_repository/pubspec.yaml @@ -3,7 +3,7 @@ description: Repository which manages user authentication using Firebase Authent version: 1.0.0+1 environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index 041c0104..b270788b 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -2,7 +2,7 @@ name: example publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" flutter: ">=2.0.0" dependencies: @@ -12,7 +12,7 @@ dependencies: path: ../ dev_dependencies: - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 flutter: uses-material-design: true diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index ab7f5177..0d01a424 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.1.0 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" flutter: ">=2.0.0" flutter: @@ -26,4 +26,4 @@ dev_dependencies: sdk: flutter mocktail: ^0.1.0 plugin_platform_interface: ^2.0.0 - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 diff --git a/packages/camera/camera/test/src/controller_test.dart b/packages/camera/camera/test/src/controller_test.dart index c917c0aa..173ba5ed 100644 --- a/packages/camera/camera/test/src/controller_test.dart +++ b/packages/camera/camera/test/src/controller_test.dart @@ -109,7 +109,7 @@ void main() { }); test('invokes CameraPlatform.takePicture', () async { - final image = const CameraImage(data: '', width: 1, height: 1); + const image = CameraImage(data: '', width: 1, height: 1); when(() => platform.takePicture(any())).thenAnswer((_) async => image); expect(await controller.takePicture(), equals(image)); verify(() => platform.takePicture(textureId)).called(1); diff --git a/packages/camera/camera_platform_interface/pubspec.yaml b/packages/camera/camera_platform_interface/pubspec.yaml index 75323be1..8cfea6d4 100644 --- a/packages/camera/camera_platform_interface/pubspec.yaml +++ b/packages/camera/camera_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the camera plugin. version: 0.0.1 environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" flutter: ">=2.0.0" dependencies: @@ -12,4 +12,4 @@ dependencies: plugin_platform_interface: ^2.0.0 dev_dependencies: - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 diff --git a/packages/camera/camera_web/lib/src/browser_detection.dart b/packages/camera/camera_web/lib/src/browser_detection.dart index 183efb08..ff61ffcf 100644 --- a/packages/camera/camera_web/lib/src/browser_detection.dart +++ b/packages/camera/camera_web/lib/src/browser_detection.dart @@ -103,6 +103,7 @@ BrowserEngine detectBrowserEngineByVendorAgent(String vendor, String agent) { return BrowserEngine.firefox; } // Assume unknown otherwise, but issue a warning. + // ignore: avoid_print print('WARNING: failed to detect current browser engine.'); return BrowserEngine.unknown; } diff --git a/packages/camera/camera_web/pubspec.yaml b/packages/camera/camera_web/pubspec.yaml index ed7d5e4c..f68fdd94 100644 --- a/packages/camera/camera_web/pubspec.yaml +++ b/packages/camera/camera_web/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.1.0 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" flutter: ">=2.0.0" flutter: @@ -26,4 +26,4 @@ dev_dependencies: flutter_test: sdk: flutter mocktail: ^0.1.1 - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 diff --git a/packages/image_compositor/analysis_options.yaml b/packages/image_compositor/analysis_options.yaml index 9df80aa4..064475c5 100644 --- a/packages/image_compositor/analysis_options.yaml +++ b/packages/image_compositor/analysis_options.yaml @@ -1 +1,4 @@ include: package:very_good_analysis/analysis_options.yaml +linter: + rules: + avoid_web_libraries_in_flutter: false \ No newline at end of file diff --git a/packages/image_compositor/pubspec.yaml b/packages/image_compositor/pubspec.yaml index 37874256..34e6ec69 100644 --- a/packages/image_compositor/pubspec.yaml +++ b/packages/image_compositor/pubspec.yaml @@ -12,4 +12,4 @@ dev_dependencies: flutter_test: sdk: flutter mocktail: ^0.1.1 - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 diff --git a/packages/photobooth_ui/lib/src/widgets/animated_pulse.dart b/packages/photobooth_ui/lib/src/widgets/animated_pulse.dart index 58de94ea..6d190a77 100644 --- a/packages/photobooth_ui/lib/src/widgets/animated_pulse.dart +++ b/packages/photobooth_ui/lib/src/widgets/animated_pulse.dart @@ -88,7 +88,7 @@ class PulsePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { final rect = Rect.fromLTRB(0.0, 0.0, size.width, size.height); - final color = PhotoboothColors.blue; + const color = PhotoboothColors.blue; final circleSize = rect.width / 2; final area = circleSize * circleSize; final radius = sqrt(area * _animation.value * 3); diff --git a/packages/photobooth_ui/lib/src/widgets/animated_sprite.dart b/packages/photobooth_ui/lib/src/widgets/animated_sprite.dart index 34563089..f3ba85b6 100644 --- a/packages/photobooth_ui/lib/src/widgets/animated_sprite.dart +++ b/packages/photobooth_ui/lib/src/widgets/animated_sprite.dart @@ -137,7 +137,7 @@ class _AnimatedSpriteState extends State { ), ) : const SizedBox(), - secondChild: Container( + secondChild: SizedBox( width: double.infinity, height: double.infinity, child: _status.isLoaded diff --git a/packages/photobooth_ui/lib/src/widgets/app_tooltip_button.dart b/packages/photobooth_ui/lib/src/widgets/app_tooltip_button.dart index 2cc7b297..f93bf6db 100644 --- a/packages/photobooth_ui/lib/src/widgets/app_tooltip_button.dart +++ b/packages/photobooth_ui/lib/src/widgets/app_tooltip_button.dart @@ -18,7 +18,7 @@ enum TooltipMode { /// {@endtemplate} class AppTooltipButton extends StatefulWidget { /// {@macro app_tooltip_button} - AppTooltipButton({ + const AppTooltipButton({ Key? key, required this.onPressed, required this.message, diff --git a/packages/photobooth_ui/lib/src/widgets/responsive_layout_builder.dart b/packages/photobooth_ui/lib/src/widgets/responsive_layout_builder.dart index 87f4755b..c384383a 100644 --- a/packages/photobooth_ui/lib/src/widgets/responsive_layout_builder.dart +++ b/packages/photobooth_ui/lib/src/widgets/responsive_layout_builder.dart @@ -40,12 +40,15 @@ class ResponsiveLayoutBuilder extends StatelessWidget { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, constraints) { - if (constraints.maxWidth <= PhotoboothBreakpoints.small) + if (constraints.maxWidth <= PhotoboothBreakpoints.small) { return small(context, child); - if (constraints.maxWidth <= PhotoboothBreakpoints.medium) + } + if (constraints.maxWidth <= PhotoboothBreakpoints.medium) { return (medium ?? large).call(context, child); - if (constraints.maxWidth <= PhotoboothBreakpoints.large) + } + if (constraints.maxWidth <= PhotoboothBreakpoints.large) { return large(context, child); + } return (xLarge ?? large).call(context, child); }, diff --git a/packages/photobooth_ui/pubspec.yaml b/packages/photobooth_ui/pubspec.yaml index c4b5814e..0a929a44 100644 --- a/packages/photobooth_ui/pubspec.yaml +++ b/packages/photobooth_ui/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: @@ -19,7 +19,7 @@ dev_dependencies: flutter_test: sdk: flutter mocktail: ^0.1.1 - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 flutter: fonts: diff --git a/packages/photos_repository/pubspec.yaml b/packages/photos_repository/pubspec.yaml index 5a05fca2..23c3cff4 100644 --- a/packages/photos_repository/pubspec.yaml +++ b/packages/photos_repository/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: @@ -17,5 +17,5 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - very_good_analysis: ^1.0.4 + very_good_analysis: ^2.0.4 mocktail: ^0.1.1 diff --git a/packages/platform_helper/analysis_options.yaml b/packages/platform_helper/analysis_options.yaml index 9df80aa4..064475c5 100644 --- a/packages/platform_helper/analysis_options.yaml +++ b/packages/platform_helper/analysis_options.yaml @@ -1 +1,4 @@ include: package:very_good_analysis/analysis_options.yaml +linter: + rules: + avoid_web_libraries_in_flutter: false \ No newline at end of file diff --git a/packages/platform_helper/pubspec.yaml b/packages/platform_helper/pubspec.yaml index 88c60ab5..eaa98877 100644 --- a/packages/platform_helper/pubspec.yaml +++ b/packages/platform_helper/pubspec.yaml @@ -12,4 +12,4 @@ dev_dependencies: flutter_test: sdk: flutter mocktail: ^0.1.1 - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 diff --git a/pubspec.lock b/pubspec.lock index bf2d8bcf..0bbd3645 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "19.0.0" + version: "22.0.0" analytics: dependency: "direct main" description: @@ -21,28 +21,28 @@ packages: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.7.0" audio_session: dependency: transitive description: name: audio_session url: "https://pub.dartlang.org" source: hosted - version: "0.1.0" + version: "0.1.2" authentication_repository: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: bloc_test url: "https://pub.dartlang.org" source: hosted - version: "8.0.0" + version: "8.0.1" boolean_selector: dependency: transitive description: @@ -140,7 +140,7 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" cross_file: dependency: "direct main" description: @@ -161,7 +161,7 @@ packages: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" fake_async: dependency: transitive description: @@ -175,84 +175,84 @@ packages: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.1" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.0" + version: "6.1.1" firebase_auth: dependency: "direct main" description: name: firebase_auth url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.2.0" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.1.1" + version: "4.2.3" firebase_auth_web: dependency: transitive description: name: firebase_auth_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.7" + version: "1.1.3" firebase_core: dependency: "direct main" description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.2.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.1.0" firebase_storage: dependency: "direct main" description: name: firebase_storage url: "https://pub.dartlang.org" source: hosted - version: "8.0.4" + version: "8.1.0" firebase_storage_platform_interface: dependency: transitive description: name: firebase_storage_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" firebase_storage_web: dependency: transitive description: name: firebase_storage_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.1.0" flame: dependency: transitive description: name: flame url: "https://pub.dartlang.org" source: hosted - version: "1.0.0-rc9" + version: "1.0.0-releasecandidate.11" flutter: dependency: "direct main" description: flutter @@ -264,7 +264,7 @@ packages: name: flutter_bloc url: "https://pub.dartlang.org" source: hosted - version: "7.0.0" + version: "7.0.1" flutter_localizations: dependency: "direct main" description: flutter @@ -280,6 +280,13 @@ packages: description: flutter source: sdk version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" glob: dependency: transitive description: @@ -293,14 +300,14 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.1" + version: "0.13.3" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" http_parser: dependency: transitive description: @@ -342,7 +349,7 @@ packages: name: just_audio url: "https://pub.dartlang.org" source: hosted - version: "0.7.4" + version: "0.7.5" just_audio_platform_interface: dependency: transitive description: @@ -377,7 +384,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.4.0" mime: dependency: transitive description: @@ -391,7 +398,7 @@ packages: name: mocktail url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.1.4" mocktail_image_network: dependency: "direct dev" description: @@ -419,7 +426,7 @@ packages: name: ordered_set url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.1.0" package_config: dependency: transitive description: @@ -440,7 +447,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" path_provider_linux: dependency: transitive description: @@ -552,7 +559,7 @@ packages: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.4" shelf_packages_handler: dependency: transitive description: @@ -634,21 +641,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.16.8" + version: "1.17.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.0" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.3.19" + version: "0.3.25" typed_data: dependency: transitive description: @@ -662,7 +669,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.3" + version: "6.0.6" url_launcher_linux: dependency: transitive description: @@ -683,14 +690,14 @@ packages: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" url_launcher_windows: dependency: transitive description: @@ -704,7 +711,7 @@ packages: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "3.0.3" + version: "3.0.4" vector_math: dependency: transitive description: @@ -718,14 +725,14 @@ packages: name: very_good_analysis url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.1.1" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "6.2.0" + version: "7.0.0" watcher: dependency: transitive description: @@ -739,7 +746,7 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" webkit_inspection_protocol: dependency: transitive description: @@ -753,7 +760,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.3" xdg_directories: dependency: transitive description: @@ -769,5 +776,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.13.0 <3.0.0" flutter: ">=2.3.0-1.0.pre.227" diff --git a/pubspec.yaml b/pubspec.yaml index b66678b7..3a5e631f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" flutter: 2.3.0-1.0.pre.227 dependencies: @@ -35,7 +35,7 @@ dependencies: photobooth_ui: path: packages/photobooth_ui uuid: ^3.0.3 - very_good_analysis: ^2.0.3 + very_good_analysis: ^2.0.4 dev_dependencies: flutter_test: diff --git a/test/helpers/pump_app.dart b/test/helpers/pump_app.dart index 6c8dce68..28dad7a9 100644 --- a/test/helpers/pump_app.dart +++ b/test/helpers/pump_app.dart @@ -50,7 +50,7 @@ extension PumpApp on WidgetTester { BlocProvider.value(value: shareBloc ?? MockShareBloc()), ], child: MaterialApp( - localizationsDelegates: [ + localizationsDelegates: const [ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate, ], diff --git a/test/photobooth/bloc/photobooth_bloc_test.dart b/test/photobooth/bloc/photobooth_bloc_test.dart index 98e1c3d0..27b6aacd 100644 --- a/test/photobooth/bloc/photobooth_bloc_test.dart +++ b/test/photobooth/bloc/photobooth_bloc_test.dart @@ -63,7 +63,7 @@ void main() { ), expect: () => [ PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.android)], + characters: const [PhotoAsset(id: '0', asset: Assets.android)], selectedAssetId: '0', ) ], @@ -76,7 +76,7 @@ void main() { act: (bloc) => bloc.add(PhotoCharacterToggled(character: Assets.dash)), expect: () => [ PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.dash)], + characters: const [PhotoAsset(id: '0', asset: Assets.dash)], selectedAssetId: '0', ) ], @@ -86,11 +86,12 @@ void main() { 'emits updated state with character ' 'when character did not exist (sparky)', build: () => PhotoboothBloc(uuid), - act: (bloc) => - bloc.add(PhotoCharacterToggled(character: Assets.sparky)), + act: (bloc) => bloc.add( + PhotoCharacterToggled(character: Assets.sparky), + ), expect: () => [ PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.sparky)], + characters: const [PhotoAsset(id: '0', asset: Assets.sparky)], selectedAssetId: '0', ) ], @@ -101,7 +102,7 @@ void main() { 'when character did exist (android)', build: () => PhotoboothBloc(uuid), seed: () => PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.android)], + characters: const [PhotoAsset(id: '0', asset: Assets.android)], ), act: (bloc) => bloc.add( PhotoCharacterToggled(character: Assets.android), @@ -114,7 +115,7 @@ void main() { 'when character did exist (dash)', build: () => PhotoboothBloc(uuid), seed: () => PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.dash)], + characters: const [PhotoAsset(id: '0', asset: Assets.dash)], ), act: (bloc) => bloc.add( PhotoCharacterToggled(character: Assets.dash), @@ -127,7 +128,7 @@ void main() { 'when character did exist (sparky)', build: () => PhotoboothBloc(uuid), seed: () => PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.sparky)], + characters: const [PhotoAsset(id: '0', asset: Assets.sparky)], ), act: (bloc) => bloc.add( PhotoCharacterToggled(character: Assets.sparky), @@ -141,7 +142,7 @@ void main() { 'emits updated state', build: () => PhotoboothBloc(uuid), seed: () => PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.sparky)], + characters: const [PhotoAsset(id: '0', asset: Assets.sparky)], ), act: (bloc) => bloc.add( PhotoCharacterDragged( @@ -156,7 +157,7 @@ void main() { ), expect: () => [ PhotoboothState( - characters: [ + characters: const [ PhotoAsset( id: '0', asset: Assets.sparky, @@ -241,7 +242,7 @@ void main() { 'emits updated state with no characters or stickers', build: () => PhotoboothBloc(uuid), seed: () => PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.dash)], + characters: const [PhotoAsset(id: '0', asset: Assets.dash)], stickers: [PhotoAsset(id: '0', asset: Assets.props.first)], ), act: (bloc) => bloc.add(PhotoClearAllTapped()), @@ -254,14 +255,14 @@ void main() { 'emits updated state with no selectedAssetId', build: () => PhotoboothBloc(uuid), seed: () => PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.dash)], + characters: const [PhotoAsset(id: '0', asset: Assets.dash)], stickers: [PhotoAsset(id: '0', asset: Assets.props.first)], selectedAssetId: '0', ), act: (bloc) => bloc.add(PhotoTapped()), expect: () => [ PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.dash)], + characters: const [PhotoAsset(id: '0', asset: Assets.dash)], stickers: [PhotoAsset(id: '0', asset: Assets.props.first)], ), ], diff --git a/test/photobooth/view/photobooth_page_test.dart b/test/photobooth/view/photobooth_page_test.dart index f3313ee8..146ce6ae 100644 --- a/test/photobooth/view/photobooth_page_test.dart +++ b/test/photobooth/view/photobooth_page_test.dart @@ -382,7 +382,7 @@ void main() { (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.android)], + characters: const [PhotoAsset(id: '0', asset: Assets.android)], ), ); const preview = SizedBox(); @@ -407,7 +407,7 @@ void main() { testWidgets('adds PhotoCharacterDragged when dragged', (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.android)], + characters: const [PhotoAsset(id: '0', asset: Assets.android)], ), ); const preview = SizedBox(); @@ -436,7 +436,7 @@ void main() { testWidgets('renders only dash when only dash is selected', (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.dash)], + characters: const [PhotoAsset(id: '0', asset: Assets.dash)], ), ); const preview = SizedBox(); @@ -458,7 +458,9 @@ void main() { testWidgets('adds PhotoCharacterDragged when dragged', (tester) async { when(() => photoboothBloc.state).thenReturn( - PhotoboothState(characters: [PhotoAsset(id: '0', asset: Assets.dash)]), + PhotoboothState( + characters: const [PhotoAsset(id: '0', asset: Assets.dash)], + ), ); const preview = SizedBox(); @@ -485,7 +487,9 @@ void main() { (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.sparky)], + characters: const [ + PhotoAsset(id: '0', asset: Assets.sparky), + ], ), ); const preview = SizedBox(); @@ -509,7 +513,9 @@ void main() { testWidgets('renders only dino when only dino is selected', (tester) async { when(() => photoboothBloc.state).thenReturn( - PhotoboothState(characters: [PhotoAsset(id: '0', asset: Assets.dino)]), + PhotoboothState( + characters: const [PhotoAsset(id: '0', asset: Assets.dino)], + ), ); const preview = SizedBox(); @@ -533,7 +539,7 @@ void main() { testWidgets('adds PhotoCharacterDragged when dragged', (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.sparky)], + characters: const [PhotoAsset(id: '0', asset: Assets.sparky)], ), ); const preview = SizedBox(); @@ -563,7 +569,7 @@ void main() { testWidgets('renders dash, sparky, dino, and android when all are selected', (tester) async { when(() => photoboothBloc.state).thenReturn( - PhotoboothState(characters: [ + PhotoboothState(characters: const [ PhotoAsset(id: '0', asset: Assets.android), PhotoAsset(id: '1', asset: Assets.dash), PhotoAsset(id: '2', asset: Assets.sparky), @@ -752,7 +758,7 @@ void main() { 'any character is selected', (tester) async { tester.setDisplaySize(const Size(PhotoboothBreakpoints.small, 1000)); when(() => photoboothBloc.state).thenReturn(PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.android)], + characters: const [PhotoAsset(id: '0', asset: Assets.android)], )); const preview = SizedBox(); await tester.pumpApp( diff --git a/test/photobooth/widgets/characters_layer_test.dart b/test/photobooth/widgets/characters_layer_test.dart index 996e8bbd..81cac2de 100644 --- a/test/photobooth/widgets/characters_layer_test.dart +++ b/test/photobooth/widgets/characters_layer_test.dart @@ -35,7 +35,7 @@ void main() { testWidgets('renders Android character assert', (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.android)], + characters: const [PhotoAsset(id: '0', asset: Assets.android)], image: image, ), ); @@ -52,7 +52,7 @@ void main() { testWidgets('renders Dash character assert', (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.dash)], + characters: const [PhotoAsset(id: '0', asset: Assets.dash)], image: image, ), ); @@ -69,7 +69,7 @@ void main() { testWidgets('renders Sparky character assert', (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.sparky)], + characters: const [PhotoAsset(id: '0', asset: Assets.sparky)], image: image, ), ); diff --git a/test/photobooth/widgets/shutter_button_test.dart b/test/photobooth/widgets/shutter_button_test.dart index 0c5ec51e..043937df 100644 --- a/test/photobooth/widgets/shutter_button_test.dart +++ b/test/photobooth/widgets/shutter_button_test.dart @@ -23,12 +23,12 @@ void main() { setUp(() { audioPlayer = MockAudioPlayer(); when(() => audioPlayer.setAsset(any())).thenAnswer((_) async => null); - when(() => audioPlayer.load()).thenAnswer((_) async => null); - when(() => audioPlayer.play()).thenAnswer((_) async => null); - when(() => audioPlayer.pause()).thenAnswer((_) async => null); - when(() => audioPlayer.stop()).thenAnswer((_) async => null); - when(() => audioPlayer.seek(any())).thenAnswer((_) async => null); - when(() => audioPlayer.dispose()).thenAnswer((_) async => null); + when(() => audioPlayer.load()).thenAnswer((_) async {}); + when(() => audioPlayer.play()).thenAnswer((_) async {}); + when(() => audioPlayer.pause()).thenAnswer((_) async {}); + when(() => audioPlayer.stop()).thenAnswer((_) async {}); + when(() => audioPlayer.seek(any())).thenAnswer((_) async {}); + when(() => audioPlayer.dispose()).thenAnswer((_) async {}); when(() => audioPlayer.playerStateStream).thenAnswer( (_) => Stream.fromIterable( [ @@ -107,10 +107,8 @@ void main() { final canvas = MockCanvas(); - TimerPainter( - animation: animation, - countdown: 3, - )..paint(canvas, const Size(200, 200)); + TimerPainter(animation: animation, countdown: 3) + .paint(canvas, const Size(200, 200)); verify(() => canvas.drawCircle(any(), any(), any())).called(1); verify(() => canvas.drawArc(any(), any(), any(), any(), any())).called(1); diff --git a/test/photobooth/widgets/stickers_layer_test.dart b/test/photobooth/widgets/stickers_layer_test.dart index b4ec923a..cd394b65 100644 --- a/test/photobooth/widgets/stickers_layer_test.dart +++ b/test/photobooth/widgets/stickers_layer_test.dart @@ -36,7 +36,7 @@ void main() { testWidgets('displays selected sticker assets', (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.android)], + characters: const [PhotoAsset(id: '0', asset: Assets.android)], stickers: [PhotoAsset(id: '0', asset: Assets.props.first)], image: image, ), @@ -54,7 +54,7 @@ void main() { testWidgets('displays multiple selected sticker assets', (tester) async { when(() => photoboothBloc.state).thenReturn( PhotoboothState( - characters: [PhotoAsset(id: '0', asset: Assets.android)], + characters: const [PhotoAsset(id: '0', asset: Assets.android)], stickers: [ PhotoAsset(id: '0', asset: Assets.props.first), PhotoAsset(id: '1', asset: Assets.props.first), diff --git a/test/share/bloc/share_bloc_test.dart b/test/share/bloc/share_bloc_test.dart index 0e8c482a..ba3a0b13 100644 --- a/test/share/bloc/share_bloc_test.dart +++ b/test/share/bloc/share_bloc_test.dart @@ -22,13 +22,13 @@ class MockAsset extends Mock implements Asset {} void main() { final data = 'data:image/png,${base64.encode(transparentImage)}'; final image = CameraImage(width: 0, height: 0, data: data); - final aspectRatio = PhotoboothAspectRatio.portrait; - final imageId = 'image-name'; - final shareText = 'share-text'; final imageData = Uint8List.fromList(transparentImage); - final explicitShareUrl = 'explicit-share-url'; - final twitterShareUrl = 'twitter-share-url'; - final facebookShareUrl = 'facebook-share-url'; + const aspectRatio = PhotoboothAspectRatio.portrait; + const imageId = 'image-name'; + const shareText = 'share-text'; + const explicitShareUrl = 'explicit-share-url'; + const twitterShareUrl = 'twitter-share-url'; + const facebookShareUrl = 'facebook-share-url'; group('ShareBloc', () { late PhotosRepository photosRepository; diff --git a/test/share/widgets/download_button_test.dart b/test/share/widgets/download_button_test.dart index 37d8ca32..04f23f4e 100644 --- a/test/share/widgets/download_button_test.dart +++ b/test/share/widgets/download_button_test.dart @@ -22,7 +22,7 @@ void main() { }); testWidgets('downloads file on tap', (tester) async { - when(() => file.saveTo(any())).thenAnswer((_) async => null); + when(() => file.saveTo(any())).thenAnswer((_) async {}); await tester.pumpApp(DownloadButton(file: file)); await tester.tap(find.byType(OutlinedButton)); diff --git a/test/stickers/widgets/stickers_drawer_layer/stickers_drawer_layer_test.dart b/test/stickers/widgets/stickers_drawer_layer/stickers_drawer_layer_test.dart index 35a235db..316766b4 100644 --- a/test/stickers/widgets/stickers_drawer_layer/stickers_drawer_layer_test.dart +++ b/test/stickers/widgets/stickers_drawer_layer/stickers_drawer_layer_test.dart @@ -53,7 +53,9 @@ void main() { await tester.pumpApp( BlocProvider.value( value: stickersBloc, - child: Scaffold(body: Stack(children: [StickersDrawerLayer()])), + child: Scaffold( + body: Stack(children: const [StickersDrawerLayer()]), + ), ), photoboothBloc: photoboothBloc, ); @@ -71,7 +73,9 @@ void main() { await tester.pumpApp( BlocProvider.value( value: stickersBloc, - child: Scaffold(body: Stack(children: [StickersDrawerLayer()])), + child: Scaffold( + body: Stack(children: const [StickersDrawerLayer()]), + ), ), photoboothBloc: photoboothBloc, ); @@ -88,7 +92,9 @@ void main() { await tester.pumpApp( BlocProvider.value( value: stickersBloc, - child: Scaffold(body: Stack(children: [StickersDrawerLayer()])), + child: Scaffold( + body: Stack(children: const [StickersDrawerLayer()]), + ), ), photoboothBloc: photoboothBloc, ); @@ -108,7 +114,9 @@ void main() { await tester.pumpApp( BlocProvider.value( value: stickersBloc, - child: Scaffold(body: Stack(children: [StickersDrawerLayer()])), + child: Scaffold( + body: Stack(children: const [StickersDrawerLayer()]), + ), ), photoboothBloc: photoboothBloc, ); @@ -135,7 +143,9 @@ void main() { await tester.pumpApp( BlocProvider.value( value: stickersBloc, - child: Scaffold(body: Stack(children: [StickersDrawerLayer()])), + child: Scaffold( + body: Stack(children: const [StickersDrawerLayer()]), + ), ), photoboothBloc: photoboothBloc, ); @@ -201,7 +211,9 @@ void main() { await tester.pumpApp( BlocProvider.value( value: stickersBloc, - child: Scaffold(body: Stack(children: [StickersDrawerLayer()])), + child: Scaffold( + body: Stack(children: const [StickersDrawerLayer()]), + ), ), photoboothBloc: photoboothBloc, );