├── app ├── analysis_options.yaml ├── ios │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── .gitignore ├── android │ ├── gradle.properties │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── multi_package_sample │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── settings.gradle │ └── build.gradle ├── lib │ ├── environments │ │ ├── staging │ │ │ ├── staging_build_config.dart │ │ │ └── staging_main.dart │ │ ├── production │ │ │ ├── production_build_config.dart │ │ │ └── production_main.dart │ │ └── app_start.dart │ ├── resolvers │ │ ├── library_resolver.dart │ │ └── app_resolver.dart │ ├── analytics │ │ └── app_analytics_receiver.dart │ ├── di │ │ ├── module │ │ │ ├── app_library_module.dart │ │ │ └── app_injection_module.dart │ │ └── app_component.dart │ └── app │ │ └── my_app.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── features ├── home │ ├── analysis_options.yaml │ ├── lib │ │ ├── home.dart │ │ └── src │ │ │ ├── localization │ │ │ ├── home_delegate.dart │ │ │ └── home_localization.dart │ │ │ ├── router │ │ │ ├── app_home_navigator.dart │ │ │ └── home_router_module.dart │ │ │ ├── di │ │ │ └── home_injection_module.dart │ │ │ ├── home_resolver.dart │ │ │ └── ui │ │ │ └── home_screen.dart │ ├── assets │ │ └── i18n │ │ │ └── pt-BR.json │ ├── .metadata │ ├── pubspec.yaml │ └── .gitignore ├── login │ ├── analysis_options.yaml │ ├── lib │ │ ├── login.dart │ │ └── src │ │ │ ├── analytics │ │ │ └── login_analytics_logger.dart │ │ │ ├── localization │ │ │ ├── login_delegate.dart │ │ │ └── login_localization.dart │ │ │ ├── router │ │ │ ├── app_login_navigator.dart │ │ │ └── login_router_module.dart │ │ │ ├── di │ │ │ └── login_injection_module.dart │ │ │ ├── login_resolver.dart │ │ │ └── ui │ │ │ └── login_screen.dart │ ├── assets │ │ └── i18n │ │ │ └── pt-BR.json │ ├── .metadata │ ├── pubspec.yaml │ └── .gitignore └── splash │ ├── lib │ ├── go_splash.dart │ └── src │ │ ├── router │ │ ├── app_splash_navigator.dart │ │ └── splash_router_module.dart │ │ ├── ui │ │ ├── cubit │ │ │ ├── splash_state.dart │ │ │ └── splash_cubit.dart │ │ └── splash_screen.dart │ │ ├── splash_resolver.dart │ │ └── di │ │ └── splash_injection.dart │ ├── analysis_options.yaml │ ├── .metadata │ ├── pubspec.yaml │ └── .gitignore ├── infrastructure ├── core │ ├── analysis_options.yaml │ ├── lib │ │ ├── src │ │ │ ├── contants.dart │ │ │ ├── analytics_logger.dart │ │ │ ├── modules │ │ │ │ ├── injection_module.dart │ │ │ │ ├── feature_resolver.dart │ │ │ │ └── router_module.dart │ │ │ ├── localization │ │ │ │ ├── locale_utils.dart │ │ │ │ ├── resolution_callback.dart │ │ │ │ └── localization.dart │ │ │ ├── injection │ │ │ │ ├── injector.dart │ │ │ │ └── app_injector.dart │ │ │ └── build_config.dart │ │ └── core.dart │ ├── .metadata │ ├── test │ │ └── core_test.dart │ ├── pubspec.yaml │ └── .gitignore ├── navigator │ ├── analysis_options.yaml │ ├── lib │ │ ├── navigator.dart │ │ └── src │ │ │ ├── home_navigator.dart │ │ │ ├── login_navigator.dart │ │ │ ├── splash_navigator.dart │ │ │ └── app_navigator.dart │ ├── .metadata │ ├── .gitignore │ └── pubspec.yaml └── common_dependencies │ ├── lib │ └── common_dependencies.dart │ ├── .metadata │ ├── pubspec.yaml │ └── .gitignore ├── .vscode ├── settings.json └── launch.json ├── README.md ├── .gitignore ├── melos.yaml └── all_lint_rules.yaml /app/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../all_lint_rules.yaml -------------------------------------------------------------------------------- /app/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /app/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /features/home/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../all_lint_rules.yaml -------------------------------------------------------------------------------- /features/login/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../all_lint_rules.yaml -------------------------------------------------------------------------------- /features/splash/lib/go_splash.dart: -------------------------------------------------------------------------------- 1 | export 'src/splash_resolver.dart'; 2 | -------------------------------------------------------------------------------- /features/splash/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../all_lint_rules.yaml 2 | -------------------------------------------------------------------------------- /app/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /infrastructure/core/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../all_lint_rules.yaml 2 | -------------------------------------------------------------------------------- /features/home/lib/home.dart: -------------------------------------------------------------------------------- 1 | library home; 2 | 3 | export 'src/home_resolver.dart'; 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "codegen", 4 | "cupertino" 5 | ] 6 | } -------------------------------------------------------------------------------- /app/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /features/home/assets/i18n/pt-BR.json: -------------------------------------------------------------------------------- 1 | { 2 | "home_screen": { 3 | "title": "Welcome back user!" 4 | } 5 | } -------------------------------------------------------------------------------- /infrastructure/core/lib/src/contants.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | const appSupportedLanguages = [ 4 | Locale('pt', 'BR'), 5 | ]; 6 | -------------------------------------------------------------------------------- /features/login/lib/login.dart: -------------------------------------------------------------------------------- 1 | library login; 2 | 3 | export 'src/analytics/login_analytics_logger.dart'; 4 | export 'src/login_resolver.dart'; 5 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/analytics_logger.dart: -------------------------------------------------------------------------------- 1 | abstract class AnalyticsLogger { 2 | void logEvent(String name, [Map? params]); 3 | } 4 | -------------------------------------------------------------------------------- /features/login/assets/i18n/pt-BR.json: -------------------------------------------------------------------------------- 1 | { 2 | "login_screen": { 3 | "title": "Welcome, press SSO to authenticate", 4 | "action": "SSO" 5 | } 6 | } -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /features/login/lib/src/analytics/login_analytics_logger.dart: -------------------------------------------------------------------------------- 1 | class LoginEvents { 2 | LoginEvents._(); 3 | 4 | static const String loginButtonClick = 'login_button_click'; 5 | } 6 | -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Create a multi package project with Flutter 2 | 3 | The complete explanation about the repository can be found [here](https://engineer-journal.hashnode.dev/building-a-multi-package-project-with-flutter) -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rodrigolmti/multi_package_sample/HEAD/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /infrastructure/navigator/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /infrastructure/navigator/lib/navigator.dart: -------------------------------------------------------------------------------- 1 | library navigator; 2 | 3 | export 'src/home_navigator.dart'; 4 | export 'src/login_navigator.dart'; 5 | export 'src/app_navigator.dart'; 6 | export 'src/splash_navigator.dart'; 7 | -------------------------------------------------------------------------------- /app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/android/app/src/main/kotlin/com/example/multi_package_sample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.multi_package_sample 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /app/lib/environments/staging/staging_build_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | 3 | class StagingBuildConfig extends BuildConfig { 4 | @override 5 | // ignore: overridden_fields 6 | Map configs = { 7 | 'analyticsLogs': true, 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /app/lib/resolvers/library_resolver.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:multi_package_sample/di/module/app_library_module.dart'; 3 | 4 | class LibraryResolver extends FeatureResolver { 5 | @override 6 | InjectionModule? get injectionModule => AppLibraryModule(); 7 | } 8 | -------------------------------------------------------------------------------- /app/lib/environments/production/production_build_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | 3 | class ProductionBuildConfig extends BuildConfig { 4 | @override 5 | // ignore: overridden_fields 6 | Map configs = { 7 | 'analyticsLogs': false, 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /app/lib/resolvers/app_resolver.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | 3 | import 'package:multi_package_sample/di/module/app_injection_module.dart'; 4 | 5 | class AppResolver extends FeatureResolver { 6 | @override 7 | InjectionModule? get injectionModule => AppInjectionModule(); 8 | } 9 | -------------------------------------------------------------------------------- /app/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /infrastructure/navigator/lib/src/home_navigator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class HomeRoutes { 4 | HomeRoutes._(); 5 | 6 | static const String root = '/home'; 7 | } 8 | 9 | abstract class HomeNavigator { 10 | void navigateToRoot(BuildContext context); 11 | } 12 | -------------------------------------------------------------------------------- /infrastructure/navigator/lib/src/login_navigator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoginRoutes { 4 | LoginRoutes._(); 5 | 6 | static const String root = '/login'; 7 | } 8 | 9 | abstract class LoginNavigator { 10 | void navigateToRoot(BuildContext context); 11 | } 12 | -------------------------------------------------------------------------------- /infrastructure/navigator/lib/src/splash_navigator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SplashRoutes { 4 | SplashRoutes._(); 5 | 6 | static const String root = '/'; 7 | } 8 | 9 | abstract class SplashNavigator { 10 | void navigateToSplash(BuildContext context); 11 | } 12 | -------------------------------------------------------------------------------- /app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /infrastructure/common_dependencies/lib/common_dependencies.dart: -------------------------------------------------------------------------------- 1 | library common_dependencies; 2 | 3 | export 'package:freezed_annotation/freezed_annotation.dart'; 4 | export 'package:intl/intl.dart'; 5 | export 'package:flutter_svg/flutter_svg.dart'; 6 | export 'package:flutter_bloc/flutter_bloc.dart'; 7 | export 'package:navigator/navigator.dart'; 8 | -------------------------------------------------------------------------------- /app/lib/environments/staging/staging_main.dart: -------------------------------------------------------------------------------- 1 | import 'package:multi_package_sample/environments/app_start.dart'; 2 | import 'package:multi_package_sample/environments/staging/staging_build_config.dart'; 3 | 4 | class StagingApp extends AppStart { 5 | StagingApp() : super(StagingBuildConfig()); 6 | } 7 | 8 | Future main() => StagingApp().startApp(); 9 | -------------------------------------------------------------------------------- /app/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /features/splash/lib/src/router/app_splash_navigator.dart: -------------------------------------------------------------------------------- 1 | import 'package:common_dependencies/common_dependencies.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AppSignInNavigator with AppNavigator implements SplashNavigator { 5 | @override 6 | void navigateToSplash(BuildContext context) => 7 | navigateTo(context, SplashRoutes.root); 8 | } 9 | -------------------------------------------------------------------------------- /features/home/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/modules/injection_module.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:core/src/build_config.dart'; 4 | import 'package:core/src/injection/injector.dart'; 5 | 6 | abstract class InjectionModule { 7 | FutureOr registerDependencies({ 8 | required Injector injector, 9 | required BuildConfig buildConfig, 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /features/home/lib/src/localization/home_delegate.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:home/src/localization/home_localization.dart'; 3 | 4 | final homeLocalizationDelegate = HomeLocalizationDelegate( 5 | getPathFunction: (locale) => 6 | getTransalationFilePath(packageName: 'home', locale: locale), 7 | supportedLocales: appSupportedLanguages, 8 | ); 9 | -------------------------------------------------------------------------------- /features/login/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /features/splash/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 4cc385b4b84ac2f816d939a49ea1f328c4e0b48e 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /features/login/lib/src/localization/login_delegate.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:login/src/localization/login_localization.dart'; 3 | 4 | final loginLocalizationDelegate = LoginLocalizationDelegate( 5 | getPathFunction: (locale) => 6 | getTransalationFilePath(packageName: 'login', locale: locale), 7 | supportedLocales: appSupportedLanguages, 8 | ); 9 | -------------------------------------------------------------------------------- /infrastructure/core/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /features/splash/lib/src/ui/cubit/splash_state.dart: -------------------------------------------------------------------------------- 1 | class SplashState { 2 | final bool isUserAuthenticated; 3 | 4 | const SplashState({this.isUserAuthenticated = false}); 5 | 6 | SplashState copyWith({ 7 | bool? isUserAuthenticated, 8 | }) => 9 | SplashState( 10 | isUserAuthenticated: isUserAuthenticated ?? this.isUserAuthenticated, 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /infrastructure/core/test/core_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | import 'package:core/core.dart'; 4 | 5 | void main() { 6 | test('adds one to input values', () { 7 | final calculator = Calculator(); 8 | expect(calculator.addOne(2), 3); 9 | expect(calculator.addOne(-7), -6); 10 | expect(calculator.addOne(0), 1); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /infrastructure/navigator/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /app/lib/analytics/app_analytics_receiver.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_print 2 | 3 | import 'package:core/core.dart'; 4 | 5 | class AppAnalyticsReceiver implements AnalyticsLogger { 6 | /// Inject here the instance of Firebase for example and log your events 7 | 8 | @override 9 | void logEvent(String name, [Map? params]) { 10 | print(name); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /infrastructure/common_dependencies/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /app/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /app/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /infrastructure/core/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: core 2 | description: A core package 3 | version: 0.0.1 4 | publish_to: none 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=1.17.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | equatable: ^2.0.3 15 | get_it: ^7.1.4 16 | flat: ^0.4.0 17 | 18 | common_dependencies: 19 | path: ../common_dependencies/ 20 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/localization/locale_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | String getTransalationFilePath({ 4 | required Locale locale, 5 | String? packageName, 6 | }) => 7 | packageName != null 8 | ? 'packages/$packageName/assets/i18n/${locale.languageCode}-${locale.countryCode}.json' 9 | : 'assets/i18n/${locale.languageCode}-${locale.countryCode}.json'; 10 | -------------------------------------------------------------------------------- /app/lib/environments/production/production_main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:multi_package_sample/environments/app_start.dart'; 4 | import 'package:multi_package_sample/environments/production/production_build_config.dart'; 5 | 6 | class ProductionApp extends AppStart { 7 | ProductionApp() : super(ProductionBuildConfig()); 8 | } 9 | 10 | Future main() => ProductionApp().startApp(); 11 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/modules/feature_resolver.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/src/modules/injection_module.dart'; 2 | import 'package:core/src/modules/router_module.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | abstract class FeatureResolver { 6 | RouterModule? get routerModule => null; 7 | 8 | LocalizationsDelegate? get localeDelegate => null; 9 | 10 | InjectionModule? get injectionModule => null; 11 | } 12 | -------------------------------------------------------------------------------- /features/splash/lib/src/splash_resolver.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:splash/src/di/splash_injection.dart'; 3 | import 'package:splash/src/router/splash_router_module.dart'; 4 | 5 | class SplashResolver extends FeatureResolver { 6 | @override 7 | InjectionModule? get injectionModule => SplashInjectionModule(); 8 | 9 | @override 10 | RouterModule? get routerModule => SplashRouterModule(); 11 | } 12 | -------------------------------------------------------------------------------- /app/lib/di/module/app_library_module.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:core/core.dart'; 4 | 5 | /// Register here all the third party libraries so they can be provided 6 | /// for the rest of the packages. 7 | class AppLibraryModule implements InjectionModule { 8 | @override 9 | FutureOr registerDependencies({ 10 | required Injector injector, 11 | required BuildConfig buildConfig, 12 | }) async {} 13 | } 14 | -------------------------------------------------------------------------------- /features/splash/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: splash 2 | description: Splash feature 3 | version: 0.0.1 4 | publish_to: none 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=2.0.0" 9 | 10 | dependencies: 11 | common_dependencies: 12 | path: ../../infrastructure/common_dependencies/ 13 | core: 14 | path: ../../infrastructure/core/ 15 | 16 | ## Libraries 17 | faker: ^2.0.0 18 | 19 | flutter: 20 | uses-material-design: true 21 | -------------------------------------------------------------------------------- /features/home/lib/src/router/app_home_navigator.dart: -------------------------------------------------------------------------------- 1 | import 'package:common_dependencies/common_dependencies.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AppHomeNavigator with AppNavigator implements HomeNavigator { 5 | @override 6 | void navigateToRoot(BuildContext context) => navigateTo( 7 | context, 8 | HomeRoutes.root, 9 | pushAndReplace: true, 10 | anchor: SplashRoutes.root, 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /features/login/lib/src/router/app_login_navigator.dart: -------------------------------------------------------------------------------- 1 | import 'package:common_dependencies/common_dependencies.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AppLoginNavigator with AppNavigator implements LoginNavigator { 5 | @override 6 | void navigateToRoot(BuildContext context) => navigateTo( 7 | context, 8 | LoginRoutes.root, 9 | pushAndReplace: true, 10 | anchor: SplashRoutes.root, 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /app/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /features/splash/lib/src/di/splash_injection.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:core/core.dart'; 4 | import 'package:splash/src/ui/cubit/splash_cubit.dart'; 5 | 6 | class SplashInjectionModule implements InjectionModule { 7 | @override 8 | FutureOr registerDependencies({ 9 | required Injector injector, 10 | required BuildConfig buildConfig, 11 | }) async { 12 | //VIEW 13 | injector.registerFactory( 14 | () => SplashCubit(), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Debug", 6 | "program": "app/lib/environments/staging/staging_main.dart", 7 | "request": "launch", 8 | "type": "dart", 9 | "flutterMode": "debug", 10 | }, 11 | { 12 | "name": "Release debug", 13 | "program": "app/lib/environments/production/production_main.dart", 14 | "request": "launch", 15 | "type": "dart", 16 | "flutterMode": "debug", 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /infrastructure/common_dependencies/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: common_dependencies 2 | description: This package aims to provide common dependencies between modules 3 | publish_to: none 4 | version: 0.0.1 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=2.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | navigator: 15 | path: ../navigator/ 16 | 17 | ## Packages 18 | freezed_annotation: ^0.14.2 19 | flutter_svg: ^0.21.0+1 20 | flutter_bloc: ^7.3.1 21 | intl: ^0.17.0 22 | -------------------------------------------------------------------------------- /app/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /app/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /app/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /features/home/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: home 2 | description: Home feature 3 | version: 0.0.1 4 | publish_to: none 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=2.0.0" 9 | 10 | dependencies: 11 | common_dependencies: 12 | path: ../../infrastructure/common_dependencies/ 13 | core: 14 | path: ../../infrastructure/core/ 15 | 16 | ## Libraries 17 | 18 | dev_dependencies: 19 | build_runner: ^2.0.4 20 | freezed: ^0.14.2 21 | 22 | flutter: 23 | uses-material-design: true 24 | assets: 25 | - assets/i18n/ 26 | -------------------------------------------------------------------------------- /infrastructure/core/lib/core.dart: -------------------------------------------------------------------------------- 1 | library core; 2 | 3 | export 'src/analytics_logger.dart'; 4 | export 'src/build_config.dart'; 5 | export 'src/contants.dart'; 6 | export 'src/injection/app_injector.dart'; 7 | export 'src/injection/injector.dart'; 8 | export 'src/localization/locale_utils.dart'; 9 | export 'src/localization/localization.dart'; 10 | export 'src/localization/resolution_callback.dart'; 11 | export 'src/modules/feature_resolver.dart'; 12 | export 'src/modules/injection_module.dart'; 13 | export 'src/modules/router_module.dart'; 14 | -------------------------------------------------------------------------------- /features/login/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: login 2 | description: Login feature 3 | version: 0.0.1 4 | publish_to: none 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=2.0.0" 9 | 10 | dependencies: 11 | common_dependencies: 12 | path: ../../infrastructure/common_dependencies/ 13 | core: 14 | path: ../../infrastructure/core/ 15 | 16 | ## Libraries 17 | 18 | dev_dependencies: 19 | build_runner: ^2.0.4 20 | freezed: ^0.14.2 21 | 22 | flutter: 23 | uses-material-design: true 24 | assets: 25 | - assets/i18n/ 26 | -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/lib/di/module/app_injection_module.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:core/core.dart'; 4 | import 'package:multi_package_sample/analytics/app_analytics_receiver.dart'; 5 | 6 | class AppInjectionModule implements InjectionModule { 7 | @override 8 | FutureOr registerDependencies({ 9 | required Injector injector, 10 | required BuildConfig buildConfig, 11 | }) async { 12 | injector 13 | ..registerSingleton(AppAnalyticsReceiver()) 14 | ..registerSingleton(buildConfig); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /features/home/lib/src/di/home_injection_module.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:common_dependencies/common_dependencies.dart'; 4 | import 'package:core/core.dart'; 5 | import 'package:home/src/router/app_home_navigator.dart'; 6 | 7 | class HomeInjectionModule implements InjectionModule { 8 | @override 9 | FutureOr registerDependencies({ 10 | required Injector injector, 11 | required BuildConfig buildConfig, 12 | }) async { 13 | injector 14 | // PRESENTATION 15 | .registerFactory(() => AppHomeNavigator()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /features/home/lib/src/router/home_router_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:common_dependencies/common_dependencies.dart'; 2 | import 'package:core/core.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:home/src/ui/home_screen.dart'; 5 | 6 | class HomeRouterModule implements RouterModule { 7 | @override 8 | Map getRoutes(RouteSettings settings) => 9 | { 10 | HomeRoutes.root: MaterialPageRoute( 11 | builder: (_) => HomeScreen(), 12 | settings: settings, 13 | ), 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /features/login/lib/src/di/login_injection_module.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:common_dependencies/common_dependencies.dart'; 4 | import 'package:core/core.dart'; 5 | import 'package:login/src/router/app_login_navigator.dart'; 6 | 7 | class LoginInjectionModule implements InjectionModule { 8 | @override 9 | FutureOr registerDependencies({ 10 | required Injector injector, 11 | required BuildConfig buildConfig, 12 | }) async { 13 | injector 14 | // PRESENTATION 15 | .registerFactory(() => AppLoginNavigator()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /features/login/lib/src/router/login_router_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:common_dependencies/common_dependencies.dart'; 2 | import 'package:core/core.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:login/src/ui/login_screen.dart'; 5 | 6 | class LoginRouterModule implements RouterModule { 7 | @override 8 | Map getRoutes(RouteSettings settings) => 9 | { 10 | LoginRoutes.root: MaterialPageRoute( 11 | builder: (_) => LoginScreen(), 12 | settings: settings, 13 | ), 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/modules/router_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class RouteMissingArgsFailure implements Exception {} 4 | 5 | T getArgsOrThrow(Object? arguments) { 6 | if (arguments == null) { 7 | throw RouteMissingArgsFailure(); 8 | } 9 | 10 | return arguments as T; 11 | } 12 | 13 | T? tryToGetArgsOrIgnore(Object? arguments) { 14 | if (arguments != null) { 15 | return arguments as T; 16 | } 17 | 18 | return null; 19 | } 20 | 21 | abstract class RouterModule { 22 | Map getRoutes(RouteSettings settings); 23 | } 24 | -------------------------------------------------------------------------------- /features/splash/lib/src/router/splash_router_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:common_dependencies/common_dependencies.dart'; 2 | import 'package:core/core.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:splash/src/ui/splash_screen.dart'; 5 | 6 | class SplashRouterModule implements RouterModule { 7 | @override 8 | Map getRoutes(RouteSettings settings) => 9 | { 10 | SplashRoutes.root: MaterialPageRoute( 11 | builder: (_) => const SplashScreen(), 12 | settings: settings, 13 | ), 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /features/home/lib/src/home_resolver.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:home/src/di/home_injection_module.dart'; 4 | import 'package:home/src/localization/home_delegate.dart'; 5 | import 'package:home/src/router/home_router_module.dart'; 6 | 7 | class HomeResolver implements FeatureResolver { 8 | @override 9 | InjectionModule? get injectionModule => HomeInjectionModule(); 10 | 11 | @override 12 | LocalizationsDelegate? get localeDelegate => homeLocalizationDelegate; 13 | 14 | @override 15 | RouterModule? get routerModule => HomeRouterModule(); 16 | } 17 | -------------------------------------------------------------------------------- /features/home/lib/src/ui/home_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:home/src/localization/home_localization.dart'; 3 | 4 | class HomeScreen extends StatefulWidget { 5 | @override 6 | _HomeScreenState createState() => _HomeScreenState(); 7 | } 8 | 9 | class _HomeScreenState extends State { 10 | late HomeLocalization _intl; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | _intl = HomeLocalization.of(context); 15 | 16 | return Scaffold( 17 | body: Center( 18 | child: Text(_intl.tr('home_screen.title')), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /features/login/lib/src/login_resolver.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:login/src/di/login_injection_module.dart'; 4 | import 'package:login/src/localization/login_delegate.dart'; 5 | import 'package:login/src/router/login_router_module.dart'; 6 | 7 | class LoginResolver implements FeatureResolver { 8 | @override 9 | InjectionModule? get injectionModule => LoginInjectionModule(); 10 | 11 | @override 12 | LocalizationsDelegate? get localeDelegate => loginLocalizationDelegate; 13 | 14 | @override 15 | RouterModule? get routerModule => LoginRouterModule(); 16 | } 17 | -------------------------------------------------------------------------------- /features/home/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | -------------------------------------------------------------------------------- /features/login/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | -------------------------------------------------------------------------------- /infrastructure/core/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | -------------------------------------------------------------------------------- /features/splash/lib/src/ui/cubit/splash_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'package:faker/faker.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:splash/src/ui/cubit/splash_state.dart'; 4 | 5 | class SplashCubit extends Cubit { 6 | SplashCubit() : super(const SplashState()) { 7 | _validateCredentials(); 8 | } 9 | 10 | Future _validateCredentials() async { 11 | /// Call use case to check if there is a user session ... 12 | final hasCredentials = faker.randomGenerator.boolean(); 13 | 14 | await Future.delayed(const Duration(seconds: 2)); 15 | 16 | emit(state.copyWith(isUserAuthenticated: hasCredentials)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /infrastructure/navigator/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | -------------------------------------------------------------------------------- /infrastructure/common_dependencies/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | -------------------------------------------------------------------------------- /app/lib/di/app_component.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:core/core.dart'; 4 | 5 | /// This is just a wrapper class that iterate throught the injection modules 6 | /// and add each dependency into the injection container. 7 | class AppInjectionComponent { 8 | AppInjectionComponent._(); 9 | 10 | static AppInjectionComponent instance = AppInjectionComponent._(); 11 | 12 | Future registerModules({ 13 | required List modules, 14 | required BuildConfig config, 15 | }) async { 16 | for (final module in modules) { 17 | await module.registerDependencies( 18 | injector: AppInjector.I, 19 | buildConfig: config, 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /app/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /app/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: multi_package_sample 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.15.1 <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | home: 16 | path: ../features/home/ 17 | login: 18 | path: ../features/login/ 19 | splash: 20 | path: ../features/splash/ 21 | 22 | common_dependencies: 23 | path: ../infrastructure/common_dependencies/ 24 | core: 25 | path: ../infrastructure/core/ 26 | 27 | flutter_localizations: 28 | sdk: flutter 29 | 30 | dev_dependencies: 31 | flutter_test: 32 | sdk: flutter 33 | 34 | flutter_lints: ^1.0.0 35 | 36 | flutter: 37 | uses-material-design: true 38 | -------------------------------------------------------------------------------- /infrastructure/navigator/lib/src/app_navigator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | mixin AppNavigator { 4 | Future navigateTo( 5 | BuildContext context, 6 | String routeName, { 7 | A? arguments, 8 | bool pushAndReplace = false, 9 | String? anchor, 10 | }) async { 11 | if (pushAndReplace && anchor != null) { 12 | return Navigator.of(context).pushNamedAndRemoveUntil( 13 | routeName, 14 | (route) => route.settings.name == anchor, 15 | arguments: arguments, 16 | ); 17 | } 18 | 19 | // ignore: unnecessary_await_in_return 20 | return await Navigator.of(context).pushNamed( 21 | routeName, 22 | arguments: arguments, 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/injection/injector.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | typedef AsyncFunc = Future Function(); 4 | typedef DisposableFunc = FutureOr Function(T param); 5 | 6 | abstract class Injector { 7 | void registerLazySingleton(T Function() function); 8 | 9 | Future registerSingletonAsync( 10 | AsyncFunc factoryFunc, { 11 | String? instanceName, 12 | Iterable? dependsOn, 13 | bool? signalsReady, 14 | DisposableFunc? dispose, 15 | }); 16 | 17 | void registerSingleton(T instance); 18 | 19 | void registerFactory(T Function() function); 20 | 21 | T get(); 22 | 23 | void unregister(); 24 | } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | .atom/ 3 | .idea/ 4 | .melos_tool/* 5 | !.vscode/tasks.json 6 | !.vscode/settings.json 7 | 8 | # Local scripts 9 | checkout.sh 10 | codegen.sh 11 | generate_apk.sh 12 | 13 | .packages 14 | .pub/ 15 | .dart_tool/ 16 | # Pubspec.lock is only used in apps. Libraries do not need to commit it. 17 | pubspec.lock 18 | 19 | local.properties 20 | keystore.properties 21 | .gradle/ 22 | gradlew 23 | gradlew.bat 24 | gradle-wrapper.jar 25 | *.iml 26 | 27 | GeneratedPluginRegistrant.h 28 | GeneratedPluginRegistrant.m 29 | GeneratedPluginRegistrant.java 30 | GeneratedPluginRegistrant.swift 31 | generated_plugin_registrant.dart 32 | 33 | --release 34 | 35 | go_app_latam/android/keystore_prod.properties 36 | 37 | build/ 38 | .flutter-plugins 39 | .flutter-plugins-dependencies 40 | 41 | .project 42 | .classpath 43 | .settings 44 | .last_build_id 45 | -------------------------------------------------------------------------------- /app/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /app/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/build_config.dart: -------------------------------------------------------------------------------- 1 | abstract class BuildConfig { 2 | Map configs = {}; 3 | 4 | bool? getBool(String key) => 5 | _getValueWithKeyOrThrowInCaseOfDifferentType(key); 6 | 7 | double? getDouble(String key) => 8 | _getValueWithKeyOrThrowInCaseOfDifferentType(key); 9 | 10 | int? getInt(String key) => 11 | _getValueWithKeyOrThrowInCaseOfDifferentType(key); 12 | 13 | String? getString(String key) => 14 | _getValueWithKeyOrThrowInCaseOfDifferentType(key); 15 | 16 | T? getObject(String key) => 17 | _getValueWithKeyOrThrowInCaseOfDifferentType(key); 18 | 19 | T? _getValueWithKeyOrThrowInCaseOfDifferentType(String key) { 20 | if (configs.isNotEmpty && configs.containsKey(key)) { 21 | final value = configs[key]; 22 | if (value is T) { 23 | return value; 24 | } else { 25 | throw const FormatException( 26 | // ignore: lines_longer_than_80_chars 27 | 'The value you are trying to get is not the same type that this function returns!'); 28 | } 29 | } else { 30 | return null; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/lib/app/my_app.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class MyApp extends StatelessWidget { 5 | final List localeDelegates; 6 | final List routes; 7 | 8 | const MyApp({ 9 | required this.localeDelegates, 10 | required this.routes, 11 | Key? key, 12 | }) : super(key: key); 13 | 14 | @override 15 | Widget build(BuildContext context) => MaterialApp( 16 | onGenerateRoute: (settings) => generateRoute( 17 | settings: settings, 18 | routes: routes, 19 | ), 20 | localeResolutionCallback: localeResolutionCallback, 21 | supportedLocales: appSupportedLanguages, 22 | localizationsDelegates: localeDelegates, 23 | debugShowCheckedModeBanner: false, 24 | ); 25 | 26 | Route? generateRoute({ 27 | required List routes, 28 | required RouteSettings settings, 29 | }) { 30 | final routesMap = {}; 31 | for (final route in routes) { 32 | routesMap.addAll(route.getRoutes(settings)); 33 | } 34 | return routesMap[settings.name]; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:multi_package_sample/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/localization/resolution_callback.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | Locale localeResolutionCallback( 4 | Locale? locale, 5 | Iterable supportedLocales, 6 | ) { 7 | final fullMatch = 8 | getSupportedLocaleForLanguageAndCountryCode(supportedLocales, locale); 9 | if (fullMatch != null) { 10 | return fullMatch; 11 | } 12 | final partialMatch = 13 | getSupportedLocaleForLanguageCode(supportedLocales, locale); 14 | if (partialMatch != null) { 15 | return partialMatch; 16 | } 17 | 18 | return supportedLocales.first; 19 | } 20 | 21 | Locale? getSupportedLocaleForLanguageAndCountryCode( 22 | Iterable supportedLocales, 23 | Locale? locale, 24 | ) { 25 | for (final supportedLocale in supportedLocales) { 26 | if (supportedLocale.languageCode == locale?.languageCode && 27 | supportedLocale.countryCode == locale?.countryCode) { 28 | return supportedLocale; 29 | } 30 | } 31 | 32 | return null; 33 | } 34 | 35 | Locale? getSupportedLocaleForLanguageCode( 36 | Iterable supportedLocales, 37 | Locale? locale, 38 | ) { 39 | for (final supportedLocale in supportedLocales) { 40 | if (supportedLocale.languageCode == locale?.languageCode) { 41 | return supportedLocale; 42 | } 43 | } 44 | 45 | return null; 46 | } 47 | -------------------------------------------------------------------------------- /features/splash/lib/src/ui/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:common_dependencies/common_dependencies.dart'; 2 | import 'package:core/core.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:splash/src/ui/cubit/splash_cubit.dart'; 5 | import 'package:splash/src/ui/cubit/splash_state.dart'; 6 | 7 | class SplashScreen extends StatefulWidget { 8 | const SplashScreen({Key? key}) : super(key: key); 9 | 10 | @override 11 | _SplashScreenState createState() => _SplashScreenState(); 12 | } 13 | 14 | class _SplashScreenState extends State 15 | with SingleTickerProviderStateMixin { 16 | final LoginNavigator _loginNavigator = AppInjector.I.get(); 17 | final HomeNavigator _homeNavigator = AppInjector.I.get(); 18 | 19 | final SplashCubit _cubit = AppInjector.I.get(); 20 | 21 | @override 22 | Widget build(BuildContext context) => BlocConsumer( 23 | bloc: _cubit, 24 | listener: (_, state) { 25 | if (state.isUserAuthenticated) { 26 | _homeNavigator.navigateToRoot(context); 27 | } else { 28 | _loginNavigator.navigateToRoot(context); 29 | } 30 | }, 31 | builder: (_, state) => Scaffold( 32 | backgroundColor: Colors.white, 33 | body: Container( 34 | margin: const EdgeInsets.all(24), 35 | child: const Center( 36 | child: CircularProgressIndicator(), 37 | ), 38 | ), 39 | ), 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /features/login/lib/src/ui/login_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:common_dependencies/common_dependencies.dart'; 2 | import 'package:core/core.dart'; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:login/src/analytics/login_analytics_logger.dart'; 6 | import 'package:login/src/localization/login_localization.dart'; 7 | 8 | class LoginScreen extends StatefulWidget { 9 | @override 10 | _LoginScreenState createState() => _LoginScreenState(); 11 | } 12 | 13 | class _LoginScreenState extends State { 14 | final AnalyticsLogger _analyticsLogger = AppInjector.I.get(); 15 | final HomeNavigator _homeNavigator = AppInjector.I.get(); 16 | 17 | late LoginLocalization _intl; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | _intl = LoginLocalization.of(context); 22 | 23 | return Scaffold( 24 | body: Padding( 25 | padding: const EdgeInsets.all(16), 26 | child: Column(children: [ 27 | const Spacer(), 28 | Text(_intl.tr('login_screen.title')), 29 | const Spacer(), 30 | SizedBox( 31 | width: double.infinity, 32 | child: ElevatedButton( 33 | onPressed: () { 34 | _analyticsLogger.logEvent(LoginEvents.loginButtonClick); 35 | _homeNavigator.navigateToRoot(context); 36 | }, 37 | child: Text(_intl.tr('login_screen.action')), 38 | ), 39 | ), 40 | const SizedBox(height: 16), 41 | ]), 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /features/home/lib/src/localization/home_localization.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | class HomeLocalization extends BaseLocalization { 5 | HomeLocalization({ 6 | required this.appLocale, 7 | required this.appPathFunction, 8 | }) : super(appPathFunction: appPathFunction, locale: appLocale); 9 | @override 10 | // ignore: overridden_fields 11 | final String Function(Locale locale) appPathFunction; 12 | final Locale appLocale; 13 | 14 | static HomeLocalization of(BuildContext context) => 15 | Localizations.of(context, HomeLocalization)!; 16 | } 17 | 18 | class HomeLocalizationDelegate extends LocalizationsDelegate { 19 | HomeLocalizationDelegate({ 20 | required this.supportedLocales, 21 | required this.getPathFunction, 22 | this.debugLogs = true, 23 | }); 24 | 25 | final List supportedLocales; 26 | 27 | final String Function(Locale locale) getPathFunction; 28 | 29 | late Locale locale; 30 | 31 | final bool debugLogs; 32 | 33 | @override 34 | bool isSupported(Locale locale) => 35 | getSupportedLocaleForLanguageCode(supportedLocales, locale) != null; 36 | 37 | @override 38 | Future load(Locale locale) async { 39 | this.locale = locale; 40 | final localization = HomeLocalization( 41 | appLocale: locale, 42 | appPathFunction: getPathFunction, 43 | ); 44 | 45 | await localization.load(); 46 | 47 | return localization; 48 | } 49 | 50 | @override 51 | bool shouldReload(HomeLocalizationDelegate old) => old.locale != locale; 52 | } 53 | -------------------------------------------------------------------------------- /features/login/lib/src/localization/login_localization.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | class LoginLocalization extends BaseLocalization { 5 | LoginLocalization({ 6 | required this.appLocale, 7 | required this.appPathFunction, 8 | }) : super(appPathFunction: appPathFunction, locale: appLocale); 9 | @override 10 | // ignore: overridden_fields 11 | final String Function(Locale locale) appPathFunction; 12 | final Locale appLocale; 13 | 14 | static LoginLocalization of(BuildContext context) => 15 | Localizations.of(context, LoginLocalization)!; 16 | } 17 | 18 | class LoginLocalizationDelegate 19 | extends LocalizationsDelegate { 20 | LoginLocalizationDelegate({ 21 | required this.supportedLocales, 22 | required this.getPathFunction, 23 | this.debugLogs = true, 24 | }); 25 | 26 | final List supportedLocales; 27 | 28 | final String Function(Locale locale) getPathFunction; 29 | 30 | late Locale locale; 31 | 32 | final bool debugLogs; 33 | 34 | @override 35 | bool isSupported(Locale locale) => 36 | getSupportedLocaleForLanguageCode(supportedLocales, locale) != null; 37 | 38 | @override 39 | Future load(Locale locale) async { 40 | this.locale = locale; 41 | final localization = LoginLocalization( 42 | appLocale: locale, 43 | appPathFunction: getPathFunction, 44 | ); 45 | 46 | await localization.load(); 47 | 48 | return localization; 49 | } 50 | 51 | @override 52 | bool shouldReload(LoginLocalizationDelegate old) => old.locale != locale; 53 | } 54 | -------------------------------------------------------------------------------- /app/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /infrastructure/navigator/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: navigator 2 | description: A new Flutter package project. 3 | version: 0.0.1 4 | homepage: 5 | 6 | environment: 7 | sdk: ">=2.15.1 <3.0.0" 8 | flutter: ">=1.17.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | flutter_lints: ^1.0.0 18 | 19 | # For information on the generic Dart part of this file, see the 20 | # following page: https://dart.dev/tools/pub/pubspec 21 | 22 | # The following section is specific to Flutter. 23 | flutter: 24 | 25 | # To add assets to your package, add an assets section, like this: 26 | # assets: 27 | # - images/a_dot_burr.jpeg 28 | # - images/a_dot_ham.jpeg 29 | # 30 | # For details regarding assets in packages, see 31 | # https://flutter.dev/assets-and-images/#from-packages 32 | # 33 | # An image asset can refer to one or more resolution-specific "variants", see 34 | # https://flutter.dev/assets-and-images/#resolution-aware. 35 | 36 | # To add custom fonts to your package, add a fonts section here, 37 | # in this "flutter" section. Each entry in this list should have a 38 | # "family" key with the font family name, and a "fonts" key with a 39 | # list giving the asset and other descriptors for the font. For 40 | # example: 41 | # fonts: 42 | # - family: Schyler 43 | # fonts: 44 | # - asset: fonts/Schyler-Regular.ttf 45 | # - asset: fonts/Schyler-Italic.ttf 46 | # style: italic 47 | # - family: Trajan Pro 48 | # fonts: 49 | # - asset: fonts/TrajanPro.ttf 50 | # - asset: fonts/TrajanPro_Bold.ttf 51 | # weight: 700 52 | # 53 | # For details regarding fonts in packages, see 54 | # https://flutter.dev/custom-fonts/#from-packages 55 | -------------------------------------------------------------------------------- /app/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Multi Package Sample 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | multi_package_sample 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /features/splash/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/ephemeral 64 | **/ios/Flutter/app.flx 65 | **/ios/Flutter/app.zip 66 | **/ios/Flutter/flutter_assets/ 67 | **/ios/Flutter/flutter_export_environment.sh 68 | **/ios/ServiceDefinitions.json 69 | **/ios/Runner/GeneratedPluginRegistrant.* 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/injection/app_injector.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/src/injection/injector.dart'; 2 | import 'package:get_it/get_it.dart'; 3 | 4 | class AppInjector implements Injector { 5 | final GetIt _getIt = GetIt.instance; 6 | 7 | AppInjector._(); 8 | 9 | static Injector? _internal; 10 | 11 | static Injector get I => _instance; 12 | 13 | static Injector get _instance { 14 | _internal ??= AppInjector._(); 15 | return _internal!; 16 | } 17 | 18 | @override 19 | void registerLazySingleton(T Function() function) { 20 | if (!_getIt.isRegistered()) { 21 | _getIt.registerLazySingleton( 22 | () => function.call(), 23 | ); 24 | } 25 | } 26 | 27 | @override 28 | void registerSingleton(T instance) { 29 | if (!_getIt.isRegistered()) { 30 | _getIt.registerSingleton(instance); 31 | } 32 | } 33 | 34 | @override 35 | T get() => _getIt.get(); 36 | 37 | @override 38 | void unregister() => _getIt.unregister(); 39 | 40 | @override 41 | void registerFactory(T Function() function) { 42 | if (!_getIt.isRegistered()) { 43 | _getIt.registerFactory(() => function.call()); 44 | } 45 | } 46 | 47 | @override 48 | Future registerSingletonAsync( 49 | AsyncFunc factoryFunc, { 50 | String? instanceName, 51 | Iterable? dependsOn, 52 | bool? signalsReady, 53 | DisposableFunc? dispose, 54 | }) async { 55 | if (!_getIt.isRegistered()) { 56 | _getIt.registerSingletonAsync( 57 | factoryFunc, 58 | instanceName: instanceName, 59 | dependsOn: dependsOn, 60 | signalsReady: signalsReady, 61 | dispose: dispose, 62 | ); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /melos.yaml: -------------------------------------------------------------------------------- 1 | name: multi_package_sample 2 | 3 | versioning: 4 | mode: independent 5 | 6 | packages: 7 | - app/* 8 | - infrastructure/** 9 | - features/** 10 | 11 | scripts: 12 | lint:all: 13 | run: melos run analyze && melos run format 14 | description: Run all static analysis checks 15 | 16 | format: 17 | run: melos exec -c 6 --fail-fast -- flutter format . 18 | analyze: 19 | run: melos exec -c 3 flutter analyze 20 | description: Run analyze for Flutter packages in this project 21 | 22 | test: 23 | run: melos run test:selective --no-select 24 | description: Run all Flutter tests in this project. 25 | test:selective: 26 | run: | 27 | melos exec -c 6 --fail-fast -- \ 28 | "flutter test --no-pub --reporter compact --no-test-assets" 29 | description: Run `flutter test` for a specific package. 30 | select-package: 31 | dir-exists: 32 | - test 33 | ignore: 34 | - "*example*" 35 | 36 | install: 37 | run: melos exec -c 6 flutter pub get 38 | description: Install all dependencies 39 | clean: 40 | run: melos exec -c 6 -- flutter clean && melos run install 41 | description: Clean Flutter packages in this project and run bootstrap 42 | 43 | format:check: 44 | run: melos exec -c 6 --fail-fast -- flutter format --set-exit-if-changed --dry-run . 45 | codegen: 46 | run: melos exec -c 1 --depends-on="build_runner" -- flutter pub run build_runner build --delete-conflicting-outputs 47 | description: Run code generation using build_runner 48 | codegen:selective: 49 | run: melos exec -c 1 --depends-on="build_runner" -- flutter pub run build_runner build --delete-conflicting-outputs 50 | description: Run code generation using build_runner in a specific package 51 | select-package: 52 | depends-on: "build_runner" 53 | 54 | environment: 55 | sdk: ">=2.12.0-0 <3.0.0" 56 | flutter: ">=2.0.0" 57 | -------------------------------------------------------------------------------- /app/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.example.multi_package_sample" 47 | minSdkVersion flutter.minSdkVersion 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /app/lib/environments/app_start.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:core/core.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/widgets.dart'; 6 | import 'package:flutter_localizations/flutter_localizations.dart'; 7 | import 'package:home/home.dart'; 8 | import 'package:login/login.dart'; 9 | import 'package:multi_package_sample/app/my_app.dart'; 10 | import 'package:multi_package_sample/di/app_component.dart'; 11 | import 'package:multi_package_sample/resolvers/app_resolver.dart'; 12 | import 'package:multi_package_sample/resolvers/library_resolver.dart'; 13 | import 'package:splash/go_splash.dart'; 14 | 15 | abstract class AppStart { 16 | final BuildConfig buildConfig; 17 | 18 | /// The order of initialization matters, make sure that the deps of you 19 | /// package were initialized before him, otherwhise you will end up with 20 | /// a exception from gitIt container. 21 | final resolvers = [ 22 | LibraryResolver(), 23 | 24 | // Features 25 | SplashResolver(), 26 | HomeResolver(), 27 | LoginResolver(), 28 | 29 | // App 30 | AppResolver(), 31 | ]; 32 | 33 | AppStart(this.buildConfig); 34 | 35 | Future startApp() async { 36 | WidgetsFlutterBinding.ensureInitialized(); 37 | 38 | final routerModules = []; 39 | 40 | final delegates = [ 41 | GlobalMaterialLocalizations.delegate, 42 | GlobalWidgetsLocalizations.delegate, 43 | GlobalCupertinoLocalizations.delegate, 44 | ]; 45 | final injections = []; 46 | 47 | for (final resolver in resolvers) { 48 | if (resolver.routerModule != null) { 49 | routerModules.add(resolver.routerModule!); 50 | } 51 | 52 | if (resolver.localeDelegate != null) { 53 | delegates.add(resolver.localeDelegate!); 54 | } 55 | 56 | if (resolver.injectionModule != null) { 57 | injections.add(resolver.injectionModule!); 58 | } 59 | } 60 | 61 | await AppInjectionComponent.instance.registerModules( 62 | config: buildConfig, 63 | modules: injections, 64 | ); 65 | 66 | await runZonedGuarded>( 67 | () async { 68 | runApp( 69 | MyApp( 70 | routes: routerModules, 71 | localeDelegates: delegates, 72 | ), 73 | ); 74 | }, 75 | (_, __) {}, 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /app/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /infrastructure/core/lib/src/localization/localization.dart: -------------------------------------------------------------------------------- 1 | import 'dart:collection'; 2 | import 'dart:convert'; 3 | 4 | import 'package:flat/flat.dart'; 5 | import 'package:flutter/services.dart' show rootBundle; 6 | import 'package:flutter/widgets.dart'; 7 | import 'package:intl/intl.dart'; 8 | 9 | /// Base class to create a Locale Delegate 10 | class BaseLocalization { 11 | final Locale locale; 12 | 13 | final String Function(Locale locale) appPathFunction; 14 | 15 | final Map _strings = HashMap(); 16 | 17 | final bool debugLogs; 18 | 19 | BaseLocalization({ 20 | required this.locale, 21 | required this.appPathFunction, 22 | this.debugLogs = false, 23 | }); 24 | 25 | static BaseLocalization of(BuildContext context) => 26 | Localizations.of(context, BaseLocalization)!; 27 | 28 | /// Initialize the locale-specific strings. 29 | /// It searchs for a string file in the 30 | /// provided appPathFunction and set them into the Intl.defaultLocale. 31 | Future load() async { 32 | try { 33 | _print('Loading locale: $locale'); 34 | final data = await rootBundle.loadString(appPathFunction(locale)); 35 | final Map strings = json.decode(data); 36 | final flattenedStrings = flatten(strings); 37 | _strings.addAll(flattenedStrings); 38 | _print('Loaded ${_strings.keys.length} keys'); 39 | 40 | final localeName = locale.countryCode?.isEmpty == null 41 | ? locale.languageCode 42 | : locale.toString(); 43 | final canonicalLocaleName = Intl.canonicalizedLocale(localeName); 44 | Intl.defaultLocale = canonicalLocaleName; 45 | } catch (exception, stacktrace) { 46 | // ignore: avoid_print 47 | print(exception); 48 | // ignore: avoid_print 49 | print(stacktrace); 50 | } 51 | } 52 | 53 | /// Translate a given key to the current locale. 54 | /// You may also use the values and pluralCount 55 | /// to add more parameters to the translation. 56 | String tr( 57 | String key, { 58 | Map? values, 59 | num? pluralCount, 60 | }) { 61 | String? message; 62 | if (pluralCount != null) { 63 | message = _loadPluralizedMessage(key, pluralCount); 64 | } else { 65 | message = _loadMessage(key); 66 | } 67 | 68 | if (message == null) { 69 | // ignore: avoid_print 70 | print('WARN [LOCALIZATION]: Could not find valid localization ' 71 | 'string for key $key, $locale'); 72 | return key; 73 | } 74 | 75 | if (values != null) { 76 | return _formatReturnMessage(message, values); 77 | } 78 | 79 | return message; 80 | } 81 | 82 | String? _loadMessage(String key) { 83 | final value = _strings[key]; 84 | 85 | if (value == null || (value is! String)) { 86 | return null; 87 | } 88 | 89 | return value; 90 | } 91 | 92 | String _loadPluralizedMessage(String key, num howMany) { 93 | final other = _loadMessage('$key.other'); 94 | if (other == null) { 95 | throw Exception( 96 | '[LOCALIZATION]: When using [pluralCount], `$key.other` is required'); 97 | } 98 | return Intl.plural( 99 | howMany, 100 | zero: _loadMessage('$key.zero'), 101 | one: _loadMessage('$key.one'), 102 | two: _loadMessage('$key.two'), 103 | few: _loadMessage('$key.few'), 104 | many: _loadMessage('$key.many'), 105 | other: other, 106 | locale: locale.toLanguageTag(), 107 | ); 108 | } 109 | 110 | String _formatReturnMessage(String value, Map arguments) { 111 | arguments.forEach( 112 | (formatKey, formatValue) => 113 | // ignore: parameter_assignments 114 | value = value.replaceAll('{$formatKey}', formatValue), 115 | ); 116 | return value; 117 | } 118 | 119 | void _print(Object obj) { 120 | if (debugLogs) { 121 | // ignore: avoid_print 122 | print(obj); 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /all_lint_rules.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | exclude: 3 | - lib/**/*.g.dart 4 | - lib/**/*.freezed.dart 5 | - graphql/** 6 | - test/* 7 | errors: 8 | missing_required_param: error 9 | 10 | linter: 11 | rules: 12 | - always_declare_return_types 13 | - always_put_control_body_on_new_line 14 | - always_put_required_named_parameters_first 15 | - always_require_non_null_named_parameters 16 | - always_use_package_imports 17 | - annotate_overrides 18 | - avoid_bool_literals_in_conditional_expressions 19 | - avoid_catching_errors 20 | - avoid_double_and_int_checks 21 | - avoid_dynamic_calls 22 | - avoid_empty_else 23 | - avoid_equals_and_hash_code_on_mutable_classes 24 | - avoid_escaping_inner_quotes 25 | - avoid_field_initializers_in_const_classes 26 | - avoid_function_literals_in_foreach_calls 27 | - avoid_implementing_value_types 28 | - avoid_init_to_null 29 | - avoid_js_rounded_ints 30 | - avoid_null_checks_in_equality_operators 31 | - avoid_positional_boolean_parameters 32 | - avoid_print 33 | - avoid_private_typedef_functions 34 | - avoid_relative_lib_imports 35 | - avoid_renaming_method_parameters 36 | - avoid_return_types_on_setters 37 | - avoid_returning_null 38 | - avoid_returning_null_for_future 39 | - avoid_returning_null_for_void 40 | - avoid_returning_this 41 | - avoid_setters_without_getters 42 | - avoid_shadowing_type_parameters 43 | - avoid_single_cascade_in_expression_statements 44 | - avoid_slow_async_io 45 | - avoid_type_to_string 46 | - avoid_types_as_parameter_names 47 | - avoid_types_on_closure_parameters 48 | - avoid_unnecessary_containers 49 | - avoid_unused_constructor_parameters 50 | - avoid_void_async 51 | - avoid_web_libraries_in_flutter 52 | - await_only_futures 53 | - camel_case_extensions 54 | - camel_case_types 55 | - cancel_subscriptions 56 | - cascade_invocations 57 | - cast_nullable_to_non_nullable 58 | - close_sinks 59 | - comment_references 60 | - control_flow_in_finally 61 | - curly_braces_in_flow_control_structures 62 | - directives_ordering 63 | - do_not_use_environment 64 | - empty_constructor_bodies 65 | - empty_statements 66 | - exhaustive_cases 67 | - file_names 68 | - flutter_style_todos 69 | - hash_and_equals 70 | - implementation_imports 71 | - invariant_booleans 72 | - iterable_contains_unrelated_type 73 | - join_return_with_assignment 74 | - leading_newlines_in_multiline_strings 75 | - library_names 76 | - library_prefixes 77 | - lines_longer_than_80_chars 78 | - list_remove_unrelated_type 79 | - literal_only_boolean_expressions 80 | - missing_whitespace_between_adjacent_strings 81 | - no_adjacent_strings_in_list 82 | - no_default_cases 83 | - no_duplicate_case_values 84 | - no_logic_in_create_state 85 | - no_runtimeType_toString 86 | - non_constant_identifier_names 87 | - null_check_on_nullable_type_parameter 88 | - null_closures 89 | - only_throw_errors 90 | - overridden_fields 91 | - package_api_docs 92 | - package_names 93 | - package_prefixed_library_names 94 | - parameter_assignments 95 | - prefer_adjacent_string_concatenation 96 | - prefer_asserts_in_initializer_lists 97 | - prefer_asserts_with_message 98 | - prefer_collection_literals 99 | - prefer_conditional_assignment 100 | - prefer_const_constructors 101 | - prefer_const_constructors_in_immutables 102 | - prefer_const_declarations 103 | - prefer_const_literals_to_create_immutables 104 | - prefer_constructors_over_static_methods 105 | - prefer_contains 106 | - prefer_equal_for_default_values 107 | - prefer_expression_function_bodies 108 | - prefer_final_fields 109 | - prefer_final_in_for_each 110 | - prefer_final_locals 111 | - prefer_for_elements_to_map_fromIterable 112 | - prefer_foreach 113 | - prefer_function_declarations_over_variables 114 | - prefer_generic_function_type_aliases 115 | - prefer_if_elements_to_conditional_expressions 116 | - prefer_if_null_operators 117 | - prefer_initializing_formals 118 | - prefer_inlined_adds 119 | - prefer_int_literals 120 | - prefer_interpolation_to_compose_strings 121 | - prefer_is_empty 122 | - prefer_is_not_empty 123 | - prefer_is_not_operator 124 | - prefer_iterable_whereType 125 | - prefer_mixin 126 | - prefer_null_aware_operators 127 | - prefer_single_quotes 128 | - prefer_spread_collections 129 | - prefer_typing_uninitialized_variables 130 | - prefer_void_to_null 131 | - provide_deprecation_message 132 | - recursive_getters 133 | - sized_box_for_whitespace 134 | - slash_for_doc_comments 135 | - sort_child_properties_last 136 | - sort_unnamed_constructors_first 137 | - test_types_in_equals 138 | - throw_in_finally 139 | - tighten_type_of_initializing_formals 140 | - type_annotate_public_apis 141 | - type_init_formals 142 | - unawaited_futures 143 | - unnecessary_await_in_return 144 | - unnecessary_brace_in_string_interps 145 | - unnecessary_const 146 | - unnecessary_getters_setters 147 | - unnecessary_lambdas 148 | - unnecessary_new 149 | - unnecessary_null_aware_assignments 150 | - unnecessary_null_checks 151 | - unnecessary_null_in_if_null_operators 152 | - unnecessary_nullable_for_final_variable_declarations 153 | - unnecessary_overrides 154 | - unnecessary_parenthesis 155 | - unnecessary_raw_strings 156 | - unnecessary_statements 157 | - unnecessary_string_escapes 158 | - unnecessary_string_interpolations 159 | - unnecessary_this 160 | - unrelated_type_equality_checks 161 | - unsafe_html 162 | - use_full_hex_values_for_flutter_colors 163 | - use_function_type_syntax_for_parameters 164 | - use_is_even_rather_than_modulo 165 | - use_late_for_private_fields_and_variables 166 | - use_raw_strings 167 | - use_rethrow_when_possible 168 | - use_setters_to_change_properties 169 | - use_string_buffers 170 | - use_to_and_as_if_applicable 171 | - valid_regexps 172 | - void_checks 173 | -------------------------------------------------------------------------------- /app/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1300; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | DEVELOPMENT_TEAM = NCY84V6D85; 292 | ENABLE_BITCODE = NO; 293 | INFOPLIST_FILE = Runner/Info.plist; 294 | LD_RUNPATH_SEARCH_PATHS = ( 295 | "$(inherited)", 296 | "@executable_path/Frameworks", 297 | ); 298 | PRODUCT_BUNDLE_IDENTIFIER = com.example.multiPackageSample; 299 | PRODUCT_NAME = "$(TARGET_NAME)"; 300 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 301 | SWIFT_VERSION = 5.0; 302 | VERSIONING_SYSTEM = "apple-generic"; 303 | }; 304 | name = Profile; 305 | }; 306 | 97C147031CF9000F007C117D /* Debug */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ALWAYS_SEARCH_USER_PATHS = NO; 310 | CLANG_ANALYZER_NONNULL = YES; 311 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 312 | CLANG_CXX_LIBRARY = "libc++"; 313 | CLANG_ENABLE_MODULES = YES; 314 | CLANG_ENABLE_OBJC_ARC = YES; 315 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 316 | CLANG_WARN_BOOL_CONVERSION = YES; 317 | CLANG_WARN_COMMA = YES; 318 | CLANG_WARN_CONSTANT_CONVERSION = YES; 319 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INFINITE_RECURSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 326 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 327 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 328 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 329 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 330 | CLANG_WARN_STRICT_PROTOTYPES = YES; 331 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 332 | CLANG_WARN_UNREACHABLE_CODE = YES; 333 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 334 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 335 | COPY_PHASE_STRIP = NO; 336 | DEBUG_INFORMATION_FORMAT = dwarf; 337 | ENABLE_STRICT_OBJC_MSGSEND = YES; 338 | ENABLE_TESTABILITY = YES; 339 | GCC_C_LANGUAGE_STANDARD = gnu99; 340 | GCC_DYNAMIC_NO_PIC = NO; 341 | GCC_NO_COMMON_BLOCKS = YES; 342 | GCC_OPTIMIZATION_LEVEL = 0; 343 | GCC_PREPROCESSOR_DEFINITIONS = ( 344 | "DEBUG=1", 345 | "$(inherited)", 346 | ); 347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 349 | GCC_WARN_UNDECLARED_SELECTOR = YES; 350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 351 | GCC_WARN_UNUSED_FUNCTION = YES; 352 | GCC_WARN_UNUSED_VARIABLE = YES; 353 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 354 | MTL_ENABLE_DEBUG_INFO = YES; 355 | ONLY_ACTIVE_ARCH = YES; 356 | SDKROOT = iphoneos; 357 | TARGETED_DEVICE_FAMILY = "1,2"; 358 | }; 359 | name = Debug; 360 | }; 361 | 97C147041CF9000F007C117D /* Release */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | ALWAYS_SEARCH_USER_PATHS = NO; 365 | CLANG_ANALYZER_NONNULL = YES; 366 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 367 | CLANG_CXX_LIBRARY = "libc++"; 368 | CLANG_ENABLE_MODULES = YES; 369 | CLANG_ENABLE_OBJC_ARC = YES; 370 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 371 | CLANG_WARN_BOOL_CONVERSION = YES; 372 | CLANG_WARN_COMMA = YES; 373 | CLANG_WARN_CONSTANT_CONVERSION = YES; 374 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 375 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 376 | CLANG_WARN_EMPTY_BODY = YES; 377 | CLANG_WARN_ENUM_CONVERSION = YES; 378 | CLANG_WARN_INFINITE_RECURSION = YES; 379 | CLANG_WARN_INT_CONVERSION = YES; 380 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 381 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 382 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 383 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 384 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 385 | CLANG_WARN_STRICT_PROTOTYPES = YES; 386 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 387 | CLANG_WARN_UNREACHABLE_CODE = YES; 388 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 389 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 390 | COPY_PHASE_STRIP = NO; 391 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 392 | ENABLE_NS_ASSERTIONS = NO; 393 | ENABLE_STRICT_OBJC_MSGSEND = YES; 394 | GCC_C_LANGUAGE_STANDARD = gnu99; 395 | GCC_NO_COMMON_BLOCKS = YES; 396 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 397 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 398 | GCC_WARN_UNDECLARED_SELECTOR = YES; 399 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 400 | GCC_WARN_UNUSED_FUNCTION = YES; 401 | GCC_WARN_UNUSED_VARIABLE = YES; 402 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 403 | MTL_ENABLE_DEBUG_INFO = NO; 404 | SDKROOT = iphoneos; 405 | SUPPORTED_PLATFORMS = iphoneos; 406 | SWIFT_COMPILATION_MODE = wholemodule; 407 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 408 | TARGETED_DEVICE_FAMILY = "1,2"; 409 | VALIDATE_PRODUCT = YES; 410 | }; 411 | name = Release; 412 | }; 413 | 97C147061CF9000F007C117D /* Debug */ = { 414 | isa = XCBuildConfiguration; 415 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 416 | buildSettings = { 417 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 418 | CLANG_ENABLE_MODULES = YES; 419 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 420 | DEVELOPMENT_TEAM = NCY84V6D85; 421 | ENABLE_BITCODE = NO; 422 | INFOPLIST_FILE = Runner/Info.plist; 423 | LD_RUNPATH_SEARCH_PATHS = ( 424 | "$(inherited)", 425 | "@executable_path/Frameworks", 426 | ); 427 | PRODUCT_BUNDLE_IDENTIFIER = com.example.multiPackageSample; 428 | PRODUCT_NAME = "$(TARGET_NAME)"; 429 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 430 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 431 | SWIFT_VERSION = 5.0; 432 | VERSIONING_SYSTEM = "apple-generic"; 433 | }; 434 | name = Debug; 435 | }; 436 | 97C147071CF9000F007C117D /* Release */ = { 437 | isa = XCBuildConfiguration; 438 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 439 | buildSettings = { 440 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 441 | CLANG_ENABLE_MODULES = YES; 442 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 443 | DEVELOPMENT_TEAM = NCY84V6D85; 444 | ENABLE_BITCODE = NO; 445 | INFOPLIST_FILE = Runner/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "@executable_path/Frameworks", 449 | ); 450 | PRODUCT_BUNDLE_IDENTIFIER = com.example.multiPackageSample; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 453 | SWIFT_VERSION = 5.0; 454 | VERSIONING_SYSTEM = "apple-generic"; 455 | }; 456 | name = Release; 457 | }; 458 | /* End XCBuildConfiguration section */ 459 | 460 | /* Begin XCConfigurationList section */ 461 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 462 | isa = XCConfigurationList; 463 | buildConfigurations = ( 464 | 97C147031CF9000F007C117D /* Debug */, 465 | 97C147041CF9000F007C117D /* Release */, 466 | 249021D3217E4FDB00AE95B9 /* Profile */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | defaultConfigurationName = Release; 470 | }; 471 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | 97C147061CF9000F007C117D /* Debug */, 475 | 97C147071CF9000F007C117D /* Release */, 476 | 249021D4217E4FDB00AE95B9 /* Profile */, 477 | ); 478 | defaultConfigurationIsVisible = 0; 479 | defaultConfigurationName = Release; 480 | }; 481 | /* End XCConfigurationList section */ 482 | }; 483 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 484 | } 485 | --------------------------------------------------------------------------------