├── .gitignore ├── .gradle ├── 6.1.1 │ ├── executionHistory │ │ └── executionHistory.lock │ ├── fileChanges │ │ └── last-build.bin │ ├── fileHashes │ │ └── fileHashes.lock │ └── gc.properties ├── buildOutputCleanup │ ├── buildOutputCleanup.lock │ └── cache.properties ├── checksums │ └── checksums.lock └── vcs-1 │ └── gc.properties ├── .metadata ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── geekysingh │ │ │ │ └── flutter_clean_architecture │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── 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 │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── core ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── lib │ ├── common │ │ └── status.dart │ ├── core.dart │ ├── core │ │ ├── core_screen.dart │ │ └── core_view_model.dart │ ├── service │ │ ├── dialog_service.dart │ │ ├── navigation_service.dart │ │ ├── snackbar_service.dart │ │ └── toast_service.dart │ └── src │ │ └── di │ │ ├── locator.config.dart │ │ └── locator.dart ├── pubspec.lock └── pubspec.yaml ├── data ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── lib │ ├── data.dart │ └── src │ │ ├── common │ │ └── constants.dart │ │ ├── datasource │ │ ├── local │ │ │ ├── dao │ │ │ │ └── article_dao.dart │ │ │ ├── db │ │ │ │ ├── app_database.dart │ │ │ │ └── app_database.g.dart │ │ │ └── entity │ │ │ │ └── article_entity.dart │ │ └── remote │ │ │ ├── dto │ │ │ ├── article_response.dart │ │ │ └── article_response.g.dart │ │ │ └── service │ │ │ ├── article_service.dart │ │ │ └── article_service.g.dart │ │ ├── di │ │ ├── locator.config.dart │ │ └── locator.dart │ │ ├── mapper │ │ └── article_mapper.dart │ │ └── repository │ │ ├── article_repository.dart │ │ └── base │ │ └── base_repository.dart ├── pubspec.lock └── pubspec.yaml ├── domain ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── lib │ ├── domain.dart │ └── src │ │ ├── common │ │ ├── error_type.dart │ │ └── result.dart │ │ ├── di │ │ ├── locator.config.dart │ │ └── locator.dart │ │ ├── model │ │ └── article_model.dart │ │ ├── repository │ │ └── article_repository.dart │ │ └── usecase │ │ ├── article_use_case.dart │ │ ├── article_use_case_impl.dart │ │ └── base │ │ └── base_use_case.dart ├── pubspec.lock └── pubspec.yaml ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── 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-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib └── main.dart ├── local.properties ├── presentation ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── assets │ └── placeholder_image.jpeg ├── lib │ ├── presentation.dart │ └── src │ │ ├── common │ │ ├── constants │ │ │ ├── app_strings.dart │ │ │ └── assets.dart │ │ └── routes │ │ │ ├── router.dart │ │ │ └── router.gr.dart │ │ ├── di │ │ ├── locator.config.dart │ │ └── locator.dart │ │ └── features │ │ ├── articles │ │ ├── details │ │ │ ├── article_detail_screen.dart │ │ │ └── article_detail_view_model.dart │ │ └── list │ │ │ ├── article_list_screen.dart │ │ │ └── article_list_view_model.dart │ │ └── login │ │ ├── login_screen.dart │ │ └── login_view_model.dart ├── pubspec.lock └── pubspec.yaml ├── pubspec.lock └── pubspec.yaml /.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 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | -------------------------------------------------------------------------------- /.gradle/6.1.1/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/.gradle/6.1.1/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /.gradle/6.1.1/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/6.1.1/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/.gradle/6.1.1/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/6.1.1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/.gradle/6.1.1/gc.properties -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Tue Apr 06 18:26:45 IST 2021 2 | gradle.version=6.1.1 3 | -------------------------------------------------------------------------------- /.gradle/checksums/checksums.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/.gradle/checksums/checksums.lock -------------------------------------------------------------------------------- /.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /.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: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter Clean Architecture 2 | 3 | Guide to design Flutter application using Clean Architecture. Here is the detailed guide on Medium https://geekysingh.medium.com/clean-architecture-for-enterprise-flutter-application-dc254a71059 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 29 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.geekysingh.flutter_clean_architecture" 42 | minSdkVersion 16 43 | targetSdkVersion 29 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/geekysingh/flutter_clean_architecture/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.geekysingh.flutter_clean_architecture 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 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 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.enableR8=true 5 | -------------------------------------------------------------------------------- /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-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | **/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/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | -------------------------------------------------------------------------------- /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: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /core/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - TODO: Add release date. 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /core/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /core/README.md: -------------------------------------------------------------------------------- 1 | # core 2 | 3 | A new Flutter package. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Dart 8 | [package](https://flutter.dev/developing-packages/), 9 | a library module containing code that can be shared easily across 10 | multiple Flutter or Dart projects. 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | -------------------------------------------------------------------------------- /core/lib/common/status.dart: -------------------------------------------------------------------------------- 1 | enum Status {LOADING, SUCCESS, ERROR} -------------------------------------------------------------------------------- /core/lib/core.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:core/src/di/locator.dart'; 3 | 4 | class Core { 5 | static void init() { 6 | /// setup required locators for core module 7 | setupLocator(); 8 | } 9 | 10 | static RootStackRouter routeBuilder(RootStackRouter router) { 11 | locator.registerLazySingleton(() => router); 12 | return router; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/lib/core/core_screen.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:stacked/stacked.dart'; 3 | 4 | import 'core_view_model.dart'; 5 | 6 | abstract class CoreScreen extends ViewModelBuilderWidget { 7 | 8 | } -------------------------------------------------------------------------------- /core/lib/core/core_view_model.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:core/common/status.dart'; 4 | import 'package:core/service/navigation_service.dart'; 5 | import 'package:core/src/di/locator.dart'; 6 | import 'package:stacked/stacked.dart'; 7 | 8 | abstract class CoreViewModel extends BaseViewModel { 9 | 10 | final NavigationService navigationService = locator(); 11 | 12 | late Status _status; 13 | Status get status => _status; 14 | 15 | void loading() { 16 | _status = Status.LOADING; 17 | setBusy(true); 18 | } 19 | 20 | void loaded(bool success) { 21 | _status = success ? Status.SUCCESS : Status.ERROR; 22 | setBusy(false); 23 | setError(success ? null : true); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /core/lib/service/dialog_service.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:adaptive_dialog/adaptive_dialog.dart'; 3 | import 'package:auto_route/auto_route.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | import 'package:injectable/injectable.dart'; 6 | 7 | @lazySingleton 8 | class DialogService { 9 | 10 | final StackRouter _router; 11 | DialogService(this._router); 12 | 13 | BuildContext _getSafeContext() { 14 | final context = _router.navigatorKey.currentContext; 15 | return context != null ? context : throw ('Have you forgot to setup routes?'); 16 | } 17 | 18 | Future error({required String title, required String message}) { 19 | return showOkAlertDialog( 20 | context: _getSafeContext(), 21 | title: title, 22 | message: message); 23 | } 24 | 25 | Future ask({required String title, required String message, required String positiveButton, required String negativeButton}) { 26 | return showOkCancelAlertDialog( 27 | context: _getSafeContext(), 28 | title: title, 29 | message: message, 30 | okLabel: positiveButton, 31 | cancelLabel: negativeButton); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/lib/service/navigation_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | 4 | /// Singleton navigation service used for navigation between the screens. 5 | /// This service allows navigation from viewmodel without requiring the context 6 | /// details from the widget. 7 | @lazySingleton 8 | class NavigationService { 9 | 10 | final StackRouter _router; 11 | NavigationService(this._router); 12 | 13 | Future push(PageRouteInfo routeInfo) async { 14 | try { 15 | return _router.push(routeInfo); 16 | } on Exception catch (e) { 17 | print('Exception occurred in navigateTo: $e'); 18 | } 19 | } 20 | 21 | Future popAndPush(PageRouteInfo routeInfo) async { 22 | try { 23 | return _router.popAndPush(routeInfo); 24 | } on Exception catch (e) { 25 | print('Exception occurred in navigateTo: $e'); 26 | } 27 | } 28 | 29 | Future pushAndRemoveUntil(PageRouteInfo routeInfo) async { 30 | try { 31 | return _router.pushAndRemoveUntil(routeInfo, 32 | predicate: (route) => route.isFirst); 33 | } on Exception catch (e) { 34 | print('Exception occurred in navigateTo: $e'); 35 | } 36 | } 37 | 38 | Future pop() { 39 | try { 40 | return _router.pop(); 41 | } on Exception catch (e) { 42 | print('Exception occurred in pop: $e'); 43 | return Future.value(false); 44 | } 45 | } 46 | 47 | void popToRoot() { 48 | try { 49 | return _router.popUntil((route) => route.isFirst); 50 | } on Exception catch (e) { 51 | print('Exception occurred in pop: $e'); 52 | } 53 | } 54 | 55 | // Future push(String routeName, [Object? arguments]) async { 56 | // try { 57 | // return ExtendedNavigator?.root?.push(routeName, arguments: arguments); 58 | // } on Exception catch (e) { 59 | // print('Exception occurred in navigateTo: $e'); 60 | // } 61 | // } 62 | // 63 | // Future popAndPush(String routeName, [Object? arguments]) async { 64 | // try { 65 | // return ExtendedNavigator?.root?.popAndPush(routeName, arguments: arguments); 66 | // } on Exception catch (e) { 67 | // print('Exception occurred in navigateTo: $e'); 68 | // } 69 | // } 70 | // 71 | // Future pushAndRemoveUntil(String routeName, [Object? arguments]) async { 72 | // try { 73 | // return ExtendedNavigator?.root?.pushAndRemoveUntil( 74 | // routeName, (route) => route.isFirst, arguments: arguments); 75 | // } on Exception catch (e) { 76 | // print('Exception occurred in navigateTo: $e'); 77 | // } 78 | // } 79 | // 80 | // void pop([Object? arguments]) { 81 | // try { 82 | // return ExtendedNavigator?.root?.pop(arguments); 83 | // } on Exception catch (e) { 84 | // print('Exception occurred in pop: $e'); 85 | // } 86 | // } 87 | // 88 | // void popToRoot() { 89 | // try { 90 | // return ExtendedNavigator?.root?.popUntil((route) => route.isFirst); 91 | // } on Exception catch (e) { 92 | // print('Exception occurred in pop: $e'); 93 | // } 94 | // } 95 | } -------------------------------------------------------------------------------- /core/lib/service/snackbar_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:injectable/injectable.dart'; 5 | 6 | @lazySingleton 7 | class SnackbarService { 8 | 9 | final StackRouter _router; 10 | SnackbarService(this._router); 11 | 12 | BuildContext _getSafeContext() { 13 | final context = _router.navigatorKey.currentContext; 14 | return context != null 15 | ? context 16 | : throw ('Have you forgot to setup routes?'); 17 | } 18 | 19 | void show(String message, {SnackBarAction? action}) { 20 | final snackBar = SnackBar(content: Text(message), action: action); 21 | ScaffoldMessenger.of(_getSafeContext()).showSnackBar(snackBar); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/lib/service/toast_service.dart: -------------------------------------------------------------------------------- 1 | // ignore: import_of_legacy_library_into_null_safe 2 | import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | 5 | @lazySingleton 6 | class ToastService { 7 | 8 | show(String message) { 9 | FlutterFlexibleToast.showToast( 10 | message: message, radius: 8); 11 | } 12 | 13 | showInCenter(String message) { 14 | FlutterFlexibleToast.showToast( 15 | message: message, 16 | radius: 8, 17 | toastGravity: ToastGravity.CENTER); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /core/lib/src/di/locator.config.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // InjectableConfigGenerator 5 | // ************************************************************************** 6 | 7 | import 'package:auto_route/auto_route.dart' as _i4; 8 | import 'package:get_it/get_it.dart' as _i1; 9 | import 'package:injectable/injectable.dart' as _i2; 10 | 11 | import '../../service/dialog_service.dart' as _i3; 12 | import '../../service/navigation_service.dart' as _i5; 13 | import '../../service/snackbar_service.dart' as _i6; 14 | import '../../service/toast_service.dart' 15 | as _i7; // ignore_for_file: unnecessary_lambdas 16 | 17 | // ignore_for_file: lines_longer_than_80_chars 18 | /// initializes the registration of provided dependencies inside of [GetIt] 19 | _i1.GetIt $initGetIt(_i1.GetIt get, 20 | {String? environment, _i2.EnvironmentFilter? environmentFilter}) { 21 | final gh = _i2.GetItHelper(get, environment, environmentFilter); 22 | gh.lazySingleton<_i3.DialogService>( 23 | () => _i3.DialogService(get<_i4.StackRouter>())); 24 | gh.lazySingleton<_i5.NavigationService>( 25 | () => _i5.NavigationService(get<_i4.StackRouter>())); 26 | gh.lazySingleton<_i6.SnackbarService>( 27 | () => _i6.SnackbarService(get<_i4.StackRouter>())); 28 | gh.lazySingleton<_i7.ToastService>(() => _i7.ToastService()); 29 | return get; 30 | } 31 | -------------------------------------------------------------------------------- /core/lib/src/di/locator.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:get_it/get_it.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | 5 | import 'locator.config.dart'; 6 | 7 | final locator = GetIt.instance..allowReassignment = true; 8 | 9 | @injectableInit 10 | void setupLocator() { 11 | _init(locator); 12 | $initGetIt(locator); 13 | } 14 | 15 | void _init(GetIt locator) { 16 | 17 | } -------------------------------------------------------------------------------- /core/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "12.0.0" 11 | adaptive_dialog: 12 | dependency: "direct main" 13 | description: 14 | name: adaptive_dialog 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.10.0+5" 18 | analyzer: 19 | dependency: transitive 20 | description: 21 | name: analyzer 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "0.40.6" 25 | animations: 26 | dependency: transitive 27 | description: 28 | name: animations 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.0.0" 32 | args: 33 | dependency: transitive 34 | description: 35 | name: args 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.6.0" 39 | async: 40 | dependency: transitive 41 | description: 42 | name: async 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.5.0" 46 | auto_route: 47 | dependency: "direct main" 48 | description: 49 | name: auto_route 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.2" 53 | auto_route_generator: 54 | dependency: "direct dev" 55 | description: 56 | name: auto_route_generator 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.0.0-beta.11" 60 | boolean_selector: 61 | dependency: transitive 62 | description: 63 | name: boolean_selector 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.0" 67 | build: 68 | dependency: transitive 69 | description: 70 | name: build 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.6.2" 74 | build_config: 75 | dependency: transitive 76 | description: 77 | name: build_config 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.4.5" 81 | build_daemon: 82 | dependency: transitive 83 | description: 84 | name: build_daemon 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "2.1.7" 88 | build_resolvers: 89 | dependency: transitive 90 | description: 91 | name: build_resolvers 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "1.5.3" 95 | build_runner: 96 | dependency: "direct dev" 97 | description: 98 | name: build_runner 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "1.11.1" 102 | build_runner_core: 103 | dependency: transitive 104 | description: 105 | name: build_runner_core 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "6.1.7" 109 | built_collection: 110 | dependency: transitive 111 | description: 112 | name: built_collection 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "4.3.2" 116 | built_value: 117 | dependency: transitive 118 | description: 119 | name: built_value 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "7.1.0" 123 | characters: 124 | dependency: transitive 125 | description: 126 | name: characters 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.1.0" 130 | charcode: 131 | dependency: transitive 132 | description: 133 | name: charcode 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.2.0" 137 | checked_yaml: 138 | dependency: transitive 139 | description: 140 | name: checked_yaml 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "1.0.4" 144 | cli_util: 145 | dependency: transitive 146 | description: 147 | name: cli_util 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "0.2.0" 151 | clock: 152 | dependency: transitive 153 | description: 154 | name: clock 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "1.1.0" 158 | code_builder: 159 | dependency: transitive 160 | description: 161 | name: code_builder 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "3.7.0" 165 | collection: 166 | dependency: transitive 167 | description: 168 | name: collection 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "1.15.0" 172 | connectivity: 173 | dependency: "direct main" 174 | description: 175 | name: connectivity 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "2.0.2" 179 | connectivity_for_web: 180 | dependency: transitive 181 | description: 182 | name: connectivity_for_web 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "0.3.1+4" 186 | connectivity_macos: 187 | dependency: transitive 188 | description: 189 | name: connectivity_macos 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "0.1.0+7" 193 | connectivity_platform_interface: 194 | dependency: transitive 195 | description: 196 | name: connectivity_platform_interface 197 | url: "https://pub.dartlang.org" 198 | source: hosted 199 | version: "1.0.6" 200 | convert: 201 | dependency: transitive 202 | description: 203 | name: convert 204 | url: "https://pub.dartlang.org" 205 | source: hosted 206 | version: "2.1.1" 207 | crypto: 208 | dependency: transitive 209 | description: 210 | name: crypto 211 | url: "https://pub.dartlang.org" 212 | source: hosted 213 | version: "2.1.5" 214 | dart_style: 215 | dependency: transitive 216 | description: 217 | name: dart_style 218 | url: "https://pub.dartlang.org" 219 | source: hosted 220 | version: "1.3.10" 221 | fake_async: 222 | dependency: transitive 223 | description: 224 | name: fake_async 225 | url: "https://pub.dartlang.org" 226 | source: hosted 227 | version: "1.2.0" 228 | file: 229 | dependency: transitive 230 | description: 231 | name: file 232 | url: "https://pub.dartlang.org" 233 | source: hosted 234 | version: "5.2.1" 235 | fixnum: 236 | dependency: transitive 237 | description: 238 | name: fixnum 239 | url: "https://pub.dartlang.org" 240 | source: hosted 241 | version: "0.10.11" 242 | flutter: 243 | dependency: "direct main" 244 | description: flutter 245 | source: sdk 246 | version: "0.0.0" 247 | flutter_flexible_toast: 248 | dependency: "direct main" 249 | description: 250 | name: flutter_flexible_toast 251 | url: "https://pub.dartlang.org" 252 | source: hosted 253 | version: "0.1.4" 254 | flutter_test: 255 | dependency: "direct dev" 256 | description: flutter 257 | source: sdk 258 | version: "0.0.0" 259 | flutter_web_plugins: 260 | dependency: transitive 261 | description: flutter 262 | source: sdk 263 | version: "0.0.0" 264 | get_it: 265 | dependency: "direct main" 266 | description: 267 | name: get_it 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "6.0.0" 271 | glob: 272 | dependency: transitive 273 | description: 274 | name: glob 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "1.2.0" 278 | graphs: 279 | dependency: transitive 280 | description: 281 | name: graphs 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "0.2.0" 285 | http_multi_server: 286 | dependency: transitive 287 | description: 288 | name: http_multi_server 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "2.2.0" 292 | http_parser: 293 | dependency: transitive 294 | description: 295 | name: http_parser 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "3.1.4" 299 | injectable: 300 | dependency: "direct main" 301 | description: 302 | name: injectable 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "1.2.2" 306 | injectable_generator: 307 | dependency: "direct dev" 308 | description: 309 | name: injectable_generator 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "1.1.2" 313 | intl: 314 | dependency: transitive 315 | description: 316 | name: intl 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "0.16.1" 320 | io: 321 | dependency: transitive 322 | description: 323 | name: io 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "0.3.5" 327 | js: 328 | dependency: transitive 329 | description: 330 | name: js 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "0.6.3" 334 | json_annotation: 335 | dependency: transitive 336 | description: 337 | name: json_annotation 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "3.1.1" 341 | logger: 342 | dependency: "direct main" 343 | description: 344 | name: logger 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "1.0.0" 348 | logging: 349 | dependency: transitive 350 | description: 351 | name: logging 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "0.11.4" 355 | matcher: 356 | dependency: transitive 357 | description: 358 | name: matcher 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "0.12.10" 362 | meta: 363 | dependency: transitive 364 | description: 365 | name: meta 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "1.3.0" 369 | mime: 370 | dependency: transitive 371 | description: 372 | name: mime 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "0.9.7" 376 | nested: 377 | dependency: transitive 378 | description: 379 | name: nested 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "1.0.0" 383 | node_interop: 384 | dependency: transitive 385 | description: 386 | name: node_interop 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "1.2.1" 390 | node_io: 391 | dependency: transitive 392 | description: 393 | name: node_io 394 | url: "https://pub.dartlang.org" 395 | source: hosted 396 | version: "1.2.0" 397 | package_config: 398 | dependency: transitive 399 | description: 400 | name: package_config 401 | url: "https://pub.dartlang.org" 402 | source: hosted 403 | version: "1.9.3" 404 | path: 405 | dependency: transitive 406 | description: 407 | name: path 408 | url: "https://pub.dartlang.org" 409 | source: hosted 410 | version: "1.8.0" 411 | pedantic: 412 | dependency: transitive 413 | description: 414 | name: pedantic 415 | url: "https://pub.dartlang.org" 416 | source: hosted 417 | version: "1.9.2" 418 | plugin_platform_interface: 419 | dependency: transitive 420 | description: 421 | name: plugin_platform_interface 422 | url: "https://pub.dartlang.org" 423 | source: hosted 424 | version: "1.0.3" 425 | pool: 426 | dependency: transitive 427 | description: 428 | name: pool 429 | url: "https://pub.dartlang.org" 430 | source: hosted 431 | version: "1.4.0" 432 | provider: 433 | dependency: transitive 434 | description: 435 | name: provider 436 | url: "https://pub.dartlang.org" 437 | source: hosted 438 | version: "5.0.0" 439 | pub_semver: 440 | dependency: transitive 441 | description: 442 | name: pub_semver 443 | url: "https://pub.dartlang.org" 444 | source: hosted 445 | version: "1.4.4" 446 | pubspec_parse: 447 | dependency: transitive 448 | description: 449 | name: pubspec_parse 450 | url: "https://pub.dartlang.org" 451 | source: hosted 452 | version: "0.1.8" 453 | quiver: 454 | dependency: transitive 455 | description: 456 | name: quiver 457 | url: "https://pub.dartlang.org" 458 | source: hosted 459 | version: "2.1.5" 460 | shelf: 461 | dependency: transitive 462 | description: 463 | name: shelf 464 | url: "https://pub.dartlang.org" 465 | source: hosted 466 | version: "0.7.9" 467 | shelf_web_socket: 468 | dependency: transitive 469 | description: 470 | name: shelf_web_socket 471 | url: "https://pub.dartlang.org" 472 | source: hosted 473 | version: "0.2.4+1" 474 | sky_engine: 475 | dependency: transitive 476 | description: flutter 477 | source: sdk 478 | version: "0.0.99" 479 | source_gen: 480 | dependency: transitive 481 | description: 482 | name: source_gen 483 | url: "https://pub.dartlang.org" 484 | source: hosted 485 | version: "0.9.10+2" 486 | source_span: 487 | dependency: transitive 488 | description: 489 | name: source_span 490 | url: "https://pub.dartlang.org" 491 | source: hosted 492 | version: "1.8.0" 493 | stack_trace: 494 | dependency: transitive 495 | description: 496 | name: stack_trace 497 | url: "https://pub.dartlang.org" 498 | source: hosted 499 | version: "1.10.0" 500 | stacked: 501 | dependency: "direct main" 502 | description: 503 | name: stacked 504 | url: "https://pub.dartlang.org" 505 | source: hosted 506 | version: "2.0.2" 507 | stream_channel: 508 | dependency: transitive 509 | description: 510 | name: stream_channel 511 | url: "https://pub.dartlang.org" 512 | source: hosted 513 | version: "2.1.0" 514 | stream_transform: 515 | dependency: transitive 516 | description: 517 | name: stream_transform 518 | url: "https://pub.dartlang.org" 519 | source: hosted 520 | version: "1.2.0" 521 | string_scanner: 522 | dependency: transitive 523 | description: 524 | name: string_scanner 525 | url: "https://pub.dartlang.org" 526 | source: hosted 527 | version: "1.1.0" 528 | term_glyph: 529 | dependency: transitive 530 | description: 531 | name: term_glyph 532 | url: "https://pub.dartlang.org" 533 | source: hosted 534 | version: "1.2.0" 535 | test_api: 536 | dependency: transitive 537 | description: 538 | name: test_api 539 | url: "https://pub.dartlang.org" 540 | source: hosted 541 | version: "0.2.19" 542 | timing: 543 | dependency: transitive 544 | description: 545 | name: timing 546 | url: "https://pub.dartlang.org" 547 | source: hosted 548 | version: "0.1.1+3" 549 | typed_data: 550 | dependency: transitive 551 | description: 552 | name: typed_data 553 | url: "https://pub.dartlang.org" 554 | source: hosted 555 | version: "1.3.0" 556 | vector_math: 557 | dependency: transitive 558 | description: 559 | name: vector_math 560 | url: "https://pub.dartlang.org" 561 | source: hosted 562 | version: "2.1.0" 563 | watcher: 564 | dependency: transitive 565 | description: 566 | name: watcher 567 | url: "https://pub.dartlang.org" 568 | source: hosted 569 | version: "0.9.7+15" 570 | web_socket_channel: 571 | dependency: transitive 572 | description: 573 | name: web_socket_channel 574 | url: "https://pub.dartlang.org" 575 | source: hosted 576 | version: "1.2.0" 577 | yaml: 578 | dependency: transitive 579 | description: 580 | name: yaml 581 | url: "https://pub.dartlang.org" 582 | source: hosted 583 | version: "2.2.1" 584 | sdks: 585 | dart: ">=2.12.0 <3.0.0" 586 | flutter: ">=1.17.0" 587 | -------------------------------------------------------------------------------- /core/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: core 2 | description: A new Flutter package. 3 | version: 0.0.1 4 | author: GeekySingh 5 | homepage: https://github.com/GeekySingh 6 | publish_to: none 7 | 8 | environment: 9 | sdk: ">=2.12.0 <3.0.0" 10 | flutter: ">=1.17.0" 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | 16 | connectivity: ^2.0.2 17 | # state management 18 | stacked: ^2.0.2 19 | # navigation 20 | auto_route: ^1.0.2 21 | # logger 22 | logger: ^1.0.0 23 | # inversion of control 24 | get_it: ^6.0.0 25 | injectable: ^1.2.2 26 | # toast and dialog 27 | flutter_flexible_toast: ^0.1.4 28 | adaptive_dialog: ^0.10.0+5 29 | 30 | dev_dependencies: 31 | flutter_test: 32 | sdk: flutter 33 | 34 | build_runner: 35 | auto_route_generator: 36 | injectable_generator: 37 | 38 | # For information on the generic Dart part of this file, see the 39 | # following page: https://dart.dev/tools/pub/pubspec 40 | 41 | # The following section is specific to Flutter. 42 | flutter: 43 | 44 | # To add assets to your package, add an assets section, like this: 45 | # assets: 46 | # - images/a_dot_burr.jpeg 47 | # - images/a_dot_ham.jpeg 48 | # 49 | # For details regarding assets in packages, see 50 | # https://flutter.dev/assets-and-images/#from-packages 51 | # 52 | # An image asset can refer to one or more resolution-specific "variants", see 53 | # https://flutter.dev/assets-and-images/#resolution-aware. 54 | 55 | # To add custom fonts to your package, add a fonts section here, 56 | # in this "flutter" section. Each entry in this list should have a 57 | # "family" key with the font family name, and a "fonts" key with a 58 | # list giving the asset and other descriptors for the font. For 59 | # example: 60 | # fonts: 61 | # - family: Schyler 62 | # fonts: 63 | # - asset: fonts/Schyler-Regular.ttf 64 | # - asset: fonts/Schyler-Italic.ttf 65 | # style: italic 66 | # - family: Trajan Pro 67 | # fonts: 68 | # - asset: fonts/TrajanPro.ttf 69 | # - asset: fonts/TrajanPro_Bold.ttf 70 | # weight: 700 71 | # 72 | # For details regarding fonts in packages, see 73 | # https://flutter.dev/custom-fonts/#from-packages 74 | -------------------------------------------------------------------------------- /data/.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/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | -------------------------------------------------------------------------------- /data/.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: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /data/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - TODO: Add release date. 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /data/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /data/README.md: -------------------------------------------------------------------------------- 1 | # data 2 | 3 | A new Flutter package. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Dart 8 | [package](https://flutter.dev/developing-packages/), 9 | a library module containing code that can be shared easily across 10 | multiple Flutter or Dart projects. 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | -------------------------------------------------------------------------------- /data/lib/data.dart: -------------------------------------------------------------------------------- 1 | library data; 2 | 3 | import 'package:data/src/di/locator.dart'; 4 | 5 | class Data { 6 | static void init() { 7 | /// setup required locators for data module 8 | setupLocator(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/lib/src/common/constants.dart: -------------------------------------------------------------------------------- 1 | 2 | abstract class Constants { 3 | 4 | static const BASE_URL = "https://api.nytimes.com/svc/"; 5 | static const API_KEY = "qtVlLSfH968rf6nd2tqbLPDnHnA7NLEb"; 6 | 7 | } -------------------------------------------------------------------------------- /data/lib/src/datasource/local/dao/article_dao.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:data/src/datasource/local/entity/article_entity.dart'; 3 | import 'package:floor/floor.dart'; 4 | 5 | const _tableName = 'ArticleEntity'; 6 | 7 | @dao 8 | abstract class ArticleDao { 9 | 10 | @Query('select * FROM $_tableName') 11 | Future> getArticles(); 12 | 13 | @Insert(onConflict: OnConflictStrategy.replace) 14 | Future saveArticles(List articles); 15 | 16 | @Query('select * from $_tableName where id = :id') 17 | Future getArticleById(int id); 18 | } -------------------------------------------------------------------------------- /data/lib/src/datasource/local/db/app_database.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:async'; 3 | 4 | import 'package:data/src/datasource/local/dao/article_dao.dart'; 5 | import 'package:data/src/datasource/local/entity/article_entity.dart'; 6 | import 'package:floor/floor.dart'; 7 | 8 | import 'package:sqflite/sqflite.dart' as sqflite; 9 | 10 | part 'app_database.g.dart'; // the generated code will be there 11 | 12 | @Database(version: 1, entities: [ArticleEntity]) 13 | abstract class AppDatabase extends FloorDatabase { 14 | 15 | ArticleDao get articleDao; 16 | 17 | } -------------------------------------------------------------------------------- /data/lib/src/datasource/local/db/app_database.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'app_database.dart'; 4 | 5 | // ************************************************************************** 6 | // FloorGenerator 7 | // ************************************************************************** 8 | 9 | class $FloorAppDatabase { 10 | /// Creates a database builder for a persistent database. 11 | /// Once a database is built, you should keep a reference to it and re-use it. 12 | static _$AppDatabaseBuilder databaseBuilder(String name) => 13 | _$AppDatabaseBuilder(name); 14 | 15 | /// Creates a database builder for an in memory database. 16 | /// Information stored in an in memory database disappears when the process is killed. 17 | /// Once a database is built, you should keep a reference to it and re-use it. 18 | static _$AppDatabaseBuilder inMemoryDatabaseBuilder() => 19 | _$AppDatabaseBuilder(null); 20 | } 21 | 22 | class _$AppDatabaseBuilder { 23 | _$AppDatabaseBuilder(this.name); 24 | 25 | final String? name; 26 | 27 | final List _migrations = []; 28 | 29 | Callback? _callback; 30 | 31 | /// Adds migrations to the builder. 32 | _$AppDatabaseBuilder addMigrations(List migrations) { 33 | _migrations.addAll(migrations); 34 | return this; 35 | } 36 | 37 | /// Adds a database [Callback] to the builder. 38 | _$AppDatabaseBuilder addCallback(Callback callback) { 39 | _callback = callback; 40 | return this; 41 | } 42 | 43 | /// Creates the database and initializes it. 44 | Future build() async { 45 | final path = name != null 46 | ? await sqfliteDatabaseFactory.getDatabasePath(name!) 47 | : ':memory:'; 48 | final database = _$AppDatabase(); 49 | database.database = await database.open( 50 | path, 51 | _migrations, 52 | _callback, 53 | ); 54 | return database; 55 | } 56 | } 57 | 58 | class _$AppDatabase extends AppDatabase { 59 | _$AppDatabase([StreamController? listener]) { 60 | changeListener = listener ?? StreamController.broadcast(); 61 | } 62 | 63 | ArticleDao? _articleDaoInstance; 64 | 65 | Future open(String path, List migrations, 66 | [Callback? callback]) async { 67 | final databaseOptions = sqflite.OpenDatabaseOptions( 68 | version: 1, 69 | onConfigure: (database) async { 70 | await database.execute('PRAGMA foreign_keys = ON'); 71 | }, 72 | onOpen: (database) async { 73 | await callback?.onOpen?.call(database); 74 | }, 75 | onUpgrade: (database, startVersion, endVersion) async { 76 | await MigrationAdapter.runMigrations( 77 | database, startVersion, endVersion, migrations); 78 | 79 | await callback?.onUpgrade?.call(database, startVersion, endVersion); 80 | }, 81 | onCreate: (database, version) async { 82 | await database.execute( 83 | 'CREATE TABLE IF NOT EXISTS `ArticleEntity` (`id` INTEGER NOT NULL, `title` TEXT NOT NULL, `description` TEXT NOT NULL, `imageUrl` TEXT NOT NULL, `articleUrl` TEXT NOT NULL, `date` TEXT NOT NULL, PRIMARY KEY (`id`))'); 84 | 85 | await callback?.onCreate?.call(database, version); 86 | }, 87 | ); 88 | return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); 89 | } 90 | 91 | @override 92 | ArticleDao get articleDao { 93 | return _articleDaoInstance ??= _$ArticleDao(database, changeListener); 94 | } 95 | } 96 | 97 | class _$ArticleDao extends ArticleDao { 98 | _$ArticleDao(this.database, this.changeListener) 99 | : _queryAdapter = QueryAdapter(database), 100 | _articleEntityInsertionAdapter = InsertionAdapter( 101 | database, 102 | 'ArticleEntity', 103 | (ArticleEntity item) => { 104 | 'id': item.id, 105 | 'title': item.title, 106 | 'description': item.description, 107 | 'imageUrl': item.imageUrl, 108 | 'articleUrl': item.articleUrl, 109 | 'date': item.date 110 | }); 111 | 112 | final sqflite.DatabaseExecutor database; 113 | 114 | final StreamController changeListener; 115 | 116 | final QueryAdapter _queryAdapter; 117 | 118 | final InsertionAdapter _articleEntityInsertionAdapter; 119 | 120 | @override 121 | Future> getArticles() async { 122 | return _queryAdapter.queryList('select * FROM ArticleEntity', 123 | mapper: (Map row) => ArticleEntity( 124 | id: row['id'] as int, 125 | title: row['title'] as String, 126 | description: row['description'] as String, 127 | imageUrl: row['imageUrl'] as String, 128 | articleUrl: row['articleUrl'] as String, 129 | date: row['date'] as String)); 130 | } 131 | 132 | @override 133 | Future getArticleById(int id) async { 134 | return _queryAdapter.query('select * from ArticleEntity where id = ?1', 135 | mapper: (Map row) => ArticleEntity( 136 | id: row['id'] as int, 137 | title: row['title'] as String, 138 | description: row['description'] as String, 139 | imageUrl: row['imageUrl'] as String, 140 | articleUrl: row['articleUrl'] as String, 141 | date: row['date'] as String), 142 | arguments: [id]); 143 | } 144 | 145 | @override 146 | Future saveArticles(List articles) async { 147 | await _articleEntityInsertionAdapter.insertList( 148 | articles, OnConflictStrategy.replace); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /data/lib/src/datasource/local/entity/article_entity.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:floor/floor.dart'; 3 | 4 | @entity 5 | class ArticleEntity { 6 | 7 | @primaryKey 8 | final int id; 9 | final String title; 10 | final String description; 11 | final String imageUrl; 12 | final String articleUrl; 13 | final String date; 14 | 15 | ArticleEntity({required this.id, required this.title, required this.description, required this.imageUrl, required this.articleUrl, required this.date}); 16 | } -------------------------------------------------------------------------------- /data/lib/src/datasource/remote/dto/article_response.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | part 'article_response.g.dart'; 6 | 7 | @JsonSerializable() 8 | class ArticleResponse { 9 | 10 | @JsonKey(name: 'results') 11 | final List
articles; 12 | 13 | ArticleResponse(this.articles); 14 | 15 | factory ArticleResponse.fromJson(Map json) => 16 | _$ArticleResponseFromJson(json); 17 | 18 | Map toJson() => _$ArticleResponseToJson(this); 19 | } 20 | 21 | @JsonSerializable() 22 | class Article { 23 | final int id; 24 | final List media; 25 | @JsonKey(name: 'published_date') 26 | final String publishedDate; 27 | final String title; 28 | final String abstract; 29 | final String updated; 30 | final String url; 31 | 32 | Article(this.id, this.media, this.publishedDate, this.title, this.abstract, 33 | this.updated, this.url); 34 | 35 | factory Article.fromJson(Map json) => 36 | _$ArticleFromJson(json); 37 | 38 | Map toJson() => _$ArticleToJson(this); 39 | 40 | } 41 | 42 | @JsonSerializable() 43 | class Media { 44 | @JsonKey(name: 'media-metadata') 45 | final List? mediaMetadata; 46 | 47 | Media(this.mediaMetadata); 48 | 49 | factory Media.fromJson(Map json) => 50 | _$MediaFromJson(json); 51 | 52 | Map toJson() => _$MediaToJson(this); 53 | } 54 | 55 | @JsonSerializable() 56 | class MediaMetaData { 57 | final String url; 58 | 59 | MediaMetaData(this.url); 60 | 61 | factory MediaMetaData.fromJson(Map json) => 62 | _$MediaMetaDataFromJson(json); 63 | 64 | Map toJson() => _$MediaMetaDataToJson(this); 65 | } -------------------------------------------------------------------------------- /data/lib/src/datasource/remote/dto/article_response.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'article_response.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ArticleResponse _$ArticleResponseFromJson(Map json) { 10 | return ArticleResponse( 11 | (json['results'] as List) 12 | .map((e) => Article.fromJson(e as Map)) 13 | .toList(), 14 | ); 15 | } 16 | 17 | Map _$ArticleResponseToJson(ArticleResponse instance) => 18 | { 19 | 'results': instance.articles, 20 | }; 21 | 22 | Article _$ArticleFromJson(Map json) { 23 | return Article( 24 | json['id'] as int, 25 | (json['media'] as List) 26 | .map((e) => Media.fromJson(e as Map)) 27 | .toList(), 28 | json['published_date'] as String, 29 | json['title'] as String, 30 | json['abstract'] as String, 31 | json['updated'] as String, 32 | json['url'] as String, 33 | ); 34 | } 35 | 36 | Map _$ArticleToJson(Article instance) => { 37 | 'id': instance.id, 38 | 'media': instance.media, 39 | 'published_date': instance.publishedDate, 40 | 'title': instance.title, 41 | 'abstract': instance.abstract, 42 | 'updated': instance.updated, 43 | 'url': instance.url, 44 | }; 45 | 46 | Media _$MediaFromJson(Map json) { 47 | return Media( 48 | (json['media-metadata'] as List?) 49 | ?.map((e) => MediaMetaData.fromJson(e as Map)) 50 | .toList(), 51 | ); 52 | } 53 | 54 | Map _$MediaToJson(Media instance) => { 55 | 'media-metadata': instance.mediaMetadata, 56 | }; 57 | 58 | MediaMetaData _$MediaMetaDataFromJson(Map json) { 59 | return MediaMetaData( 60 | json['url'] as String, 61 | ); 62 | } 63 | 64 | Map _$MediaMetaDataToJson(MediaMetaData instance) => 65 | { 66 | 'url': instance.url, 67 | }; 68 | -------------------------------------------------------------------------------- /data/lib/src/datasource/remote/service/article_service.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:data/src/common/constants.dart'; 3 | import 'package:data/src/datasource/remote/dto/article_response.dart'; 4 | import 'package:dio/dio.dart'; 5 | import 'package:retrofit/retrofit.dart'; 6 | 7 | part 'article_service.g.dart'; 8 | 9 | @RestApi() 10 | abstract class ArticleService { 11 | 12 | factory ArticleService(Dio dio, {String baseUrl}) = _ArticleService; 13 | 14 | @GET("mostpopular/v2/mostviewed/all-sections/7.json?api-key=${Constants.API_KEY}") 15 | Future getArticles(); 16 | 17 | } -------------------------------------------------------------------------------- /data/lib/src/datasource/remote/service/article_service.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'article_service.dart'; 4 | 5 | // ************************************************************************** 6 | // RetrofitGenerator 7 | // ************************************************************************** 8 | 9 | class _ArticleService implements ArticleService { 10 | _ArticleService(this._dio, {this.baseUrl}); 11 | 12 | final Dio _dio; 13 | 14 | String? baseUrl; 15 | 16 | @override 17 | Future getArticles() async { 18 | const _extra = {}; 19 | final queryParameters = {}; 20 | final _data = {}; 21 | final _result = await _dio.fetch>(_setStreamType< 22 | ArticleResponse>(Options( 23 | method: 'GET', headers: {}, extra: _extra) 24 | .compose(_dio.options, 25 | 'mostpopular/v2/mostviewed/all-sections/7.json?api-key=qtVlLSfH968rf6nd2tqbLPDnHnA7NLEb', 26 | queryParameters: queryParameters, data: _data) 27 | .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); 28 | final value = ArticleResponse.fromJson(_result.data!); 29 | return value; 30 | } 31 | 32 | RequestOptions _setStreamType(RequestOptions requestOptions) { 33 | if (T != dynamic && 34 | !(requestOptions.responseType == ResponseType.bytes || 35 | requestOptions.responseType == ResponseType.stream)) { 36 | if (T == String) { 37 | requestOptions.responseType = ResponseType.plain; 38 | } else { 39 | requestOptions.responseType = ResponseType.json; 40 | } 41 | } 42 | return requestOptions; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /data/lib/src/di/locator.config.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // InjectableConfigGenerator 5 | // ************************************************************************** 6 | 7 | import 'package:domain/domain.dart' as _i3; 8 | import 'package:get_it/get_it.dart' as _i1; 9 | import 'package:injectable/injectable.dart' as _i2; 10 | 11 | import '../datasource/local/dao/article_dao.dart' as _i6; 12 | import '../datasource/remote/service/article_service.dart' as _i5; 13 | import '../repository/article_repository.dart' 14 | as _i4; // ignore_for_file: unnecessary_lambdas 15 | 16 | // ignore_for_file: lines_longer_than_80_chars 17 | /// initializes the registration of provided dependencies inside of [GetIt] 18 | _i1.GetIt $initGetIt(_i1.GetIt get, 19 | {String? environment, _i2.EnvironmentFilter? environmentFilter}) { 20 | final gh = _i2.GetItHelper(get, environment, environmentFilter); 21 | gh.factory<_i3.ArticleRepository>(() => _i4.ArticleRepositoryImpl( 22 | get<_i5.ArticleService>(), get<_i6.ArticleDao>())); 23 | return get; 24 | } 25 | -------------------------------------------------------------------------------- /data/lib/src/di/locator.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:data/src/common/constants.dart'; 3 | import 'package:data/src/datasource/local/dao/article_dao.dart'; 4 | import 'package:data/src/datasource/local/db/app_database.dart'; 5 | import 'package:data/src/datasource/remote/service/article_service.dart'; 6 | import 'package:dio/dio.dart'; 7 | import 'package:get_it/get_it.dart'; 8 | import 'package:injectable/injectable.dart'; 9 | 10 | import 'locator.config.dart'; 11 | 12 | final locator = GetIt.instance..allowReassignment = true; 13 | 14 | @injectableInit 15 | void setupLocator() { 16 | _init(locator); 17 | $initGetIt(locator); 18 | } 19 | 20 | void _init(GetIt locator) { 21 | 22 | _registerNetworkModules(locator); 23 | _registerServices(locator); 24 | _registerDatabase(locator); 25 | } 26 | 27 | void _registerNetworkModules(GetIt locator) { 28 | 29 | locator.registerSingleton(Dio()); 30 | } 31 | 32 | void _registerServices(GetIt locator) { 33 | 34 | locator.registerLazySingleton(() => ArticleService(locator(), baseUrl: Constants.BASE_URL)); 35 | } 36 | 37 | void _registerDatabase(GetIt locator) async { 38 | final database = await $FloorAppDatabase.databaseBuilder("article_database.db").build(); 39 | locator.registerLazySingleton(() => database); 40 | locator.registerLazySingleton(() => locator.get().articleDao); 41 | } -------------------------------------------------------------------------------- /data/lib/src/mapper/article_mapper.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:data/src/datasource/local/entity/article_entity.dart'; 3 | import 'package:data/src/datasource/remote/dto/article_response.dart'; 4 | import 'package:domain/domain.dart'; 5 | 6 | extension ArticleExtension on Article { 7 | ArticleModel toModel() => ArticleModel( 8 | id: id, 9 | title: title, 10 | description: abstract, 11 | imageUrl: media.length > 2 12 | ? media[2].mediaMetadata![0].url 13 | : media.length > 1 14 | ? media[1].mediaMetadata![0].url 15 | : media.length > 0 16 | ? media[0].mediaMetadata![0].url 17 | : "", 18 | articleUrl: url, 19 | date: publishedDate); 20 | 21 | ArticleEntity toEntity() => ArticleEntity( 22 | id: id, 23 | title: title, 24 | description: abstract, 25 | imageUrl: media.length > 2 26 | ? media[2].mediaMetadata![0].url 27 | : media.length > 1 28 | ? media[1].mediaMetadata![0].url 29 | : media.length > 0 30 | ? media[0].mediaMetadata![0].url 31 | : "", 32 | articleUrl: url, 33 | date: publishedDate); 34 | } 35 | 36 | extension ArticleEntityExtension on ArticleEntity { 37 | ArticleModel toModel() => ArticleModel( 38 | id: id, 39 | title: title, 40 | description: description, 41 | imageUrl: imageUrl, 42 | articleUrl: articleUrl, 43 | date: date); 44 | } -------------------------------------------------------------------------------- /data/lib/src/repository/article_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:data/src/datasource/local/dao/article_dao.dart'; 2 | import 'package:data/src/datasource/local/entity/article_entity.dart'; 3 | import 'package:data/src/datasource/remote/dto/article_response.dart'; 4 | import 'package:data/src/datasource/remote/service/article_service.dart'; 5 | import 'package:data/src/mapper/article_mapper.dart'; 6 | import 'package:domain/domain.dart'; 7 | import 'package:injectable/injectable.dart'; 8 | 9 | import 'base/base_repository.dart'; 10 | 11 | @Injectable(as: ArticleRepository) 12 | class ArticleRepositoryImpl extends BaseRepository 13 | implements ArticleRepository { 14 | final ArticleService _articleService; 15 | final ArticleDao _articleDao; 16 | 17 | ArticleRepositoryImpl(this._articleService, this._articleDao); 18 | 19 | @override 20 | Future> getArticle(int id) async { 21 | // return safeCall(_articleService.getArticles(), 22 | // mapper: (ArticleResponse response) => response.articles 23 | // .map((e) => e.toModel()) 24 | // .toList() 25 | // .firstWhere((element) => element.id == id)); 26 | return safeDbCall(_articleDao.getArticleById(id), 27 | mapper: (ArticleEntity? entity) => entity?.toModel()); 28 | } 29 | 30 | @override 31 | Future>> getArticles() { 32 | return safeApiCall(_articleService.getArticles(), 33 | mapper: (ArticleResponse response) => 34 | response.articles.map((e) => e.toModel()).toList(), 35 | saveResult: (ArticleResponse response) => _articleDao 36 | .saveArticles(response.articles.map((e) => e.toEntity()).toList())); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /data/lib/src/repository/base/base_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:domain/domain.dart'; 3 | import 'package:floor/floor.dart'; 4 | import 'package:logger/logger.dart'; 5 | 6 | typedef ResponseToModelMapper = Model Function(Response response); 7 | typedef EntityToModelMapper = Model? Function(Entity? entity); 8 | typedef SaveResult = Future Function(Response response); 9 | 10 | abstract class BaseRepository { 11 | final _logger = Logger(); 12 | 13 | Future> safeDbCall( 14 | Future call, 15 | {required EntityToModelMapper mapper}) async { 16 | try { 17 | final response = await call; 18 | if(response != null) { 19 | _logger.d("DB success message -> $response"); 20 | return Success(mapper.call(response)!); 21 | } else { 22 | _logger.d("DB response is null"); 23 | return Error(ErrorType.GENERIC, "DB response is null!"); 24 | } 25 | } catch (exception) { 26 | _logger.d("DB failure message -> $exception"); 27 | return Error(ErrorType.GENERIC, "Unknown DB error"); 28 | } 29 | } 30 | 31 | Future> safeApiCall( 32 | Future call, 33 | {required ResponseToModelMapper mapper, 34 | SaveResult? saveResult}) async { 35 | try { 36 | var response = await call; 37 | _logger.d("Api success message -> $response"); 38 | await saveResult?.call(response); 39 | return Success(mapper.call(response)); 40 | } on Exception catch (exception) { 41 | _logger.e("Api error message -> ${exception.toString()}"); 42 | _logger.e(exception); 43 | if (exception is DioError) { 44 | switch (exception.type) { 45 | case DioErrorType.connectTimeout: 46 | case DioErrorType.sendTimeout: 47 | case DioErrorType.receiveTimeout: 48 | case DioErrorType.cancel: 49 | return Error(ErrorType.POOR_NETWORK, exception.message); 50 | 51 | case DioErrorType.other: 52 | return Error(ErrorType.NO_NETWORK, exception.message); 53 | 54 | case DioErrorType.response: 55 | return Error(ErrorType.GENERIC, exception.message); 56 | } 57 | } 58 | return Error(ErrorType.GENERIC, "Unknown API error"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /data/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "20.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.4.0" 18 | args: 19 | dependency: transitive 20 | description: 21 | name: args 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.6.0" 25 | async: 26 | dependency: transitive 27 | description: 28 | name: async 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.5.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.1.0" 39 | build: 40 | dependency: transitive 41 | description: 42 | name: build 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.0.0" 46 | build_config: 47 | dependency: transitive 48 | description: 49 | name: build_config 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.4.7" 53 | build_daemon: 54 | dependency: transitive 55 | description: 56 | name: build_daemon 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.7" 60 | build_resolvers: 61 | dependency: transitive 62 | description: 63 | name: build_resolvers 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.0.0" 67 | build_runner: 68 | dependency: "direct dev" 69 | description: 70 | name: build_runner 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.12.2" 74 | build_runner_core: 75 | dependency: transitive 76 | description: 77 | name: build_runner_core 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "6.1.12" 81 | built_collection: 82 | dependency: transitive 83 | description: 84 | name: built_collection 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "5.0.0" 88 | built_value: 89 | dependency: transitive 90 | description: 91 | name: built_value 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "8.0.4" 95 | characters: 96 | dependency: transitive 97 | description: 98 | name: characters 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "1.1.0" 102 | charcode: 103 | dependency: transitive 104 | description: 105 | name: charcode 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.2.0" 109 | checked_yaml: 110 | dependency: transitive 111 | description: 112 | name: checked_yaml 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "2.0.1" 116 | cli_util: 117 | dependency: transitive 118 | description: 119 | name: cli_util 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "0.3.0" 123 | clock: 124 | dependency: transitive 125 | description: 126 | name: clock 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.1.0" 130 | code_builder: 131 | dependency: transitive 132 | description: 133 | name: code_builder 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "3.7.0" 137 | collection: 138 | dependency: transitive 139 | description: 140 | name: collection 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "1.15.0" 144 | convert: 145 | dependency: transitive 146 | description: 147 | name: convert 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "3.0.0" 151 | crypto: 152 | dependency: transitive 153 | description: 154 | name: crypto 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "3.0.1" 158 | dart_style: 159 | dependency: transitive 160 | description: 161 | name: dart_style 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "2.0.0" 165 | dio: 166 | dependency: "direct main" 167 | description: 168 | name: dio 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "4.0.0" 172 | domain: 173 | dependency: "direct main" 174 | description: 175 | path: "../domain" 176 | relative: true 177 | source: path 178 | version: "0.0.1" 179 | fake_async: 180 | dependency: transitive 181 | description: 182 | name: fake_async 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "1.2.0" 186 | ffi: 187 | dependency: transitive 188 | description: 189 | name: ffi 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "1.0.0" 193 | file: 194 | dependency: transitive 195 | description: 196 | name: file 197 | url: "https://pub.dartlang.org" 198 | source: hosted 199 | version: "6.1.0" 200 | fixnum: 201 | dependency: transitive 202 | description: 203 | name: fixnum 204 | url: "https://pub.dartlang.org" 205 | source: hosted 206 | version: "1.0.0" 207 | floor: 208 | dependency: "direct main" 209 | description: 210 | name: floor 211 | url: "https://pub.dartlang.org" 212 | source: hosted 213 | version: "1.0.1" 214 | floor_annotation: 215 | dependency: transitive 216 | description: 217 | name: floor_annotation 218 | url: "https://pub.dartlang.org" 219 | source: hosted 220 | version: "1.0.0" 221 | floor_generator: 222 | dependency: "direct dev" 223 | description: 224 | name: floor_generator 225 | url: "https://pub.dartlang.org" 226 | source: hosted 227 | version: "1.0.1" 228 | flutter: 229 | dependency: "direct main" 230 | description: flutter 231 | source: sdk 232 | version: "0.0.0" 233 | flutter_test: 234 | dependency: "direct dev" 235 | description: flutter 236 | source: sdk 237 | version: "0.0.0" 238 | get_it: 239 | dependency: "direct main" 240 | description: 241 | name: get_it 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "6.0.0" 245 | glob: 246 | dependency: transitive 247 | description: 248 | name: glob 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "2.0.1" 252 | graphs: 253 | dependency: transitive 254 | description: 255 | name: graphs 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "1.0.0" 259 | http_multi_server: 260 | dependency: transitive 261 | description: 262 | name: http_multi_server 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "2.2.0" 266 | http_parser: 267 | dependency: transitive 268 | description: 269 | name: http_parser 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "4.0.0" 273 | injectable: 274 | dependency: "direct main" 275 | description: 276 | name: injectable 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "1.2.2" 280 | injectable_generator: 281 | dependency: "direct dev" 282 | description: 283 | name: injectable_generator 284 | url: "https://pub.dartlang.org" 285 | source: hosted 286 | version: "1.2.2" 287 | io: 288 | dependency: transitive 289 | description: 290 | name: io 291 | url: "https://pub.dartlang.org" 292 | source: hosted 293 | version: "0.3.5" 294 | js: 295 | dependency: transitive 296 | description: 297 | name: js 298 | url: "https://pub.dartlang.org" 299 | source: hosted 300 | version: "0.6.2" 301 | json_annotation: 302 | dependency: "direct main" 303 | description: 304 | name: json_annotation 305 | url: "https://pub.dartlang.org" 306 | source: hosted 307 | version: "4.0.1" 308 | json_serializable: 309 | dependency: "direct dev" 310 | description: 311 | name: json_serializable 312 | url: "https://pub.dartlang.org" 313 | source: hosted 314 | version: "4.1.0" 315 | logger: 316 | dependency: "direct main" 317 | description: 318 | name: logger 319 | url: "https://pub.dartlang.org" 320 | source: hosted 321 | version: "1.0.0" 322 | logging: 323 | dependency: transitive 324 | description: 325 | name: logging 326 | url: "https://pub.dartlang.org" 327 | source: hosted 328 | version: "1.0.1" 329 | matcher: 330 | dependency: transitive 331 | description: 332 | name: matcher 333 | url: "https://pub.dartlang.org" 334 | source: hosted 335 | version: "0.12.10" 336 | meta: 337 | dependency: transitive 338 | description: 339 | name: meta 340 | url: "https://pub.dartlang.org" 341 | source: hosted 342 | version: "1.3.0" 343 | mime: 344 | dependency: transitive 345 | description: 346 | name: mime 347 | url: "https://pub.dartlang.org" 348 | source: hosted 349 | version: "0.9.7" 350 | package_config: 351 | dependency: transitive 352 | description: 353 | name: package_config 354 | url: "https://pub.dartlang.org" 355 | source: hosted 356 | version: "2.0.0" 357 | path: 358 | dependency: transitive 359 | description: 360 | name: path 361 | url: "https://pub.dartlang.org" 362 | source: hosted 363 | version: "1.8.0" 364 | pedantic: 365 | dependency: transitive 366 | description: 367 | name: pedantic 368 | url: "https://pub.dartlang.org" 369 | source: hosted 370 | version: "1.11.0" 371 | pool: 372 | dependency: transitive 373 | description: 374 | name: pool 375 | url: "https://pub.dartlang.org" 376 | source: hosted 377 | version: "1.5.0" 378 | pub_semver: 379 | dependency: transitive 380 | description: 381 | name: pub_semver 382 | url: "https://pub.dartlang.org" 383 | source: hosted 384 | version: "2.0.0" 385 | pubspec_parse: 386 | dependency: transitive 387 | description: 388 | name: pubspec_parse 389 | url: "https://pub.dartlang.org" 390 | source: hosted 391 | version: "1.0.0" 392 | quiver: 393 | dependency: transitive 394 | description: 395 | name: quiver 396 | url: "https://pub.dartlang.org" 397 | source: hosted 398 | version: "3.0.1" 399 | retrofit: 400 | dependency: "direct main" 401 | description: 402 | name: retrofit 403 | url: "https://pub.dartlang.org" 404 | source: hosted 405 | version: "2.0.0-beta1" 406 | retrofit_generator: 407 | dependency: "direct dev" 408 | description: 409 | name: retrofit_generator 410 | url: "https://pub.dartlang.org" 411 | source: hosted 412 | version: "2.0.0-beta3" 413 | shelf: 414 | dependency: transitive 415 | description: 416 | name: shelf 417 | url: "https://pub.dartlang.org" 418 | source: hosted 419 | version: "1.1.0" 420 | shelf_web_socket: 421 | dependency: transitive 422 | description: 423 | name: shelf_web_socket 424 | url: "https://pub.dartlang.org" 425 | source: hosted 426 | version: "0.2.4+1" 427 | sky_engine: 428 | dependency: transitive 429 | description: flutter 430 | source: sdk 431 | version: "0.0.99" 432 | source_gen: 433 | dependency: transitive 434 | description: 435 | name: source_gen 436 | url: "https://pub.dartlang.org" 437 | source: hosted 438 | version: "1.0.0" 439 | source_span: 440 | dependency: transitive 441 | description: 442 | name: source_span 443 | url: "https://pub.dartlang.org" 444 | source: hosted 445 | version: "1.8.0" 446 | sqflite: 447 | dependency: transitive 448 | description: 449 | name: sqflite 450 | url: "https://pub.dartlang.org" 451 | source: hosted 452 | version: "2.0.0+3" 453 | sqflite_common: 454 | dependency: transitive 455 | description: 456 | name: sqflite_common 457 | url: "https://pub.dartlang.org" 458 | source: hosted 459 | version: "2.0.0+2" 460 | sqflite_common_ffi: 461 | dependency: transitive 462 | description: 463 | name: sqflite_common_ffi 464 | url: "https://pub.dartlang.org" 465 | source: hosted 466 | version: "2.0.0" 467 | sqlite3: 468 | dependency: transitive 469 | description: 470 | name: sqlite3 471 | url: "https://pub.dartlang.org" 472 | source: hosted 473 | version: "1.0.0" 474 | stack_trace: 475 | dependency: transitive 476 | description: 477 | name: stack_trace 478 | url: "https://pub.dartlang.org" 479 | source: hosted 480 | version: "1.10.0" 481 | stream_channel: 482 | dependency: transitive 483 | description: 484 | name: stream_channel 485 | url: "https://pub.dartlang.org" 486 | source: hosted 487 | version: "2.1.0" 488 | stream_transform: 489 | dependency: transitive 490 | description: 491 | name: stream_transform 492 | url: "https://pub.dartlang.org" 493 | source: hosted 494 | version: "2.0.0" 495 | string_scanner: 496 | dependency: transitive 497 | description: 498 | name: string_scanner 499 | url: "https://pub.dartlang.org" 500 | source: hosted 501 | version: "1.1.0" 502 | synchronized: 503 | dependency: transitive 504 | description: 505 | name: synchronized 506 | url: "https://pub.dartlang.org" 507 | source: hosted 508 | version: "3.0.0" 509 | term_glyph: 510 | dependency: transitive 511 | description: 512 | name: term_glyph 513 | url: "https://pub.dartlang.org" 514 | source: hosted 515 | version: "1.2.0" 516 | test_api: 517 | dependency: transitive 518 | description: 519 | name: test_api 520 | url: "https://pub.dartlang.org" 521 | source: hosted 522 | version: "0.2.19" 523 | timing: 524 | dependency: transitive 525 | description: 526 | name: timing 527 | url: "https://pub.dartlang.org" 528 | source: hosted 529 | version: "0.1.1+3" 530 | tuple: 531 | dependency: transitive 532 | description: 533 | name: tuple 534 | url: "https://pub.dartlang.org" 535 | source: hosted 536 | version: "2.0.0" 537 | typed_data: 538 | dependency: transitive 539 | description: 540 | name: typed_data 541 | url: "https://pub.dartlang.org" 542 | source: hosted 543 | version: "1.3.0" 544 | vector_math: 545 | dependency: transitive 546 | description: 547 | name: vector_math 548 | url: "https://pub.dartlang.org" 549 | source: hosted 550 | version: "2.1.0" 551 | watcher: 552 | dependency: transitive 553 | description: 554 | name: watcher 555 | url: "https://pub.dartlang.org" 556 | source: hosted 557 | version: "1.0.0" 558 | web_socket_channel: 559 | dependency: transitive 560 | description: 561 | name: web_socket_channel 562 | url: "https://pub.dartlang.org" 563 | source: hosted 564 | version: "1.2.0" 565 | yaml: 566 | dependency: transitive 567 | description: 568 | name: yaml 569 | url: "https://pub.dartlang.org" 570 | source: hosted 571 | version: "3.1.0" 572 | sdks: 573 | dart: ">=2.12.0 <3.0.0" 574 | flutter: ">=1.24.0-10" 575 | -------------------------------------------------------------------------------- /data/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: data 2 | description: A new Flutter package. 3 | version: 0.0.1 4 | author: GeekySingh 5 | homepage: https://github.com/GeekySingh 6 | publish_to: none 7 | 8 | environment: 9 | sdk: ">=2.12.0 <3.0.0" 10 | flutter: ">=1.17.0" 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | 16 | domain: 17 | path: ../domain 18 | 19 | # inversion of control 20 | get_it: ^6.0.0 21 | injectable: ^1.1.0 22 | # network 23 | dio: ^4.0.0 24 | retrofit: ^2.0.0-beta1 25 | json_annotation: ^4.0.1 26 | # database 27 | floor: ^1.0.1 28 | # logger 29 | logger: ^1.0.0 30 | 31 | dev_dependencies: 32 | flutter_test: 33 | sdk: flutter 34 | 35 | build_runner: 36 | json_serializable: 37 | retrofit_generator: 38 | injectable_generator: 39 | floor_generator: 40 | 41 | # For information on the generic Dart part of this file, see the 42 | # following page: https://dart.dev/tools/pub/pubspec 43 | 44 | # The following section is specific to Flutter. 45 | flutter: 46 | 47 | # To add assets to your package, add an assets section, like this: 48 | # assets: 49 | # - images/a_dot_burr.jpeg 50 | # - images/a_dot_ham.jpeg 51 | # 52 | # For details regarding assets in packages, see 53 | # https://flutter.dev/assets-and-images/#from-packages 54 | # 55 | # An image asset can refer to one or more resolution-specific "variants", see 56 | # https://flutter.dev/assets-and-images/#resolution-aware. 57 | 58 | # To add custom fonts to your package, add a fonts section here, 59 | # in this "flutter" section. Each entry in this list should have a 60 | # "family" key with the font family name, and a "fonts" key with a 61 | # list giving the asset and other descriptors for the font. For 62 | # example: 63 | # fonts: 64 | # - family: Schyler 65 | # fonts: 66 | # - asset: fonts/Schyler-Regular.ttf 67 | # - asset: fonts/Schyler-Italic.ttf 68 | # style: italic 69 | # - family: Trajan Pro 70 | # fonts: 71 | # - asset: fonts/TrajanPro.ttf 72 | # - asset: fonts/TrajanPro_Bold.ttf 73 | # weight: 700 74 | # 75 | # For details regarding fonts in packages, see 76 | # https://flutter.dev/custom-fonts/#from-packages 77 | -------------------------------------------------------------------------------- /domain/.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/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | -------------------------------------------------------------------------------- /domain/.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: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /domain/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - TODO: Add release date. 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /domain/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /domain/README.md: -------------------------------------------------------------------------------- 1 | # domain 2 | 3 | A new Flutter package. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Dart 8 | [package](https://flutter.dev/developing-packages/), 9 | a library module containing code that can be shared easily across 10 | multiple Flutter or Dart projects. 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | -------------------------------------------------------------------------------- /domain/lib/domain.dart: -------------------------------------------------------------------------------- 1 | library domain; 2 | 3 | export 'src/model/article_model.dart'; 4 | export 'src/usecase/article_use_case.dart'; 5 | export 'src/common/result.dart'; 6 | export 'src/common/error_type.dart'; 7 | export 'src/repository/article_repository.dart'; 8 | 9 | import 'package:domain/src/di/locator.dart'; 10 | 11 | class Domain { 12 | static void init() { 13 | /// setup required locators for domain module 14 | setupLocator(); 15 | } 16 | } -------------------------------------------------------------------------------- /domain/lib/src/common/error_type.dart: -------------------------------------------------------------------------------- 1 | enum ErrorType { POOR_NETWORK, NO_NETWORK, GENERIC } -------------------------------------------------------------------------------- /domain/lib/src/common/result.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'error_type.dart'; 3 | 4 | class Result with SealedResult { 5 | bool get isSuccessful => this is Success; 6 | } 7 | 8 | class Success extends Result { 9 | T data; 10 | 11 | Success(this.data); 12 | } 13 | 14 | class Error extends Result { 15 | ErrorType type; 16 | String error; 17 | 18 | Error(this.type, this.error); 19 | } 20 | 21 | abstract class SealedResult { 22 | R? when({ 23 | R Function(T)? success, 24 | R Function(ErrorType, String)? error, 25 | }) { 26 | if (this is Success) { 27 | return success?.call(((this as Success).data)); 28 | } 29 | if (this is Error) { 30 | return error?.call((this as Error).type, (this as Error).error); 31 | } 32 | throw new Exception( 33 | 'If you got here, probably you forgot to regenerate the classes? Try running flutter packages pub run build_runner build'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /domain/lib/src/di/locator.config.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // InjectableConfigGenerator 5 | // ************************************************************************** 6 | 7 | import 'package:get_it/get_it.dart' as _i1; 8 | import 'package:injectable/injectable.dart' as _i2; 9 | 10 | import '../../domain.dart' as _i3; 11 | import '../usecase/article_use_case_impl.dart' 12 | as _i4; // ignore_for_file: unnecessary_lambdas 13 | 14 | // ignore_for_file: lines_longer_than_80_chars 15 | /// initializes the registration of provided dependencies inside of [GetIt] 16 | _i1.GetIt $initGetIt(_i1.GetIt get, 17 | {String? environment, _i2.EnvironmentFilter? environmentFilter}) { 18 | final gh = _i2.GetItHelper(get, environment, environmentFilter); 19 | gh.factory<_i3.GetAllArticleUseCase>( 20 | () => _i4.GetAllArticleUseCaseImpl(get<_i3.ArticleRepository>())); 21 | gh.factory<_i3.GetArticleByIdUseCase>( 22 | () => _i4.GetArticleByIdUseCaseImpl(get<_i3.ArticleRepository>())); 23 | return get; 24 | } 25 | -------------------------------------------------------------------------------- /domain/lib/src/di/locator.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:get_it/get_it.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | 5 | import 'locator.config.dart'; 6 | 7 | final locator = GetIt.instance..allowReassignment = true; 8 | 9 | @injectableInit 10 | void setupLocator() { 11 | _init(locator); 12 | $initGetIt(locator); 13 | } 14 | 15 | void _init(GetIt locator) { 16 | 17 | } -------------------------------------------------------------------------------- /domain/lib/src/model/article_model.dart: -------------------------------------------------------------------------------- 1 | class ArticleModel { 2 | final int id; 3 | final String title; 4 | final String description; 5 | final String imageUrl; 6 | final String articleUrl; 7 | final String date; 8 | 9 | ArticleModel( 10 | {required this.id, 11 | required this.title, 12 | required this.description, 13 | required this.imageUrl, 14 | required this.articleUrl, 15 | required this.date}); 16 | } 17 | -------------------------------------------------------------------------------- /domain/lib/src/repository/article_repository.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:domain/src/common/result.dart'; 3 | import 'package:domain/src/model/article_model.dart'; 4 | 5 | abstract class ArticleRepository { 6 | 7 | Future>> getArticles(); 8 | 9 | Future> getArticle(int id); 10 | 11 | } -------------------------------------------------------------------------------- /domain/lib/src/usecase/article_use_case.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:domain/src/common/result.dart'; 3 | import 'package:domain/src/model/article_model.dart'; 4 | 5 | import 'base/base_use_case.dart'; 6 | 7 | /// abstraction of use case to be used by viewmodel 8 | abstract class GetAllArticleUseCase implements BaseUseCase { 9 | 10 | Future>> getArticles(); 11 | } 12 | 13 | /// abstraction of use case to be used by viewmodel 14 | abstract class GetArticleByIdUseCase implements BaseUseCase { 15 | Future> getArticle(int id); 16 | } -------------------------------------------------------------------------------- /domain/lib/src/usecase/article_use_case_impl.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:domain/src/common/result.dart'; 3 | import 'package:domain/src/model/article_model.dart'; 4 | import 'package:domain/src/repository/article_repository.dart'; 5 | import 'package:injectable/injectable.dart'; 6 | 7 | import '../../domain.dart'; 8 | 9 | @Injectable(as: GetAllArticleUseCase) 10 | /// implementation of use cases 11 | class GetAllArticleUseCaseImpl extends GetAllArticleUseCase { 12 | final ArticleRepository _repository; 13 | 14 | GetAllArticleUseCaseImpl(this._repository); 15 | 16 | @override 17 | Future>> getArticles() => _repository.getArticles(); 18 | } 19 | 20 | @Injectable(as: GetArticleByIdUseCase) 21 | /// implementation of use cases 22 | class GetArticleByIdUseCaseImpl extends GetArticleByIdUseCase { 23 | final ArticleRepository _repository; 24 | 25 | GetArticleByIdUseCaseImpl(this._repository); 26 | 27 | @override 28 | Future> getArticle(int id) => _repository.getArticle(id); 29 | } 30 | -------------------------------------------------------------------------------- /domain/lib/src/usecase/base/base_use_case.dart: -------------------------------------------------------------------------------- 1 | 2 | abstract class BaseUseCase {} -------------------------------------------------------------------------------- /domain/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "12.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.40.6" 18 | args: 19 | dependency: transitive 20 | description: 21 | name: args 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.6.0" 25 | async: 26 | dependency: transitive 27 | description: 28 | name: async 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.5.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.1.0" 39 | build: 40 | dependency: transitive 41 | description: 42 | name: build 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.6.2" 46 | build_config: 47 | dependency: transitive 48 | description: 49 | name: build_config 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.4.5" 53 | build_daemon: 54 | dependency: transitive 55 | description: 56 | name: build_daemon 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.7" 60 | build_resolvers: 61 | dependency: transitive 62 | description: 63 | name: build_resolvers 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.5.3" 67 | build_runner: 68 | dependency: "direct dev" 69 | description: 70 | name: build_runner 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.11.1" 74 | build_runner_core: 75 | dependency: transitive 76 | description: 77 | name: build_runner_core 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "6.1.7" 81 | built_collection: 82 | dependency: transitive 83 | description: 84 | name: built_collection 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "4.3.2" 88 | built_value: 89 | dependency: transitive 90 | description: 91 | name: built_value 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "7.1.0" 95 | characters: 96 | dependency: transitive 97 | description: 98 | name: characters 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "1.1.0" 102 | charcode: 103 | dependency: transitive 104 | description: 105 | name: charcode 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.2.0" 109 | checked_yaml: 110 | dependency: transitive 111 | description: 112 | name: checked_yaml 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.0.4" 116 | cli_util: 117 | dependency: transitive 118 | description: 119 | name: cli_util 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "0.2.0" 123 | clock: 124 | dependency: transitive 125 | description: 126 | name: clock 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.1.0" 130 | code_builder: 131 | dependency: transitive 132 | description: 133 | name: code_builder 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "3.7.0" 137 | collection: 138 | dependency: transitive 139 | description: 140 | name: collection 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "1.15.0" 144 | convert: 145 | dependency: transitive 146 | description: 147 | name: convert 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "2.1.1" 151 | crypto: 152 | dependency: transitive 153 | description: 154 | name: crypto 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "2.1.5" 158 | dart_style: 159 | dependency: transitive 160 | description: 161 | name: dart_style 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "1.3.10" 165 | fake_async: 166 | dependency: transitive 167 | description: 168 | name: fake_async 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "1.2.0" 172 | file: 173 | dependency: transitive 174 | description: 175 | name: file 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "5.2.1" 179 | fixnum: 180 | dependency: transitive 181 | description: 182 | name: fixnum 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "0.10.11" 186 | flutter: 187 | dependency: "direct main" 188 | description: flutter 189 | source: sdk 190 | version: "0.0.0" 191 | flutter_test: 192 | dependency: "direct dev" 193 | description: flutter 194 | source: sdk 195 | version: "0.0.0" 196 | get_it: 197 | dependency: "direct main" 198 | description: 199 | name: get_it 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "6.0.0" 203 | glob: 204 | dependency: transitive 205 | description: 206 | name: glob 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "1.2.0" 210 | graphs: 211 | dependency: transitive 212 | description: 213 | name: graphs 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "0.2.0" 217 | http_multi_server: 218 | dependency: transitive 219 | description: 220 | name: http_multi_server 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "2.2.0" 224 | http_parser: 225 | dependency: transitive 226 | description: 227 | name: http_parser 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "3.1.4" 231 | injectable: 232 | dependency: "direct main" 233 | description: 234 | name: injectable 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "1.2.2" 238 | injectable_generator: 239 | dependency: "direct dev" 240 | description: 241 | name: injectable_generator 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "1.1.2" 245 | intl: 246 | dependency: transitive 247 | description: 248 | name: intl 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "0.16.1" 252 | io: 253 | dependency: transitive 254 | description: 255 | name: io 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "0.3.5" 259 | js: 260 | dependency: transitive 261 | description: 262 | name: js 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "0.6.2" 266 | json_annotation: 267 | dependency: transitive 268 | description: 269 | name: json_annotation 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "3.1.1" 273 | logging: 274 | dependency: transitive 275 | description: 276 | name: logging 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "0.11.4" 280 | matcher: 281 | dependency: transitive 282 | description: 283 | name: matcher 284 | url: "https://pub.dartlang.org" 285 | source: hosted 286 | version: "0.12.10" 287 | meta: 288 | dependency: transitive 289 | description: 290 | name: meta 291 | url: "https://pub.dartlang.org" 292 | source: hosted 293 | version: "1.3.0" 294 | mime: 295 | dependency: transitive 296 | description: 297 | name: mime 298 | url: "https://pub.dartlang.org" 299 | source: hosted 300 | version: "0.9.7" 301 | node_interop: 302 | dependency: transitive 303 | description: 304 | name: node_interop 305 | url: "https://pub.dartlang.org" 306 | source: hosted 307 | version: "1.2.1" 308 | node_io: 309 | dependency: transitive 310 | description: 311 | name: node_io 312 | url: "https://pub.dartlang.org" 313 | source: hosted 314 | version: "1.2.0" 315 | package_config: 316 | dependency: transitive 317 | description: 318 | name: package_config 319 | url: "https://pub.dartlang.org" 320 | source: hosted 321 | version: "1.9.3" 322 | path: 323 | dependency: transitive 324 | description: 325 | name: path 326 | url: "https://pub.dartlang.org" 327 | source: hosted 328 | version: "1.8.0" 329 | pedantic: 330 | dependency: transitive 331 | description: 332 | name: pedantic 333 | url: "https://pub.dartlang.org" 334 | source: hosted 335 | version: "1.9.2" 336 | pool: 337 | dependency: transitive 338 | description: 339 | name: pool 340 | url: "https://pub.dartlang.org" 341 | source: hosted 342 | version: "1.4.0" 343 | pub_semver: 344 | dependency: transitive 345 | description: 346 | name: pub_semver 347 | url: "https://pub.dartlang.org" 348 | source: hosted 349 | version: "1.4.4" 350 | pubspec_parse: 351 | dependency: transitive 352 | description: 353 | name: pubspec_parse 354 | url: "https://pub.dartlang.org" 355 | source: hosted 356 | version: "0.1.8" 357 | quiver: 358 | dependency: transitive 359 | description: 360 | name: quiver 361 | url: "https://pub.dartlang.org" 362 | source: hosted 363 | version: "2.1.5" 364 | shelf: 365 | dependency: transitive 366 | description: 367 | name: shelf 368 | url: "https://pub.dartlang.org" 369 | source: hosted 370 | version: "0.7.9" 371 | shelf_web_socket: 372 | dependency: transitive 373 | description: 374 | name: shelf_web_socket 375 | url: "https://pub.dartlang.org" 376 | source: hosted 377 | version: "0.2.4+1" 378 | sky_engine: 379 | dependency: transitive 380 | description: flutter 381 | source: sdk 382 | version: "0.0.99" 383 | source_gen: 384 | dependency: transitive 385 | description: 386 | name: source_gen 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "0.9.10+2" 390 | source_span: 391 | dependency: transitive 392 | description: 393 | name: source_span 394 | url: "https://pub.dartlang.org" 395 | source: hosted 396 | version: "1.8.0" 397 | stack_trace: 398 | dependency: transitive 399 | description: 400 | name: stack_trace 401 | url: "https://pub.dartlang.org" 402 | source: hosted 403 | version: "1.10.0" 404 | stream_channel: 405 | dependency: transitive 406 | description: 407 | name: stream_channel 408 | url: "https://pub.dartlang.org" 409 | source: hosted 410 | version: "2.1.0" 411 | stream_transform: 412 | dependency: transitive 413 | description: 414 | name: stream_transform 415 | url: "https://pub.dartlang.org" 416 | source: hosted 417 | version: "1.2.0" 418 | string_scanner: 419 | dependency: transitive 420 | description: 421 | name: string_scanner 422 | url: "https://pub.dartlang.org" 423 | source: hosted 424 | version: "1.1.0" 425 | term_glyph: 426 | dependency: transitive 427 | description: 428 | name: term_glyph 429 | url: "https://pub.dartlang.org" 430 | source: hosted 431 | version: "1.2.0" 432 | test_api: 433 | dependency: transitive 434 | description: 435 | name: test_api 436 | url: "https://pub.dartlang.org" 437 | source: hosted 438 | version: "0.2.19" 439 | timing: 440 | dependency: transitive 441 | description: 442 | name: timing 443 | url: "https://pub.dartlang.org" 444 | source: hosted 445 | version: "0.1.1+3" 446 | typed_data: 447 | dependency: transitive 448 | description: 449 | name: typed_data 450 | url: "https://pub.dartlang.org" 451 | source: hosted 452 | version: "1.3.0" 453 | vector_math: 454 | dependency: transitive 455 | description: 456 | name: vector_math 457 | url: "https://pub.dartlang.org" 458 | source: hosted 459 | version: "2.1.0" 460 | watcher: 461 | dependency: transitive 462 | description: 463 | name: watcher 464 | url: "https://pub.dartlang.org" 465 | source: hosted 466 | version: "0.9.7+15" 467 | web_socket_channel: 468 | dependency: transitive 469 | description: 470 | name: web_socket_channel 471 | url: "https://pub.dartlang.org" 472 | source: hosted 473 | version: "1.2.0" 474 | yaml: 475 | dependency: transitive 476 | description: 477 | name: yaml 478 | url: "https://pub.dartlang.org" 479 | source: hosted 480 | version: "2.2.1" 481 | sdks: 482 | dart: ">=2.12.0 <3.0.0" 483 | flutter: ">=1.17.0" 484 | -------------------------------------------------------------------------------- /domain/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: domain 2 | description: A new Flutter package. 3 | version: 0.0.1 4 | author: GeekySingh 5 | homepage: https://github.com/GeekySingh 6 | 7 | environment: 8 | sdk: ">=2.12.0 <3.0.0" 9 | flutter: ">=1.17.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | # inversion of control 16 | get_it: ^6.0.0 17 | injectable: ^1.1.0 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | 23 | build_runner: 24 | injectable_generator: 25 | 26 | # For information on the generic Dart part of this file, see the 27 | # following page: https://dart.dev/tools/pub/pubspec 28 | 29 | # The following section is specific to Flutter. 30 | flutter: 31 | 32 | # To add assets to your package, add an assets section, like this: 33 | # assets: 34 | # - images/a_dot_burr.jpeg 35 | # - images/a_dot_ham.jpeg 36 | # 37 | # For details regarding assets in packages, see 38 | # https://flutter.dev/assets-and-images/#from-packages 39 | # 40 | # An image asset can refer to one or more resolution-specific "variants", see 41 | # https://flutter.dev/assets-and-images/#resolution-aware. 42 | 43 | # To add custom fonts to your package, add a fonts section here, 44 | # in this "flutter" section. Each entry in this list should have a 45 | # "family" key with the font family name, and a "fonts" key with a 46 | # list giving the asset and other descriptors for the font. For 47 | # example: 48 | # fonts: 49 | # - family: Schyler 50 | # fonts: 51 | # - asset: fonts/Schyler-Regular.ttf 52 | # - asset: fonts/Schyler-Italic.ttf 53 | # style: italic 54 | # - family: Trajan Pro 55 | # fonts: 56 | # - asset: fonts/TrajanPro.ttf 57 | # - asset: fonts/TrajanPro_Bold.ttf 58 | # weight: 700 59 | # 60 | # For details regarding fonts in packages, see 61 | # https://flutter.dev/custom-fonts/#from-packages 62 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - connectivity (0.0.1): 3 | - Flutter 4 | - Reachability 5 | - Flutter (1.0.0) 6 | - flutter_flexible_toast (0.0.1): 7 | - Flutter 8 | - FMDB (2.7.5): 9 | - FMDB/standard (= 2.7.5) 10 | - FMDB/standard (2.7.5) 11 | - Reachability (3.2) 12 | - sqflite (0.0.2): 13 | - Flutter 14 | - FMDB (>= 2.7.5) 15 | 16 | DEPENDENCIES: 17 | - connectivity (from `.symlinks/plugins/connectivity/ios`) 18 | - Flutter (from `Flutter`) 19 | - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) 20 | - sqflite (from `.symlinks/plugins/sqflite/ios`) 21 | 22 | SPEC REPOS: 23 | trunk: 24 | - FMDB 25 | - Reachability 26 | 27 | EXTERNAL SOURCES: 28 | connectivity: 29 | :path: ".symlinks/plugins/connectivity/ios" 30 | Flutter: 31 | :path: Flutter 32 | flutter_flexible_toast: 33 | :path: ".symlinks/plugins/flutter_flexible_toast/ios" 34 | sqflite: 35 | :path: ".symlinks/plugins/sqflite/ios" 36 | 37 | SPEC CHECKSUMS: 38 | connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 39 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c 40 | flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 41 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 42 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 43 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 44 | 45 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c 46 | 47 | COCOAPODS: 1.10.1 48 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 19C5CD6DF14A3371678EE090 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C69AA1236745A4CF039D3C40 /* Pods_Runner.framework */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 077C30F378C081E8954D2374 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 4DD7B93B4D8AFD2A62BC383D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 38 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 39 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 41 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 42 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 43 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | C69AA1236745A4CF039D3C40 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | FA95C19D45E420292C50E3AB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 19C5CD6DF14A3371678EE090 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 6C7EF6961D5769578C45A8EA /* Frameworks */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | C69AA1236745A4CF039D3C40 /* Pods_Runner.framework */, 68 | ); 69 | name = Frameworks; 70 | sourceTree = ""; 71 | }; 72 | 9740EEB11CF90186004384FC /* Flutter */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 77 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 78 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 79 | ); 80 | name = Flutter; 81 | sourceTree = ""; 82 | }; 83 | 97C146E51CF9000F007C117D = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9740EEB11CF90186004384FC /* Flutter */, 87 | 97C146F01CF9000F007C117D /* Runner */, 88 | 97C146EF1CF9000F007C117D /* Products */, 89 | A7055968AA1EEA915140F2A0 /* Pods */, 90 | 6C7EF6961D5769578C45A8EA /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 106 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 107 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 108 | 97C147021CF9000F007C117D /* Info.plist */, 109 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 110 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 111 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 112 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 113 | ); 114 | path = Runner; 115 | sourceTree = ""; 116 | }; 117 | A7055968AA1EEA915140F2A0 /* Pods */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 4DD7B93B4D8AFD2A62BC383D /* Pods-Runner.debug.xcconfig */, 121 | 077C30F378C081E8954D2374 /* Pods-Runner.release.xcconfig */, 122 | FA95C19D45E420292C50E3AB /* Pods-Runner.profile.xcconfig */, 123 | ); 124 | name = Pods; 125 | path = Pods; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | 97C146ED1CF9000F007C117D /* Runner */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 134 | buildPhases = ( 135 | D33D8EC1191E518C9CCA19B8 /* [CP] Check Pods Manifest.lock */, 136 | 9740EEB61CF901F6004384FC /* Run Script */, 137 | 97C146EA1CF9000F007C117D /* Sources */, 138 | 97C146EB1CF9000F007C117D /* Frameworks */, 139 | 97C146EC1CF9000F007C117D /* Resources */, 140 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 142 | B128E02F260A33FEB07CD2E6 /* [CP] Embed Pods Frameworks */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Runner; 149 | productName = Runner; 150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 97C146E61CF9000F007C117D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 1020; 160 | ORGANIZATIONNAME = ""; 161 | TargetAttributes = { 162 | 97C146ED1CF9000F007C117D = { 163 | CreatedOnToolsVersion = 7.3.1; 164 | LastSwiftMigration = 1100; 165 | }; 166 | }; 167 | }; 168 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 169 | compatibilityVersion = "Xcode 9.3"; 170 | developmentRegion = en; 171 | hasScannedForEncodings = 0; 172 | knownRegions = ( 173 | en, 174 | Base, 175 | ); 176 | mainGroup = 97C146E51CF9000F007C117D; 177 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 178 | projectDirPath = ""; 179 | projectRoot = ""; 180 | targets = ( 181 | 97C146ED1CF9000F007C117D /* Runner */, 182 | ); 183 | }; 184 | /* End PBXProject section */ 185 | 186 | /* Begin PBXResourcesBuildPhase section */ 187 | 97C146EC1CF9000F007C117D /* Resources */ = { 188 | isa = PBXResourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXShellScriptBuildPhase section */ 201 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 202 | isa = PBXShellScriptBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputPaths = ( 207 | ); 208 | name = "Thin Binary"; 209 | outputPaths = ( 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | shellPath = /bin/sh; 213 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 214 | }; 215 | 9740EEB61CF901F6004384FC /* Run Script */ = { 216 | isa = PBXShellScriptBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | inputPaths = ( 221 | ); 222 | name = "Run Script"; 223 | outputPaths = ( 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | shellPath = /bin/sh; 227 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 228 | }; 229 | B128E02F260A33FEB07CD2E6 /* [CP] Embed Pods Frameworks */ = { 230 | isa = PBXShellScriptBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | ); 234 | inputFileListPaths = ( 235 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 236 | ); 237 | name = "[CP] Embed Pods Frameworks"; 238 | outputFileListPaths = ( 239 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | shellPath = /bin/sh; 243 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 244 | showEnvVarsInLog = 0; 245 | }; 246 | D33D8EC1191E518C9CCA19B8 /* [CP] Check Pods Manifest.lock */ = { 247 | isa = PBXShellScriptBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | inputFileListPaths = ( 252 | ); 253 | inputPaths = ( 254 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 255 | "${PODS_ROOT}/Manifest.lock", 256 | ); 257 | name = "[CP] Check Pods Manifest.lock"; 258 | outputFileListPaths = ( 259 | ); 260 | outputPaths = ( 261 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | shellPath = /bin/sh; 265 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 266 | showEnvVarsInLog = 0; 267 | }; 268 | /* End PBXShellScriptBuildPhase section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | 97C146EA1CF9000F007C117D /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 276 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXSourcesBuildPhase section */ 281 | 282 | /* Begin PBXVariantGroup section */ 283 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 284 | isa = PBXVariantGroup; 285 | children = ( 286 | 97C146FB1CF9000F007C117D /* Base */, 287 | ); 288 | name = Main.storyboard; 289 | sourceTree = ""; 290 | }; 291 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 292 | isa = PBXVariantGroup; 293 | children = ( 294 | 97C147001CF9000F007C117D /* Base */, 295 | ); 296 | name = LaunchScreen.storyboard; 297 | sourceTree = ""; 298 | }; 299 | /* End PBXVariantGroup section */ 300 | 301 | /* Begin XCBuildConfiguration section */ 302 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 333 | ENABLE_NS_ASSERTIONS = NO; 334 | ENABLE_STRICT_OBJC_MSGSEND = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_NO_COMMON_BLOCKS = YES; 337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 339 | GCC_WARN_UNDECLARED_SELECTOR = YES; 340 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 341 | GCC_WARN_UNUSED_FUNCTION = YES; 342 | GCC_WARN_UNUSED_VARIABLE = YES; 343 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 344 | MTL_ENABLE_DEBUG_INFO = NO; 345 | SDKROOT = iphoneos; 346 | SUPPORTED_PLATFORMS = iphoneos; 347 | TARGETED_DEVICE_FAMILY = "1,2"; 348 | VALIDATE_PRODUCT = YES; 349 | }; 350 | name = Profile; 351 | }; 352 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 353 | isa = XCBuildConfiguration; 354 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 355 | buildSettings = { 356 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 357 | CLANG_ENABLE_MODULES = YES; 358 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 359 | ENABLE_BITCODE = NO; 360 | FRAMEWORK_SEARCH_PATHS = ( 361 | "$(inherited)", 362 | "$(PROJECT_DIR)/Flutter", 363 | ); 364 | INFOPLIST_FILE = Runner/Info.plist; 365 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 366 | LIBRARY_SEARCH_PATHS = ( 367 | "$(inherited)", 368 | "$(PROJECT_DIR)/Flutter", 369 | ); 370 | PRODUCT_BUNDLE_IDENTIFIER = com.geekysingh.flutterCleanArchitecture; 371 | PRODUCT_NAME = "$(TARGET_NAME)"; 372 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 373 | SWIFT_VERSION = 5.0; 374 | VERSIONING_SYSTEM = "apple-generic"; 375 | }; 376 | name = Profile; 377 | }; 378 | 97C147031CF9000F007C117D /* Debug */ = { 379 | isa = XCBuildConfiguration; 380 | buildSettings = { 381 | ALWAYS_SEARCH_USER_PATHS = NO; 382 | CLANG_ANALYZER_NONNULL = YES; 383 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 384 | CLANG_CXX_LIBRARY = "libc++"; 385 | CLANG_ENABLE_MODULES = YES; 386 | CLANG_ENABLE_OBJC_ARC = YES; 387 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 388 | CLANG_WARN_BOOL_CONVERSION = YES; 389 | CLANG_WARN_COMMA = YES; 390 | CLANG_WARN_CONSTANT_CONVERSION = YES; 391 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 392 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 393 | CLANG_WARN_EMPTY_BODY = YES; 394 | CLANG_WARN_ENUM_CONVERSION = YES; 395 | CLANG_WARN_INFINITE_RECURSION = YES; 396 | CLANG_WARN_INT_CONVERSION = YES; 397 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 398 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 399 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 400 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 401 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 402 | CLANG_WARN_STRICT_PROTOTYPES = YES; 403 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 404 | CLANG_WARN_UNREACHABLE_CODE = YES; 405 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 406 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 407 | COPY_PHASE_STRIP = NO; 408 | DEBUG_INFORMATION_FORMAT = dwarf; 409 | ENABLE_STRICT_OBJC_MSGSEND = YES; 410 | ENABLE_TESTABILITY = YES; 411 | GCC_C_LANGUAGE_STANDARD = gnu99; 412 | GCC_DYNAMIC_NO_PIC = NO; 413 | GCC_NO_COMMON_BLOCKS = YES; 414 | GCC_OPTIMIZATION_LEVEL = 0; 415 | GCC_PREPROCESSOR_DEFINITIONS = ( 416 | "DEBUG=1", 417 | "$(inherited)", 418 | ); 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 426 | MTL_ENABLE_DEBUG_INFO = YES; 427 | ONLY_ACTIVE_ARCH = YES; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | }; 431 | name = Debug; 432 | }; 433 | 97C147041CF9000F007C117D /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | ALWAYS_SEARCH_USER_PATHS = NO; 437 | CLANG_ANALYZER_NONNULL = YES; 438 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 439 | CLANG_CXX_LIBRARY = "libc++"; 440 | CLANG_ENABLE_MODULES = YES; 441 | CLANG_ENABLE_OBJC_ARC = YES; 442 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 443 | CLANG_WARN_BOOL_CONVERSION = YES; 444 | CLANG_WARN_COMMA = YES; 445 | CLANG_WARN_CONSTANT_CONVERSION = YES; 446 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 447 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 448 | CLANG_WARN_EMPTY_BODY = YES; 449 | CLANG_WARN_ENUM_CONVERSION = YES; 450 | CLANG_WARN_INFINITE_RECURSION = YES; 451 | CLANG_WARN_INT_CONVERSION = YES; 452 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 453 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 454 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 455 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 456 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 457 | CLANG_WARN_STRICT_PROTOTYPES = YES; 458 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 459 | CLANG_WARN_UNREACHABLE_CODE = YES; 460 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 461 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 462 | COPY_PHASE_STRIP = NO; 463 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 464 | ENABLE_NS_ASSERTIONS = NO; 465 | ENABLE_STRICT_OBJC_MSGSEND = YES; 466 | GCC_C_LANGUAGE_STANDARD = gnu99; 467 | GCC_NO_COMMON_BLOCKS = YES; 468 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 469 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 470 | GCC_WARN_UNDECLARED_SELECTOR = YES; 471 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 472 | GCC_WARN_UNUSED_FUNCTION = YES; 473 | GCC_WARN_UNUSED_VARIABLE = YES; 474 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 475 | MTL_ENABLE_DEBUG_INFO = NO; 476 | SDKROOT = iphoneos; 477 | SUPPORTED_PLATFORMS = iphoneos; 478 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 479 | TARGETED_DEVICE_FAMILY = "1,2"; 480 | VALIDATE_PRODUCT = YES; 481 | }; 482 | name = Release; 483 | }; 484 | 97C147061CF9000F007C117D /* Debug */ = { 485 | isa = XCBuildConfiguration; 486 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 487 | buildSettings = { 488 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 489 | CLANG_ENABLE_MODULES = YES; 490 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 491 | ENABLE_BITCODE = NO; 492 | FRAMEWORK_SEARCH_PATHS = ( 493 | "$(inherited)", 494 | "$(PROJECT_DIR)/Flutter", 495 | ); 496 | INFOPLIST_FILE = Runner/Info.plist; 497 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 498 | LIBRARY_SEARCH_PATHS = ( 499 | "$(inherited)", 500 | "$(PROJECT_DIR)/Flutter", 501 | ); 502 | PRODUCT_BUNDLE_IDENTIFIER = com.geekysingh.flutterCleanArchitecture; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 505 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 506 | SWIFT_VERSION = 5.0; 507 | VERSIONING_SYSTEM = "apple-generic"; 508 | }; 509 | name = Debug; 510 | }; 511 | 97C147071CF9000F007C117D /* Release */ = { 512 | isa = XCBuildConfiguration; 513 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 514 | buildSettings = { 515 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 516 | CLANG_ENABLE_MODULES = YES; 517 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 518 | ENABLE_BITCODE = NO; 519 | FRAMEWORK_SEARCH_PATHS = ( 520 | "$(inherited)", 521 | "$(PROJECT_DIR)/Flutter", 522 | ); 523 | INFOPLIST_FILE = Runner/Info.plist; 524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 525 | LIBRARY_SEARCH_PATHS = ( 526 | "$(inherited)", 527 | "$(PROJECT_DIR)/Flutter", 528 | ); 529 | PRODUCT_BUNDLE_IDENTIFIER = com.geekysingh.flutterCleanArchitecture; 530 | PRODUCT_NAME = "$(TARGET_NAME)"; 531 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 532 | SWIFT_VERSION = 5.0; 533 | VERSIONING_SYSTEM = "apple-generic"; 534 | }; 535 | name = Release; 536 | }; 537 | /* End XCBuildConfiguration section */ 538 | 539 | /* Begin XCConfigurationList section */ 540 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 541 | isa = XCConfigurationList; 542 | buildConfigurations = ( 543 | 97C147031CF9000F007C117D /* Debug */, 544 | 97C147041CF9000F007C117D /* Release */, 545 | 249021D3217E4FDB00AE95B9 /* Profile */, 546 | ); 547 | defaultConfigurationIsVisible = 0; 548 | defaultConfigurationName = Release; 549 | }; 550 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | 97C147061CF9000F007C117D /* Debug */, 554 | 97C147071CF9000F007C117D /* Release */, 555 | 249021D4217E4FDB00AE95B9 /* Profile */, 556 | ); 557 | defaultConfigurationIsVisible = 0; 558 | defaultConfigurationName = Release; 559 | }; 560 | /* End XCConfigurationList section */ 561 | }; 562 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 563 | } 564 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_clean_architecture 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:presentation/presentation.dart'; 4 | 5 | void main() { 6 | WidgetsFlutterBinding.ensureInitialized(); 7 | /// since main module is dependent on Core module and Feature module, 8 | /// we need to init these dependent modules here 9 | Core.init(); 10 | Presentation.init(); 11 | runApp(MyApp()); 12 | } 13 | 14 | class MyApp extends StatelessWidget { 15 | // This widget is the root of your application. 16 | 17 | final _coreRouter = Core.routeBuilder(Presentation.getFeatureRouter()); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return MaterialApp.router( 22 | title: 'Flutter Clean Architecture Sample', 23 | debugShowCheckedModeBanner: false, 24 | theme: ThemeData( 25 | primarySwatch: Colors.blue, 26 | visualDensity: VisualDensity.adaptivePlatformDensity, 27 | ), 28 | routerDelegate: _coreRouter.delegate(), 29 | routeInformationParser: _coreRouter.defaultRouteParser()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Tue Apr 06 18:26:33 IST 2021 8 | sdk.dir=/Users/gaganpreetsingh/Library/Android/sdk 9 | -------------------------------------------------------------------------------- /presentation/.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/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | -------------------------------------------------------------------------------- /presentation/.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: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /presentation/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - TODO: Add release date. 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /presentation/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /presentation/README.md: -------------------------------------------------------------------------------- 1 | # features 2 | 3 | A new Flutter package. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Dart 8 | [package](https://flutter.dev/developing-packages/), 9 | a library module containing code that can be shared easily across 10 | multiple Flutter or Dart projects. 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | -------------------------------------------------------------------------------- /presentation/assets/placeholder_image.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeekySingh/flutter_clean_architecture/1840e430863cdd144caff8194d5499837055b51f/presentation/assets/placeholder_image.jpeg -------------------------------------------------------------------------------- /presentation/lib/presentation.dart: -------------------------------------------------------------------------------- 1 | library feature; 2 | 3 | import 'package:auto_route/auto_route.dart'; 4 | import 'package:data/data.dart'; 5 | import 'package:domain/domain.dart'; 6 | import 'package:presentation/src/common/routes/router.dart'; 7 | import 'package:presentation/src/di/locator.dart'; 8 | 9 | class Presentation { 10 | static void init() { 11 | /// Feature module is dependent on Domain and Data modules, 12 | /// we need to init these two modules here 13 | Data.init(); 14 | Domain.init(); 15 | /// setup required locators for feature module 16 | setupLocator(); 17 | } 18 | 19 | /// Returns router information for features 20 | /// This information will be used by core module (in main app) 21 | /// to setup router 22 | static RootStackRouter getFeatureRouter() => FeatureRouter(); 23 | } -------------------------------------------------------------------------------- /presentation/lib/src/common/constants/app_strings.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | abstract class AppStrings { 4 | 5 | static const login = 'Login'; 6 | static const userName = 'Username'; 7 | static const password = 'Password'; 8 | 9 | static const articleList = 'Article List'; 10 | static const articleDetail = 'Article Detail'; 11 | static const publishedOn = 'Published on'; 12 | static const readFullStory = 'Read full story >'; 13 | } -------------------------------------------------------------------------------- /presentation/lib/src/common/constants/assets.dart: -------------------------------------------------------------------------------- 1 | 2 | abstract class Assets { 3 | static const placeholder = 'assets/placeholder_image.jpeg'; 4 | } -------------------------------------------------------------------------------- /presentation/lib/src/common/routes/router.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/annotations.dart'; 2 | import 'package:presentation/src/features/articles/details/article_detail_screen.dart'; 3 | import 'package:presentation/src/features/articles/list/article_list_screen.dart'; 4 | import 'package:presentation/src/features/login/login_screen.dart'; 5 | 6 | export 'router.gr.dart'; 7 | 8 | @MaterialAutoRouter(routes: [ 9 | AutoRoute(page: LoginScreen, initial: true), 10 | AutoRoute(page: ArticleListScreen), 11 | AutoRoute(page: ArticleDetailScreen) 12 | ]) 13 | class $FeatureRouter {} 14 | -------------------------------------------------------------------------------- /presentation/lib/src/common/routes/router.gr.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // AutoRouteGenerator 5 | // ************************************************************************** 6 | 7 | import 'package:auto_route/auto_route.dart' as _i1; 8 | 9 | import '../../features/articles/details/article_detail_screen.dart' as _i4; 10 | import '../../features/articles/list/article_list_screen.dart' as _i3; 11 | import '../../features/login/login_screen.dart' as _i2; 12 | 13 | class FeatureRouter extends _i1.RootStackRouter { 14 | FeatureRouter(); 15 | 16 | @override 17 | final Map pagesMap = { 18 | LoginScreenRoute.name: (entry) { 19 | return _i1.MaterialPageX(entry: entry, child: _i2.LoginScreen()); 20 | }, 21 | ArticleListScreenRoute.name: (entry) { 22 | return _i1.MaterialPageX(entry: entry, child: _i3.ArticleListScreen()); 23 | }, 24 | ArticleDetailScreenRoute.name: (entry) { 25 | var args = entry.routeData.argsAs(); 26 | return _i1.MaterialPageX( 27 | entry: entry, child: _i4.ArticleDetailScreen(id: args.id)); 28 | } 29 | }; 30 | 31 | @override 32 | List<_i1.RouteConfig> get routes => [ 33 | _i1.RouteConfig(LoginScreenRoute.name, path: '/'), 34 | _i1.RouteConfig(ArticleListScreenRoute.name, 35 | path: '/article-list-screen'), 36 | _i1.RouteConfig(ArticleDetailScreenRoute.name, 37 | path: '/article-detail-screen') 38 | ]; 39 | } 40 | 41 | class LoginScreenRoute extends _i1.PageRouteInfo { 42 | const LoginScreenRoute() : super(name, path: '/'); 43 | 44 | static const String name = 'LoginScreenRoute'; 45 | } 46 | 47 | class ArticleListScreenRoute extends _i1.PageRouteInfo { 48 | const ArticleListScreenRoute() : super(name, path: '/article-list-screen'); 49 | 50 | static const String name = 'ArticleListScreenRoute'; 51 | } 52 | 53 | class ArticleDetailScreenRoute 54 | extends _i1.PageRouteInfo { 55 | ArticleDetailScreenRoute({required int id}) 56 | : super(name, 57 | path: '/article-detail-screen', 58 | args: ArticleDetailScreenRouteArgs(id: id)); 59 | 60 | static const String name = 'ArticleDetailScreenRoute'; 61 | } 62 | 63 | class ArticleDetailScreenRouteArgs { 64 | const ArticleDetailScreenRouteArgs({required this.id}); 65 | 66 | final int id; 67 | } 68 | -------------------------------------------------------------------------------- /presentation/lib/src/di/locator.config.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // InjectableConfigGenerator 5 | // ************************************************************************** 6 | 7 | import 'package:core/service/toast_service.dart' as _i6; 8 | import 'package:domain/domain.dart' as _i4; 9 | import 'package:get_it/get_it.dart' as _i1; 10 | import 'package:injectable/injectable.dart' as _i2; 11 | 12 | import '../features/articles/details/article_detail_view_model.dart' as _i3; 13 | import '../features/articles/list/article_list_view_model.dart' as _i5; 14 | import '../features/login/login_view_model.dart' 15 | as _i7; // ignore_for_file: unnecessary_lambdas 16 | 17 | // ignore_for_file: lines_longer_than_80_chars 18 | /// initializes the registration of provided dependencies inside of [GetIt] 19 | _i1.GetIt $initGetIt(_i1.GetIt get, 20 | {String? environment, _i2.EnvironmentFilter? environmentFilter}) { 21 | final gh = _i2.GetItHelper(get, environment, environmentFilter); 22 | gh.factory<_i3.ArticleDetailViewModel>( 23 | () => _i3.ArticleDetailViewModel(get<_i4.GetArticleByIdUseCase>())); 24 | gh.factory<_i5.ArticleListViewModel>(() => _i5.ArticleListViewModel( 25 | get<_i4.GetAllArticleUseCase>(), get<_i6.ToastService>())); 26 | gh.factory<_i7.LoginViewModel>(() => _i7.LoginViewModel()); 27 | return get; 28 | } 29 | -------------------------------------------------------------------------------- /presentation/lib/src/di/locator.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:get_it/get_it.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | 5 | import 'locator.config.dart'; 6 | 7 | final locator = GetIt.instance..allowReassignment = true; 8 | 9 | @injectableInit 10 | void setupLocator() { 11 | _init(locator); 12 | $initGetIt(locator); 13 | } 14 | 15 | void _init(GetIt locator) { 16 | 17 | } -------------------------------------------------------------------------------- /presentation/lib/src/features/articles/details/article_detail_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core/core_screen.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:presentation/src/common/constants/app_strings.dart'; 5 | import 'package:presentation/src/common/constants/assets.dart'; 6 | 7 | import '../../../di/locator.dart'; 8 | import 'article_detail_view_model.dart'; 9 | 10 | class ArticleDetailScreen extends CoreScreen { 11 | final int id; 12 | 13 | ArticleDetailScreen({required this.id}); 14 | 15 | @override 16 | Widget builder( 17 | BuildContext context, ArticleDetailViewModel viewModel, Widget? child) { 18 | return Scaffold( 19 | appBar: AppBar(title: Text(AppStrings.articleDetail)), 20 | body: _buildBody(context, viewModel)); 21 | } 22 | 23 | Widget _buildBody(BuildContext context, ArticleDetailViewModel viewModel) { 24 | if (viewModel.isBusy) { 25 | return Center(child: CircularProgressIndicator()); 26 | } else if (viewModel.hasError) { 27 | return Center(child: Text(viewModel.errorMsg)); 28 | } else { 29 | return SingleChildScrollView( 30 | child: Column( 31 | crossAxisAlignment: CrossAxisAlignment.stretch, 32 | children: [ 33 | FadeInImage(image: NetworkImage(viewModel.articleModel.imageUrl), placeholder: AssetImage(Assets.placeholder), 34 | height: 300, fit: BoxFit.cover), 35 | Padding( 36 | padding: EdgeInsets.all(20), 37 | child: Text(viewModel.articleModel.title, 38 | style: TextStyle( 39 | fontSize: 22, color: Theme.of(context).accentColor))), 40 | Padding( 41 | padding: EdgeInsets.fromLTRB(20, 0, 20, 20), 42 | child: Text(viewModel.articleModel.description, 43 | style: TextStyle(fontSize: 20))), 44 | Padding( 45 | padding: EdgeInsets.only(right: 20), 46 | child: Align( 47 | child: Text( 48 | "${AppStrings.publishedOn} ${viewModel.articleModel.date}"), 49 | alignment: Alignment.centerRight)), 50 | Padding( 51 | padding: EdgeInsets.all(20), 52 | child: TextButton( 53 | child: Text(AppStrings.readFullStory, 54 | style: TextStyle(fontSize: 16, color: Theme.of(context).accentColor), textAlign: TextAlign.end), 55 | onPressed: () => {}, 56 | )), 57 | ], 58 | )); 59 | } 60 | } 61 | 62 | @override 63 | ArticleDetailViewModel viewModelBuilder(BuildContext context) => 64 | locator()..getArticleDetails(id); 65 | } 66 | -------------------------------------------------------------------------------- /presentation/lib/src/features/articles/details/article_detail_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core/core_view_model.dart'; 2 | import 'package:domain/domain.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | 5 | @Injectable() 6 | class ArticleDetailViewModel extends CoreViewModel { 7 | 8 | final GetArticleByIdUseCase _articleByIdUseCase; 9 | 10 | ArticleDetailViewModel(this._articleByIdUseCase); 11 | 12 | late String _errorMsg; 13 | String get errorMsg => _errorMsg; 14 | 15 | late ArticleModel _articleModel; 16 | ArticleModel get articleModel => _articleModel; 17 | 18 | void getArticleDetails(int id) async { 19 | loading(); 20 | 21 | final result = await _articleByIdUseCase.getArticle(id); 22 | result.when( 23 | success: (article) => _articleModel = article, 24 | error: (type, message) => _errorMsg = message); 25 | 26 | loaded(result.isSuccessful); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /presentation/lib/src/features/articles/list/article_list_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core/core_screen.dart'; 2 | import 'package:domain/domain.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | import 'package:presentation/src/common/constants/app_strings.dart'; 6 | 7 | import '../../../di/locator.dart'; 8 | import 'article_list_view_model.dart'; 9 | 10 | class ArticleListScreen extends CoreScreen { 11 | @override 12 | Widget builder( 13 | BuildContext context, ArticleListViewModel viewModel, Widget? child) { 14 | return Scaffold( 15 | appBar: AppBar(title: Text(AppStrings.articleList)), 16 | body: _buildBody(context, viewModel), 17 | floatingActionButton: Visibility( 18 | visible: !viewModel.isBusy, 19 | child: FloatingActionButton( 20 | onPressed: () => viewModel.loadArticles(), 21 | child: Icon(Icons.refresh), 22 | ), 23 | ), 24 | ); 25 | } 26 | 27 | Widget _buildBody(BuildContext context, ArticleListViewModel viewModel) { 28 | if (viewModel.isBusy) { 29 | return Center(child: CircularProgressIndicator()); 30 | } else if (viewModel.hasError) { 31 | return Center(child: Text(viewModel.errorMsg)); 32 | } else { 33 | return ListView.builder( 34 | itemCount: viewModel.articleList.length, 35 | itemBuilder: (context, index) => _buildListViewItem( 36 | context, viewModel, viewModel.articleList[index])); 37 | } 38 | } 39 | 40 | Widget _buildListViewItem(BuildContext context, 41 | ArticleListViewModel viewModel, ArticleModel model) { 42 | return ListTile( 43 | isThreeLine: true, 44 | subtitle: Text(model.date, textDirection: TextDirection.rtl), 45 | contentPadding: EdgeInsets.all(10), 46 | title: Text(model.title, style: TextStyle(fontSize: 18)), 47 | leading: CircleAvatar(backgroundImage: NetworkImage(model.imageUrl), radius: 40), 48 | onTap: () => viewModel.onArticleItemClicked(model.id), 49 | ); 50 | } 51 | 52 | @override 53 | ArticleListViewModel viewModelBuilder(BuildContext context) => 54 | locator(); 55 | } 56 | -------------------------------------------------------------------------------- /presentation/lib/src/features/articles/list/article_list_view_model.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:core/core/core_view_model.dart'; 3 | import 'package:core/service/toast_service.dart'; 4 | import 'package:domain/domain.dart'; 5 | import 'package:injectable/injectable.dart'; 6 | import 'package:presentation/src/common/routes/router.dart'; 7 | 8 | @injectable 9 | class ArticleListViewModel extends CoreViewModel { 10 | 11 | final GetAllArticleUseCase _allArticleUseCase; 12 | final ToastService _toastService; 13 | 14 | ArticleListViewModel(this._allArticleUseCase, this._toastService) { 15 | loadArticles(); 16 | } 17 | 18 | late List _articleList; 19 | List get articleList => _articleList; 20 | 21 | late String _errorMsg; 22 | String get errorMsg => _errorMsg; 23 | 24 | void loadArticles() async { 25 | loading(); 26 | 27 | final result = await _allArticleUseCase.getArticles(); 28 | result.when( 29 | success: (data) => _articleList = data, 30 | error: (errorType, message) => _errorMsg = message, 31 | ); 32 | 33 | loaded(result.isSuccessful); 34 | if(result.isSuccessful) { 35 | _toastService.show("Data fetched!"); 36 | } 37 | } 38 | 39 | void onArticleItemClicked(int id) { 40 | navigationService.push(ArticleDetailScreenRoute(id: id)); 41 | } 42 | } -------------------------------------------------------------------------------- /presentation/lib/src/features/login/login_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:core/core/core_screen.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:presentation/src/common/constants/app_strings.dart'; 5 | 6 | import '../../di/locator.dart'; 7 | import 'login_view_model.dart'; 8 | 9 | class LoginScreen extends CoreScreen { 10 | @override 11 | Widget builder(BuildContext context, LoginViewModel viewModel, Widget? child) { 12 | return Scaffold( 13 | appBar: AppBar(title: Text(AppStrings.login)), 14 | body: _buildBody(context, viewModel)); 15 | } 16 | 17 | Widget _buildBody(BuildContext context, LoginViewModel viewModel) { 18 | return Padding( 19 | padding: EdgeInsets.all(20), 20 | child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ 21 | TextField( 22 | decoration: InputDecoration( 23 | border: OutlineInputBorder(), 24 | labelText: AppStrings.userName, 25 | )), 26 | SizedBox(height: 20), 27 | TextField( 28 | obscureText: true, 29 | decoration: InputDecoration( 30 | border: OutlineInputBorder(), 31 | labelText: AppStrings.password, 32 | )), 33 | SizedBox(height: 20), 34 | RaisedButton( 35 | child: Text(AppStrings.login), 36 | onPressed: () => viewModel.onLoginButtonPressed()) 37 | ])); 38 | } 39 | 40 | @override 41 | LoginViewModel viewModelBuilder(BuildContext context) => 42 | locator(); 43 | } 44 | -------------------------------------------------------------------------------- /presentation/lib/src/features/login/login_view_model.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:core/core/core_view_model.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | import 'package:presentation/src/common/routes/router.dart'; 5 | 6 | @Injectable() 7 | class LoginViewModel extends CoreViewModel { 8 | 9 | void onLoginButtonPressed() { 10 | navigationService.push(ArticleListScreenRoute()); 11 | } 12 | } -------------------------------------------------------------------------------- /presentation/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "20.0.0" 11 | adaptive_dialog: 12 | dependency: transitive 13 | description: 14 | name: adaptive_dialog 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.10.0+5" 18 | analyzer: 19 | dependency: transitive 20 | description: 21 | name: analyzer 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.4.0" 25 | animations: 26 | dependency: transitive 27 | description: 28 | name: animations 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.0.0" 32 | args: 33 | dependency: transitive 34 | description: 35 | name: args 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.6.0" 39 | async: 40 | dependency: transitive 41 | description: 42 | name: async 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.5.0" 46 | auto_route: 47 | dependency: "direct main" 48 | description: 49 | name: auto_route 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.2" 53 | auto_route_generator: 54 | dependency: "direct dev" 55 | description: 56 | name: auto_route_generator 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.0.2" 60 | boolean_selector: 61 | dependency: transitive 62 | description: 63 | name: boolean_selector 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.0" 67 | build: 68 | dependency: transitive 69 | description: 70 | name: build 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.0.0" 74 | build_config: 75 | dependency: transitive 76 | description: 77 | name: build_config 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.4.7" 81 | build_daemon: 82 | dependency: transitive 83 | description: 84 | name: build_daemon 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "2.1.7" 88 | build_resolvers: 89 | dependency: transitive 90 | description: 91 | name: build_resolvers 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "2.0.0" 95 | build_runner: 96 | dependency: "direct dev" 97 | description: 98 | name: build_runner 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "1.12.2" 102 | build_runner_core: 103 | dependency: transitive 104 | description: 105 | name: build_runner_core 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "6.1.12" 109 | built_collection: 110 | dependency: transitive 111 | description: 112 | name: built_collection 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "4.3.2" 116 | built_value: 117 | dependency: transitive 118 | description: 119 | name: built_value 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "7.1.0" 123 | characters: 124 | dependency: transitive 125 | description: 126 | name: characters 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.1.0" 130 | charcode: 131 | dependency: transitive 132 | description: 133 | name: charcode 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.2.0" 137 | checked_yaml: 138 | dependency: transitive 139 | description: 140 | name: checked_yaml 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "2.0.1" 144 | cli_util: 145 | dependency: transitive 146 | description: 147 | name: cli_util 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "0.3.0" 151 | clock: 152 | dependency: transitive 153 | description: 154 | name: clock 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "1.1.0" 158 | code_builder: 159 | dependency: transitive 160 | description: 161 | name: code_builder 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "3.7.0" 165 | collection: 166 | dependency: transitive 167 | description: 168 | name: collection 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "1.15.0" 172 | connectivity: 173 | dependency: transitive 174 | description: 175 | name: connectivity 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "2.0.2" 179 | connectivity_for_web: 180 | dependency: transitive 181 | description: 182 | name: connectivity_for_web 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "0.3.1+4" 186 | connectivity_macos: 187 | dependency: transitive 188 | description: 189 | name: connectivity_macos 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "0.1.0+7" 193 | connectivity_platform_interface: 194 | dependency: transitive 195 | description: 196 | name: connectivity_platform_interface 197 | url: "https://pub.dartlang.org" 198 | source: hosted 199 | version: "1.0.6" 200 | convert: 201 | dependency: transitive 202 | description: 203 | name: convert 204 | url: "https://pub.dartlang.org" 205 | source: hosted 206 | version: "3.0.0" 207 | core: 208 | dependency: "direct main" 209 | description: 210 | path: "../core" 211 | relative: true 212 | source: path 213 | version: "0.0.1" 214 | crypto: 215 | dependency: transitive 216 | description: 217 | name: crypto 218 | url: "https://pub.dartlang.org" 219 | source: hosted 220 | version: "3.0.1" 221 | dart_style: 222 | dependency: transitive 223 | description: 224 | name: dart_style 225 | url: "https://pub.dartlang.org" 226 | source: hosted 227 | version: "2.0.0" 228 | data: 229 | dependency: "direct main" 230 | description: 231 | path: "../data" 232 | relative: true 233 | source: path 234 | version: "0.0.1" 235 | dio: 236 | dependency: transitive 237 | description: 238 | name: dio 239 | url: "https://pub.dartlang.org" 240 | source: hosted 241 | version: "4.0.0" 242 | domain: 243 | dependency: "direct main" 244 | description: 245 | path: "../domain" 246 | relative: true 247 | source: path 248 | version: "0.0.1" 249 | fake_async: 250 | dependency: transitive 251 | description: 252 | name: fake_async 253 | url: "https://pub.dartlang.org" 254 | source: hosted 255 | version: "1.2.0" 256 | ffi: 257 | dependency: transitive 258 | description: 259 | name: ffi 260 | url: "https://pub.dartlang.org" 261 | source: hosted 262 | version: "1.0.0" 263 | file: 264 | dependency: transitive 265 | description: 266 | name: file 267 | url: "https://pub.dartlang.org" 268 | source: hosted 269 | version: "6.1.0" 270 | fixnum: 271 | dependency: transitive 272 | description: 273 | name: fixnum 274 | url: "https://pub.dartlang.org" 275 | source: hosted 276 | version: "0.10.11" 277 | floor: 278 | dependency: transitive 279 | description: 280 | name: floor 281 | url: "https://pub.dartlang.org" 282 | source: hosted 283 | version: "1.0.1" 284 | floor_annotation: 285 | dependency: transitive 286 | description: 287 | name: floor_annotation 288 | url: "https://pub.dartlang.org" 289 | source: hosted 290 | version: "1.0.0" 291 | flutter: 292 | dependency: "direct main" 293 | description: flutter 294 | source: sdk 295 | version: "0.0.0" 296 | flutter_flexible_toast: 297 | dependency: transitive 298 | description: 299 | name: flutter_flexible_toast 300 | url: "https://pub.dartlang.org" 301 | source: hosted 302 | version: "0.1.4" 303 | flutter_test: 304 | dependency: "direct dev" 305 | description: flutter 306 | source: sdk 307 | version: "0.0.0" 308 | flutter_web_plugins: 309 | dependency: transitive 310 | description: flutter 311 | source: sdk 312 | version: "0.0.0" 313 | get_it: 314 | dependency: "direct main" 315 | description: 316 | name: get_it 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "6.0.0" 320 | glob: 321 | dependency: transitive 322 | description: 323 | name: glob 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "2.0.1" 327 | graphs: 328 | dependency: transitive 329 | description: 330 | name: graphs 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "1.0.0" 334 | http_multi_server: 335 | dependency: transitive 336 | description: 337 | name: http_multi_server 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "2.2.0" 341 | http_parser: 342 | dependency: transitive 343 | description: 344 | name: http_parser 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "4.0.0" 348 | injectable: 349 | dependency: "direct main" 350 | description: 351 | name: injectable 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "1.2.2" 355 | injectable_generator: 356 | dependency: "direct dev" 357 | description: 358 | name: injectable_generator 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "1.2.2" 362 | io: 363 | dependency: transitive 364 | description: 365 | name: io 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "0.3.5" 369 | js: 370 | dependency: transitive 371 | description: 372 | name: js 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "0.6.3" 376 | json_annotation: 377 | dependency: transitive 378 | description: 379 | name: json_annotation 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "4.0.1" 383 | logger: 384 | dependency: transitive 385 | description: 386 | name: logger 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "1.0.0" 390 | logging: 391 | dependency: transitive 392 | description: 393 | name: logging 394 | url: "https://pub.dartlang.org" 395 | source: hosted 396 | version: "1.0.1" 397 | matcher: 398 | dependency: transitive 399 | description: 400 | name: matcher 401 | url: "https://pub.dartlang.org" 402 | source: hosted 403 | version: "0.12.10" 404 | meta: 405 | dependency: transitive 406 | description: 407 | name: meta 408 | url: "https://pub.dartlang.org" 409 | source: hosted 410 | version: "1.3.0" 411 | mime: 412 | dependency: transitive 413 | description: 414 | name: mime 415 | url: "https://pub.dartlang.org" 416 | source: hosted 417 | version: "0.9.7" 418 | nested: 419 | dependency: transitive 420 | description: 421 | name: nested 422 | url: "https://pub.dartlang.org" 423 | source: hosted 424 | version: "1.0.0" 425 | package_config: 426 | dependency: transitive 427 | description: 428 | name: package_config 429 | url: "https://pub.dartlang.org" 430 | source: hosted 431 | version: "2.0.0" 432 | path: 433 | dependency: transitive 434 | description: 435 | name: path 436 | url: "https://pub.dartlang.org" 437 | source: hosted 438 | version: "1.8.0" 439 | pedantic: 440 | dependency: transitive 441 | description: 442 | name: pedantic 443 | url: "https://pub.dartlang.org" 444 | source: hosted 445 | version: "1.11.0" 446 | plugin_platform_interface: 447 | dependency: transitive 448 | description: 449 | name: plugin_platform_interface 450 | url: "https://pub.dartlang.org" 451 | source: hosted 452 | version: "1.0.3" 453 | pool: 454 | dependency: transitive 455 | description: 456 | name: pool 457 | url: "https://pub.dartlang.org" 458 | source: hosted 459 | version: "1.5.0" 460 | provider: 461 | dependency: transitive 462 | description: 463 | name: provider 464 | url: "https://pub.dartlang.org" 465 | source: hosted 466 | version: "5.0.0" 467 | pub_semver: 468 | dependency: transitive 469 | description: 470 | name: pub_semver 471 | url: "https://pub.dartlang.org" 472 | source: hosted 473 | version: "2.0.0" 474 | pubspec_parse: 475 | dependency: transitive 476 | description: 477 | name: pubspec_parse 478 | url: "https://pub.dartlang.org" 479 | source: hosted 480 | version: "1.0.0" 481 | quiver: 482 | dependency: transitive 483 | description: 484 | name: quiver 485 | url: "https://pub.dartlang.org" 486 | source: hosted 487 | version: "2.1.5" 488 | retrofit: 489 | dependency: transitive 490 | description: 491 | name: retrofit 492 | url: "https://pub.dartlang.org" 493 | source: hosted 494 | version: "2.0.0-beta1" 495 | shelf: 496 | dependency: transitive 497 | description: 498 | name: shelf 499 | url: "https://pub.dartlang.org" 500 | source: hosted 501 | version: "1.1.0" 502 | shelf_web_socket: 503 | dependency: transitive 504 | description: 505 | name: shelf_web_socket 506 | url: "https://pub.dartlang.org" 507 | source: hosted 508 | version: "0.2.4+1" 509 | sky_engine: 510 | dependency: transitive 511 | description: flutter 512 | source: sdk 513 | version: "0.0.99" 514 | source_gen: 515 | dependency: transitive 516 | description: 517 | name: source_gen 518 | url: "https://pub.dartlang.org" 519 | source: hosted 520 | version: "1.0.0" 521 | source_span: 522 | dependency: transitive 523 | description: 524 | name: source_span 525 | url: "https://pub.dartlang.org" 526 | source: hosted 527 | version: "1.8.0" 528 | sqflite: 529 | dependency: transitive 530 | description: 531 | name: sqflite 532 | url: "https://pub.dartlang.org" 533 | source: hosted 534 | version: "2.0.0+3" 535 | sqflite_common: 536 | dependency: transitive 537 | description: 538 | name: sqflite_common 539 | url: "https://pub.dartlang.org" 540 | source: hosted 541 | version: "2.0.0+2" 542 | sqflite_common_ffi: 543 | dependency: transitive 544 | description: 545 | name: sqflite_common_ffi 546 | url: "https://pub.dartlang.org" 547 | source: hosted 548 | version: "2.0.0" 549 | sqlite3: 550 | dependency: transitive 551 | description: 552 | name: sqlite3 553 | url: "https://pub.dartlang.org" 554 | source: hosted 555 | version: "1.0.0" 556 | stack_trace: 557 | dependency: transitive 558 | description: 559 | name: stack_trace 560 | url: "https://pub.dartlang.org" 561 | source: hosted 562 | version: "1.10.0" 563 | stacked: 564 | dependency: transitive 565 | description: 566 | name: stacked 567 | url: "https://pub.dartlang.org" 568 | source: hosted 569 | version: "2.0.2" 570 | stream_channel: 571 | dependency: transitive 572 | description: 573 | name: stream_channel 574 | url: "https://pub.dartlang.org" 575 | source: hosted 576 | version: "2.1.0" 577 | stream_transform: 578 | dependency: transitive 579 | description: 580 | name: stream_transform 581 | url: "https://pub.dartlang.org" 582 | source: hosted 583 | version: "2.0.0" 584 | string_scanner: 585 | dependency: transitive 586 | description: 587 | name: string_scanner 588 | url: "https://pub.dartlang.org" 589 | source: hosted 590 | version: "1.1.0" 591 | synchronized: 592 | dependency: transitive 593 | description: 594 | name: synchronized 595 | url: "https://pub.dartlang.org" 596 | source: hosted 597 | version: "3.0.0" 598 | term_glyph: 599 | dependency: transitive 600 | description: 601 | name: term_glyph 602 | url: "https://pub.dartlang.org" 603 | source: hosted 604 | version: "1.2.0" 605 | test_api: 606 | dependency: transitive 607 | description: 608 | name: test_api 609 | url: "https://pub.dartlang.org" 610 | source: hosted 611 | version: "0.2.19" 612 | timing: 613 | dependency: transitive 614 | description: 615 | name: timing 616 | url: "https://pub.dartlang.org" 617 | source: hosted 618 | version: "0.1.1+3" 619 | typed_data: 620 | dependency: transitive 621 | description: 622 | name: typed_data 623 | url: "https://pub.dartlang.org" 624 | source: hosted 625 | version: "1.3.0" 626 | vector_math: 627 | dependency: transitive 628 | description: 629 | name: vector_math 630 | url: "https://pub.dartlang.org" 631 | source: hosted 632 | version: "2.1.0" 633 | watcher: 634 | dependency: transitive 635 | description: 636 | name: watcher 637 | url: "https://pub.dartlang.org" 638 | source: hosted 639 | version: "1.0.0" 640 | web_socket_channel: 641 | dependency: transitive 642 | description: 643 | name: web_socket_channel 644 | url: "https://pub.dartlang.org" 645 | source: hosted 646 | version: "1.2.0" 647 | yaml: 648 | dependency: transitive 649 | description: 650 | name: yaml 651 | url: "https://pub.dartlang.org" 652 | source: hosted 653 | version: "3.1.0" 654 | sdks: 655 | dart: ">=2.12.0 <3.0.0" 656 | flutter: ">=1.24.0-10" 657 | -------------------------------------------------------------------------------- /presentation/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: presentation 2 | description: A new Flutter package. 3 | version: 0.0.1 4 | author: GeekySingh 5 | homepage: https://github.com/GeekySingh 6 | publish_to: none 7 | 8 | environment: 9 | sdk: ">=2.12.0 <3.0.0" 10 | flutter: ">=1.17.0" 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | 16 | core: 17 | path: ../core 18 | data: 19 | path: ../data 20 | domain: 21 | path: ../domain 22 | 23 | # inversion of control 24 | get_it: ^6.0.0 25 | injectable: ^1.2.2 26 | # navigation 27 | auto_route: ^1.0.2 28 | 29 | dev_dependencies: 30 | flutter_test: 31 | sdk: flutter 32 | 33 | build_runner: 34 | injectable_generator: 35 | auto_route_generator: ^1.0.2 36 | 37 | # For information on the generic Dart part of this file, see the 38 | # following page: https://dart.dev/tools/pub/pubspec 39 | 40 | # The following section is specific to Flutter. 41 | flutter: 42 | assets: 43 | - assets/placeholder_image.jpeg 44 | 45 | # To add assets to your package, add an assets section, like this: 46 | # assets: 47 | # - images/a_dot_burr.jpeg 48 | # - images/a_dot_ham.jpeg 49 | # 50 | # For details regarding assets in packages, see 51 | # https://flutter.dev/assets-and-images/#from-packages 52 | # 53 | # An image asset can refer to one or more resolution-specific "variants", see 54 | # https://flutter.dev/assets-and-images/#resolution-aware. 55 | 56 | # To add custom fonts to your package, add a fonts section here, 57 | # in this "flutter" section. Each entry in this list should have a 58 | # "family" key with the font family name, and a "fonts" key with a 59 | # list giving the asset and other descriptors for the font. For 60 | # example: 61 | # fonts: 62 | # - family: Schyler 63 | # fonts: 64 | # - asset: fonts/Schyler-Regular.ttf 65 | # - asset: fonts/Schyler-Italic.ttf 66 | # style: italic 67 | # - family: Trajan Pro 68 | # fonts: 69 | # - asset: fonts/TrajanPro.ttf 70 | # - asset: fonts/TrajanPro_Bold.ttf 71 | # weight: 700 72 | # 73 | # For details regarding fonts in packages, see 74 | # https://flutter.dev/custom-fonts/#from-packages 75 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | adaptive_dialog: 5 | dependency: transitive 6 | description: 7 | name: adaptive_dialog 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.10.0+5" 11 | animations: 12 | dependency: transitive 13 | description: 14 | name: animations 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.0.0" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.5.0" 25 | auto_route: 26 | dependency: transitive 27 | description: 28 | name: auto_route 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.2" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.1.0" 39 | characters: 40 | dependency: transitive 41 | description: 42 | name: characters 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0" 46 | charcode: 47 | dependency: transitive 48 | description: 49 | name: charcode 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.2.0" 53 | clock: 54 | dependency: transitive 55 | description: 56 | name: clock 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.1.0" 60 | collection: 61 | dependency: transitive 62 | description: 63 | name: collection 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.15.0" 67 | connectivity: 68 | dependency: transitive 69 | description: 70 | name: connectivity 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.0.2" 74 | connectivity_for_web: 75 | dependency: transitive 76 | description: 77 | name: connectivity_for_web 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.3.1+4" 81 | connectivity_macos: 82 | dependency: transitive 83 | description: 84 | name: connectivity_macos 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "0.1.0+7" 88 | connectivity_platform_interface: 89 | dependency: transitive 90 | description: 91 | name: connectivity_platform_interface 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "1.0.6" 95 | core: 96 | dependency: "direct main" 97 | description: 98 | path: core 99 | relative: true 100 | source: path 101 | version: "0.0.1" 102 | cupertino_icons: 103 | dependency: "direct main" 104 | description: 105 | name: cupertino_icons 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.0.0" 109 | data: 110 | dependency: transitive 111 | description: 112 | path: data 113 | relative: true 114 | source: path 115 | version: "0.0.1" 116 | dio: 117 | dependency: transitive 118 | description: 119 | name: dio 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "4.0.0" 123 | domain: 124 | dependency: transitive 125 | description: 126 | path: domain 127 | relative: true 128 | source: path 129 | version: "0.0.1" 130 | fake_async: 131 | dependency: transitive 132 | description: 133 | name: fake_async 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.2.0" 137 | ffi: 138 | dependency: transitive 139 | description: 140 | name: ffi 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "1.0.0" 144 | floor: 145 | dependency: transitive 146 | description: 147 | name: floor 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "1.0.1" 151 | floor_annotation: 152 | dependency: transitive 153 | description: 154 | name: floor_annotation 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "1.0.0" 158 | flutter: 159 | dependency: "direct main" 160 | description: flutter 161 | source: sdk 162 | version: "0.0.0" 163 | flutter_flexible_toast: 164 | dependency: transitive 165 | description: 166 | name: flutter_flexible_toast 167 | url: "https://pub.dartlang.org" 168 | source: hosted 169 | version: "0.1.4" 170 | flutter_test: 171 | dependency: "direct dev" 172 | description: flutter 173 | source: sdk 174 | version: "0.0.0" 175 | flutter_web_plugins: 176 | dependency: transitive 177 | description: flutter 178 | source: sdk 179 | version: "0.0.0" 180 | get_it: 181 | dependency: transitive 182 | description: 183 | name: get_it 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "6.0.0" 187 | http_parser: 188 | dependency: transitive 189 | description: 190 | name: http_parser 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "4.0.0" 194 | injectable: 195 | dependency: transitive 196 | description: 197 | name: injectable 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "1.2.2" 201 | js: 202 | dependency: transitive 203 | description: 204 | name: js 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "0.6.3" 208 | json_annotation: 209 | dependency: transitive 210 | description: 211 | name: json_annotation 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "4.0.1" 215 | logger: 216 | dependency: transitive 217 | description: 218 | name: logger 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.0.0" 222 | matcher: 223 | dependency: transitive 224 | description: 225 | name: matcher 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "0.12.10" 229 | meta: 230 | dependency: transitive 231 | description: 232 | name: meta 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "1.3.0" 236 | nested: 237 | dependency: transitive 238 | description: 239 | name: nested 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "1.0.0" 243 | path: 244 | dependency: transitive 245 | description: 246 | name: path 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "1.8.0" 250 | plugin_platform_interface: 251 | dependency: transitive 252 | description: 253 | name: plugin_platform_interface 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "1.0.3" 257 | presentation: 258 | dependency: "direct main" 259 | description: 260 | path: presentation 261 | relative: true 262 | source: path 263 | version: "0.0.1" 264 | provider: 265 | dependency: transitive 266 | description: 267 | name: provider 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "5.0.0" 271 | retrofit: 272 | dependency: transitive 273 | description: 274 | name: retrofit 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "2.0.0-beta1" 278 | sky_engine: 279 | dependency: transitive 280 | description: flutter 281 | source: sdk 282 | version: "0.0.99" 283 | source_span: 284 | dependency: transitive 285 | description: 286 | name: source_span 287 | url: "https://pub.dartlang.org" 288 | source: hosted 289 | version: "1.8.0" 290 | sqflite: 291 | dependency: transitive 292 | description: 293 | name: sqflite 294 | url: "https://pub.dartlang.org" 295 | source: hosted 296 | version: "2.0.0+3" 297 | sqflite_common: 298 | dependency: transitive 299 | description: 300 | name: sqflite_common 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "2.0.0+2" 304 | sqflite_common_ffi: 305 | dependency: transitive 306 | description: 307 | name: sqflite_common_ffi 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "2.0.0" 311 | sqlite3: 312 | dependency: transitive 313 | description: 314 | name: sqlite3 315 | url: "https://pub.dartlang.org" 316 | source: hosted 317 | version: "1.0.0" 318 | stack_trace: 319 | dependency: transitive 320 | description: 321 | name: stack_trace 322 | url: "https://pub.dartlang.org" 323 | source: hosted 324 | version: "1.10.0" 325 | stacked: 326 | dependency: transitive 327 | description: 328 | name: stacked 329 | url: "https://pub.dartlang.org" 330 | source: hosted 331 | version: "2.0.2" 332 | stream_channel: 333 | dependency: transitive 334 | description: 335 | name: stream_channel 336 | url: "https://pub.dartlang.org" 337 | source: hosted 338 | version: "2.1.0" 339 | string_scanner: 340 | dependency: transitive 341 | description: 342 | name: string_scanner 343 | url: "https://pub.dartlang.org" 344 | source: hosted 345 | version: "1.1.0" 346 | synchronized: 347 | dependency: transitive 348 | description: 349 | name: synchronized 350 | url: "https://pub.dartlang.org" 351 | source: hosted 352 | version: "3.0.0" 353 | term_glyph: 354 | dependency: transitive 355 | description: 356 | name: term_glyph 357 | url: "https://pub.dartlang.org" 358 | source: hosted 359 | version: "1.2.0" 360 | test_api: 361 | dependency: transitive 362 | description: 363 | name: test_api 364 | url: "https://pub.dartlang.org" 365 | source: hosted 366 | version: "0.2.19" 367 | typed_data: 368 | dependency: transitive 369 | description: 370 | name: typed_data 371 | url: "https://pub.dartlang.org" 372 | source: hosted 373 | version: "1.3.0" 374 | vector_math: 375 | dependency: transitive 376 | description: 377 | name: vector_math 378 | url: "https://pub.dartlang.org" 379 | source: hosted 380 | version: "2.1.0" 381 | sdks: 382 | dart: ">=2.12.0 <3.0.0" 383 | flutter: ">=1.24.0-10" 384 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_clean_architecture 2 | description: A new Flutter application. 3 | author: GeekySingh 4 | homepage: https://github.com/GeekySingh 5 | 6 | # The following line prevents the package from being accidentally published to 7 | # pub.dev using `pub publish`. This is preferred for private packages. 8 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 9 | 10 | # The following defines the version and build number for your application. 11 | # A version number is three numbers separated by dots, like 1.2.43 12 | # followed by an optional build number separated by a +. 13 | # Both the version and the builder number may be overridden in flutter 14 | # build by specifying --build-name and --build-number, respectively. 15 | # In Android, build-name is used as versionName while build-number used as versionCode. 16 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 17 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 18 | # Read more about iOS versioning at 19 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 20 | version: 1.0.0+1 21 | 22 | environment: 23 | sdk: ">=2.7.0 <3.0.0" 24 | 25 | dependencies: 26 | flutter: 27 | sdk: flutter 28 | 29 | core: 30 | path: core 31 | presentation: 32 | path: presentation 33 | 34 | # The following adds the Cupertino Icons font to your application. 35 | # Use with the CupertinoIcons class for iOS style icons. 36 | cupertino_icons: ^1.0.0 37 | 38 | dev_dependencies: 39 | flutter_test: 40 | sdk: flutter 41 | 42 | # For information on the generic Dart part of this file, see the 43 | # following page: https://dart.dev/tools/pub/pubspec 44 | 45 | # The following section is specific to Flutter. 46 | flutter: 47 | 48 | # The following line ensures that the Material Icons font is 49 | # included with your application, so that you can use the icons in 50 | # the material Icons class. 51 | uses-material-design: true 52 | 53 | # To add assets to your application, add an assets section, like this: 54 | # assets: 55 | # - images/a_dot_burr.jpeg 56 | # - images/a_dot_ham.jpeg 57 | 58 | # An image asset can refer to one or more resolution-specific "variants", see 59 | # https://flutter.dev/assets-and-images/#resolution-aware. 60 | 61 | # For details regarding adding assets from package dependencies, see 62 | # https://flutter.dev/assets-and-images/#from-packages 63 | 64 | # To add custom fonts to your application, add a fonts section here, 65 | # in this "flutter" section. Each entry in this list should have a 66 | # "family" key with the font family name, and a "fonts" key with a 67 | # list giving the asset and other descriptors for the font. For 68 | # example: 69 | # fonts: 70 | # - family: Schyler 71 | # fonts: 72 | # - asset: fonts/Schyler-Regular.ttf 73 | # - asset: fonts/Schyler-Italic.ttf 74 | # style: italic 75 | # - family: Trajan Pro 76 | # fonts: 77 | # - asset: fonts/TrajanPro.ttf 78 | # - asset: fonts/TrajanPro_Bold.ttf 79 | # weight: 700 80 | # 81 | # For details regarding fonts from package dependencies, 82 | # see https://flutter.dev/custom-fonts/#from-packages 83 | --------------------------------------------------------------------------------