diff --git a/assets/images/2.0x/Check.png b/assets/images/2.0x/Check.png deleted file mode 100644 index fb9c3c1..0000000 Binary files a/assets/images/2.0x/Check.png and /dev/null differ diff --git a/assets/images/2.0x/Estrella.png b/assets/images/2.0x/Estrella.png deleted file mode 100644 index 5094995..0000000 Binary files a/assets/images/2.0x/Estrella.png and /dev/null differ diff --git a/assets/images/2.0x/Reloj.png b/assets/images/2.0x/Reloj.png deleted file mode 100644 index 8fa8b1e..0000000 Binary files a/assets/images/2.0x/Reloj.png and /dev/null differ diff --git a/assets/images/2.0x/background_green_prop.png b/assets/images/2.0x/background_green_prop.png deleted file mode 100644 index 85bcdd3..0000000 Binary files a/assets/images/2.0x/background_green_prop.png and /dev/null differ diff --git a/assets/images/2.0x/background_red_prop.png b/assets/images/2.0x/background_red_prop.png deleted file mode 100644 index 2c24f00..0000000 Binary files a/assets/images/2.0x/background_red_prop.png and /dev/null differ diff --git a/assets/images/3.0x/Check.png b/assets/images/3.0x/Check.png deleted file mode 100644 index 89a69c5..0000000 Binary files a/assets/images/3.0x/Check.png and /dev/null differ diff --git a/assets/images/3.0x/Estrella.png b/assets/images/3.0x/Estrella.png deleted file mode 100644 index f869dfe..0000000 Binary files a/assets/images/3.0x/Estrella.png and /dev/null differ diff --git a/assets/images/3.0x/Reloj.png b/assets/images/3.0x/Reloj.png deleted file mode 100644 index c77f012..0000000 Binary files a/assets/images/3.0x/Reloj.png and /dev/null differ diff --git a/assets/images/3.0x/background_green_prop.png b/assets/images/3.0x/background_green_prop.png deleted file mode 100644 index 29c4273..0000000 Binary files a/assets/images/3.0x/background_green_prop.png and /dev/null differ diff --git a/assets/images/3.0x/background_red_prop.png b/assets/images/3.0x/background_red_prop.png deleted file mode 100644 index 1336e5c..0000000 Binary files a/assets/images/3.0x/background_red_prop.png and /dev/null differ diff --git a/assets/images/4.0x/Check.png b/assets/images/4.0x/Check.png deleted file mode 100644 index 4ddae5e..0000000 Binary files a/assets/images/4.0x/Check.png and /dev/null differ diff --git a/assets/images/4.0x/Estrella.png b/assets/images/4.0x/Estrella.png deleted file mode 100644 index 777c580..0000000 Binary files a/assets/images/4.0x/Estrella.png and /dev/null differ diff --git a/assets/images/4.0x/Reloj.png b/assets/images/4.0x/Reloj.png deleted file mode 100644 index 5545509..0000000 Binary files a/assets/images/4.0x/Reloj.png and /dev/null differ diff --git a/assets/images/4.0x/background_green_prop.png b/assets/images/4.0x/background_green_prop.png deleted file mode 100644 index 866fe43..0000000 Binary files a/assets/images/4.0x/background_green_prop.png and /dev/null differ diff --git a/assets/images/4.0x/background_red_prop.png b/assets/images/4.0x/background_red_prop.png deleted file mode 100644 index b174606..0000000 Binary files a/assets/images/4.0x/background_red_prop.png and /dev/null differ diff --git a/assets/images/Check.png b/assets/images/Check.png deleted file mode 100644 index af8d947..0000000 Binary files a/assets/images/Check.png and /dev/null differ diff --git a/assets/images/Estrella.png b/assets/images/Estrella.png deleted file mode 100644 index 4960298..0000000 Binary files a/assets/images/Estrella.png and /dev/null differ diff --git a/assets/images/Reloj.png b/assets/images/Reloj.png deleted file mode 100644 index e69dea1..0000000 Binary files a/assets/images/Reloj.png and /dev/null differ diff --git a/assets/images/background_green_prop.png b/assets/images/background_green_prop.png deleted file mode 100644 index d2c716c..0000000 Binary files a/assets/images/background_green_prop.png and /dev/null differ diff --git a/assets/images/background_red_prop.png b/assets/images/background_red_prop.png deleted file mode 100644 index e9a1f1f..0000000 Binary files a/assets/images/background_red_prop.png and /dev/null differ diff --git a/design_system/lib/gen/assets.gen.dart b/design_system/lib/gen/assets.gen.dart index 555c846..c1ab4f3 100644 --- a/design_system/lib/gen/assets.gen.dart +++ b/design_system/lib/gen/assets.gen.dart @@ -35,8 +35,8 @@ class $AssetsImagesGen { [check, estrella, reloj, backgroundGreenProp, backgroundRedProp]; } -class Assets { - Assets._(); +class DsAssets { + DsAssets._(); static const $AssetsImagesGen images = $AssetsImagesGen(); } @@ -66,7 +66,7 @@ class AssetGenImage { bool matchTextDirection = false, bool gaplessPlayback = false, bool isAntiAlias = false, - String? package, + String? package = 'design_system', FilterQuality filterQuality = FilterQuality.low, int? cacheWidth, int? cacheHeight, @@ -101,7 +101,7 @@ class AssetGenImage { ImageProvider provider({ AssetBundle? bundle, - String? package, + String? package = 'design_system', }) { return AssetImage( _assetName, @@ -112,5 +112,5 @@ class AssetGenImage { String get path => _assetName; - String get keyName => _assetName; + String get keyName => 'packages/design_system/$_assetName'; } diff --git a/design_system/lib/widgets/app_text_fields.dart b/design_system/lib/widgets/app_text_fields.dart index 3832091..bd2b6fe 100644 --- a/design_system/lib/widgets/app_text_fields.dart +++ b/design_system/lib/widgets/app_text_fields.dart @@ -23,6 +23,7 @@ class AppTextField extends StatefulWidget { final bool hasScreenBottomNavigation; final int? currentLength; final bool enableSuggestions; + final bool autocorrect; const AppTextField({ required this.controller, @@ -34,6 +35,7 @@ class AppTextField extends StatefulWidget { this.suffixIcon, this.onTrailingIconPress, this.keyboardType, + this.autocorrect = false, this.enabled = true, this.obscureText = false, this.maxLength, @@ -73,6 +75,7 @@ class _AppTextFieldState extends State { maxLength: widget.maxLength, minLines: widget.minLines, maxLines: widget.maxLines, + autocorrect: widget.autocorrect, cursorHeight: 24, textAlignVertical: TextAlignVertical.center, controller: widget.controller, diff --git a/design_system/lib/widgets/background.dart b/design_system/lib/widgets/background.dart index 670ed3f..9aff3e8 100644 --- a/design_system/lib/widgets/background.dart +++ b/design_system/lib/widgets/background.dart @@ -16,12 +16,12 @@ class ScreenBackgroundContainer extends StatelessWidget { Positioned( top: 0, left: 0, - child: Assets.images.backgroundGreenProp.image(), + child: DsAssets.images.backgroundGreenProp.image(), ), Positioned( bottom: 0, right: 0, - child: Assets.images.backgroundRedProp.image(), + child: DsAssets.images.backgroundRedProp.image(), ), ], ), diff --git a/design_system/lib/widgets/points_counter.dart b/design_system/lib/widgets/points_counter.dart index 3c56a9f..dc5178e 100644 --- a/design_system/lib/widgets/points_counter.dart +++ b/design_system/lib/widgets/points_counter.dart @@ -65,7 +65,7 @@ class _PointsCounterState extends State child: Row( mainAxisSize: MainAxisSize.min, children: [ - Assets.images.estrella.image(), + DsAssets.images.estrella.image(), const SizedBox(width: 8), AnimatedCount( count: widget.points, diff --git a/design_system/lib/widgets/summary_widget.dart b/design_system/lib/widgets/summary_widget.dart index 5710c6b..805cbb8 100644 --- a/design_system/lib/widgets/summary_widget.dart +++ b/design_system/lib/widgets/summary_widget.dart @@ -114,7 +114,7 @@ class _Icon extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - Assets.images.estrella.image( + DsAssets.images.estrella.image( fit: BoxFit.fill, filterQuality: FilterQuality.high, ), @@ -131,7 +131,7 @@ class _Icon extends StatelessWidget { InformationSummaryType.gestures => Row( mainAxisSize: MainAxisSize.min, children: [ - Assets.images.check.image( + DsAssets.images.check.image( fit: BoxFit.fill, filterQuality: FilterQuality.high, ), @@ -148,7 +148,7 @@ class _Icon extends StatelessWidget { InformationSummaryType.time => Row( mainAxisSize: MainAxisSize.min, children: [ - Assets.images.reloj.image( + DsAssets.images.reloj.image( fit: BoxFit.fill, filterQuality: FilterQuality.high, ), diff --git a/design_system/pubspec.yaml b/design_system/pubspec.yaml index 17dc29d..7cf59c9 100644 --- a/design_system/pubspec.yaml +++ b/design_system/pubspec.yaml @@ -25,6 +25,12 @@ dev_dependencies: build_runner: 2.4.6 lints: 3.0.0 +flutter_gen: + assets: + outputs: + class_name: DsAssets + package_parameter_enabled: true + flutter: generate: true uses-material-design: true diff --git a/ios/Podfile.lock b/ios/Podfile.lock index fde508d..d5e5bc5 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1157,7 +1157,7 @@ PODS: - BoringSSL-GRPC/Interface (0.0.36) - camera_avfoundation (0.0.1): - Flutter - - cloud_firestore (5.1.0): + - cloud_firestore (5.4.2): - Firebase/Firestore (= 11.0.0) - firebase_core - Flutter @@ -1182,7 +1182,7 @@ PODS: - firebase_core (3.5.0): - Firebase/CoreOnly (= 11.0.0) - Flutter - - firebase_crashlytics (4.1.1): + - firebase_crashlytics (4.1.2): - Firebase/Crashlytics (= 11.0.0) - firebase_core - Flutter @@ -1552,11 +1552,11 @@ SPEC CHECKSUMS: audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40 BoringSSL-GRPC: ca6a8e5d04812fce8ffd6437810c2d46f925eaeb camera_avfoundation: 759172d1a77ae7be0de08fc104cfb79738b8a59e - cloud_firestore: 3f3395f245d7c0818519f94585b368224726b56b + cloud_firestore: efded0403c9e674954e2788d93bc2772a5089557 Firebase: 9f574c08c2396885b5e7e100ed4293d956218af9 firebase_auth: f27287630c4d9e2c3c63e64d9240822ad6b07e5b firebase_core: 2ec6b789859c7c24766344ec71fdf78639402d56 - firebase_crashlytics: 4111f8198b78c99471c955af488cecd8224967e6 + firebase_crashlytics: 60630a0f91ee432275fa1660fd8593079761448a firebase_remote_config: 730cce6bb1c8c42708fc7dce9031a88026b8b87b FirebaseABTesting: 2104d957ce33888a3d6f3bde298cdee376dde8f1 FirebaseAppCheckInterop: ea21450529cf0ebd132788dd8916a0269abc684f diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index bf2155b..3e8f56d 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -7,8 +7,6 @@ // ignore_for_file: type=lint // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use -import 'package:flutter/widgets.dart'; - class $AssetsAudioGen { const $AssetsAudioGen(); @@ -19,32 +17,6 @@ class $AssetsAudioGen { List get values => [marioCoinSound]; } -class $AssetsImagesGen { - const $AssetsImagesGen(); - - /// File path: assets/images/Check.png - AssetGenImage get check => const AssetGenImage('assets/images/Check.png'); - - /// File path: assets/images/Estrella.png - AssetGenImage get estrella => - const AssetGenImage('assets/images/Estrella.png'); - - /// File path: assets/images/Reloj.png - AssetGenImage get reloj => const AssetGenImage('assets/images/Reloj.png'); - - /// File path: assets/images/background_green_prop.png - AssetGenImage get backgroundGreenProp => - const AssetGenImage('assets/images/background_green_prop.png'); - - /// File path: assets/images/background_red_prop.png - AssetGenImage get backgroundRedProp => - const AssetGenImage('assets/images/background_red_prop.png'); - - /// List of all assets - List get values => - [check, estrella, reloj, backgroundGreenProp, backgroundRedProp]; -} - class $AssetsModelsGen { const $AssetsModelsGen(); @@ -79,82 +51,5 @@ class Assets { Assets._(); static const $AssetsAudioGen audio = $AssetsAudioGen(); - static const $AssetsImagesGen images = $AssetsImagesGen(); static const $AssetsModelsGen models = $AssetsModelsGen(); } - -class AssetGenImage { - const AssetGenImage(this._assetName, {this.size = null}); - - final String _assetName; - - final Size? size; - - Image image({ - Key? key, - AssetBundle? bundle, - ImageFrameBuilder? frameBuilder, - ImageErrorWidgetBuilder? errorBuilder, - String? semanticLabel, - bool excludeFromSemantics = false, - double? scale, - double? width, - double? height, - Color? color, - Animation? opacity, - BlendMode? colorBlendMode, - BoxFit? fit, - AlignmentGeometry alignment = Alignment.center, - ImageRepeat repeat = ImageRepeat.noRepeat, - Rect? centerSlice, - bool matchTextDirection = false, - bool gaplessPlayback = false, - bool isAntiAlias = false, - String? package, - FilterQuality filterQuality = FilterQuality.low, - int? cacheWidth, - int? cacheHeight, - }) { - return Image.asset( - _assetName, - key: key, - bundle: bundle, - frameBuilder: frameBuilder, - errorBuilder: errorBuilder, - semanticLabel: semanticLabel, - excludeFromSemantics: excludeFromSemantics, - scale: scale, - width: width, - height: height, - color: color, - opacity: opacity, - colorBlendMode: colorBlendMode, - fit: fit, - alignment: alignment, - repeat: repeat, - centerSlice: centerSlice, - matchTextDirection: matchTextDirection, - gaplessPlayback: gaplessPlayback, - isAntiAlias: isAntiAlias, - package: package, - filterQuality: filterQuality, - cacheWidth: cacheWidth, - cacheHeight: cacheHeight, - ); - } - - ImageProvider provider({ - AssetBundle? bundle, - String? package, - }) { - return AssetImage( - _assetName, - bundle: bundle, - package: package, - ); - } - - String get path => _assetName; - - String get keyName => _assetName; -} diff --git a/lib/ui/game_screen/game_screen.dart b/lib/ui/game_screen/game_screen.dart index d2b2bfe..f9e04c5 100644 --- a/lib/ui/game_screen/game_screen.dart +++ b/lib/ui/game_screen/game_screen.dart @@ -1,10 +1,10 @@ import 'package:auto_route/auto_route.dart'; import 'package:design_system/design_system.dart'; +import 'package:design_system/gen/assets.gen.dart'; import 'package:design_system/widgets/app_scaffold.dart'; import 'package:design_system/widgets/points_counter.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:simon_ai/gen/assets.gen.dart'; import 'package:simon_ai/ui/game_screen/gesture_feedback.dart'; import 'package:simon_ai/ui/game_screen/game_overlay.dart'; import 'package:simon_ai/ui/game_screen/game_screen_cubit.dart'; @@ -165,7 +165,7 @@ class _GesturesCounter extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ - Assets.images.check.image( + DsAssets.images.check.image( fit: BoxFit.fill, filterQuality: FilterQuality.high, ), diff --git a/lib/ui/leaderboard/leaderboard_screen.dart b/lib/ui/leaderboard/leaderboard_screen.dart index d50c902..a38f473 100644 --- a/lib/ui/leaderboard/leaderboard_screen.dart +++ b/lib/ui/leaderboard/leaderboard_screen.dart @@ -1,12 +1,12 @@ import 'package:auto_route/auto_route.dart'; import 'package:design_system/design_system.dart'; import 'package:design_system/extensions/color_extensions.dart'; +import 'package:design_system/gen/assets.gen.dart'; import 'package:design_system/widgets/app_button.dart'; import 'package:design_system/widgets/app_scaffold.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:simon_ai/gen/assets.gen.dart'; import 'package:simon_ai/ui/common/app_constrained_widget.dart'; import 'package:simon_ai/ui/extensions/context_device_extensions.dart'; import 'package:simon_ai/ui/leaderboard/leaderboard_cubit.dart'; @@ -233,7 +233,7 @@ class _LeaderboardUserCard extends StatelessWidget { ), Row( children: [ - Assets.images.estrella.image( + DsAssets.images.estrella.image( fit: BoxFit.fill, filterQuality: FilterQuality.high, width: 24, diff --git a/scripts/clean_up.sh b/scripts/clean_up.sh index c9b0827..dd6e7e3 100755 --- a/scripts/clean_up.sh +++ b/scripts/clean_up.sh @@ -8,3 +8,5 @@ cd design_system/design_system_gallery && fvm flutter pub get && cd ../.. echo ':: dart run build_runner build --delete-conflicting-outputs ::' fvm dart run build_runner build --delete-conflicting-outputs +cd design_system/design_system_gallery && fvm dart run build_runner build --delete-conflicting-outputs && cd ../.. +