├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── basic_architecture
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── 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-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
└── images
│ ├── 13028129.jpg
│ └── flutter-logo.png
├── devtools_options.yaml
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── 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
└── RunnerTests
│ └── RunnerTests.swift
├── l10n.yaml
├── lib
├── App
│ ├── app.dart
│ └── app_preferences.dart
├── Data
│ ├── data_source
│ │ ├── remote_data_source.dart
│ │ └── remote_data_source_imp.dart
│ ├── network
│ │ ├── api_client.dart
│ │ ├── api_endpoint.dart
│ │ ├── api_provider.dart
│ │ ├── api_sample_data_service.dart
│ │ ├── api_sample_data_service.g.dart
│ │ ├── api_service.dart
│ │ ├── api_service.g.dart
│ │ └── auth_token_dio_interceptor.dart
│ ├── repository
│ │ ├── authentication_repository_imp.dart
│ │ ├── member_repository_imp.dart
│ │ └── sample_data_repository_imp.dart
│ ├── responses
│ │ ├── authentication_response.dart
│ │ ├── authentication_response.g.dart
│ │ ├── base_response.dart
│ │ ├── member_response.dart
│ │ ├── member_response.g.dart
│ │ ├── sample_data_response.dart
│ │ ├── sample_data_response.g.dart
│ │ ├── subscription_key_response.dart
│ │ └── subscription_key_response.g.dart
│ └── translator
│ │ └── translator.dart
├── Domain
│ ├── models
│ │ ├── authentication.dart
│ │ ├── member_info.dart
│ │ ├── sample_data.dart
│ │ └── subscription_key.dart
│ ├── repository
│ │ ├── authentication_repository.dart
│ │ ├── member_repository.dart
│ │ └── sample_data_repository.dart
│ ├── request
│ │ ├── login_request.dart
│ │ └── register_request.dart
│ └── usecase
│ │ ├── base_usecase.dart
│ │ ├── detail_load_sample_data_usecase.dart
│ │ ├── load_sample_data_usecase.dart
│ │ ├── login_usecase.dart
│ │ ├── logout_usecase.dart
│ │ ├── member_info_usecase.dart
│ │ └── subscription_key_info_usecase.dart
├── Injectable
│ ├── configurations.config.dart
│ └── configurations.dart
├── Presentation
│ ├── authentication
│ │ └── bloc
│ │ │ ├── authentication_bloc.dart
│ │ │ ├── authentication_event.dart
│ │ │ ├── authentication_state.dart
│ │ │ └── member_viewmodel.dart
│ ├── component
│ │ └── placeholders.dart
│ ├── home
│ │ ├── bloc
│ │ │ ├── sample_data_bloc.dart
│ │ │ ├── sample_data_event.dart
│ │ │ └── sample_data_state.dart
│ │ └── view
│ │ │ ├── app_view.dart
│ │ │ ├── desktop_home_view.dart
│ │ │ └── mobile_home_view.dart
│ ├── login
│ │ ├── bloc
│ │ │ ├── login_bloc.dart
│ │ │ ├── login_event.dart
│ │ │ └── login_state.dart
│ │ ├── forms
│ │ │ ├── id_input.dart
│ │ │ └── password_input.dart
│ │ └── view
│ │ │ └── login_view.dart
│ ├── routes_manager.dart
│ ├── splash
│ │ └── splash.dart
│ └── subscription_info
│ │ ├── bloc
│ │ ├── subscription_info_bloc.dart
│ │ ├── subscription_info_event.dart
│ │ └── subscription_info_state.dart
│ │ └── view
│ │ └── subscription_info_view.dart
├── config.dart
├── l10n
│ └── arb
│ │ ├── app_en.arb
│ │ └── app_ko.arb
└── main.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
└── my_application.h
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_512.png
│ │ │ └── app_icon_64.png
│ ├── Base.lproj
│ │ └── MainMenu.xib
│ ├── Configs
│ │ ├── AppInfo.xcconfig
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
└── RunnerTests
│ └── RunnerTests.swift
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Symbolication related
35 | app.*.symbols
36 |
37 | # Obfuscation related
38 | app.*.map.json
39 |
40 | # Android Studio will place build artifacts here
41 | /android/app/debug
42 | /android/app/profile
43 | /android/app/release
44 |
--------------------------------------------------------------------------------
/.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: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a"
8 | channel: "stable"
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
17 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
18 | - platform: android
19 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
20 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
21 | - platform: ios
22 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
23 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
24 | - platform: linux
25 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
26 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
27 | - platform: macos
28 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
29 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
30 | - platform: web
31 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
32 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
33 | - platform: windows
34 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
35 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
36 |
37 | # User provided section
38 |
39 | # List of Local paths (relative to this file) that should be
40 | # ignored by the migrate tool.
41 | #
42 | # Files that are not part of the templates will be ignored by default.
43 | unmanaged_files:
44 | - 'lib/main.dart'
45 | - 'ios/Runner.xcodeproj/project.pbxproj'
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flutter basic clean architecture demo app
2 |
3 | ### This project is based on Flutter and implements and explains simple functions aimed at basic Clean Architecture design.
4 | ### 이 프로젝트는 Flutter 기반으로 기본적인 Clean Architecture 설계를 목표로한 간단한 기능이 구현 되어 있고, 설명 하고 있습니다.
5 |
6 | - blog post : [Flutter - Clean Architecture 적용해보기](https://blog.arong.info/flutter/2023/11/29/Flutter-Clean-Architecture-%EC%A0%81%EC%9A%A9%ED%95%B4%EB%B3%B4%EA%B8%B0.html)
7 |
8 | Project Architecture
9 | -
10 | 
11 |
12 | > **※ Incorrect orientation of the 'Import to' arrow in the architectural diagram.**
13 | > ~[Presentaion Module] Bloc -> [Domain Module] Use Case~ → [Domain Module] Use Case -> [Presentaion Module] Bloc
14 | > ~[Data Module] Translator -> [Domain Module] Model~ → [Domain Module] Model -> [Data Module] Translator
15 |
16 | Project solution structure
17 | -
18 |
19 | ├─**App** - App initial settings
20 | ├─**Data**
21 | │ ├─**data_source** - API request
22 | │ ├─**network** - http request module
23 | │ ├─**repository** - Implementation of actual data request processing
24 | │ ├─**responses** - data entity
25 | │ └─**translator** - Domain layer Model Mapper
26 | ├─**Domain**
27 | │ ├─**models** - Data Model
28 | │ ├─**repository** - Business logic abstraction
29 | │ ├─**request** - Data request information
30 | │ └─**usecase** - Either Concepts (Left - Failure) / (Right - Success), UseCase definition
31 | ├─**Injectable** - Initialize injectable
32 | ├─**l10n**
33 | │ └─arb
34 | └─**Presentation** - UI(Login, Data List, Simple page routing, skeleton loading)
35 | ├─**authentication**
36 | │ └─**bloc** - Authentication-related UI business logic
37 | ├─**component** - common widgets
38 | ├─**home**
39 | │ ├─**bloc** - Main home UI business logic
40 | │ └─**view** - Main home UI
41 | ├─**login**
42 | │ ├─**bloc** - Login UI business logic
43 | │ ├─**forms** - Login user input forms (used in the forms package)
44 | │ └─**view** - Login UI
45 | ├─**splash** - splash UI
46 | └─**subscription_info**
47 | ├─**bloc**
48 | └─**view**
49 |
50 | Packages
51 | -
52 |
53 | - get_it
54 | - injectable
55 | - flutter_bloc
56 | - dio
57 | - pretty_dio_logger
58 | - equatable
59 | - dartz
60 | - json_annotation
61 | - json_serializable
62 | - retrofit
63 | - formz
64 | - shared_preferences
65 | - flutter_secure_storage
66 | - flutter_speed_dial
67 | - bottom_sheet
68 | - shimmer
69 |
70 |
71 |
72 | > **This project implements various functions in basic app implementation.**
73 |
74 | > **이 프로젝트는 기본적인 앱 구현에 있어 필요한 다양한 기능들이 구현 되어 있습니다.**
75 | > (반응형 UI처리, skeleton loading 효과, 다국어 처리, BLoC를 통한 상태 관리, Dio Interceptor를 통한 API Access token 인증 처리, API Access token 만료시 재발급 로직 설명 등)
76 |
77 | ***
78 |
79 | how to use tha app?
80 | -
81 |
82 | 
83 |
84 | ### for *login* use the following data
85 | ```
86 | {
87 | "Id":"test",
88 | "Password":"1234"
89 | }
90 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at https://dart.dev/lints.
17 | #
18 | # Instead of disabling a lint rule for the entire project in the
19 | # section below, it can also be suppressed for a single line of code
20 | # or a specific dart file by using the `// ignore: name_of_lint` and
21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
22 | # producing the lint.
23 | rules:
24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26 |
27 | # Additional information about this file can be found at
28 | # https://dart.dev/guides/language/analysis-options
29 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "com.android.application"
3 | id "kotlin-android"
4 | id "dev.flutter.flutter-gradle-plugin"
5 | }
6 |
7 | def localProperties = new Properties()
8 | def localPropertiesFile = rootProject.file('local.properties')
9 | if (localPropertiesFile.exists()) {
10 | localPropertiesFile.withReader('UTF-8') { reader ->
11 | localProperties.load(reader)
12 | }
13 | }
14 |
15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16 | if (flutterVersionCode == null) {
17 | flutterVersionCode = '1'
18 | }
19 |
20 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
21 | if (flutterVersionName == null) {
22 | flutterVersionName = '1.0'
23 | }
24 |
25 | android {
26 | namespace "com.example.basic_architecture"
27 | compileSdkVersion flutter.compileSdkVersion
28 | ndkVersion flutter.ndkVersion
29 |
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 |
35 | kotlinOptions {
36 | jvmTarget = '1.8'
37 | }
38 |
39 | sourceSets {
40 | main.java.srcDirs += 'src/main/kotlin'
41 | }
42 |
43 | defaultConfig {
44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45 | applicationId "com.example.basic_architecture"
46 | // You can update the following values to match your application needs.
47 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48 | minSdkVersion flutter.minSdkVersion
49 | targetSdkVersion flutter.targetSdkVersion
50 | versionCode flutterVersionCode.toInteger()
51 | versionName flutterVersionName
52 | }
53 |
54 | buildTypes {
55 | release {
56 | // TODO: Add your own signing config for the release build.
57 | // Signing with the debug keys for now, so `flutter run --release` works.
58 | signingConfig signingConfigs.debug
59 | }
60 | }
61 | }
62 |
63 | flutter {
64 | source '../..'
65 | }
66 |
67 | dependencies {}
68 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/basic_architecture/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.basic_architecture
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 |
13 | allprojects {
14 | repositories {
15 | google()
16 | mavenCentral()
17 | }
18 | }
19 |
20 | rootProject.buildDir = '../build'
21 | subprojects {
22 | project.buildDir = "${rootProject.buildDir}/${project.name}"
23 | }
24 | subprojects {
25 | project.evaluationDependsOn(':app')
26 | }
27 |
28 | tasks.register("clean", Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx4G
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }
9 | settings.ext.flutterSdkPath = flutterSdkPath()
10 |
11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
12 |
13 | repositories {
14 | google()
15 | mavenCentral()
16 | gradlePluginPortal()
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
21 | }
22 | }
23 |
24 | plugins {
25 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
26 | id "com.android.application" version "7.3.0" apply false
27 | }
28 |
29 | include ":app"
30 |
--------------------------------------------------------------------------------
/assets/images/13028129.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/assets/images/13028129.jpg
--------------------------------------------------------------------------------
/assets/images/flutter-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/assets/images/flutter-logo.png
--------------------------------------------------------------------------------
/devtools_options.yaml:
--------------------------------------------------------------------------------
1 | extensions:
2 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/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 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tyeom/flutter_basic_architecture/d7728c83e5c123f67eca63a3a1330f51097d5e72/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 | CFBundleDisplayName
8 | Basic Architecture
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | basic_architecture
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | CADisableMinimumFrameDurationOnPhone
45 |
46 | UIApplicationSupportsIndirectInputEvents
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/l10n.yaml:
--------------------------------------------------------------------------------
1 | arb-dir: lib/l10n/arb
2 | template-arb-file: app_en.arb
3 | output-localization-file: app_localizations.dart
--------------------------------------------------------------------------------
/lib/App/app.dart:
--------------------------------------------------------------------------------
1 | import 'package:basic_architecture/Injectable/configurations.dart';
2 | import 'package:basic_architecture/Presentation/authentication/bloc/authentication_bloc.dart';
3 | import 'package:basic_architecture/Presentation/home/bloc/sample_data_bloc.dart';
4 | import 'package:basic_architecture/Presentation/routes_manager.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter_bloc/flutter_bloc.dart';
7 | import 'package:flutter_localizations/flutter_localizations.dart';
8 | import 'package:flutter_gen/gen_l10n/app_localizations.dart';
9 | import 'package:basic_architecture/config.dart';
10 |
11 | class MyApp extends StatelessWidget {
12 | const MyApp({super.key});
13 |
14 | @override
15 | Widget build(BuildContext context) => MultiBlocProvider(
16 | providers: [
17 | BlocProvider(
18 | create: (BuildContext context) => getIt()
19 | ..add(
20 | AuthenticationStatusChanged(AuthenticationStatus.loading)),
21 | ),
22 | ],
23 | child: MaterialApp(
24 | title: 'Clean Architecture in Flutter Demo App',
25 | debugShowCheckedModeBanner: false,
26 | theme: ThemeData(
27 | primarySwatch: Colors.blue,
28 | ),
29 | localizationsDelegates: const [
30 | AppLocalizations.delegate,
31 | GlobalMaterialLocalizations.delegate,
32 | GlobalWidgetsLocalizations.delegate,
33 | GlobalCupertinoLocalizations.delegate,
34 | ],
35 | supportedLocales: Language.values.map((e) => e.locale).toList(),
36 | locale: Language.ko.locale,
37 | onGenerateRoute: RouteGenerator.getRoute,
38 | initialRoute: Routes.splashRoute,
39 | ));
40 | }
41 |
--------------------------------------------------------------------------------
/lib/App/app_preferences.dart:
--------------------------------------------------------------------------------
1 | import 'package:injectable/injectable.dart';
2 | import 'package:shared_preferences/shared_preferences.dart';
3 |
4 | const String PREFS_KEY_USER_LOGIN = "USER_LOGIN";
5 |
6 | class AppPreferences {
7 | final SharedPreferences _sharedPreferences;
8 |
9 | AppPreferences(this._sharedPreferences);
10 |
11 | /// 로그인 완료시, 추후 자동 로그인 사용
12 | bool? get userToken => _sharedPreferences.getBool(PREFS_KEY_USER_LOGIN);
13 |
14 | Future login() =>
15 | _sharedPreferences.setBool(PREFS_KEY_USER_LOGIN, true);
16 |
17 | Future logout() async {
18 | await _sharedPreferences.remove(PREFS_KEY_USER_LOGIN);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/Data/data_source/remote_data_source.dart:
--------------------------------------------------------------------------------
1 | import 'package:basic_architecture/Data/responses/authentication_response.dart';
2 | import 'package:basic_architecture/Data/responses/member_response.dart';
3 | import 'package:basic_architecture/Data/responses/sample_data_response.dart';
4 | import 'package:basic_architecture/Data/responses/subscription_key_response.dart';
5 | import 'package:basic_architecture/Domain/request/login_request.dart';
6 | import 'package:basic_architecture/Domain/request/register_request.dart';
7 |
8 | abstract class RemoteDataSource {
9 | Future login(LoginRequest loginRequest);
10 | Future logout();
11 | Future register(RegisterRequest registerRequest);
12 | Future getMemberInfo();
13 | Future> getSampleData();
14 | Future getDetailSampleData(int id);
15 | Future getSubscriptionKeyResponse();
16 | }
17 |
--------------------------------------------------------------------------------
/lib/Data/data_source/remote_data_source_imp.dart:
--------------------------------------------------------------------------------
1 | import 'package:basic_architecture/Data/data_source/remote_data_source.dart';
2 | import 'package:basic_architecture/Data/network/api_sample_data_service.dart';
3 | import 'package:basic_architecture/Data/network/api_service.dart';
4 | import 'package:basic_architecture/Data/responses/authentication_response.dart';
5 | import 'package:basic_architecture/Data/responses/member_response.dart';
6 | import 'package:basic_architecture/Data/responses/sample_data_response.dart';
7 | import 'package:basic_architecture/Data/responses/subscription_key_response.dart';
8 | import 'package:basic_architecture/Domain/request/login_request.dart';
9 | import 'package:basic_architecture/Domain/request/register_request.dart';
10 |
11 | class RemoteDataSourceImp implements RemoteDataSource {
12 | final ApiService _apiService;
13 | final ApiSampleDataService _apiSampleDataService;
14 |
15 | RemoteDataSourceImp(this._apiService, this._apiSampleDataService);
16 |
17 | @override
18 | Future login(LoginRequest loginRequest) async {
19 | return await _apiService.login(loginRequest.id, loginRequest.password);
20 | }
21 |
22 | @override
23 | Future logout() async {
24 | return await _apiService.logout();
25 | }
26 |
27 | @override
28 | Future register(RegisterRequest registerRequest) async {
29 | return await _apiService.register(
30 | registerRequest.id,
31 | registerRequest.password,
32 | registerRequest.role,
33 | registerRequest.name,
34 | registerRequest.email,
35 | registerRequest.tel);
36 | }
37 |
38 | @override
39 | Future getMemberInfo() async {
40 | return await _apiService.getMemberInfo();
41 | }
42 |
43 | @override
44 | Future> getSampleData() async {
45 | return await _apiSampleDataService.getSampleData();
46 | }
47 |
48 | @override
49 | Future getDetailSampleData(int id) async {
50 | return await _apiSampleDataService.getDetailSampleData(id);
51 | }
52 |
53 | @override
54 | Future getSubscriptionKeyResponse() async {
55 | return await _apiService.getSubscriptionKeyInfo();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/lib/Data/network/api_client.dart:
--------------------------------------------------------------------------------
1 | import 'package:basic_architecture/App/app_preferences.dart';
2 | import 'package:basic_architecture/Data/network/api_endpoint.dart';
3 | import 'package:basic_architecture/Data/network/api_provider.dart';
4 |
5 | class ApiClient {
6 | final bool enableLogging;
7 | late final ApiProviderFactory apiProvider;
8 |
9 | ApiClient(ApiType apiType, {required this.enableLogging}) {
10 | apiProvider = ApiProviderFactory(apiType, enableLogging);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/Data/network/api_endpoint.dart:
--------------------------------------------------------------------------------
1 | class ApiEndpoint {
2 | static const String baseUrl = 'https://api.namicro.co.kr';
3 | static const String publicApi = '/public';
4 | static const String privateApi = '/private';
5 |
6 | static const String baseUrlSampleData = 'http://arong.info:7003';
7 | static const String sampleDataApi = '/posts';
8 | }
9 |
--------------------------------------------------------------------------------
/lib/Data/network/api_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:basic_architecture/Data/network/api_endpoint.dart';
2 | import 'package:basic_architecture/Data/network/auth_token_dio_interceptor.dart';
3 | import 'package:dio/dio.dart';
4 | import 'package:flutter_secure_storage/flutter_secure_storage.dart';
5 | import 'package:pretty_dio_logger/pretty_dio_logger.dart';
6 |
7 | enum ApiType { base, sampleData }
8 |
9 | abstract class ApiProviderFactory {
10 | Dio get getDio;
11 |
12 | factory ApiProviderFactory(ApiType type, bool enableLogger,
13 | {BaseOptions? options}) {
14 | switch (type) {
15 | case ApiType.base:
16 | return ApiProvider(enableLogger, options: options);
17 | case ApiType.sampleData:
18 | return SampleDataApiProvider(enableLogger, options: options);
19 | }
20 | }
21 | }
22 |
23 | /// 기본 RestFul API
24 | /// Basic RestFul API
25 | class ApiProvider implements ApiProviderFactory {
26 | static const int apiTimeOut = 60000;
27 | static late Dio dio;
28 |
29 | bool enableLogger;
30 |
31 | ApiProvider(this.enableLogger, {BaseOptions? options}) {
32 | final dioInstance = Dio(options ?? BaseOptions()
33 | ..baseUrl = ApiEndpoint.baseUrl
34 | ..connectTimeout = const Duration(milliseconds: apiTimeOut)
35 | ..receiveTimeout = const Duration(milliseconds: apiTimeOut)
36 | ..headers = {
37 | 'Content-Type': 'application/json; charset=utf-8',
38 | 'accept': 'application/json',
39 | });
40 |
41 | if (enableLogger) {
42 | dioInstance.interceptors.add(PrettyDioLogger(
43 | requestHeader: true,
44 | requestBody: true,
45 | responseBody: true,
46 | responseHeader: false,
47 | error: true,
48 | compact: true,
49 | maxWidth: 90));
50 | }
51 |
52 | const storage = FlutterSecureStorage();
53 | dioInstance.interceptors.add(AuthTokenDioInterceptor(storage: storage));
54 | dio = dioInstance;
55 | }
56 |
57 | @override
58 | Dio get getDio => dio;
59 | }
60 |
61 | /// 테스트용 데이터 Web API
62 | /// Sample data call web api
63 | class SampleDataApiProvider implements ApiProviderFactory {
64 | static const int apiTimeOut = 60000;
65 | static late Dio dio;
66 |
67 | bool enableLogger;
68 |
69 | SampleDataApiProvider(this.enableLogger, {BaseOptions? options}) {
70 | final dioInstance = Dio(options ?? BaseOptions()
71 | ..baseUrl = ApiEndpoint.baseUrlSampleData
72 | ..connectTimeout = const Duration(milliseconds: apiTimeOut)
73 | ..receiveTimeout = const Duration(milliseconds: apiTimeOut)
74 | ..headers = {
75 | 'Content-Type': 'application/json; charset=utf-8',
76 | 'accept': 'application/json',
77 | });
78 |
79 | if (enableLogger) {
80 | dioInstance.interceptors.add(PrettyDioLogger(
81 | requestHeader: true,
82 | requestBody: true,
83 | responseBody: true,
84 | responseHeader: false,
85 | error: true,
86 | compact: true,
87 | maxWidth: 90));
88 | }
89 |
90 | dio = dioInstance;
91 | }
92 |
93 | @override
94 | Dio get getDio => dio;
95 | }
96 |
--------------------------------------------------------------------------------
/lib/Data/network/api_sample_data_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:basic_architecture/Data/network/api_endpoint.dart';
2 | import 'package:basic_architecture/Data/responses/sample_data_response.dart';
3 | import 'package:dio/dio.dart';
4 | import 'package:retrofit/retrofit.dart';
5 |
6 | part 'api_sample_data_service.g.dart';
7 |
8 | @RestApi()
9 | abstract class ApiSampleDataService {
10 | factory ApiSampleDataService(final Dio dio) = _ApiSampleDataService;
11 |
12 | /// 샘플 데이터 정보 요청
13 | @GET("${ApiEndpoint.sampleDataApi}")
14 | Future> getSampleData();
15 |
16 | /// 샘플 데이터 상세 정보 요청
17 | @GET("${ApiEndpoint.sampleDataApi}/{id}")
18 | Future getDetailSampleData(
19 | @Path("id") int id,
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/lib/Data/network/api_sample_data_service.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'api_sample_data_service.dart';
4 |
5 | // **************************************************************************
6 | // RetrofitGenerator
7 | // **************************************************************************
8 |
9 | // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers
10 |
11 | class _ApiSampleDataService implements ApiSampleDataService {
12 | _ApiSampleDataService(
13 | this._dio, {
14 | this.baseUrl,
15 | });
16 |
17 | final Dio _dio;
18 |
19 | String? baseUrl;
20 |
21 | @override
22 | Future> getSampleData() async {
23 | const _extra = {};
24 | final queryParameters = {};
25 | final _headers = {};
26 | final Map? _data = null;
27 | final _result = await _dio
28 | .fetch>(_setStreamType>(Options(
29 | method: 'GET',
30 | headers: _headers,
31 | extra: _extra,
32 | )
33 | .compose(
34 | _dio.options,
35 | '/posts',
36 | queryParameters: queryParameters,
37 | data: _data,
38 | )
39 | .copyWith(
40 | baseUrl: _combineBaseUrls(
41 | _dio.options.baseUrl,
42 | baseUrl,
43 | ))));
44 | var value = _result.data!
45 | .map((dynamic i) =>
46 | SampleDataResponse.fromJson(i as Map))
47 | .toList();
48 | return value;
49 | }
50 |
51 | @override
52 | Future getDetailSampleData(int id) async {
53 | const _extra = {};
54 | final queryParameters = {};
55 | final _headers = {};
56 | final Map? _data = null;
57 | final _result = await _dio
58 | .fetch