diff --git a/analysis_options.yaml b/analysis_options.yaml index 426f7214..0bb75cd0 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -9,6 +9,11 @@ # packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml +analyzer: + errors: + prefer_const_constructors: ignore + unused_element: ignore # mostly because of super.key + linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` @@ -22,9 +27,8 @@ linter: # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: - always_declare_return_types: true - always_use_package_imports: true - prefer_const_constructors: false - prefer_single_quotes: true + - always_declare_return_types + - always_use_package_imports + - prefer_single_quotes # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/lib/_tools/artifact_search_helper.dart b/lib/_tools/artifact_search_helper.dart index 5f74d24e..a7c387bc 100644 --- a/lib/_tools/artifact_search_helper.dart +++ b/lib/_tools/artifact_search_helper.dart @@ -16,7 +16,7 @@ final int maxYear = wondersLogic.timelineEndYear; const int maxRequests = 32; class ArtifactSearchHelper extends StatefulWidget { - const ArtifactSearchHelper({Key? key}) : super(key: key); + const ArtifactSearchHelper({super.key}); @override State createState() => _ArtifactSearchHelperState(); @@ -161,10 +161,14 @@ class _ArtifactSearchHelperState extends State { //if (!json.containsKey('isPublicDomain') || !json['isPublicDomain']) return _logError(id, 'not public domain') final int year = ((json['objectBeginDate'] as int) + (json['objectEndDate'] as int)) ~/ 2; - if (year < minYear || year > maxYear) return _logError(id, 'year is out of range'); + if (year < minYear || year > maxYear) { + return _logError(id, 'year is out of range'); + } String? imageUrlSmall = json['primaryImageSmall']; - if (imageUrlSmall == null || imageUrlSmall.isEmpty) return _logError(id, 'no small image url'); + if (imageUrlSmall == null || imageUrlSmall.isEmpty) { + return _logError(id, 'no small image url'); + } // if (!imageUrlSmall.startsWith(SearchData.baseImagePath)) { // return _logError(id, 'unexpected image uri: "$imageUrlSmall"'); // } diff --git a/lib/assets.dart b/lib/assets.dart index d27d1f9a..eb0005ef 100644 --- a/lib/assets.dart +++ b/lib/assets.dart @@ -43,24 +43,16 @@ class SvgPaths { /// For wonder specific assets, add an extension to [WonderType] for easy lookup extension WonderAssetExtensions on WonderType { String get assetPath { - switch (this) { - case WonderType.pyramidsGiza: - return '${ImagePaths.root}/pyramids'; - case WonderType.greatWall: - return '${ImagePaths.root}/great_wall_of_china'; - case WonderType.petra: - return '${ImagePaths.root}/petra'; - case WonderType.colosseum: - return '${ImagePaths.root}/colosseum'; - case WonderType.chichenItza: - return '${ImagePaths.root}/chichen_itza'; - case WonderType.machuPicchu: - return '${ImagePaths.root}/machu_picchu'; - case WonderType.tajMahal: - return '${ImagePaths.root}/taj_mahal'; - case WonderType.christRedeemer: - return '${ImagePaths.root}/christ_the_redeemer'; - } + return switch (this) { + WonderType.pyramidsGiza => '${ImagePaths.root}/pyramids', + WonderType.greatWall => '${ImagePaths.root}/great_wall_of_china', + WonderType.petra => '${ImagePaths.root}/petra', + WonderType.colosseum => '${ImagePaths.root}/colosseum', + WonderType.chichenItza => '${ImagePaths.root}/chichen_itza', + WonderType.machuPicchu => '${ImagePaths.root}/machu_picchu', + WonderType.tajMahal => '${ImagePaths.root}/taj_mahal', + WonderType.christRedeemer => '${ImagePaths.root}/christ_the_redeemer' + }; } String get homeBtn => '$assetPath/wonder-button.png'; diff --git a/lib/common_libs.dart b/lib/common_libs.dart index 26196000..a6b6219e 100644 --- a/lib/common_libs.dart +++ b/lib/common_libs.dart @@ -1,4 +1,5 @@ /// Consolidate imports that are common across the app. +library; export 'dart:math'; diff --git a/lib/logic/collectibles_logic.dart b/lib/logic/collectibles_logic.dart index f4b519df..3477dce0 100644 --- a/lib/logic/collectibles_logic.dart +++ b/lib/logic/collectibles_logic.dart @@ -98,7 +98,7 @@ class CollectiblesLogic with ThrottledSaveLoadMixin { } Future _updateNativeHomeWidgetData({String title = '', String id = '', String imageUrl = ''}) async { - if(!_nativeWidget.isSupported) return; + if (!_nativeWidget.isSupported) return; // Save title await _nativeWidget.save('lastDiscoveredTitle', title); // Subtitle diff --git a/lib/logic/data/unsplash_photo_data.dart b/lib/logic/data/unsplash_photo_data.dart index 175a5e91..3669d368 100644 --- a/lib/logic/data/unsplash_photo_data.dart +++ b/lib/logic/data/unsplash_photo_data.dart @@ -14,18 +14,11 @@ class UnsplashPhotoData { String getUnsplashUrl(int size) => '$url?q=90&fm=jpg&w=$size&fit=max'; static String getSelfHostedUrl(String id, UnsplashPhotoSize targetSize) { - late int size; - switch (targetSize) { - case UnsplashPhotoSize.med: - size = 400; - break; - case UnsplashPhotoSize.large: - size = 800; - break; - case UnsplashPhotoSize.xl: - size = 1200; - break; - } + int size = switch (targetSize) { + UnsplashPhotoSize.med => 400, + UnsplashPhotoSize.large => 800, + UnsplashPhotoSize.xl => 1200 + }; if (PlatformInfo.pixelRatio >= 1.5 || PlatformInfo.isDesktop) { size *= 2; } diff --git a/lib/logic/data/wonders_data/chichen_itza_data.dart b/lib/logic/data/wonders_data/chichen_itza_data.dart index 7c041fcc..c4f1a83c 100644 --- a/lib/logic/data/wonders_data/chichen_itza_data.dart +++ b/lib/logic/data/wonders_data/chichen_itza_data.dart @@ -60,4 +60,4 @@ class ChichenItzaData extends WonderData { 1535: $strings.chichenItza1535ce, }, ); -} \ No newline at end of file +} diff --git a/lib/logic/unsplash_logic.dart b/lib/logic/unsplash_logic.dart index a85a505f..13fe9424 100644 --- a/lib/logic/unsplash_logic.dart +++ b/lib/logic/unsplash_logic.dart @@ -8,5 +8,4 @@ class UnsplashLogic { UnsplashService get service => GetIt.I.get(); List? getCollectionPhotos(String collectionId) => _idsByCollection[collectionId]; - } diff --git a/lib/main.dart b/lib/main.dart index cc784bf4..9a300667 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -30,7 +30,7 @@ void main() async { /// Creates an app using the [MaterialApp.router] constructor and the global `appRouter`, an instance of [GoRouter]. class WondersApp extends StatelessWidget with GetItMixin { - WondersApp({Key? key}) : super(key: key); + WondersApp({super.key}); @override Widget build(BuildContext context) { final locale = watchX((SettingsLogic s) => s.currentLocale); diff --git a/lib/styles/styles.dart b/lib/styles/styles.dart index a36f57b2..03eaf412 100644 --- a/lib/styles/styles.dart +++ b/lib/styles/styles.dart @@ -1,7 +1,5 @@ // ignore_for_file: library_private_types_in_public_api -import 'dart:ui'; - import 'package:wonders/common_libs.dart'; export 'colors.dart'; diff --git a/lib/styles/wonders_color_extensions.dart b/lib/styles/wonders_color_extensions.dart index 67ab0820..c1f1d132 100644 --- a/lib/styles/wonders_color_extensions.dart +++ b/lib/styles/wonders_color_extensions.dart @@ -2,45 +2,29 @@ import 'package:wonders/common_libs.dart'; extension WonderColorExtensions on WonderType { Color get bgColor { - switch (this) { - case WonderType.pyramidsGiza: - return const Color(0xFF16184D); - case WonderType.greatWall: - return const Color(0xFF642828); - case WonderType.petra: - return const Color(0xFF444B9B); - case WonderType.colosseum: - return const Color(0xFF1E736D); - case WonderType.chichenItza: - return const Color(0xFF164F2A); - case WonderType.machuPicchu: - return const Color(0xFF0E4064); - case WonderType.tajMahal: - return const Color(0xFFC96454); - case WonderType.christRedeemer: - return const Color(0xFF1C4D46); - } + return switch (this) { + WonderType.pyramidsGiza => const Color(0xFF16184D), + WonderType.greatWall => const Color(0xFF642828), + WonderType.petra => const Color(0xFF444B9B), + WonderType.colosseum => const Color(0xFF1E736D), + WonderType.chichenItza => const Color(0xFF164F2A), + WonderType.machuPicchu => const Color(0xFF0E4064), + WonderType.tajMahal => const Color(0xFFC96454), + WonderType.christRedeemer => const Color(0xFF1C4D46) + }; } Color get fgColor { - switch (this) { - case WonderType.pyramidsGiza: - return const Color(0xFF444B9B); - case WonderType.greatWall: - return const Color(0xFF688750); - case WonderType.petra: - return const Color(0xFF1B1A65); - case WonderType.colosseum: - return const Color(0xFF4AA39D); - case WonderType.chichenItza: - return const Color(0xFFE2CFBB); - case WonderType.machuPicchu: - return const Color(0xFFC1D9D1); - case WonderType.tajMahal: - return const Color(0xFF642828); - case WonderType.christRedeemer: - return const Color(0xFFED7967); - } + return switch (this) { + WonderType.pyramidsGiza => const Color(0xFF444B9B), + WonderType.greatWall => const Color(0xFF688750), + WonderType.petra => const Color(0xFF1B1A65), + WonderType.colosseum => const Color(0xFF4AA39D), + WonderType.chichenItza => const Color(0xFFE2CFBB), + WonderType.machuPicchu => const Color(0xFFC1D9D1), + WonderType.tajMahal => const Color(0xFF642828), + WonderType.christRedeemer => const Color(0xFFED7967) + }; } } diff --git a/lib/ui/app_scaffold.dart b/lib/ui/app_scaffold.dart index d74aaf8b..8b62a778 100644 --- a/lib/ui/app_scaffold.dart +++ b/lib/ui/app_scaffold.dart @@ -2,7 +2,7 @@ import 'package:wonders/common_libs.dart'; import 'package:wonders/ui/common/app_scroll_behavior.dart'; class WondersAppScaffold extends StatelessWidget { - const WondersAppScaffold({Key? key, required this.child}) : super(key: key); + const WondersAppScaffold({super.key, required this.child}); final Widget child; static AppStyle get style => _style; static AppStyle _style = AppStyle(); diff --git a/lib/ui/common/app_backdrop.dart b/lib/ui/common/app_backdrop.dart index f7ed8efa..3a89b4f3 100644 --- a/lib/ui/common/app_backdrop.dart +++ b/lib/ui/common/app_backdrop.dart @@ -1,14 +1,13 @@ import 'dart:ui'; -import 'package:flutter/foundation.dart'; import 'package:wonders/common_libs.dart'; class AppBackdrop extends StatelessWidget { const AppBackdrop({ - Key? key, + super.key, this.strength = 1, this.child, - }) : super(key: key); + }); final double strength; final Widget? child; diff --git a/lib/ui/common/app_icons.dart b/lib/ui/common/app_icons.dart index 9543d719..d40f93de 100644 --- a/lib/ui/common/app_icons.dart +++ b/lib/ui/common/app_icons.dart @@ -2,7 +2,7 @@ import 'package:wonders/common_libs.dart'; class AppIcon extends StatelessWidget { - const AppIcon(this.icon, {Key? key, this.size = 22, this.color}) : super(key: key); + const AppIcon(this.icon, {super.key, this.size = 22, this.color}); final AppIcons icon; final double size; final Color? color; diff --git a/lib/ui/common/app_shortcuts.dart b/lib/ui/common/app_shortcuts.dart index ff3d3186..2b74da95 100644 --- a/lib/ui/common/app_shortcuts.dart +++ b/lib/ui/common/app_shortcuts.dart @@ -34,14 +34,11 @@ class AppShortcuts { }; static Map? get defaults { - switch (defaultTargetPlatform) { + return switch (defaultTargetPlatform) { // fall back to default shortcuts for ios and android - case TargetPlatform.iOS: - case TargetPlatform.android: - return null; + TargetPlatform.iOS || TargetPlatform.android => null, // unify shortcuts for desktop/web - default: - return _defaultWebAndDesktopShortcuts; - } + _ => _defaultWebAndDesktopShortcuts + }; } } diff --git a/lib/ui/common/blend_mask.dart b/lib/ui/common/blend_mask.dart index bbfd5194..8e55adf0 100644 --- a/lib/ui/common/blend_mask.dart +++ b/lib/ui/common/blend_mask.dart @@ -5,8 +5,7 @@ class BlendMask extends SingleChildRenderObjectWidget { final List blendModes; final double opacity; - const BlendMask({required this.blendModes, this.opacity = 1.0, Key? key, required Widget child}) - : super(key: key, child: child); + const BlendMask({required this.blendModes, this.opacity = 1.0, super.key, required Widget super.child}); @override RenderObject createRenderObject(context) => RenderBlendMask(blendModes, opacity); diff --git a/lib/ui/common/centered_box.dart b/lib/ui/common/centered_box.dart index 23af7b3a..4140e16d 100644 --- a/lib/ui/common/centered_box.dart +++ b/lib/ui/common/centered_box.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; class CenteredBox extends StatelessWidget { - const CenteredBox({Key? key, required this.child, this.width, this.height, this.padding}) : super(key: key); + const CenteredBox({super.key, required this.child, this.width, this.height, this.padding}); final Widget child; final double? width; final double? height; diff --git a/lib/ui/common/collectible_item.dart b/lib/ui/common/collectible_item.dart index 3aa7d7eb..64464203 100644 --- a/lib/ui/common/collectible_item.dart +++ b/lib/ui/common/collectible_item.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/common/utils/app_haptics.dart'; import 'package:wonders/ui/screens/collectible_found/collectible_found_screen.dart'; class CollectibleItem extends StatelessWidget with GetItMixin { - CollectibleItem(this.collectible, {this.size = 64.0, Key? key, this.focus}) : super(key: key) { + CollectibleItem(this.collectible, {this.size = 64.0, super.key, this.focus}) { // pre-fetch the image, so it's ready if we show the collectible found screen. _imageProvider = NetworkImage(collectible.imageUrl); _imageProvider.resolve(ImageConfiguration()).addListener(ImageStreamListener((_, __) {})); diff --git a/lib/ui/common/compass_divider.dart b/lib/ui/common/compass_divider.dart index 5d23fdcc..d19958b8 100644 --- a/lib/ui/common/compass_divider.dart +++ b/lib/ui/common/compass_divider.dart @@ -2,8 +2,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:wonders/common_libs.dart'; class CompassDivider extends StatelessWidget { - const CompassDivider({Key? key, required this.isExpanded, this.duration, this.linesColor, this.compassColor}) - : super(key: key); + const CompassDivider({super.key, required this.isExpanded, this.duration, this.linesColor, this.compassColor}); final bool isExpanded; final Duration? duration; final Color? linesColor; diff --git a/lib/ui/common/controls/app_header.dart b/lib/ui/common/controls/app_header.dart index f04cae2e..983a1917 100644 --- a/lib/ui/common/controls/app_header.dart +++ b/lib/ui/common/controls/app_header.dart @@ -3,7 +3,7 @@ import 'package:wonders/ui/common/app_icons.dart'; class AppHeader extends StatelessWidget { const AppHeader( - {Key? key, + {super.key, this.title, this.subtitle, this.showBackBtn = true, @@ -11,8 +11,7 @@ class AppHeader extends StatelessWidget { this.onBack, this.trailing, this.backIcon = AppIcons.prev, - this.backBtnSemantics}) - : super(key: key); + this.backBtnSemantics}); final String? title; final String? subtitle; final bool showBackBtn; diff --git a/lib/ui/common/controls/app_image.dart b/lib/ui/common/controls/app_image.dart index 1a5b6c59..2ec18f5b 100644 --- a/lib/ui/common/controls/app_image.dart +++ b/lib/ui/common/controls/app_image.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/common/controls/app_loading_indicator.dart'; class AppImage extends StatefulWidget { const AppImage({ - Key? key, + super.key, required this.image, this.fit = BoxFit.scaleDown, this.alignment = Alignment.center, @@ -16,7 +16,7 @@ class AppImage extends StatefulWidget { this.progress = false, this.color, this.scale, - }) : super(key: key); + }); final ImageProvider? image; final BoxFit fit; @@ -88,7 +88,9 @@ class _AppImageState extends State { ImageProvider? _capImageSize(ImageProvider? image) { // Disable resizing for web as it is currently single-threaded and causes the UI to lock up when resizing large images - if (kIsWeb) return image; // TODO: Remove this when the web engine is updated to support non-blocking image resizing + if (kIsWeb) { + return image; // TODO: Remove this when the web engine is updated to support non-blocking image resizing + } if (image == null || widget.scale == null) return image; final MediaQueryData mq = MediaQuery.of(context); final Size screenSize = mq.size * mq.devicePixelRatio * widget.scale!; diff --git a/lib/ui/common/controls/app_loading_indicator.dart b/lib/ui/common/controls/app_loading_indicator.dart index 5576796c..ff12baeb 100644 --- a/lib/ui/common/controls/app_loading_indicator.dart +++ b/lib/ui/common/controls/app_loading_indicator.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; class AppLoadingIndicator extends StatelessWidget { - const AppLoadingIndicator({Key? key, this.value, this.color}) : super(key: key); + const AppLoadingIndicator({super.key, this.value, this.color}); final Color? color; final double? value; diff --git a/lib/ui/common/controls/app_page_indicator.dart b/lib/ui/common/controls/app_page_indicator.dart index 352d10e7..3c00fa9a 100644 --- a/lib/ui/common/controls/app_page_indicator.dart +++ b/lib/ui/common/controls/app_page_indicator.dart @@ -3,15 +3,14 @@ import 'package:wonders/common_libs.dart'; class AppPageIndicator extends StatefulWidget { AppPageIndicator({ - Key? key, + super.key, required this.count, required this.controller, this.onDotPressed, this.color, this.dotSize, String? semanticPageTitle, - }) : semanticPageTitle = semanticPageTitle ?? $strings.appPageDefaultTitlePage, - super(key: key); + }) : semanticPageTitle = semanticPageTitle ?? $strings.appPageDefaultTitlePage; final int count; final PageController controller; final void Function(int index)? onDotPressed; diff --git a/lib/ui/common/controls/buttons.dart b/lib/ui/common/controls/buttons.dart index c210a511..3ffdd087 100644 --- a/lib/ui/common/controls/buttons.dart +++ b/lib/ui/common/controls/buttons.dart @@ -9,7 +9,7 @@ Widget _buildIcon(BuildContext context, AppIcons icon, {required bool isSecondar class AppBtn extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables AppBtn({ - Key? key, + super.key, required this.onPressed, required this.semanticLabel, this.enableFeedback = true, @@ -24,11 +24,10 @@ class AppBtn extends StatelessWidget { this.border, this.focusNode, this.onFocusChanged, - }) : _builder = null, - super(key: key); + }) : _builder = null; AppBtn.from({ - Key? key, + super.key, required this.onPressed, this.enableFeedback = true, this.pressEffect = true, @@ -45,9 +44,10 @@ class AppBtn extends StatelessWidget { AppIcons? icon, double? iconSize, }) : child = null, - circular = false, - super(key: key) { - if (semanticLabel == null && text == null) throw ('AppBtn.from must include either text or semanticLabel'); + circular = false { + if (semanticLabel == null && text == null) { + throw ('AppBtn.from must include either text or semanticLabel'); + } this.semanticLabel = semanticLabel ?? text ?? ''; _builder = (context) { if (text == null && icon == null) return SizedBox.shrink(); @@ -70,7 +70,7 @@ class AppBtn extends StatelessWidget { // ignore: prefer_const_constructors_in_immutables AppBtn.basic({ - Key? key, + super.key, required this.onPressed, required this.semanticLabel, this.enableFeedback = true, @@ -85,8 +85,7 @@ class AppBtn extends StatelessWidget { }) : expand = false, bgColor = Colors.transparent, border = null, - _builder = null, - super(key: key); + _builder = null; // interaction: final VoidCallback? onPressed; @@ -185,7 +184,7 @@ class AppBtn extends StatelessWidget { /// Add a transparency-based press effect to buttons. /// ////////////////////////////////////////////////// class _ButtonPressEffect extends StatefulWidget { - const _ButtonPressEffect(this.child, {Key? key}) : super(key: key); + const _ButtonPressEffect(this.child); final Widget child; @override @@ -212,7 +211,7 @@ class _ButtonPressEffectState extends State<_ButtonPressEffect> { } class _CustomFocusBuilder extends StatefulWidget { - const _CustomFocusBuilder({Key? key, required this.builder, this.focusNode, this.onFocusChanged}) : super(key: key); + const _CustomFocusBuilder({required this.builder, this.focusNode, this.onFocusChanged}); final Widget Function(BuildContext context, FocusNode focus) builder; final void Function(bool hasFocus)? onFocusChanged; final FocusNode? focusNode; diff --git a/lib/ui/common/controls/checkbox.dart b/lib/ui/common/controls/checkbox.dart index 455cd9b2..1cf8d1dc 100644 --- a/lib/ui/common/controls/checkbox.dart +++ b/lib/ui/common/controls/checkbox.dart @@ -2,8 +2,7 @@ import 'package:wonders/common_libs.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; class SimpleCheckbox extends StatelessWidget { - const SimpleCheckbox({Key? key, required this.active, required this.onToggled, required this.label}) - : super(key: key); + const SimpleCheckbox({super.key, required this.active, required this.onToggled, required this.label}); final bool active; final String label; final Function(bool? onToggle) onToggled; diff --git a/lib/ui/common/controls/circle_buttons.dart b/lib/ui/common/controls/circle_buttons.dart index ef80916d..96a3d039 100644 --- a/lib/ui/common/controls/circle_buttons.dart +++ b/lib/ui/common/controls/circle_buttons.dart @@ -4,14 +4,14 @@ import 'package:wonders/ui/common/fullscreen_keyboard_listener.dart'; class CircleBtn extends StatelessWidget { const CircleBtn({ - Key? key, + super.key, required this.child, required this.onPressed, this.border, this.bgColor, this.size, required this.semanticLabel, - }) : super(key: key); + }); static double defaultSize = 48; @@ -40,7 +40,7 @@ class CircleBtn extends StatelessWidget { class CircleIconBtn extends StatelessWidget { const CircleIconBtn({ - Key? key, + super.key, required this.icon, required this.onPressed, this.border, @@ -50,7 +50,7 @@ class CircleIconBtn extends StatelessWidget { this.iconSize, this.flipIcon = false, required this.semanticLabel, - }) : super(key: key); + }); //TODO: Reduce size if design re-exports icon-images without padding static double defaultSize = 28; @@ -87,13 +87,13 @@ class CircleIconBtn extends StatelessWidget { class BackBtn extends StatelessWidget { const BackBtn({ - Key? key, + super.key, this.icon = AppIcons.prev, this.onPressed, this.semanticLabel, this.bgColor, this.iconColor, - }) : super(key: key); + }); final Color? bgColor; final Color? iconColor; @@ -121,20 +121,23 @@ class BackBtn extends StatelessWidget { @override Widget build(BuildContext context) { return FullscreenKeyboardListener( - onKeyDown: (event) => _handleKeyDown(context, event), child: CircleIconBtn( - icon: icon, - bgColor: bgColor, - color: iconColor, - onPressed: onPressed ?? () { - final nav = Navigator.of(context); - if(nav.canPop()){ - Navigator.pop(context); - } else { - context.go(ScreenPaths.home); - } - }, - semanticLabel: semanticLabel ?? $strings.circleButtonsSemanticBack, - ),); + onKeyDown: (event) => _handleKeyDown(context, event), + child: CircleIconBtn( + icon: icon, + bgColor: bgColor, + color: iconColor, + onPressed: onPressed ?? + () { + final nav = Navigator.of(context); + if (nav.canPop()) { + Navigator.pop(context); + } else { + context.go(ScreenPaths.home); + } + }, + semanticLabel: semanticLabel ?? $strings.circleButtonsSemanticBack, + ), + ); } Widget safe() => _SafeAreaWithPadding(child: this); @@ -153,7 +156,7 @@ class BackBtn extends StatelessWidget { } class _SafeAreaWithPadding extends StatelessWidget { - const _SafeAreaWithPadding({Key? key, required this.child}) : super(key: key); + const _SafeAreaWithPadding({required this.child}); final Widget child; diff --git a/lib/ui/common/controls/diagonal_text_page_indicator.dart b/lib/ui/common/controls/diagonal_text_page_indicator.dart index 881727b5..a7d43916 100644 --- a/lib/ui/common/controls/diagonal_text_page_indicator.dart +++ b/lib/ui/common/controls/diagonal_text_page_indicator.dart @@ -2,7 +2,7 @@ import 'package:wonders/common_libs.dart'; import 'package:wonders/ui/common/static_text_scale.dart'; class DiagonalTextPageIndicator extends StatelessWidget { - const DiagonalTextPageIndicator({Key? key, required this.current, required this.total}) : super(key: key); + const DiagonalTextPageIndicator({super.key, required this.current, required this.total}); final int current; final int total; static final _fontSize = 26 * $styles.scale; diff --git a/lib/ui/common/controls/eight_way_swipe_detector.dart b/lib/ui/common/controls/eight_way_swipe_detector.dart index e831cdd2..f4a65257 100644 --- a/lib/ui/common/controls/eight_way_swipe_detector.dart +++ b/lib/ui/common/controls/eight_way_swipe_detector.dart @@ -1,8 +1,7 @@ import 'package:wonders/common_libs.dart'; class EightWaySwipeDetector extends StatefulWidget { - const EightWaySwipeDetector({Key? key, required this.child, this.threshold = 50, required this.onSwipe}) - : super(key: key); + const EightWaySwipeDetector({super.key, required this.child, this.threshold = 50, required this.onSwipe}); final Widget child; final double threshold; final void Function(Offset dir)? onSwipe; diff --git a/lib/ui/common/controls/locale_switcher.dart b/lib/ui/common/controls/locale_switcher.dart index debc42e1..0bf5c9b3 100644 --- a/lib/ui/common/controls/locale_switcher.dart +++ b/lib/ui/common/controls/locale_switcher.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; class LocaleSwitcher extends StatelessWidget with GetItMixin { - LocaleSwitcher({Key? key}) : super(key: key); + LocaleSwitcher({super.key}); @override Widget build(BuildContext context) { @@ -11,6 +11,7 @@ class LocaleSwitcher extends StatelessWidget with GetItMixin { await settingsLogic.changeLocale(newLocale); } - return AppBtn.from(text: $strings.localeSwapButton, onPressed: handleSwapLocale, padding: EdgeInsets.all($styles.insets.sm)); + return AppBtn.from( + text: $strings.localeSwapButton, onPressed: handleSwapLocale, padding: EdgeInsets.all($styles.insets.sm)); } } diff --git a/lib/ui/common/controls/scroll_decorator.dart b/lib/ui/common/controls/scroll_decorator.dart index 959e8913..1255999d 100644 --- a/lib/ui/common/controls/scroll_decorator.dart +++ b/lib/ui/common/controls/scroll_decorator.dart @@ -6,19 +6,19 @@ class ScrollDecorator extends StatefulWidget { /// its ScrollController. // ignore: prefer_const_constructors_in_immutables ScrollDecorator({ - Key? key, + super.key, required this.builder, this.fgBuilder, this.bgBuilder, this.controller, this.onInit, - }) : super(key: key); + }); /// Creates a ScrollDecorator that fades a widget in at the begin or end of the scrolling widget based on the scroll /// position. For example on a vertical list, it would fade in the `begin` widget when the list is not scrolled to the /// top. ScrollDecorator.fade({ - Key? key, + super.key, required this.builder, this.controller, this.onInit, @@ -27,7 +27,7 @@ class ScrollDecorator extends StatefulWidget { bool bg = false, Axis direction = Axis.vertical, Duration duration = const Duration(milliseconds: 150), - }) : super(key: key) { + }) { Flex flexBuilder(controller) { return Flex( direction: direction, @@ -55,12 +55,12 @@ class ScrollDecorator extends StatefulWidget { /// Creates an ScrollDecorator that adds a shadow to the top of a vertical list when it is scrolled down. ScrollDecorator.shadow({ - Key? key, + super.key, required this.builder, this.controller, this.onInit, Color color = Colors.black54, - }) : super(key: key) { + }) { bgBuilder = null; fgBuilder = (controller) { final double ratio = controller.hasClients ? min(1, controller.position.extentBefore / 60) : 0; diff --git a/lib/ui/common/curved_clippers.dart b/lib/ui/common/curved_clippers.dart index d0bf9747..9617e772 100644 --- a/lib/ui/common/curved_clippers.dart +++ b/lib/ui/common/curved_clippers.dart @@ -40,33 +40,29 @@ class ArchPoint { List _getArchPts(Size size, ArchType type) { double distanceFromTop = size.width / 3; - switch (type) { - case ArchType.pyramid: - return [ + return switch (type) { + ArchType.pyramid => [ ArchPoint(Offset(0, size.height)), ArchPoint(Offset(0, distanceFromTop)), ArchPoint(Offset(size.width / 2, 0)), ArchPoint(Offset(size.width, distanceFromTop)), ArchPoint(Offset(size.width, size.height)), - ]; - case ArchType.spade: - return [ + ], + ArchType.spade => [ ArchPoint(Offset(0, size.height)), ArchPoint(Offset(0, distanceFromTop)), ArchPoint(Offset(size.width / 2, 0), Offset(0, distanceFromTop * .66)), ArchPoint(Offset(size.width, distanceFromTop), Offset(size.width, distanceFromTop * .66)), ArchPoint(Offset(size.width, size.height)), - ]; - case ArchType.arch: - return [ + ], + ArchType.arch => [ ArchPoint(Offset(0, size.height)), ArchPoint(Offset(0, size.width / 2)), ArchPoint(Offset(size.width / 2, 0), Offset(0, 0)), ArchPoint(Offset(size.width, size.width / 2), Offset(size.width, 0)), ArchPoint(Offset(size.width, size.height)), - ]; - case ArchType.wideArch: - return [ + ], + ArchType.wideArch => [ ArchPoint(Offset(0, size.height)), ArchPoint(Offset(0, size.width / 2)), ArchPoint(Offset(0, distanceFromTop)), @@ -74,17 +70,16 @@ List _getArchPts(Size size, ArchType type) { ArchPoint(Offset(size.width, distanceFromTop), Offset(size.width, 0)), ArchPoint(Offset(size.width, size.width / 2)), ArchPoint(Offset(size.width, size.height)), - ]; - case ArchType.flatPyramid: - return [ + ], + ArchType.flatPyramid => [ ArchPoint(Offset(0, size.height)), ArchPoint(Offset(0, distanceFromTop)), ArchPoint(Offset(size.width * 0.8 / 2, 0)), ArchPoint(Offset(size.width * 1.2 / 2, 0)), ArchPoint(Offset(size.width, distanceFromTop)), ArchPoint(Offset(size.width, size.height)), - ]; - } + ] + }; } class CurvedTopClipper extends CustomClipper { diff --git a/lib/ui/common/dashed_line.dart b/lib/ui/common/dashed_line.dart index 52b0da90..fac03698 100644 --- a/lib/ui/common/dashed_line.dart +++ b/lib/ui/common/dashed_line.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; class DashedLine extends StatelessWidget { - const DashedLine({Key? key, this.vertical = false}) : super(key: key); + const DashedLine({super.key, this.vertical = false}); final bool vertical; @override diff --git a/lib/ui/common/fade_color_transition.dart b/lib/ui/common/fade_color_transition.dart index fd394a4b..b1ab6ee3 100644 --- a/lib/ui/common/fade_color_transition.dart +++ b/lib/ui/common/fade_color_transition.dart @@ -3,7 +3,7 @@ import 'package:wonders/common_libs.dart'; /// Colored box that can fade in and out, should yield better performance than /// fading with an additional Opacity layer. class FadeColorTransition extends StatelessWidget { - const FadeColorTransition({Key? key, required this.animation, required this.color}) : super(key: key); + const FadeColorTransition({super.key, required this.animation, required this.color}); final Animation animation; final Color color; diff --git a/lib/ui/common/gradient_container.dart b/lib/ui/common/gradient_container.dart index 5010904b..44fb789e 100644 --- a/lib/ui/common/gradient_container.dart +++ b/lib/ui/common/gradient_container.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class GradientContainer extends StatelessWidget { const GradientContainer(this.colors, this.stops, - {Key? key, + {super.key, this.child, this.width, this.height, @@ -10,8 +10,7 @@ class GradientContainer extends StatelessWidget { this.begin, this.end, this.blendMode, - this.borderRadius}) - : super(key: key); + this.borderRadius}); final List colors; final List stops; final double? width; @@ -45,41 +44,12 @@ class GradientContainer extends StatelessWidget { } class HzGradient extends GradientContainer { - const HzGradient(List colors, List stops, - {Key? key, - Widget? child, - double? width, - double? height, - Alignment? alignment, - BlendMode? blendMode, - BorderRadius? borderRadius}) - : super(colors, stops, - key: key, - child: child, - width: width, - height: height, - alignment: alignment, - blendMode: blendMode, - borderRadius: borderRadius); + const HzGradient(super.colors, super.stops, + {super.key, super.child, super.width, super.height, super.alignment, super.blendMode, super.borderRadius}); } class VtGradient extends GradientContainer { - const VtGradient(List colors, List stops, - {Key? key, - Widget? child, - double? width, - double? height, - Alignment? alignment, - BlendMode? blendMode, - BorderRadius? borderRadius}) - : super(colors, stops, - key: key, - child: child, - width: width, - height: height, - alignment: alignment, - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - blendMode: blendMode, - borderRadius: borderRadius); + const VtGradient(super.colors, super.stops, + {super.key, super.child, super.width, super.height, super.alignment, super.blendMode, super.borderRadius}) + : super(begin: Alignment.topCenter, end: Alignment.bottomCenter); } diff --git a/lib/ui/common/hidden_collectible.dart b/lib/ui/common/hidden_collectible.dart index dde15ac9..6d67d591 100644 --- a/lib/ui/common/hidden_collectible.dart +++ b/lib/ui/common/hidden_collectible.dart @@ -6,9 +6,8 @@ import 'package:wonders/ui/common/collectible_item.dart'; /// If `wonders` is empty, then the collectible is always shown. class HiddenCollectible extends StatelessWidget with GetItMixin { HiddenCollectible(this.currentWonder, - {Key? key, required this.index, this.matches = const [], this.size = 64, this.focus}) - : assert(index <= 2, 'index should not exceed 2'), - super(key: key); + {super.key, required this.index, this.matches = const [], this.size = 64, this.focus}) + : assert(index <= 2, 'index should not exceed 2'); final int index; final double size; final List matches; diff --git a/lib/ui/common/keyboard_arrows_listener.dart b/lib/ui/common/keyboard_arrows_listener.dart index fd7d3e90..bf4f01ef 100644 --- a/lib/ui/common/keyboard_arrows_listener.dart +++ b/lib/ui/common/keyboard_arrows_listener.dart @@ -9,7 +9,7 @@ class ArrowDir { } class KeyboardArrowsListener extends StatefulWidget { - const KeyboardArrowsListener({Key? key, required this.child, required this.onArrow}) : super(key: key); + const KeyboardArrowsListener({super.key, required this.child, required this.onArrow}); final Widget child; final void Function(ArrowDir dir) onArrow; @override diff --git a/lib/ui/common/lazy_indexed_stack.dart b/lib/ui/common/lazy_indexed_stack.dart index acc82e8e..e9138c49 100644 --- a/lib/ui/common/lazy_indexed_stack.dart +++ b/lib/ui/common/lazy_indexed_stack.dart @@ -3,13 +3,13 @@ import 'package:flutter/material.dart'; /// A lazy-loading [IndexedStack] that loads [children] accordingly. class LazyIndexedStack extends StatefulWidget { const LazyIndexedStack({ - Key? key, + super.key, this.alignment = AlignmentDirectional.topStart, this.textDirection, this.sizing = StackFit.loose, this.index = 0, this.children = const [], - }) : super(key: key); + }); final AlignmentGeometry alignment; final TextDirection? textDirection; diff --git a/lib/ui/common/list_gradient.dart b/lib/ui/common/list_gradient.dart index 3c35371b..35bef772 100644 --- a/lib/ui/common/list_gradient.dart +++ b/lib/ui/common/list_gradient.dart @@ -4,7 +4,7 @@ import 'package:wonders/ui/common/gradient_container.dart'; /// Used for situations where the list content should blend into a background color. /// Can be placed at the top or bottom of a list, using the `flip' option when on the bottom class ListOverscollGradient extends StatelessWidget { - const ListOverscollGradient({Key? key, this.size = 100, this.color, this.bottomUp = false}) : super(key: key); + const ListOverscollGradient({super.key, this.size = 100, this.color, this.bottomUp = false}); final bool bottomUp; final double size; final Color? color; diff --git a/lib/ui/common/measurable_widget.dart b/lib/ui/common/measurable_widget.dart index dc3bd472..01c4a314 100644 --- a/lib/ui/common/measurable_widget.dart +++ b/lib/ui/common/measurable_widget.dart @@ -4,7 +4,7 @@ import 'package:flutter/rendering.dart'; import 'package:wonders/common_libs.dart'; class MeasurableWidget extends SingleChildRenderObjectWidget { - const MeasurableWidget({Key? key, required this.onChange, required Widget child}) : super(key: key, child: child); + const MeasurableWidget({super.key, required this.onChange, required Widget super.child}); final void Function(Size size) onChange; @override RenderObject createRenderObject(BuildContext context) => MeasureSizeRenderObject(onChange); diff --git a/lib/ui/common/modals/app_modals.dart b/lib/ui/common/modals/app_modals.dart index 4ca9dd25..1b596805 100644 --- a/lib/ui/common/modals/app_modals.dart +++ b/lib/ui/common/modals/app_modals.dart @@ -11,7 +11,7 @@ Future showModal(BuildContext context, {required Widget child}) async { } class LoadingModal extends StatelessWidget { - const LoadingModal({Key? key, this.title, this.msg, this.child}) : super(key: key); + const LoadingModal({super.key, this.title, this.msg, this.child}); final String? title; final String? msg; final Widget? child; @@ -28,7 +28,7 @@ class LoadingModal extends StatelessWidget { } class OkModal extends StatelessWidget { - const OkModal({Key? key, this.title, this.msg, this.child}) : super(key: key); + const OkModal({super.key, this.title, this.msg, this.child}); final String? title; final String? msg; final Widget? child; @@ -51,7 +51,7 @@ class OkModal extends StatelessWidget { } class OkCancelModal extends StatelessWidget { - const OkCancelModal({Key? key, this.title, this.msg, this.child}) : super(key: key); + const OkCancelModal({super.key, this.title, this.msg, this.child}); final String? title; final String? msg; final Widget? child; @@ -83,7 +83,7 @@ class _BaseContentModal extends StatelessWidget { final Widget? child; final List buttons; - const _BaseContentModal({Key? key, this.title, this.msg, required this.buttons, this.child}) : super(key: key); + const _BaseContentModal({this.title, this.msg, required this.buttons, this.child}); @override Widget build(BuildContext context) { diff --git a/lib/ui/common/modals/fullscreen_maps_viewer.dart b/lib/ui/common/modals/fullscreen_maps_viewer.dart index 28c76370..4a769dbc 100644 --- a/lib/ui/common/modals/fullscreen_maps_viewer.dart +++ b/lib/ui/common/modals/fullscreen_maps_viewer.dart @@ -5,7 +5,7 @@ import 'package:wonders/ui/common/controls/app_header.dart'; import 'package:wonders/ui/common/google_maps_marker.dart'; class FullscreenMapsViewer extends StatelessWidget { - FullscreenMapsViewer({Key? key, required this.type}) : super(key: key); + FullscreenMapsViewer({super.key, required this.type}); final WonderType type; WonderData get data => wondersLogic.getData(type); diff --git a/lib/ui/common/modals/fullscreen_url_img_viewer.dart b/lib/ui/common/modals/fullscreen_url_img_viewer.dart index c8dbe71c..8cb717de 100644 --- a/lib/ui/common/modals/fullscreen_url_img_viewer.dart +++ b/lib/ui/common/modals/fullscreen_url_img_viewer.dart @@ -7,7 +7,7 @@ import 'package:wonders/ui/common/fullscreen_keyboard_listener.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; class FullscreenUrlImgViewer extends StatefulWidget { - const FullscreenUrlImgViewer({Key? key, required this.urls, this.index = 0}) : super(key: key); + const FullscreenUrlImgViewer({super.key, required this.urls, this.index = 0}); final List urls; final int index; @@ -126,7 +126,7 @@ class _FullscreenUrlImgViewerState extends State { } class _Viewer extends StatefulWidget { - const _Viewer(this.url, this.isZoomed, {Key? key}) : super(key: key); + const _Viewer(this.url, this.isZoomed); final String url; final ValueNotifier isZoomed; diff --git a/lib/ui/common/modals/fullscreen_video_viewer.dart b/lib/ui/common/modals/fullscreen_video_viewer.dart index f9a86616..c4b9df28 100644 --- a/lib/ui/common/modals/fullscreen_video_viewer.dart +++ b/lib/ui/common/modals/fullscreen_video_viewer.dart @@ -5,7 +5,7 @@ import 'package:wonders/logic/common/platform_info.dart'; import 'package:youtube_player_iframe/youtube_player_iframe.dart'; class FullscreenVideoViewer extends StatefulWidget { - const FullscreenVideoViewer({Key? key, required this.id}) : super(key: key); + const FullscreenVideoViewer({super.key, required this.id}); final String id; @override diff --git a/lib/ui/common/modals/fullscreen_web_view.dart b/lib/ui/common/modals/fullscreen_web_view.dart index dde31fd9..de8391c1 100644 --- a/lib/ui/common/modals/fullscreen_web_view.dart +++ b/lib/ui/common/modals/fullscreen_web_view.dart @@ -2,7 +2,7 @@ import 'package:webview_flutter/webview_flutter.dart'; import 'package:wonders/common_libs.dart'; class FullscreenWebView extends StatelessWidget { - FullscreenWebView(this.url, {Key? key}) : super(key: key); + FullscreenWebView(this.url, {super.key}); final String url; late final controller = WebViewController() diff --git a/lib/ui/common/opening_card.dart b/lib/ui/common/opening_card.dart index a2ac62b4..2bf82776 100644 --- a/lib/ui/common/opening_card.dart +++ b/lib/ui/common/opening_card.dart @@ -3,13 +3,12 @@ import 'package:wonders/ui/common/measurable_widget.dart'; class OpeningCard extends StatefulWidget { const OpeningCard( - {Key? key, + {super.key, required this.closedBuilder, required this.openBuilder, required this.isOpen, this.background, - this.padding}) - : super(key: key); + this.padding}); final Widget Function(BuildContext) closedBuilder; final Widget Function(BuildContext) openBuilder; diff --git a/lib/ui/common/pop_navigator_underlay.dart b/lib/ui/common/pop_navigator_underlay.dart index b7aed1d7..c634aea8 100644 --- a/lib/ui/common/pop_navigator_underlay.dart +++ b/lib/ui/common/pop_navigator_underlay.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; class PopNavigatorUnderlay extends StatelessWidget { - const PopNavigatorUnderlay({Key? key}) : super(key: key); + const PopNavigatorUnderlay({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/common/pop_router_on_over_scroll.dart b/lib/ui/common/pop_router_on_over_scroll.dart index 6830b7f3..3cb68f42 100644 --- a/lib/ui/common/pop_router_on_over_scroll.dart +++ b/lib/ui/common/pop_router_on_over_scroll.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; class PopRouterOnOverScroll extends StatefulWidget { - const PopRouterOnOverScroll({Key? key, required this.child, required this.controller}) : super(key: key); + const PopRouterOnOverScroll({super.key, required this.child, required this.controller}); final ScrollController controller; final Widget child; diff --git a/lib/ui/common/scaling_list_item.dart b/lib/ui/common/scaling_list_item.dart index 5aaa7b40..91c3a42d 100644 --- a/lib/ui/common/scaling_list_item.dart +++ b/lib/ui/common/scaling_list_item.dart @@ -2,7 +2,7 @@ import 'package:wonders/common_libs.dart'; import 'package:wonders/ui/common/utils/context_utils.dart'; class AnimatedListItem extends StatelessWidget { - const AnimatedListItem({Key? key, required this.scrollPos, required this.builder}) : super(key: key); + const AnimatedListItem({super.key, required this.scrollPos, required this.builder}); final ValueNotifier scrollPos; final Widget Function(BuildContext context, double pctVisible) builder; @@ -35,7 +35,7 @@ class AnimatedListItem extends StatelessWidget { /// Takes a scroll position notifier and a child. /// Scales its child as it scrolls onto screen for a nice effect. class ScalingListItem extends StatelessWidget { - const ScalingListItem({Key? key, required this.scrollPos, required this.child}) : super(key: key); + const ScalingListItem({super.key, required this.scrollPos, required this.child}); final ValueNotifier scrollPos; final Widget child; diff --git a/lib/ui/common/stacked_page_view_builder.dart b/lib/ui/common/stacked_page_view_builder.dart index 850278e6..a36cffe9 100644 --- a/lib/ui/common/stacked_page_view_builder.dart +++ b/lib/ui/common/stacked_page_view_builder.dart @@ -11,12 +11,12 @@ import 'package:wonders/common_libs.dart'; /// class StackedPageViewBuilder extends StatefulWidget { const StackedPageViewBuilder({ - Key? key, + super.key, this.initialIndex = 0, required this.pageCount, required this.builder, this.onInit, - }) : super(key: key); + }); final int initialIndex; final int pageCount; final Widget Function(BuildContext builder, PageController controller, PageController follower) builder; diff --git a/lib/ui/common/static_text_scale.dart b/lib/ui/common/static_text_scale.dart index 5dd74a74..965f6ce2 100644 --- a/lib/ui/common/static_text_scale.dart +++ b/lib/ui/common/static_text_scale.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; class StaticTextScale extends StatelessWidget { - const StaticTextScale({Key? key, required this.child, this.scale = 1}) : super(key: key); + const StaticTextScale({super.key, required this.child, this.scale = 1}); final Widget child; final double scale; diff --git a/lib/ui/common/themed_text.dart b/lib/ui/common/themed_text.dart index db4d9e39..de161ee3 100644 --- a/lib/ui/common/themed_text.dart +++ b/lib/ui/common/themed_text.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; class DefaultTextColor extends StatelessWidget { - const DefaultTextColor({Key? key, required this.color, required this.child}) : super(key: key); + const DefaultTextColor({super.key, required this.color, required this.child}); final Color color; final Widget child; @@ -15,7 +15,7 @@ class DefaultTextColor extends StatelessWidget { } class LightText extends StatelessWidget { - const LightText({Key? key, required this.child}) : super(key: key); + const LightText({super.key, required this.child}); final Widget child; @override @@ -26,7 +26,7 @@ class LightText extends StatelessWidget { } class DarkText extends StatelessWidget { - const DarkText({Key? key, required this.child}) : super(key: key); + const DarkText({super.key, required this.child}); final Widget child; @override diff --git a/lib/ui/common/timeline_event_card.dart b/lib/ui/common/timeline_event_card.dart index fb764397..37c17175 100644 --- a/lib/ui/common/timeline_event_card.dart +++ b/lib/ui/common/timeline_event_card.dart @@ -3,7 +3,7 @@ import 'package:wonders/logic/common/string_utils.dart'; import 'package:wonders/ui/common/themed_text.dart'; class TimelineEventCard extends StatelessWidget { - const TimelineEventCard({Key? key, required this.year, required this.text, this.darkMode = false}) : super(key: key); + const TimelineEventCard({super.key, required this.year, required this.text, this.darkMode = false}); final int year; final String text; final bool darkMode; diff --git a/lib/ui/common/unsplash_photo.dart b/lib/ui/common/unsplash_photo.dart index 6b744b57..a8bf21a7 100644 --- a/lib/ui/common/unsplash_photo.dart +++ b/lib/ui/common/unsplash_photo.dart @@ -2,8 +2,7 @@ import 'package:wonders/common_libs.dart'; import 'package:wonders/logic/data/unsplash_photo_data.dart'; class UnsplashPhoto extends StatelessWidget { - const UnsplashPhoto(this.id, {Key? key, this.fit = BoxFit.cover, required this.size, this.showCredits = false}) - : super(key: key); + const UnsplashPhoto(this.id, {super.key, this.fit = BoxFit.cover, required this.size, this.showCredits = false}); final String id; final BoxFit fit; final UnsplashPhotoSize size; diff --git a/lib/ui/common/wonders_timeline_builder.dart b/lib/ui/common/wonders_timeline_builder.dart index f3e23d9b..c2c4f323 100644 --- a/lib/ui/common/wonders_timeline_builder.dart +++ b/lib/ui/common/wonders_timeline_builder.dart @@ -6,13 +6,13 @@ import 'package:wonders/logic/data/wonder_data.dart'; /// Provides a builder, so the visual representation of each track entry can be customized class WondersTimelineBuilder extends StatelessWidget { const WondersTimelineBuilder({ - Key? key, + super.key, this.selectedWonders = const [], this.timelineBuilder, this.axis = Axis.horizontal, this.crossAxisGap, this.minSize = 10, - }) : super(key: key); + }); final List selectedWonders; final Widget Function(BuildContext, WonderData type, bool isSelected)? timelineBuilder; final Axis axis; @@ -96,7 +96,7 @@ class WondersTimelineBuilder extends StatelessWidget { } class _DefaultTrackEntry extends StatelessWidget { - const _DefaultTrackEntry({Key? key, required this.isSelected}) : super(key: key); + const _DefaultTrackEntry({required this.isSelected}); final bool isSelected; @override diff --git a/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart b/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart index b45c3572..ebc9e030 100644 --- a/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart +++ b/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart @@ -12,7 +12,7 @@ part 'widgets/_bottom_text_content.dart'; part 'widgets/_collapsing_carousel_item.dart'; class ArtifactCarouselScreen extends StatefulWidget { - const ArtifactCarouselScreen({Key? key, required this.type, this.contentPadding = EdgeInsets.zero}) : super(key: key); + const ArtifactCarouselScreen({super.key, required this.type, this.contentPadding = EdgeInsets.zero}); final WonderType type; final EdgeInsets contentPadding; diff --git a/lib/ui/screens/artifact/artifact_carousel/widgets/_blurred_image_bg.dart b/lib/ui/screens/artifact/artifact_carousel/widgets/_blurred_image_bg.dart index fa5d32bf..499b561f 100644 --- a/lib/ui/screens/artifact/artifact_carousel/widgets/_blurred_image_bg.dart +++ b/lib/ui/screens/artifact/artifact_carousel/widgets/_blurred_image_bg.dart @@ -2,7 +2,7 @@ part of '../artifact_carousel_screen.dart'; /// Blurry image background for the Artifact Highlights view. Contains horizontal and vertical gradients that stack overtop the blended image. class _BlurredImageBg extends StatelessWidget { - const _BlurredImageBg({Key? key, this.url}) : super(key: key); + const _BlurredImageBg({super.key, this.url}); final String? url; @override diff --git a/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart b/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart index bb7ea474..98e73aaa 100644 --- a/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart +++ b/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart @@ -2,8 +2,7 @@ part of '../artifact_carousel_screen.dart'; class _BottomTextContent extends StatelessWidget { const _BottomTextContent( - {Key? key, required this.artifact, required this.height, required this.state, required this.shortMode}) - : super(key: key); + {super.key, required this.artifact, required this.height, required this.state, required this.shortMode}); final HighlightData artifact; final double height; diff --git a/lib/ui/screens/artifact/artifact_carousel/widgets/_collapsing_carousel_item.dart b/lib/ui/screens/artifact/artifact_carousel/widgets/_collapsing_carousel_item.dart index 2da795d4..cad33855 100644 --- a/lib/ui/screens/artifact/artifact_carousel/widgets/_collapsing_carousel_item.dart +++ b/lib/ui/screens/artifact/artifact_carousel/widgets/_collapsing_carousel_item.dart @@ -4,13 +4,12 @@ part of '../artifact_carousel_screen.dart'; /// This lets the child simply render it's contents class _CollapsingCarouselItem extends StatelessWidget { const _CollapsingCarouselItem( - {Key? key, + {super.key, required this.child, required this.indexOffset, required this.width, required this.onPressed, - required this.title}) - : super(key: key); + required this.title}); final Widget child; final int indexOffset; final double width; @@ -50,11 +49,11 @@ class _CollapsingCarouselItem extends StatelessWidget { class _AnimatedTranslate extends StatelessWidget { const _AnimatedTranslate({ - Key? key, + super.key, required this.duration, required this.offset, required this.child, - }) : super(key: key); + }); final Duration duration; final Offset offset; final Widget child; @@ -71,7 +70,7 @@ class _AnimatedTranslate extends StatelessWidget { } class _DoubleBorderImage extends StatelessWidget { - const _DoubleBorderImage(this.data, {Key? key}) : super(key: key); + const _DoubleBorderImage(this.data, {super.key}); final HighlightData data; @override Widget build(BuildContext context) => Container( diff --git a/lib/ui/screens/artifact/artifact_details/artifact_details_screen.dart b/lib/ui/screens/artifact/artifact_details/artifact_details_screen.dart index fdde60d6..fdab4e71 100644 --- a/lib/ui/screens/artifact/artifact_details/artifact_details_screen.dart +++ b/lib/ui/screens/artifact/artifact_details/artifact_details_screen.dart @@ -10,7 +10,7 @@ part 'widgets/_info_column.dart'; part 'widgets/_artifact_image_btn.dart'; class ArtifactDetailsScreen extends StatefulWidget { - const ArtifactDetailsScreen({Key? key, required this.artifactId}) : super(key: key); + const ArtifactDetailsScreen({super.key, required this.artifactId}); final String artifactId; @override diff --git a/lib/ui/screens/artifact/artifact_details/widgets/_artifact_image_btn.dart b/lib/ui/screens/artifact/artifact_details/widgets/_artifact_image_btn.dart index c7e25a1e..7bbaf004 100644 --- a/lib/ui/screens/artifact/artifact_details/widgets/_artifact_image_btn.dart +++ b/lib/ui/screens/artifact/artifact_details/widgets/_artifact_image_btn.dart @@ -1,7 +1,7 @@ part of '../artifact_details_screen.dart'; class _ArtifactImageBtn extends StatelessWidget { - const _ArtifactImageBtn({Key? key, required this.data}) : super(key: key); + const _ArtifactImageBtn({super.key, required this.data}); final ArtifactData data; @override diff --git a/lib/ui/screens/artifact/artifact_details/widgets/_info_column.dart b/lib/ui/screens/artifact/artifact_details/widgets/_info_column.dart index c762660d..637c5046 100644 --- a/lib/ui/screens/artifact/artifact_details/widgets/_info_column.dart +++ b/lib/ui/screens/artifact/artifact_details/widgets/_info_column.dart @@ -1,7 +1,7 @@ part of '../artifact_details_screen.dart'; class _InfoColumn extends StatelessWidget { - const _InfoColumn({Key? key, required this.data}) : super(key: key); + const _InfoColumn({super.key, required this.data}); final ArtifactData data; @override @@ -67,7 +67,7 @@ class _InfoColumn extends StatelessWidget { } class _InfoRow extends StatelessWidget { - const _InfoRow(this.label, this.value, {Key? key}) : super(key: key); + const _InfoRow(this.label, this.value, {super.key}); final String label; final String value; diff --git a/lib/ui/screens/artifact/artifact_search/artifact_search_screen.dart b/lib/ui/screens/artifact/artifact_search/artifact_search_screen.dart index 61789a81..185f4a8c 100644 --- a/lib/ui/screens/artifact/artifact_search/artifact_search_screen.dart +++ b/lib/ui/screens/artifact/artifact_search/artifact_search_screen.dart @@ -15,7 +15,7 @@ part 'widgets/_search_input.dart'; /// User can use this screen to search the MET server for an artifact by name or timeline. Artifacts results will /// appear as images, which the user can click on to being up the details view for more information. class ArtifactSearchScreen extends StatefulWidget with GetItStatefulWidgetMixin { - ArtifactSearchScreen({Key? key, required this.type}) : super(key: key); + ArtifactSearchScreen({super.key, required this.type}); final WonderType type; @override @@ -203,7 +203,7 @@ class _ArtifactSearchScreenState extends State with GetItS } class PanelController extends ValueNotifier { - PanelController(bool value) : super(value); + PanelController(super.value); void toggle() => value = !value; } diff --git a/lib/ui/screens/artifact/artifact_search/time_range_selector/expanding_time_range_selector.dart b/lib/ui/screens/artifact/artifact_search/time_range_selector/expanding_time_range_selector.dart index 4e097d9d..0f36a3a0 100644 --- a/lib/ui/screens/artifact/artifact_search/time_range_selector/expanding_time_range_selector.dart +++ b/lib/ui/screens/artifact/artifact_search/time_range_selector/expanding_time_range_selector.dart @@ -11,14 +11,14 @@ import 'package:wonders/ui/screens/artifact/artifact_search/time_range_selector/ // Expandable timerange selector component that further refines Artifact Search based on date range. class ExpandingTimeRangeSelector extends StatefulWidget { const ExpandingTimeRangeSelector({ - Key? key, + super.key, required this.wonder, required this.startYear, required this.endYear, required this.onChanged, required this.panelController, required this.vizController, - }) : super(key: key); + }); final WonderData wonder; final double startYear; final double endYear; @@ -95,10 +95,9 @@ class _ExpandingTimeRangeSelectorState extends State class _ClosedTimeRange extends StatelessWidget { const _ClosedTimeRange({ - Key? key, required this.startYear, required this.endYear, - }) : super(key: key); + }); final double startYear, endYear; @override @@ -120,14 +119,13 @@ class _ClosedTimeRange extends StatelessWidget { class _OpenedTimeRange extends StatelessWidget { const _OpenedTimeRange({ - Key? key, required this.onChange, required this.startYear, required this.endYear, required this.wonder, required this.painter, required this.onClose, - }) : super(key: key); + }); final double startYear; final double endYear; final void Function(double start, double end) onChange; diff --git a/lib/ui/screens/artifact/artifact_search/time_range_selector/range_selector.dart b/lib/ui/screens/artifact/artifact_search/time_range_selector/range_selector.dart index b8555f1f..f6503044 100644 --- a/lib/ui/screens/artifact/artifact_search/time_range_selector/range_selector.dart +++ b/lib/ui/screens/artifact/artifact_search/time_range_selector/range_selector.dart @@ -6,7 +6,7 @@ class RangeSelector extends StatefulWidget { static const double handleWidth = 20; const RangeSelector({ - Key? key, + super.key, required this.start, required this.end, required this.min, @@ -15,7 +15,7 @@ class RangeSelector extends StatefulWidget { this.isLocked = false, this.onUpdated, this.onChanged, - }) : super(key: key); + }); final double start; final double end; final double min; diff --git a/lib/ui/screens/artifact/artifact_search/widgets/_result_tile.dart b/lib/ui/screens/artifact/artifact_search/widgets/_result_tile.dart index 0a866811..1660dc24 100644 --- a/lib/ui/screens/artifact/artifact_search/widgets/_result_tile.dart +++ b/lib/ui/screens/artifact/artifact_search/widgets/_result_tile.dart @@ -1,7 +1,7 @@ part of '../artifact_search_screen.dart'; class _ResultTile extends StatelessWidget { - const _ResultTile({Key? key, required this.onPressed, required this.data}) : super(key: key); + const _ResultTile({super.key, required this.onPressed, required this.data}); final void Function(SearchData data) onPressed; final SearchData data; diff --git a/lib/ui/screens/artifact/artifact_search/widgets/_results_grid.dart b/lib/ui/screens/artifact/artifact_search/widgets/_results_grid.dart index 1449bdc6..6160d4ef 100644 --- a/lib/ui/screens/artifact/artifact_search/widgets/_results_grid.dart +++ b/lib/ui/screens/artifact/artifact_search/widgets/_results_grid.dart @@ -2,7 +2,7 @@ part of '../artifact_search_screen.dart'; /// Staggered Masonry styled grid for displaying two columns of different aspect-ratio images. class _ResultsGrid extends StatefulWidget { - const _ResultsGrid({Key? key, required this.searchResults, required this.onPressed}) : super(key: key); + const _ResultsGrid({super.key, required this.searchResults, required this.onPressed}); final void Function(SearchData) onPressed; final List searchResults; diff --git a/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart b/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart index b18dd799..23f4c5fb 100644 --- a/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart +++ b/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart @@ -2,7 +2,7 @@ part of '../artifact_search_screen.dart'; /// Autopopulating textfield used for searching for Artifacts by name. class _SearchInput extends StatelessWidget { - const _SearchInput({Key? key, required this.onSubmit, required this.wonder}) : super(key: key); + const _SearchInput({super.key, required this.onSubmit, required this.wonder}); final void Function(String) onSubmit; final WonderData wonder; @@ -23,7 +23,9 @@ class _SearchInput extends StatelessWidget { } Iterable _getSuggestions(TextEditingValue textEditingValue) { - if (textEditingValue.text == '') return wonder.searchSuggestions.getRange(0, 10); + if (textEditingValue.text == '') { + return wonder.searchSuggestions.getRange(0, 10); + } return wonder.searchSuggestions.where((str) { return str.startsWith(textEditingValue.text.toLowerCase()); diff --git a/lib/ui/screens/collectible_found/collectible_found_screen.dart b/lib/ui/screens/collectible_found/collectible_found_screen.dart index 7b4332ee..0868bf26 100644 --- a/lib/ui/screens/collectible_found/collectible_found_screen.dart +++ b/lib/ui/screens/collectible_found/collectible_found_screen.dart @@ -12,7 +12,7 @@ part 'widgets/_celebration_particles.dart'; class CollectibleFoundScreen extends StatelessWidget { // CollectibleItem passes in a (theoretically) pre-loaded imageProvider. // we could check for load completion, and hold after introT, but that shouldn't be necessary in a real-world scenario. - const CollectibleFoundScreen({required this.collectible, required this.imageProvider, Key? key}) : super(key: key); + const CollectibleFoundScreen({required this.collectible, required this.imageProvider, super.key}); final CollectibleData collectible; final ImageProvider imageProvider; diff --git a/lib/ui/screens/collectible_found/widgets/_animated_ribbon.dart b/lib/ui/screens/collectible_found/widgets/_animated_ribbon.dart index 4feed8ab..b03c897f 100644 --- a/lib/ui/screens/collectible_found/widgets/_animated_ribbon.dart +++ b/lib/ui/screens/collectible_found/widgets/_animated_ribbon.dart @@ -1,7 +1,7 @@ part of '../collectible_found_screen.dart'; class _AnimatedRibbon extends StatelessWidget { - const _AnimatedRibbon(this.text, {Key? key}) : super(key: key); + const _AnimatedRibbon(this.text, {super.key}); final String text; static const double height = 48; diff --git a/lib/ui/screens/collectible_found/widgets/_celebration_particles.dart b/lib/ui/screens/collectible_found/widgets/_celebration_particles.dart index 909675a0..7830b7fc 100644 --- a/lib/ui/screens/collectible_found/widgets/_celebration_particles.dart +++ b/lib/ui/screens/collectible_found/widgets/_celebration_particles.dart @@ -1,7 +1,7 @@ part of '../collectible_found_screen.dart'; class _CelebrationParticles extends StatelessWidget { - const _CelebrationParticles({Key? key, this.fadeMs = 1000}) : super(key: key); + const _CelebrationParticles({super.key, this.fadeMs = 1000}); final int fadeMs; diff --git a/lib/ui/screens/collection/collection_screen.dart b/lib/ui/screens/collection/collection_screen.dart index 0fb6715a..4fb3b942 100644 --- a/lib/ui/screens/collection/collection_screen.dart +++ b/lib/ui/screens/collection/collection_screen.dart @@ -16,7 +16,7 @@ part 'widgets/_collection_list_card.dart'; part 'widgets/_newly_discovered_items_btn.dart'; class CollectionScreen extends StatefulWidget with GetItStatefulWidgetMixin { - CollectionScreen({required this.fromId, Key? key}) : super(key: key); + CollectionScreen({required this.fromId, super.key}); final String fromId; diff --git a/lib/ui/screens/collection/widgets/_collectible_image.dart b/lib/ui/screens/collection/widgets/_collectible_image.dart index 82fd66f0..a7012c99 100644 --- a/lib/ui/screens/collection/widgets/_collectible_image.dart +++ b/lib/ui/screens/collection/widgets/_collectible_image.dart @@ -2,12 +2,12 @@ part of '../collection_screen.dart'; class _CollectibleImage extends StatelessWidget { const _CollectibleImage({ - Key? key, + super.key, required this.collectible, required this.state, required this.onPressed, this.heroTag, - }) : super(key: key); + }); final CollectibleData collectible; final ValueSetter onPressed; diff --git a/lib/ui/screens/collection/widgets/_collection_footer.dart b/lib/ui/screens/collection/widgets/_collection_footer.dart index 82685133..8e2a6e68 100644 --- a/lib/ui/screens/collection/widgets/_collection_footer.dart +++ b/lib/ui/screens/collection/widgets/_collection_footer.dart @@ -2,7 +2,7 @@ part of '../collection_screen.dart'; @immutable class _CollectionFooter extends StatelessWidget { - const _CollectionFooter({Key? key, required this.count, required this.total}) : super(key: key); + const _CollectionFooter({super.key, required this.count, required this.total}); final int count; final int total; diff --git a/lib/ui/screens/collection/widgets/_collection_list.dart b/lib/ui/screens/collection/widgets/_collection_list.dart index c8540468..67e90d2e 100644 --- a/lib/ui/screens/collection/widgets/_collection_list.dart +++ b/lib/ui/screens/collection/widgets/_collection_list.dart @@ -3,11 +3,11 @@ part of '../collection_screen.dart'; @immutable class _CollectionList extends StatefulWidget with GetItStatefulWidgetMixin { _CollectionList({ - Key? key, + super.key, this.onReset, required this.fromId, this.scrollKey, - }) : super(key: key); + }); static const double _vtCardExtent = 300; static const double _hzCardExtent = 600; @@ -63,7 +63,7 @@ class _CollectionListState extends State<_CollectionList> with GetItStateMixin { fromId: widget.fromId, data: d, ); - }).toList() + }) ]; // Scroll view adapts to scroll vertically or horizontally return SingleChildScrollView( diff --git a/lib/ui/screens/collection/widgets/_collection_list_card.dart b/lib/ui/screens/collection/widgets/_collection_list_card.dart index 65192012..189f286f 100644 --- a/lib/ui/screens/collection/widgets/_collection_list_card.dart +++ b/lib/ui/screens/collection/widgets/_collection_list_card.dart @@ -1,7 +1,7 @@ part of '../collection_screen.dart'; class _CollectionListCard extends StatelessWidget with GetItMixin { - _CollectionListCard({Key? key, this.width, this.height, required this.data, required this.fromId}) : super(key: key); + _CollectionListCard({super.key, this.width, this.height, required this.data, required this.fromId}); final double? width; final double? height; @@ -48,7 +48,7 @@ class _CollectionListCard extends StatelessWidget with GetItMixin { heroTag: e.id == fromId ? 'collectible_image_$fromId' : null, ), ); - }).toList() + }) ]), ) ], diff --git a/lib/ui/screens/collection/widgets/_newly_discovered_items_btn.dart b/lib/ui/screens/collection/widgets/_newly_discovered_items_btn.dart index b698f00c..d6f6d206 100644 --- a/lib/ui/screens/collection/widgets/_newly_discovered_items_btn.dart +++ b/lib/ui/screens/collection/widgets/_newly_discovered_items_btn.dart @@ -2,7 +2,7 @@ part of '../collection_screen.dart'; @immutable class _NewlyDiscoveredItemsBtn extends StatelessWidget { - const _NewlyDiscoveredItemsBtn({Key? key, this.count = 0, required this.onPressed}) : super(key: key); + const _NewlyDiscoveredItemsBtn({super.key, this.count = 0, required this.onPressed}); final int count; final VoidCallback onPressed; diff --git a/lib/ui/screens/editorial/editorial_screen.dart b/lib/ui/screens/editorial/editorial_screen.dart index 9a9e5956..b250bb55 100644 --- a/lib/ui/screens/editorial/editorial_screen.dart +++ b/lib/ui/screens/editorial/editorial_screen.dart @@ -38,7 +38,7 @@ part 'widgets/_title_text.dart'; part 'widgets/_top_illustration.dart'; class WonderEditorialScreen extends StatefulWidget { - const WonderEditorialScreen(this.data, {Key? key, required this.contentPadding}) : super(key: key); + const WonderEditorialScreen(this.data, {super.key, required this.contentPadding}); final WonderData data; //final void Function(double scrollPos) onScroll; final EdgeInsets contentPadding; diff --git a/lib/ui/screens/editorial/widgets/_app_bar.dart b/lib/ui/screens/editorial/widgets/_app_bar.dart index 53102fdf..48b5eba2 100644 --- a/lib/ui/screens/editorial/widgets/_app_bar.dart +++ b/lib/ui/screens/editorial/widgets/_app_bar.dart @@ -1,7 +1,7 @@ part of '../editorial_screen.dart'; class _AppBar extends StatelessWidget { - _AppBar(this.wonderType, {Key? key, required this.sectionIndex, required this.scrollPos}) : super(key: key); + _AppBar(this.wonderType, {super.key, required this.sectionIndex, required this.scrollPos}); final WonderType wonderType; final ValueNotifier sectionIndex; final ValueNotifier scrollPos; @@ -18,24 +18,16 @@ class _AppBar extends StatelessWidget { ]; ArchType _getArchType() { - switch (wonderType) { - case WonderType.chichenItza: - return ArchType.flatPyramid; - case WonderType.christRedeemer: - return ArchType.wideArch; - case WonderType.colosseum: - return ArchType.arch; - case WonderType.greatWall: - return ArchType.arch; - case WonderType.machuPicchu: - return ArchType.pyramid; - case WonderType.petra: - return ArchType.wideArch; - case WonderType.pyramidsGiza: - return ArchType.pyramid; - case WonderType.tajMahal: - return ArchType.spade; - } + return switch (wonderType) { + WonderType.chichenItza => ArchType.flatPyramid, + WonderType.christRedeemer => ArchType.wideArch, + WonderType.colosseum => ArchType.arch, + WonderType.greatWall => ArchType.arch, + WonderType.machuPicchu => ArchType.pyramid, + WonderType.petra => ArchType.wideArch, + WonderType.pyramidsGiza => ArchType.pyramid, + WonderType.tajMahal => ArchType.spade + }; } @override diff --git a/lib/ui/screens/editorial/widgets/_callout.dart b/lib/ui/screens/editorial/widgets/_callout.dart index f7fb0d1f..f682d341 100644 --- a/lib/ui/screens/editorial/widgets/_callout.dart +++ b/lib/ui/screens/editorial/widgets/_callout.dart @@ -3,7 +3,7 @@ part of '../editorial_screen.dart'; class _Callout extends StatelessWidget { final String text; - const _Callout({Key? key, required this.text}) : super(key: key); + const _Callout({super.key, required this.text}); @override Widget build(BuildContext context) { return IntrinsicHeight( diff --git a/lib/ui/screens/editorial/widgets/_circular_title_bar.dart b/lib/ui/screens/editorial/widgets/_circular_title_bar.dart index d5156509..2e0360cd 100644 --- a/lib/ui/screens/editorial/widgets/_circular_title_bar.dart +++ b/lib/ui/screens/editorial/widgets/_circular_title_bar.dart @@ -1,9 +1,8 @@ part of '../editorial_screen.dart'; class _CircularTitleBar extends StatelessWidget { - const _CircularTitleBar({Key? key, required this.titles, required this.icons, required this.index}) - : assert(titles.length == icons.length, 'The number of titles and icons do not match.'), - super(key: key); + const _CircularTitleBar({super.key, required this.titles, required this.icons, required this.index}) + : assert(titles.length == icons.length, 'The number of titles and icons do not match.'); final List titles; final List icons; final int index; @@ -48,10 +47,10 @@ class _CircularTitleBar extends StatelessWidget { class _AnimatedCircleWithText extends StatefulWidget { const _AnimatedCircleWithText({ - Key? key, + super.key, required this.titles, required this.index, - }) : super(key: key); + }); final List titles; final int index; diff --git a/lib/ui/screens/editorial/widgets/_collapsing_pull_quote_image.dart b/lib/ui/screens/editorial/widgets/_collapsing_pull_quote_image.dart index 68fc6fbc..65103ba4 100644 --- a/lib/ui/screens/editorial/widgets/_collapsing_pull_quote_image.dart +++ b/lib/ui/screens/editorial/widgets/_collapsing_pull_quote_image.dart @@ -1,7 +1,7 @@ part of '../editorial_screen.dart'; class _CollapsingPullQuoteImage extends StatelessWidget { - const _CollapsingPullQuoteImage({Key? key, required this.scrollPos, required this.data}) : super(key: key); + const _CollapsingPullQuoteImage({super.key, required this.scrollPos, required this.data}); final ValueNotifier scrollPos; final WonderData data; @@ -25,7 +25,7 @@ class _CollapsingPullQuoteImage extends StatelessWidget { if (top) offsetY *= -1; // flip? return Transform.translate( offset: Offset(0, offsetY), - child:Text(value, style: quoteStyle, textAlign: TextAlign.center), + child: Text(value, style: quoteStyle, textAlign: TextAlign.center), ); } diff --git a/lib/ui/screens/editorial/widgets/_large_simple_quote.dart b/lib/ui/screens/editorial/widgets/_large_simple_quote.dart index 33d3f13f..b449ebe8 100644 --- a/lib/ui/screens/editorial/widgets/_large_simple_quote.dart +++ b/lib/ui/screens/editorial/widgets/_large_simple_quote.dart @@ -1,7 +1,7 @@ part of '../editorial_screen.dart'; class _LargeSimpleQuote extends StatelessWidget { - const _LargeSimpleQuote({Key? key, required this.text, required this.author}) : super(key: key); + const _LargeSimpleQuote({super.key, required this.text, required this.author}); final String text; final String author; diff --git a/lib/ui/screens/editorial/widgets/_scrolling_content.dart b/lib/ui/screens/editorial/widgets/_scrolling_content.dart index 90a8f6b8..fea6e796 100644 --- a/lib/ui/screens/editorial/widgets/_scrolling_content.dart +++ b/lib/ui/screens/editorial/widgets/_scrolling_content.dart @@ -1,8 +1,7 @@ part of '../editorial_screen.dart'; class _ScrollingContent extends StatelessWidget { - const _ScrollingContent(this.data, {Key? key, required this.scrollPos, required this.sectionNotifier}) - : super(key: key); + const _ScrollingContent(this.data, {super.key, required this.scrollPos, required this.sectionNotifier}); final WonderData data; final ValueNotifier scrollPos; final ValueNotifier sectionNotifier; @@ -64,16 +63,12 @@ class _ScrollingContent extends StatelessWidget { Widget buildHiddenCollectible({required int slot}) { List getTypesForSlot(slot) { - switch (slot) { - case 0: - return [WonderType.chichenItza, WonderType.colosseum]; - case 1: - return [WonderType.pyramidsGiza, WonderType.petra]; - case 2: - return [WonderType.machuPicchu, WonderType.christRedeemer]; - default: - return [WonderType.tajMahal, WonderType.greatWall]; - } + return switch (slot) { + 0 => [WonderType.chichenItza, WonderType.colosseum], + 1 => [WonderType.pyramidsGiza, WonderType.petra], + 2 => [WonderType.machuPicchu, WonderType.christRedeemer], + _ => [WonderType.tajMahal, WonderType.greatWall] + }; } return HiddenCollectible( @@ -166,7 +161,7 @@ class _ScrollingContent extends StatelessWidget { } class _YouTubeThumbnail extends StatelessWidget { - const _YouTubeThumbnail({Key? key, required this.id, required this.caption}) : super(key: key); + const _YouTubeThumbnail({super.key, required this.id, required this.caption}); final String id; final String caption; @@ -217,7 +212,7 @@ class _YouTubeThumbnail extends StatelessWidget { } class _MapsThumbnail extends StatefulWidget { - const _MapsThumbnail(this.data, {Key? key}) : super(key: key); + const _MapsThumbnail(this.data, {super.key}); final WonderData data; @override @@ -279,10 +274,10 @@ class _MapsThumbnailState extends State<_MapsThumbnail> { class SliverBackgroundColor extends SingleChildRenderObjectWidget { const SliverBackgroundColor({ - Key? key, + super.key, required this.color, Widget? sliver, - }) : super(key: key, child: sliver); + }) : super(child: sliver); final Color color; diff --git a/lib/ui/screens/editorial/widgets/_section_divider.dart b/lib/ui/screens/editorial/widgets/_section_divider.dart index 84097a9a..ccff801a 100644 --- a/lib/ui/screens/editorial/widgets/_section_divider.dart +++ b/lib/ui/screens/editorial/widgets/_section_divider.dart @@ -1,7 +1,7 @@ part of '../editorial_screen.dart'; class _SectionDivider extends StatefulWidget { - const _SectionDivider(this.scrollNotifier, this.sectionNotifier, {Key? key, required this.index}) : super(key: key); + const _SectionDivider(this.scrollNotifier, this.sectionNotifier, {super.key, required this.index}); final int index; final ValueNotifier scrollNotifier; final ValueNotifier sectionNotifier; diff --git a/lib/ui/screens/editorial/widgets/_sliding_image_stack.dart b/lib/ui/screens/editorial/widgets/_sliding_image_stack.dart index 4edb35b6..7be4fca9 100644 --- a/lib/ui/screens/editorial/widgets/_sliding_image_stack.dart +++ b/lib/ui/screens/editorial/widgets/_sliding_image_stack.dart @@ -1,7 +1,7 @@ part of '../editorial_screen.dart'; class _SlidingImageStack extends StatelessWidget { - const _SlidingImageStack({Key? key, required this.scrollPos, required this.type}) : super(key: key); + const _SlidingImageStack({super.key, required this.scrollPos, required this.type}); final ValueNotifier scrollPos; final WonderType type; diff --git a/lib/ui/screens/editorial/widgets/_title_text.dart b/lib/ui/screens/editorial/widgets/_title_text.dart index 4c546f79..2d325c63 100644 --- a/lib/ui/screens/editorial/widgets/_title_text.dart +++ b/lib/ui/screens/editorial/widgets/_title_text.dart @@ -1,7 +1,7 @@ part of '../editorial_screen.dart'; class _TitleText extends StatelessWidget { - const _TitleText(this.data, {Key? key, required this.scroller}) : super(key: key); + const _TitleText(this.data, {super.key, required this.scroller}); final WonderData data; final ScrollController scroller; diff --git a/lib/ui/screens/editorial/widgets/_top_illustration.dart b/lib/ui/screens/editorial/widgets/_top_illustration.dart index 0be48094..12b63db7 100644 --- a/lib/ui/screens/editorial/widgets/_top_illustration.dart +++ b/lib/ui/screens/editorial/widgets/_top_illustration.dart @@ -1,7 +1,7 @@ part of '../editorial_screen.dart'; class _TopIllustration extends StatelessWidget { - const _TopIllustration(this.type, {Key? key, this.fgOffset = Offset.zero}) : super(key: key); + const _TopIllustration(this.type, {super.key, this.fgOffset = Offset.zero}); final WonderType type; final Offset fgOffset; diff --git a/lib/ui/screens/home/_vertical_swipe_controller.dart b/lib/ui/screens/home/_vertical_swipe_controller.dart index 1c107905..63d688d5 100644 --- a/lib/ui/screens/home/_vertical_swipe_controller.dart +++ b/lib/ui/screens/home/_vertical_swipe_controller.dart @@ -1,7 +1,7 @@ part of 'wonders_home_screen.dart'; class _VerticalSwipeController { - _VerticalSwipeController(this.ticker, this.onSwipeComplete){ + _VerticalSwipeController(this.ticker, this.onSwipeComplete) { swipeReleaseAnim = AnimationController(vsync: ticker)..addListener(handleSwipeReleaseAnimTick); } final TickerProvider ticker; @@ -64,7 +64,7 @@ class _VerticalSwipeController { behavior: HitTestBehavior.translucent, child: child); - void dispose(){ + void dispose() { swipeAmt.dispose(); isPointerDown.dispose(); swipeReleaseAnim.dispose(); diff --git a/lib/ui/screens/home/widgets/_animated_arrow_button.dart b/lib/ui/screens/home/widgets/_animated_arrow_button.dart index 6ff0d58a..26170ecd 100644 --- a/lib/ui/screens/home/widgets/_animated_arrow_button.dart +++ b/lib/ui/screens/home/widgets/_animated_arrow_button.dart @@ -2,7 +2,7 @@ part of '../wonders_home_screen.dart'; /// An arrow that fades out, then fades back in and slides down, ending in it's original position with full opacity. class _AnimatedArrowButton extends StatelessWidget { - _AnimatedArrowButton({Key? key, required this.onTap, required this.semanticTitle}) : super(key: key); + _AnimatedArrowButton({required this.onTap, required this.semanticTitle}); final String semanticTitle; final VoidCallback onTap; diff --git a/lib/ui/screens/home/wonders_home_screen.dart b/lib/ui/screens/home/wonders_home_screen.dart index 8c61853b..f8756cf4 100644 --- a/lib/ui/screens/home/wonders_home_screen.dart +++ b/lib/ui/screens/home/wonders_home_screen.dart @@ -17,7 +17,7 @@ part '_vertical_swipe_controller.dart'; part 'widgets/_animated_arrow_button.dart'; class HomeScreen extends StatefulWidget with GetItStatefulWidgetMixin { - HomeScreen({Key? key}) : super(key: key); + HomeScreen({super.key}); @override State createState() => _HomeScreenState(); @@ -64,7 +64,9 @@ class _HomeScreenState extends State with SingleTickerProviderStateM void _handlePageChanged(value) { final newIndex = value % _numWonders; - if (newIndex == _wonderIndex) return; // Exit early if we're already on this page + if (newIndex == _wonderIndex) { + return; // Exit early if we're already on this page + } setState(() { _wonderIndex = newIndex; settingsLogic.prevWonderIndex.value = _wonderIndex; @@ -195,7 +197,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM ..._wonders.map((e) { final config = WonderIllustrationConfig.bg(isShowing: _isSelected(e.type)); return WonderIllustration(e.type, config: config); - }).toList(), + }), // Clouds FractionallySizedBox( widthFactor: 1, @@ -248,7 +250,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM onPlay: _handleFadeAnimInit, child: IgnorePointer(child: WonderIllustration(e.type, config: config))); }); - }).toList(), + }), /// Foreground gradient-2, gets darker when swiping up BottomCenter( diff --git a/lib/ui/screens/home_menu/about_dialog_content.dart b/lib/ui/screens/home_menu/about_dialog_content.dart index d9b251d8..a8961f24 100644 --- a/lib/ui/screens/home_menu/about_dialog_content.dart +++ b/lib/ui/screens/home_menu/about_dialog_content.dart @@ -6,7 +6,7 @@ import 'package:wonders/logic/common/platform_info.dart'; import 'package:wonders/ui/common/modals/fullscreen_web_view.dart'; class AboutDialogContent extends StatelessWidget { - const AboutDialogContent({Key? key}) : super(key: key); + const AboutDialogContent({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/screens/home_menu/home_menu.dart b/lib/ui/screens/home_menu/home_menu.dart index ce794dad..164b4ca7 100644 --- a/lib/ui/screens/home_menu/home_menu.dart +++ b/lib/ui/screens/home_menu/home_menu.dart @@ -11,7 +11,7 @@ import 'package:wonders/ui/common/wonderous_logo.dart'; import 'package:wonders/ui/screens/home_menu/about_dialog_content.dart'; class HomeMenu extends StatefulWidget { - const HomeMenu({Key? key, required this.data}) : super(key: key); + const HomeMenu({super.key, required this.data}); final WonderData data; @override @@ -188,7 +188,7 @@ class _HomeMenuState extends State { } class _MenuTextBtn extends StatelessWidget { - const _MenuTextBtn({Key? key, required this.label, required this.onPressed, required this.icon}) : super(key: key); + const _MenuTextBtn({required this.label, required this.onPressed, required this.icon}); final String label; final VoidCallback onPressed; final AppIcons icon; diff --git a/lib/ui/screens/intro/intro_screen.dart b/lib/ui/screens/intro/intro_screen.dart index ab7678ae..b0c3b151 100644 --- a/lib/ui/screens/intro/intro_screen.dart +++ b/lib/ui/screens/intro/intro_screen.dart @@ -10,7 +10,7 @@ import 'package:wonders/ui/common/themed_text.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; class IntroScreen extends StatefulWidget { - const IntroScreen({Key? key}) : super(key: key); + const IntroScreen({super.key}); @override State createState() => _IntroScreenState(); @@ -257,7 +257,7 @@ class _PageData { } class _Page extends StatelessWidget { - const _Page({Key? key, required this.data}) : super(key: key); + const _Page({required this.data}); final _PageData data; @@ -314,7 +314,7 @@ class _WonderousLogo extends StatelessWidget { } class _PageImage extends StatelessWidget { - const _PageImage({Key? key, required this.data}) : super(key: key); + const _PageImage({required this.data}); final _PageData data; diff --git a/lib/ui/screens/photo_gallery/photo_gallery.dart b/lib/ui/screens/photo_gallery/photo_gallery.dart index acdfcdfc..44329549 100644 --- a/lib/ui/screens/photo_gallery/photo_gallery.dart +++ b/lib/ui/screens/photo_gallery/photo_gallery.dart @@ -14,8 +14,7 @@ import 'package:wonders/ui/common/utils/app_haptics.dart'; part 'widgets/_animated_cutout_overlay.dart'; class PhotoGallery extends StatefulWidget { - const PhotoGallery({Key? key, this.imageSize, required this.collectionId, required this.wonderType}) - : super(key: key); + const PhotoGallery({super.key, this.imageSize, required this.collectionId, required this.wonderType}); final Size? imageSize; final String collectionId; final WonderType wonderType; @@ -82,20 +81,12 @@ class _PhotoGalleryState extends State { /// Used for hiding collectibles around the photo grid. int _getCollectibleIndex() { - switch (widget.wonderType) { - case WonderType.chichenItza: - case WonderType.petra: - return 0; - case WonderType.colosseum: - case WonderType.pyramidsGiza: - return _gridSize - 1; - case WonderType.christRedeemer: - case WonderType.machuPicchu: - return _imgCount - 1; - case WonderType.greatWall: - case WonderType.tajMahal: - return _imgCount - _gridSize; - } + return switch (widget.wonderType) { + WonderType.chichenItza || WonderType.petra => 0, + WonderType.colosseum || WonderType.pyramidsGiza => _gridSize - 1, + WonderType.christRedeemer || WonderType.machuPicchu => _imgCount - 1, + WonderType.greatWall || WonderType.tajMahal => _imgCount - _gridSize + }; } bool _handleKeyDown(KeyDownEvent event) { @@ -132,9 +123,15 @@ class _PhotoGalleryState extends State { if (dir.dy != 0) newIndex += _gridSize * (dir.dy > 0 ? -1 : 1); if (dir.dx != 0) newIndex += (dir.dx > 0 ? -1 : 1); // After calculating new index, exit early if we don't like it... - if (newIndex < 0 || newIndex > _imgCount - 1) return; // keep the index in range - if (dir.dx < 0 && newIndex % _gridSize == 0) return; // prevent right-swipe when at right side - if (dir.dx > 0 && newIndex % _gridSize == _gridSize - 1) return; // prevent left-swipe when at left side + if (newIndex < 0 || newIndex > _imgCount - 1) { + return; // keep the index in range + } + if (dir.dx < 0 && newIndex % _gridSize == 0) { + return; // prevent right-swipe when at right side + } + if (dir.dx > 0 && newIndex % _gridSize == _gridSize - 1) { + return; // prevent left-swipe when at left side + } _lastSwipeDir = dir; AppHaptics.lightImpact(); _setIndex(newIndex); diff --git a/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart b/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart index 29aad469..2b0e70ef 100644 --- a/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart +++ b/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart @@ -5,7 +5,7 @@ part of '../photo_gallery.dart'; /// Uses[_CutoutClipper] to create the cutout. class _AnimatedCutoutOverlay extends StatelessWidget { const _AnimatedCutoutOverlay({ - Key? key, + super.key, required this.child, required this.cutoutSize, required this.animationKey, @@ -13,7 +13,7 @@ class _AnimatedCutoutOverlay extends StatelessWidget { required this.swipeDir, required this.opacity, required this.enabled, - }) : super(key: key); + }); final Widget child; final Size cutoutSize; final Key animationKey; diff --git a/lib/ui/screens/timeline/timeline_screen.dart b/lib/ui/screens/timeline/timeline_screen.dart index 5d21fbc8..d1df1bfe 100644 --- a/lib/ui/screens/timeline/timeline_screen.dart +++ b/lib/ui/screens/timeline/timeline_screen.dart @@ -29,7 +29,7 @@ part 'widgets/_year_markers.dart'; class TimelineScreen extends StatefulWidget { final WonderType? type; - const TimelineScreen({Key? key, required this.type}) : super(key: key); + const TimelineScreen({super.key, required this.type}); @override State createState() => _TimelineScreenState(); diff --git a/lib/ui/screens/timeline/widgets/_bottom_scrubber.dart b/lib/ui/screens/timeline/widgets/_bottom_scrubber.dart index 24f3d1a6..e01be3c2 100644 --- a/lib/ui/screens/timeline/widgets/_bottom_scrubber.dart +++ b/lib/ui/screens/timeline/widgets/_bottom_scrubber.dart @@ -2,8 +2,7 @@ part of '../timeline_screen.dart'; class _BottomScrubber extends StatelessWidget { const _BottomScrubber(this.scroller, - {Key? key, required this.timelineMinSize, required this.size, required this.selectedWonder}) - : super(key: key); + {super.key, required this.timelineMinSize, required this.size, required this.selectedWonder}); final ScrollController? scroller; final double timelineMinSize; final double size; diff --git a/lib/ui/screens/timeline/widgets/_dashed_divider_with_year.dart b/lib/ui/screens/timeline/widgets/_dashed_divider_with_year.dart index 36ac305c..66e28a5f 100644 --- a/lib/ui/screens/timeline/widgets/_dashed_divider_with_year.dart +++ b/lib/ui/screens/timeline/widgets/_dashed_divider_with_year.dart @@ -1,7 +1,7 @@ part of '../timeline_screen.dart'; class _DashedDividerWithYear extends StatelessWidget { - const _DashedDividerWithYear(this.year, {Key? key}) : super(key: key); + const _DashedDividerWithYear(this.year, {super.key}); final int year; @override diff --git a/lib/ui/screens/timeline/widgets/_event_markers.dart b/lib/ui/screens/timeline/widgets/_event_markers.dart index 615e18ef..1f963ef8 100644 --- a/lib/ui/screens/timeline/widgets/_event_markers.dart +++ b/lib/ui/screens/timeline/widgets/_event_markers.dart @@ -3,8 +3,7 @@ part of '../timeline_screen.dart'; /// A vertically aligned stack of dots that represent global events /// The event closest to the [selectedYr] param will be visible selected class _EventMarkers extends StatefulWidget { - const _EventMarkers(this.selectedYr, {Key? key, required this.onEventChanged, required this.onMarkerPressed}) - : super(key: key); + const _EventMarkers(this.selectedYr, {super.key, required this.onEventChanged, required this.onMarkerPressed}); final void Function(TimelineEvent? event) onEventChanged; final void Function(TimelineEvent event) onMarkerPressed; @@ -114,11 +113,11 @@ class _EventMarkersState extends State<_EventMarkers> { class _EventMarker extends StatelessWidget { const _EventMarker( this.offset, { - Key? key, + super.key, required this.isSelected, required this.event, required this.onPressed, - }) : super(key: key); + }); final double offset; final TimelineEvent event; final bool isSelected; diff --git a/lib/ui/screens/timeline/widgets/_event_popups.dart b/lib/ui/screens/timeline/widgets/_event_popups.dart index 56731057..bd02ae6c 100644 --- a/lib/ui/screens/timeline/widgets/_event_popups.dart +++ b/lib/ui/screens/timeline/widgets/_event_popups.dart @@ -1,7 +1,7 @@ part of '../timeline_screen.dart'; class _EventPopups extends StatefulWidget { - const _EventPopups({Key? key, required this.currentEvent}) : super(key: key); + const _EventPopups({super.key, required this.currentEvent}); final TimelineEvent? currentEvent; @override diff --git a/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart b/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart index ecd6adbd..863b9d9a 100644 --- a/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart +++ b/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart @@ -2,7 +2,7 @@ part of '../timeline_screen.dart'; class _ScrollingViewport extends StatefulWidget { const _ScrollingViewport({ - Key? key, + super.key, // ignore: unused_element this.onInit, required this.scroller, @@ -10,7 +10,7 @@ class _ScrollingViewport extends StatefulWidget { required this.maxSize, required this.selectedWonder, this.onYearChanged, - }) : super(key: key); + }); final double minSize; final double maxSize; final ScrollController scroller; diff --git a/lib/ui/screens/timeline/widgets/_timeline_section.dart b/lib/ui/screens/timeline/widgets/_timeline_section.dart index d0b938a9..99f8841c 100644 --- a/lib/ui/screens/timeline/widgets/_timeline_section.dart +++ b/lib/ui/screens/timeline/widgets/_timeline_section.dart @@ -1,7 +1,7 @@ part of '../timeline_screen.dart'; class TimelineSection extends StatelessWidget { - const TimelineSection(this.data, this.selectedYr, {Key? key, required this.selectedWonder}) : super(key: key); + const TimelineSection(this.data, this.selectedYr, {super.key, required this.selectedWonder}); final WonderData data; final int selectedYr; final WonderType? selectedWonder; diff --git a/lib/ui/screens/timeline/widgets/_year_markers.dart b/lib/ui/screens/timeline/widgets/_year_markers.dart index f1796841..321c47d9 100644 --- a/lib/ui/screens/timeline/widgets/_year_markers.dart +++ b/lib/ui/screens/timeline/widgets/_year_markers.dart @@ -1,7 +1,7 @@ part of '../timeline_screen.dart'; class _YearMarkers extends StatelessWidget { - _YearMarkers({Key? key}) : super(key: key); + _YearMarkers({super.key}); int get startYr => wondersLogic.timelineStartYear; int get endYr => wondersLogic.timelineEndYear; @@ -48,7 +48,7 @@ class _YearMarkers extends StatelessWidget { } class _YearMarker extends StatelessWidget { - const _YearMarker(this.yr, this.offset, {Key? key}) : super(key: key); + const _YearMarker(this.yr, this.offset, {super.key}); final int yr; final double offset; diff --git a/lib/ui/screens/wonder_details/wonder_details_tab_menu.dart b/lib/ui/screens/wonder_details/wonder_details_tab_menu.dart index 2bf1df70..d4ab6112 100644 --- a/lib/ui/screens/wonder_details/wonder_details_tab_menu.dart +++ b/lib/ui/screens/wonder_details/wonder_details_tab_menu.dart @@ -7,13 +7,13 @@ class WonderDetailsTabMenu extends StatelessWidget { static const double maxTabSize = 100; const WonderDetailsTabMenu({ - Key? key, + super.key, required this.tabController, this.showBg = false, required this.wonderType, this.axis = Axis.horizontal, required this.onTap, - }) : super(key: key); + }); final TabController tabController; final bool showBg; @@ -152,8 +152,7 @@ class WonderDetailsTabMenu extends StatelessWidget { } class _WonderHomeBtn extends StatelessWidget { - const _WonderHomeBtn({Key? key, required this.size, required this.wonderType, required this.borderSize}) - : super(key: key); + const _WonderHomeBtn({required this.size, required this.wonderType, required this.borderSize}); final double size; final WonderType wonderType; @@ -185,14 +184,13 @@ class _TabBtn extends StatelessWidget { const _TabBtn( this.index, this.tabController, { - Key? key, required this.iconImg, required this.color, required this.label, required this.axis, required this.mainAxisSize, required this.onTap, - }) : super(key: key); + }); static const double crossBtnSize = 60; diff --git a/lib/ui/screens/wonder_details/wonders_details_screen.dart b/lib/ui/screens/wonder_details/wonders_details_screen.dart index d885bb99..eba86dcf 100644 --- a/lib/ui/screens/wonder_details/wonders_details_screen.dart +++ b/lib/ui/screens/wonder_details/wonders_details_screen.dart @@ -8,7 +8,7 @@ import 'package:wonders/ui/screens/wonder_details/wonder_details_tab_menu.dart'; import 'package:wonders/ui/screens/wonder_events/wonder_events.dart'; class WonderDetailsScreen extends StatefulWidget with GetItStatefulWidgetMixin { - WonderDetailsScreen({Key? key, required this.type, this.tabIndex = 0}) : super(key: key); + WonderDetailsScreen({super.key, required this.type, this.tabIndex = 0}); final WonderType type; final int tabIndex; diff --git a/lib/ui/screens/wonder_events/widgets/_events_list.dart b/lib/ui/screens/wonder_events/widgets/_events_list.dart index 81b3703c..295cf1f6 100644 --- a/lib/ui/screens/wonder_events/widgets/_events_list.dart +++ b/lib/ui/screens/wonder_events/widgets/_events_list.dart @@ -2,14 +2,14 @@ part of '../wonder_events.dart'; class _EventsList extends StatefulWidget { const _EventsList({ - Key? key, + super.key, required this.data, this.topHeight = 0, this.blurOnScroll = false, this.showTopGradient = true, required this.initialScrollOffset, required this.onScroll, - }) : super(key: key); + }); final WonderData data; final double topHeight; final bool blurOnScroll; diff --git a/lib/ui/screens/wonder_events/widgets/_timeline_btn.dart b/lib/ui/screens/wonder_events/widgets/_timeline_btn.dart index 1045f711..5886b32a 100644 --- a/lib/ui/screens/wonder_events/widgets/_timeline_btn.dart +++ b/lib/ui/screens/wonder_events/widgets/_timeline_btn.dart @@ -1,7 +1,7 @@ part of '../wonder_events.dart'; class _TimelineBtn extends StatelessWidget { - const _TimelineBtn({Key? key, required this.type, this.width}) : super(key: key); + const _TimelineBtn({super.key, required this.type, this.width}); final WonderType type; final double? width; diff --git a/lib/ui/screens/wonder_events/widgets/_wonder_image_with_timeline.dart b/lib/ui/screens/wonder_events/widgets/_wonder_image_with_timeline.dart index e7c49fb0..59544e8f 100644 --- a/lib/ui/screens/wonder_events/widgets/_wonder_image_with_timeline.dart +++ b/lib/ui/screens/wonder_events/widgets/_wonder_image_with_timeline.dart @@ -1,7 +1,7 @@ part of '../wonder_events.dart'; class _WonderImageWithTimeline extends StatelessWidget { - const _WonderImageWithTimeline({Key? key, required this.data, required this.height}) : super(key: key); + const _WonderImageWithTimeline({super.key, required this.data, required this.height}); final WonderData data; final double height; @@ -47,7 +47,9 @@ class _WonderImageWithTimeline extends StatelessWidget { return Container( decoration: BoxDecoration( color: isSelected ? _fixLuminance(data.type.fgColor) : Colors.transparent, - border: isSelected ? Border.all(color: Colors.transparent) : Border.all(color: $styles.colors.greyMedium), + border: isSelected + ? Border.all(color: Colors.transparent) + : Border.all(color: $styles.colors.greyMedium), borderRadius: BorderRadius.circular($styles.corners.md), ), ); diff --git a/lib/ui/screens/wonder_events/wonder_events.dart b/lib/ui/screens/wonder_events/wonder_events.dart index 960bd0ea..2d902e6d 100644 --- a/lib/ui/screens/wonder_events/wonder_events.dart +++ b/lib/ui/screens/wonder_events/wonder_events.dart @@ -19,7 +19,7 @@ part 'widgets/_timeline_btn.dart'; part 'widgets/_wonder_image_with_timeline.dart'; class WonderEvents extends StatefulWidget { - const WonderEvents({Key? key, required this.type, this.contentPadding = EdgeInsets.zero}) : super(key: key); + const WonderEvents({super.key, required this.type, this.contentPadding = EdgeInsets.zero}); final WonderType type; final EdgeInsets contentPadding; @override diff --git a/lib/ui/wonder_illustrations/chichen_itza_illustration.dart b/lib/ui/wonder_illustrations/chichen_itza_illustration.dart index d5e64bda..e4809f94 100644 --- a/lib/ui/wonder_illustrations/chichen_itza_illustration.dart +++ b/lib/ui/wonder_illustrations/chichen_itza_illustration.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; class ChichenItzaIllustration extends StatelessWidget { - ChichenItzaIllustration({Key? key, required this.config}) : super(key: key); + ChichenItzaIllustration({super.key, required this.config}); final WonderIllustrationConfig config; final assetPath = WonderType.chichenItza.assetPath; final fgColor = WonderType.chichenItza.fgColor; diff --git a/lib/ui/wonder_illustrations/christ_redeemer_illustration.dart b/lib/ui/wonder_illustrations/christ_redeemer_illustration.dart index 5c6bdec0..7f709903 100644 --- a/lib/ui/wonder_illustrations/christ_redeemer_illustration.dart +++ b/lib/ui/wonder_illustrations/christ_redeemer_illustration.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; class ChristRedeemerIllustration extends StatelessWidget { - ChristRedeemerIllustration({Key? key, required this.config}) : super(key: key); + ChristRedeemerIllustration({super.key, required this.config}); final WonderIllustrationConfig config; final String assetPath = WonderType.christRedeemer.assetPath; final fgColor = WonderType.christRedeemer.fgColor; diff --git a/lib/ui/wonder_illustrations/colosseum_illustration.dart b/lib/ui/wonder_illustrations/colosseum_illustration.dart index 2bad0dcd..abe3f7d6 100644 --- a/lib/ui/wonder_illustrations/colosseum_illustration.dart +++ b/lib/ui/wonder_illustrations/colosseum_illustration.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; class ColosseumIllustration extends StatelessWidget { - ColosseumIllustration({Key? key, required this.config}) : super(key: key); + ColosseumIllustration({super.key, required this.config}); final WonderIllustrationConfig config; final String assetPath = WonderType.colosseum.assetPath; final bgColor = WonderType.colosseum.bgColor; diff --git a/lib/ui/wonder_illustrations/common/animated_clouds.dart b/lib/ui/wonder_illustrations/common/animated_clouds.dart index ff9c02bf..fa3c7dd3 100644 --- a/lib/ui/wonder_illustrations/common/animated_clouds.dart +++ b/lib/ui/wonder_illustrations/common/animated_clouds.dart @@ -9,8 +9,7 @@ import 'package:wonders/ui/common/utils/context_utils.dart'; // Uses a random seed system, to make sure we get the same set of clouds for each wonder, without actually having to hand-position them. class AnimatedClouds extends StatefulWidget with GetItStatefulWidgetMixin { AnimatedClouds( - {Key? key, this.enableAnimations = true, required this.wonderType, required this.opacity, this.cloudSize = 500}) - : super(key: key); + {super.key, this.enableAnimations = true, required this.wonderType, required this.opacity, this.cloudSize = 500}); final WonderType wonderType; final bool enableAnimations; final double opacity; @@ -50,24 +49,16 @@ class _AnimatedCloudsState extends State with SingleTickerProvid } int _getCloudSeed(WonderType type) { - switch (type) { - case WonderType.chichenItza: - return 2; - case WonderType.christRedeemer: - return 78; - case WonderType.colosseum: - return 1; - case WonderType.greatWall: - return 500; - case WonderType.machuPicchu: - return 37; - case WonderType.petra: - return 111; - case WonderType.pyramidsGiza: - return 15; - case WonderType.tajMahal: - return 2; - } + return switch (type) { + WonderType.chichenItza => 2, + WonderType.christRedeemer => 78, + WonderType.colosseum => 1, + WonderType.greatWall => 500, + WonderType.machuPicchu => 37, + WonderType.petra => 111, + WonderType.pyramidsGiza => 15, + WonderType.tajMahal => 2 + }; } /// Starts playing the clouds animation, or jumps right to the end, based on [AnimatedClouds.enableAnimations] diff --git a/lib/ui/wonder_illustrations/common/illustration_piece.dart b/lib/ui/wonder_illustrations/common/illustration_piece.dart index 93f1a1f6..54d48534 100644 --- a/lib/ui/wonder_illustrations/common/illustration_piece.dart +++ b/lib/ui/wonder_illustrations/common/illustration_piece.dart @@ -7,7 +7,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build /// to standardize behavior across the various wonder illustrations class IllustrationPiece extends StatefulWidget { const IllustrationPiece({ - Key? key, + super.key, required this.fileName, required this.heightFactor, this.alignment = Alignment.center, @@ -21,7 +21,7 @@ class IllustrationPiece extends StatefulWidget { this.dynamicHzOffset = 0, this.top, this.bottom, - }) : super(key: key); + }); final String fileName; diff --git a/lib/ui/wonder_illustrations/common/paint_textures.dart b/lib/ui/wonder_illustrations/common/paint_textures.dart index 192ecf78..b8348919 100644 --- a/lib/ui/wonder_illustrations/common/paint_textures.dart +++ b/lib/ui/wonder_illustrations/common/paint_textures.dart @@ -2,8 +2,7 @@ import 'package:wonders/common_libs.dart'; class IllustrationTexture extends StatelessWidget { const IllustrationTexture(this.path, - {Key? key, this.scale = 1, this.color, this.flipX = false, this.flipY = false, this.opacity}) - : super(key: key); + {super.key, this.scale = 1, this.color, this.flipX = false, this.flipY = false, this.opacity}); final Color? color; final double scale; final bool flipX; diff --git a/lib/ui/wonder_illustrations/common/wonder_hero.dart b/lib/ui/wonder_illustrations/common/wonder_hero.dart index cf106e9c..cef1fab2 100644 --- a/lib/ui/wonder_illustrations/common/wonder_hero.dart +++ b/lib/ui/wonder_illustrations/common/wonder_hero.dart @@ -3,7 +3,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_confi /// Utility class that wraps a normal [Hero] widget, but respects WonderIllustrationConfig.enableHero setting class WonderHero extends StatelessWidget { - const WonderHero(this.config, this.tag, {Key? key, required this.child}) : super(key: key); + const WonderHero(this.config, this.tag, {super.key, required this.child}); final WonderIllustrationConfig config; final Widget child; final String tag; diff --git a/lib/ui/wonder_illustrations/common/wonder_illustration.dart b/lib/ui/wonder_illustrations/common/wonder_illustration.dart index ff49cd49..1652a5c3 100644 --- a/lib/ui/wonder_illustrations/common/wonder_illustration.dart +++ b/lib/ui/wonder_illustrations/common/wonder_illustration.dart @@ -11,29 +11,21 @@ import 'package:wonders/ui/wonder_illustrations/taj_mahal_illustration.dart'; /// Convenience class for showing an illustration when all you have is the type. class WonderIllustration extends StatelessWidget { - const WonderIllustration(this.type, {Key? key, required this.config}) : super(key: key); + const WonderIllustration(this.type, {super.key, required this.config}); final WonderIllustrationConfig config; final WonderType type; @override Widget build(BuildContext context) { - switch (type) { - case WonderType.chichenItza: - return ChichenItzaIllustration(config: config); - case WonderType.christRedeemer: - return ChristRedeemerIllustration(config: config); - case WonderType.colosseum: - return ColosseumIllustration(config: config); - case WonderType.greatWall: - return GreatWallIllustration(config: config); - case WonderType.machuPicchu: - return MachuPicchuIllustration(config: config); - case WonderType.petra: - return PetraIllustration(config: config); - case WonderType.pyramidsGiza: - return PyramidsGizaIllustration(config: config); - case WonderType.tajMahal: - return TajMahalIllustration(config: config); - } + return switch (type) { + WonderType.chichenItza => ChichenItzaIllustration(config: config), + WonderType.christRedeemer => ChristRedeemerIllustration(config: config), + WonderType.colosseum => ColosseumIllustration(config: config), + WonderType.greatWall => GreatWallIllustration(config: config), + WonderType.machuPicchu => MachuPicchuIllustration(config: config), + WonderType.petra => PetraIllustration(config: config), + WonderType.pyramidsGiza => PyramidsGizaIllustration(config: config), + WonderType.tajMahal => TajMahalIllustration(config: config) + }; } } diff --git a/lib/ui/wonder_illustrations/common/wonder_illustration_builder.dart b/lib/ui/wonder_illustrations/common/wonder_illustration_builder.dart index a0358851..7aa30c7c 100644 --- a/lib/ui/wonder_illustrations/common/wonder_illustration_builder.dart +++ b/lib/ui/wonder_illustrations/common/wonder_illustration_builder.dart @@ -8,13 +8,13 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_confi /// Also manages an AnimationController that is passed to each layer if it would like to animate itself on or off screen. class WonderIllustrationBuilder extends StatefulWidget { const WonderIllustrationBuilder({ - Key? key, + super.key, required this.config, required this.fgBuilder, required this.mgBuilder, required this.bgBuilder, required this.wonderType, - }) : super(key: key); + }); final List Function(BuildContext context, Animation animation) fgBuilder; final List Function(BuildContext context, Animation animation) mgBuilder; final List Function(BuildContext context, Animation animation) bgBuilder; diff --git a/lib/ui/wonder_illustrations/common/wonder_title_text.dart b/lib/ui/wonder_illustrations/common/wonder_title_text.dart index b9187a81..f0832b22 100644 --- a/lib/ui/wonder_illustrations/common/wonder_title_text.dart +++ b/lib/ui/wonder_illustrations/common/wonder_title_text.dart @@ -7,7 +7,7 @@ import 'package:wonders/logic/data/wonder_data.dart'; /// - of/the should be down-sized /// Accomplished using a set of TextSpans, and a white list of 'small words' class WonderTitleText extends StatelessWidget { - const WonderTitleText(this.data, {Key? key, this.enableShadows = false, this.enableHero = true}) : super(key: key); + const WonderTitleText(this.data, {super.key, this.enableShadows = false, this.enableHero = true}); final WonderData data; final bool enableShadows; final bool enableHero; diff --git a/lib/ui/wonder_illustrations/great_wall_illustration.dart b/lib/ui/wonder_illustrations/great_wall_illustration.dart index fab8367a..11a530e7 100644 --- a/lib/ui/wonder_illustrations/great_wall_illustration.dart +++ b/lib/ui/wonder_illustrations/great_wall_illustration.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; class GreatWallIllustration extends StatelessWidget { - GreatWallIllustration({Key? key, required this.config}) : super(key: key); + GreatWallIllustration({super.key, required this.config}); final WonderIllustrationConfig config; final String assetPath = WonderType.greatWall.assetPath; final fgColor = WonderType.greatWall.fgColor; diff --git a/lib/ui/wonder_illustrations/machu_picchu_illustration.dart b/lib/ui/wonder_illustrations/machu_picchu_illustration.dart index 8b203a06..5653e445 100644 --- a/lib/ui/wonder_illustrations/machu_picchu_illustration.dart +++ b/lib/ui/wonder_illustrations/machu_picchu_illustration.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; class MachuPicchuIllustration extends StatelessWidget { - MachuPicchuIllustration({Key? key, required this.config}) : super(key: key); + MachuPicchuIllustration({super.key, required this.config}); final WonderIllustrationConfig config; final String assetPath = WonderType.machuPicchu.assetPath; final fgColor = WonderType.machuPicchu.fgColor; diff --git a/lib/ui/wonder_illustrations/petra_illustration.dart b/lib/ui/wonder_illustrations/petra_illustration.dart index caa19146..b76d2e61 100644 --- a/lib/ui/wonder_illustrations/petra_illustration.dart +++ b/lib/ui/wonder_illustrations/petra_illustration.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; class PetraIllustration extends StatelessWidget { - PetraIllustration({Key? key, required this.config}) : super(key: key); + PetraIllustration({super.key, required this.config}); final WonderIllustrationConfig config; final String assetPath = WonderType.petra.assetPath; final fgColor = WonderType.petra.fgColor; diff --git a/lib/ui/wonder_illustrations/pyramids_giza_illustration.dart b/lib/ui/wonder_illustrations/pyramids_giza_illustration.dart index af1e9436..6ae6c9d4 100644 --- a/lib/ui/wonder_illustrations/pyramids_giza_illustration.dart +++ b/lib/ui/wonder_illustrations/pyramids_giza_illustration.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; class PyramidsGizaIllustration extends StatelessWidget { - PyramidsGizaIllustration({Key? key, required this.config}) : super(key: key); + PyramidsGizaIllustration({super.key, required this.config}); final WonderIllustrationConfig config; final String assetPath = WonderType.pyramidsGiza.assetPath; final fgColor = WonderType.pyramidsGiza.fgColor; diff --git a/lib/ui/wonder_illustrations/taj_mahal_illustration.dart b/lib/ui/wonder_illustrations/taj_mahal_illustration.dart index bc7cf453..dcf320aa 100644 --- a/lib/ui/wonder_illustrations/taj_mahal_illustration.dart +++ b/lib/ui/wonder_illustrations/taj_mahal_illustration.dart @@ -6,7 +6,7 @@ import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_build import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; class TajMahalIllustration extends StatelessWidget { - TajMahalIllustration({Key? key, required this.config}) : super(key: key); + TajMahalIllustration({super.key, required this.config}); final WonderIllustrationConfig config; final fgColor = WonderType.tajMahal.fgColor; diff --git a/pubspec.lock b/pubspec.lock index 6ff7c349..4e97d246 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -141,10 +141,10 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" file: dependency: transitive description: @@ -194,10 +194,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "3.0.1" flutter_localizations: dependency: "direct main" description: flutter @@ -239,10 +239,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" url: "https://pub.dev" source: hosted - version: "2.0.9" + version: "2.0.10+1" flutter_web_plugins: dependency: transitive description: flutter @@ -292,10 +292,10 @@ packages: dependency: "direct main" description: name: go_router - sha256: "07ee2436909f749d606f53521dc1725dd738dc5196e5ff815bc254253c594075" + sha256: "170c46e237d6eb0e6e9f0e8b3f56101e14fb64f787016e42edd74c39cf8b176a" url: "https://pub.dev" source: hosted - version: "13.1.0" + version: "13.2.0" google_maps: dependency: transitive description: @@ -324,10 +324,10 @@ packages: dependency: transitive description: name: google_maps_flutter_ios - sha256: c89556ed0338fcb4b843c9fcdafac7ad2df601c8b41286d82f0727f7f66434e4 + sha256: "29503b5159da2308a66212c3827963998bfb943ba073e2114fb2d486b47fd2c8" url: "https://pub.dev" source: hosted - version: "2.3.6" + version: "2.4.2" google_maps_flutter_platform_interface: dependency: transitive description: @@ -388,10 +388,10 @@ packages: dependency: "direct main" description: name: image - sha256: "004a2e90ce080f8627b5a04aecb4cdfac87d2c3f3b520aa291260be5a32c033d" + sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e" url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "4.1.7" image_fade: dependency: "direct main" description: @@ -452,10 +452,10 @@ packages: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" logging: dependency: transitive description: @@ -468,18 +468,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" nested: dependency: transitive description: @@ -524,10 +524,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_parsing: dependency: transitive description: @@ -817,10 +817,10 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f" + sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745 url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.3.0" url_launcher_ios: dependency: transitive description: @@ -849,10 +849,10 @@ packages: dependency: transitive description: name: url_launcher_platform_interface - sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" url_launcher_web: dependency: transitive description: @@ -873,26 +873,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "18f6690295af52d081f6808f2f7c69f0eed6d7e23a71539d75f4aeb8f0062172" + sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" url: "https://pub.dev" source: hosted - version: "1.1.9+2" + version: "1.1.11+1" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: "531d20465c10dfac7f5cd90b60bbe4dd9921f1ec4ca54c83ebb176dbacb7bb2d" + sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da url: "https://pub.dev" source: hosted - version: "1.1.9+2" + version: "1.1.11+1" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "03012b0a33775c5530576b70240308080e1d5050f0faf000118c20e6463bc0ad" + sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" url: "https://pub.dev" source: hosted - version: "1.1.9+2" + version: "1.1.11+1" vector_math: dependency: transitive description: @@ -905,26 +905,26 @@ packages: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.4.2" webview_flutter: dependency: "direct main" description: name: webview_flutter - sha256: "71e1bfaef41016c8d5954291df5e9f8c6172f1f6ff3af01b5656456ddb11f94c" + sha256: "25e1b6e839e8cbfbd708abc6f85ed09d1727e24e08e08c6b8590d7c65c9a8932" url: "https://pub.dev" source: hosted - version: "4.4.4" + version: "4.7.0" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - sha256: "4ea3c4e1b8ed590162b15b8a61b41b1ef3ff179a314627c16ce40c086d94b8af" + sha256: "3e5f4e9d818086b0d01a66fb1ff9cc72ab0cc58c71980e3d3661c5685ea0efb0" url: "https://pub.dev" source: hosted - version: "3.14.0" + version: "3.15.0" webview_flutter_platform_interface: dependency: transitive description: @@ -937,10 +937,10 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "4d062ad505390ecef1c4bfb6001cd857a51e00912cc9dfb66edb1886a9ebd80c" + sha256: "9bf168bccdf179ce90450b5f37e36fe263f591c9338828d6bf09b6f8d0f57f86" url: "https://pub.dev" source: hosted - version: "3.10.2" + version: "3.12.0" win32: dependency: transitive description: @@ -990,5 +990,5 @@ packages: source: hosted version: "2.0.2" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.16.6" diff --git a/pubspec.yaml b/pubspec.yaml index 11d91fd6..aea7a492 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: "none" version: 2.2.2+9 environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ^3.3.0 dependencies: flutter: @@ -55,7 +55,7 @@ dependencies: dev_dependencies: icons_launcher: ^2.1.3 - flutter_lints: ^2.0.2 + flutter_lints: ^3.0.0 dependency_validator: ^3.2.2 icons_launcher: