diff --git a/.gitattributes b/.gitattributes index dfe07704..2334398e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,15 @@ # Auto detect text files and perform LF normalization * text=auto + +# Generated files +**/*.g.dart linguist-generated=true +**/*.mapper.dart linguist-generated=true +**/*.modddel.dart linguist-generated=true +**/*.iconfig.dart linguist-generated=true +**/i18n.dart linguist-generated=true +lib/generated/intl/messages*.dart linguist-generated=true +**/*.chopper.dart linguist-generated=true +**/*.swagger.dart linguist-generated=true +**/client_mapping.dart linguist-generated=true +**/*.auto_mappr.dart linguist-generated=true +**/*.lock linguist-generated=true diff --git a/lib/main.dart b/lib/main.dart index 246db8a3..68fb29d8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,7 +14,7 @@ void main() async { // * https://docs.flutter.dev/testing/errors registerErrorHandlers(); AppFlavor.initConfig(); - const env = EnvFlavor.instance; + final env = EnvFlavor.instance; if (env.usePathUrlStrategy) { usePathUrlStrategy(); } diff --git a/lib/src/routing/presentation/widgets/responsive_scaffold.dart b/lib/src/routing/presentation/widgets/responsive_scaffold.dart index bf0a7de6..e5a1ed31 100644 --- a/lib/src/routing/presentation/widgets/responsive_scaffold.dart +++ b/lib/src/routing/presentation/widgets/responsive_scaffold.dart @@ -393,30 +393,34 @@ class _ResponsiveScaffoldState extends State ? SystemUiOverlayStyle.dark : SystemUiOverlayStyle.light, child: SafeArea( - child: ResponsiveNavigationToolbar( - leadingButton: leadingButton, - middle: title != null - ? Text( - title, - style: theme.textTheme.titleMedium, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ) - : null, - action: widget.buildActionButton - ?.call(context, topRoute, widget.currentIndex, false), - actionExpanded: widget.buildActionButton - ?.call(context, topRoute, widget.currentIndex, true), - willShowLeadingButton: willShowLeadingButton, - transitionDuration: widget.transitionDuration, - transitionReverseDuration: widget.transitionReverseDuration, - logoExpanded: widget.buildLogo - ?.call(context, topRoute, widget.currentIndex, true), - logo: widget.buildLogo - ?.call(context, topRoute, widget.currentIndex, false), - minLogoCollapsedWidth: widget.minLogoCollapsedWidth, - minLogoExpandedWidth: widget.minLogoExpandedWidth, - minActionExpandedWidth: widget.minActionExpandedWidth, + child: Padding( + padding: + const EdgeInsetsDirectional.symmetric(horizontal: 8.0), + child: ResponsiveNavigationToolbar( + leadingButton: leadingButton, + middle: title != null + ? Text( + title, + style: theme.textTheme.titleMedium, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ) + : null, + action: widget.buildActionButton + ?.call(context, topRoute, widget.currentIndex, false), + actionExpanded: widget.buildActionButton + ?.call(context, topRoute, widget.currentIndex, true), + willShowLeadingButton: willShowLeadingButton, + transitionDuration: widget.transitionDuration, + transitionReverseDuration: widget.transitionReverseDuration, + logoExpanded: widget.buildLogo + ?.call(context, topRoute, widget.currentIndex, true), + logo: widget.buildLogo + ?.call(context, topRoute, widget.currentIndex, false), + minLogoCollapsedWidth: widget.minLogoCollapsedWidth, + minLogoExpandedWidth: widget.minLogoExpandedWidth, + minActionExpandedWidth: widget.minActionExpandedWidth, + ), ), ), ), @@ -486,15 +490,13 @@ class _ResponsiveScaffoldState extends State child: tabBar, ), ), - if (!isRootRoute) ...[ - gap16, - Expanded( - child: Text( - title, - style: theme.textTheme.titleMedium, - ), + gap16, + Expanded( + child: Text( + title, + style: theme.textTheme.titleMedium, ), - ], + ), ], ), ), diff --git a/lib/src/routing/router/router_extensions.dart b/lib/src/routing/router/router_extensions.dart index 4758cb1c..fdea1ac4 100644 --- a/lib/src/routing/router/router_extensions.dart +++ b/lib/src/routing/router/router_extensions.dart @@ -30,13 +30,13 @@ extension GoRouterExtension on GoRouter { } final pathSegments = location.pathSegments; - final newLoc = location.replace(path: '/${pathSegments.join(' / ')}'); + final newLoc = location.replace(path: '/${pathSegments.join('/')}'); go(newLoc.path); return true; } - bool goBack({bool stripQueryParameters = true}) { + bool goBack({bool stripQueryParameters = false}) { if (!canGoBack()) { return false; } @@ -44,7 +44,7 @@ extension GoRouterExtension on GoRouter { final location = routerDelegate.locationUri; final length = routerDelegate.locationUri.pathSegments.length; final pathSegments = location.pathSegments.slice(0, length - 1).toList(); - final newLoc = location.replace(path: '/${pathSegments.join(' / ')}'); + final newLoc = location.replace(path: '/${pathSegments.join('/')}'); go(stripQueryParameters ? newLoc.path : newLoc.toString()); return true; diff --git a/melos.yaml b/melos.yaml index 7d0bc537..45d819a0 100644 --- a/melos.yaml +++ b/melos.yaml @@ -128,7 +128,7 @@ scripts: ignore: localization watch:pkg: - run: dart run build_runner watch + run: dart run build_runner watch --delete-conflicting-outputs exec: # concurrency: 1 failFast: true diff --git a/packages/env/lib/src/env/config/env_flavor.dart b/packages/env/lib/src/env/config/env_flavor.dart index fb281646..f2931ebd 100644 --- a/packages/env/lib/src/env/config/env_flavor.dart +++ b/packages/env/lib/src/env/config/env_flavor.dart @@ -12,7 +12,7 @@ abstract class EnvFlavor implements EnvFields { ? String.fromEnvironment('FLUTTER_APP_FLAVOR') : 'local'; - static const EnvFlavor instance = + static final EnvFlavor instance = EnvFlavor.rawFlavor == 'prod' || EnvFlavor.rawFlavor == 'beta' ? ProdEnv() : EnvFlavor.rawFlavor == 'staging' @@ -21,6 +21,20 @@ abstract class EnvFlavor implements EnvFields { ? LocalEnv() : DevEnv(); + static const bool isProd = flavor == Flavor.prod; + static const bool isStaging = flavor == Flavor.staging; + static const bool isLocal = flavor == Flavor.local; + static const bool isDev = flavor == Flavor.dev; + + static const Flavor flavor = + EnvFlavor.rawFlavor == 'prod' || EnvFlavor.rawFlavor == 'beta' + ? Flavor.prod + : EnvFlavor.rawFlavor == 'staging' + ? Flavor.staging + : EnvFlavor.rawFlavor == 'local' + ? Flavor.local + : Flavor.dev; + const EnvFlavor._(); } diff --git a/packages/env/lib/src/env/dev_env.dart b/packages/env/lib/src/env/dev_env.dart index 921ade67..7de0ee6b 100644 --- a/packages/env/lib/src/env/dev_env.dart +++ b/packages/env/lib/src/env/dev_env.dart @@ -6,7 +6,7 @@ part 'dev_env.g.dart'; @Envied(name: 'Env', path: 'dev.env', allowOptionalFields: true) class DevEnv implements EnvFlavor, EnvFields { - const DevEnv(); + DevEnv(); // Using nullable types or providing a default value for everything allows // the app to be build without setting up the .env file. This would be diff --git a/packages/env/lib/src/env/local_env.dart b/packages/env/lib/src/env/local_env.dart index 27087bf1..2867cc1a 100644 --- a/packages/env/lib/src/env/local_env.dart +++ b/packages/env/lib/src/env/local_env.dart @@ -6,7 +6,7 @@ part 'local_env.g.dart'; @Envied(name: 'Env', path: 'local.env', allowOptionalFields: true) class LocalEnv implements EnvFlavor, EnvFields { - const LocalEnv(); + LocalEnv(); // Using nullable types or providing a default value for everything allows // the app to be build without setting up the .env file. This would be diff --git a/packages/env/lib/src/env/prod_env.dart b/packages/env/lib/src/env/prod_env.dart index a50dbb4c..145b5aec 100644 --- a/packages/env/lib/src/env/prod_env.dart +++ b/packages/env/lib/src/env/prod_env.dart @@ -6,7 +6,7 @@ part 'prod_env.g.dart'; @Envied(name: 'Env', path: 'prod.env', allowOptionalFields: true) class ProdEnv implements EnvFlavor, EnvFields { - const ProdEnv(); + ProdEnv(); // Using nullable types or providing a default value for everything allows // the app to be build without setting up the .env file. This would be diff --git a/packages/env/lib/src/env/staging_env.dart b/packages/env/lib/src/env/staging_env.dart index b66f06c8..ff5c493b 100644 --- a/packages/env/lib/src/env/staging_env.dart +++ b/packages/env/lib/src/env/staging_env.dart @@ -6,7 +6,7 @@ part 'staging_env.g.dart'; @Envied(name: 'Env', path: 'staging.env', allowOptionalFields: true) class StagingEnv implements EnvFlavor, EnvFields { - const StagingEnv(); + StagingEnv(); // Using nullable types or providing a default value for everything allows // the app to be build without setting up the .env file. This would be diff --git a/pubspec.lock b/pubspec.lock index 51fb8821..2b7f490f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -362,18 +362,18 @@ packages: dependency: "direct main" description: name: dart_mappable - sha256: "7b6d38ae95f1ae8ffa65df9a5464f14b56c2de94699a035202ca4cd3a0ba249e" + sha256: f9f272f2af6c11adf4abc22574eb946df110251052a0d00c03519ecf2442defc url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.2.1" dart_mappable_builder: dependency: "direct dev" description: name: dart_mappable_builder - sha256: "98c058f7e80a98ea42d357d888ed1648d96bedac8b16872b58fc7024faefcdfe" + sha256: dd42e99b7e605ad6cf4a5c241a777c0f4f76a9769f27c439795355c444283074 url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.2.1" dart_style: dependency: transitive description: @@ -473,10 +473,10 @@ packages: dependency: "direct main" description: name: flex_color_picker - sha256: "0871edc170153cfc3de316d30625f40a85daecfa76ce541641f3cc0ec7757cbf" + sha256: "904373c7b0531fd4a92d29705a80ab4594b7647da2d93044487aaec4614cb6ed" url: "https://pub.dev" source: hosted - version: "3.3.1" + version: "3.4.0" flex_color_scheme: dependency: "direct main" description: @@ -703,10 +703,10 @@ packages: dependency: "direct main" description: name: google_fonts - sha256: f0b8d115a13ecf827013ec9fc883390ccc0e87a96ed5347a3114cac177ef18e8 + sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.2.1" graphs: dependency: transitive description: @@ -1377,10 +1377,10 @@ packages: dependency: "direct main" description: name: skeletonizer - sha256: "86f373126d9a887a2d63f2463a9913a973ce7f282efa7f0d9d06a17e3f19838c" + sha256: "2eb80153c80507359ff05f6a18ed50ae0bafa1b999aa867a8cef0a53387b5650" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" sky_engine: dependency: transitive description: flutter @@ -1390,10 +1390,10 @@ packages: dependency: "direct dev" description: name: solid_lints - sha256: "67b2c0a7052d6c95de4fce442fe926c2a8e2b928115c3a5f633dda5d51c7f12b" + sha256: "1cbc3491be714b2d3660a81feb76e228434a7dc0b5bd308063e75a85cea42d87" url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.1.4" source_gen: dependency: transitive description: @@ -1598,10 +1598,10 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c + sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e" url: "https://pub.dev" source: hosted - version: "6.2.4" + version: "6.2.5" url_launcher_android: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index c768a44e..f42640cf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: An opinionated template for a Flutter project. publish_to: none -version: 0.6.0 +version: 0.6.1 environment: sdk: ">=3.1.0 <4.0.0" @@ -22,7 +22,7 @@ dependencies: dart_mappable: ^4.1.0 env: path: packages/env - flex_color_picker: ^3.3.1 + flex_color_picker: ^3.4.0 flex_color_scheme: ^7.3.1 flutter: sdk: flutter @@ -36,7 +36,7 @@ dependencies: fpdart: ^1.1.0 freezed_annotation: ^2.2.0 go_router: ^13.1.0 - google_fonts: ^6.1.0 + google_fonts: ^6.2.1 hive: ^2.2.3 hive_flutter: ^1.1.0 hooks_riverpod: ^2.4.9 @@ -53,11 +53,11 @@ dependencies: riverpod_annotation: ^2.3.4 sidebarx: path: packages/pub/sidebarx - skeletonizer: ^1.0.1 + skeletonizer: ^1.1.0 stock: ^1.0.1 super_clipboard: ^0.8.5 universal_html: ^2.2.4 - url_launcher: ^6.2.4 + url_launcher: ^6.2.5 window_manager: ^0.3.8 wolt_modal_sheet: ^0.4.1 @@ -68,7 +68,7 @@ dev_dependencies: build_verify: ^3.1.0 change_app_package_name: ^1.1.0 custom_lint: ^0.6.2 - dart_mappable_builder: ^4.2.0 + dart_mappable_builder: ^4.2.1 flutter_launcher_icons: ^0.13.1 flutter_lints: ^3.0.1 flutter_test: @@ -85,7 +85,7 @@ dev_dependencies: patrol: ^3.5.2 riverpod_generator: ^2.3.10 riverpod_lint: ^2.3.8 - solid_lints: ^0.1.3 + solid_lints: ^0.1.4 test: any flutter: