Repository: phamdinhduc795397/flutter-getx-clean-architecture
Branch: main
Commit: 34b6635a6728
Files: 90
Total size: 113.0 KB
Directory structure:
gitextract_fl8yy2g0/
├── .gitignore
├── README.md
├── android/
│ ├── .gitignore
│ ├── app/
│ │ ├── build.gradle
│ │ └── src/
│ │ ├── debug/
│ │ │ └── AndroidManifest.xml
│ │ ├── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin/
│ │ │ │ └── com/
│ │ │ │ └── example/
│ │ │ │ └── getx_clean_architecture/
│ │ │ │ └── MainActivity.kt
│ │ │ └── res/
│ │ │ ├── drawable/
│ │ │ │ └── launch_background.xml
│ │ │ ├── drawable-v21/
│ │ │ │ └── launch_background.xml
│ │ │ ├── values/
│ │ │ │ └── styles.xml
│ │ │ └── values-night/
│ │ │ └── styles.xml
│ │ └── profile/
│ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ └── settings.gradle
├── ios/
│ ├── .gitignore
│ ├── Flutter/
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Runner/
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets/
│ │ │ ├── AppIcon.appiconset/
│ │ │ │ └── Contents.json
│ │ │ └── LaunchImage.imageset/
│ │ │ ├── Contents.json
│ │ │ └── README.md
│ │ ├── Base.lproj/
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
│ ├── 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
├── lib/
│ ├── app/
│ │ ├── config/
│ │ │ ├── app_colors.dart
│ │ │ ├── app_constants.dart
│ │ │ └── app_text_styles.dart
│ │ ├── core/
│ │ │ └── usecases/
│ │ │ ├── no_param_usecase.dart
│ │ │ └── pram_usecase.dart
│ │ ├── extensions/
│ │ │ └── color.dart
│ │ ├── services/
│ │ │ └── local_storage.dart
│ │ ├── types/
│ │ │ ├── category_type.dart
│ │ │ └── tab_type.dart
│ │ └── util/
│ │ ├── dependency.dart
│ │ └── util.dart
│ ├── data/
│ │ ├── models/
│ │ │ ├── article_model.dart
│ │ │ ├── article_model.g.dart
│ │ │ └── paging_model.dart
│ │ ├── providers/
│ │ │ ├── database/
│ │ │ │ └── firebase_database_provider.dart
│ │ │ └── network/
│ │ │ ├── api_endpoint.dart
│ │ │ ├── api_provider.dart
│ │ │ ├── api_request_representable.dart
│ │ │ └── apis/
│ │ │ ├── article_api.dart
│ │ │ └── auth_api.dart
│ │ └── repositories/
│ │ ├── article_repository.dart
│ │ └── auth_repository.dart
│ ├── domain/
│ │ ├── entities/
│ │ │ ├── article.dart
│ │ │ ├── paging.dart
│ │ │ └── user.dart
│ │ ├── repositories/
│ │ │ ├── article_repository.dart
│ │ │ └── auth_repository.dart
│ │ └── usecases/
│ │ ├── fetch_headline_use_case.dart
│ │ ├── fetch_news_use_case.dart
│ │ └── signup_use_case.dart
│ ├── generated_plugin_registrant.dart
│ ├── main.dart
│ └── presentation/
│ ├── app.dart
│ ├── controllers/
│ │ ├── auth/
│ │ │ ├── auth_binding.dart
│ │ │ └── auth_controller.dart
│ │ ├── headline/
│ │ │ ├── headline_binding.dart
│ │ │ └── headline_controller.dart
│ │ └── news/
│ │ ├── news_binding.dart
│ │ └── news_controller.dart
│ └── pages/
│ ├── detail/
│ │ └── detail_page.dart
│ ├── headline/
│ │ ├── headline_page.dart
│ │ └── views/
│ │ └── article_cell.dart
│ ├── home/
│ │ └── home_page.dart
│ ├── news/
│ │ └── news_page.dart
│ └── profile/
│ └── profile_page.dart
├── pubspec.yaml
├── test/
│ ├── data/
│ │ ├── headline_sample.json
│ │ └── news_sample.json
│ ├── repositories/
│ │ ├── mock_article_repository.dart
│ │ └── mock_auth_repository.dart
│ └── widget_test.dart
└── web/
├── index.html
└── manifest.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
================================================
FILE: README.md
================================================
# flutter-getx-clean-architecture
A Flutter Clean Architecture Using [GetX](https://github.com/jonataslaw/getx).
## Work Flow

## Project Structure
```
|-- lib
|-- main.dart
|-- app
|-- core
|-- usecases
|-- config
|-- app_constants.dart
|-- app_colors.dart
| -- app_text_styles.dart
|-- services
|-- util
|-- types
|-- extensitons
|-- data
|-- models
|-- repositories
|-- providers
|-- database
|-- network
|-- apis
|-- api_endpoints.dart
|-- api_provider.dart
|-- api_representable.dart
|-- domain
|-- entities
|-- repositories
|-- usecases
|-- presentation
|-- controllers
|-- pages
|-- views
|-- app.dart
```
## Features
- Integrating Unit Test.
- Create an easy to use API provider with [GetConnect](https://github.com/jonataslaw/getx#getconnect).
================================================
FILE: android/.gitignore
================================================
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
================================================
FILE: android/app/build.gradle
================================================
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.getx_clean_architecture"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
================================================
FILE: android/app/src/debug/AndroidManifest.xml
================================================
================================================
FILE: android/app/src/main/AndroidManifest.xml
================================================
================================================
FILE: android/app/src/main/kotlin/com/example/getx_clean_architecture/MainActivity.kt
================================================
package com.example.getx_clean_architecture
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
================================================
FILE: android/app/src/main/res/drawable/launch_background.xml
================================================
================================================
FILE: android/app/src/main/res/drawable-v21/launch_background.xml
================================================
================================================
FILE: android/app/src/main/res/values/styles.xml
================================================
================================================
FILE: android/app/src/main/res/values-night/styles.xml
================================================
================================================
FILE: android/app/src/profile/AndroidManifest.xml
================================================
================================================
FILE: android/build.gradle
================================================
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
================================================
FILE: android/gradle/wrapper/gradle-wrapper.properties
================================================
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
================================================
FILE: android/gradle.properties
================================================
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
================================================
FILE: android/settings.gradle
================================================
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
================================================
FILE: ios/.gitignore
================================================
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
================================================
FILE: ios/Flutter/AppFrameworkInfo.plist
================================================
CFBundleDevelopmentRegionenCFBundleExecutableAppCFBundleIdentifierio.flutter.flutter.appCFBundleInfoDictionaryVersion6.0CFBundleNameAppCFBundlePackageTypeFMWKCFBundleShortVersionString1.0CFBundleSignature????CFBundleVersion1.0MinimumOSVersion8.0
================================================
FILE: ios/Flutter/Debug.xcconfig
================================================
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
================================================
FILE: ios/Flutter/Release.xcconfig
================================================
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
================================================
FILE: ios/Podfile
================================================
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
================================================
FILE: ios/Runner/AppDelegate.swift
================================================
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
================================================
FILE: ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
================================================
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
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.
================================================
FILE: ios/Runner/Base.lproj/LaunchScreen.storyboard
================================================
================================================
FILE: ios/Runner/Base.lproj/Main.storyboard
================================================
================================================
FILE: ios/Runner/Info.plist
================================================
CFBundleDevelopmentRegion$(DEVELOPMENT_LANGUAGE)CFBundleExecutable$(EXECUTABLE_NAME)CFBundleIdentifier$(PRODUCT_BUNDLE_IDENTIFIER)CFBundleInfoDictionaryVersion6.0CFBundleNamegetx_clean_architectureCFBundlePackageTypeAPPLCFBundleShortVersionString$(FLUTTER_BUILD_NAME)CFBundleSignature????CFBundleVersion$(FLUTTER_BUILD_NUMBER)LSRequiresIPhoneOSUILaunchStoryboardNameLaunchScreenUIMainStoryboardFileMainUISupportedInterfaceOrientationsUIInterfaceOrientationPortraitUIInterfaceOrientationLandscapeLeftUIInterfaceOrientationLandscapeRightUISupportedInterfaceOrientations~ipadUIInterfaceOrientationPortraitUIInterfaceOrientationPortraitUpsideDownUIInterfaceOrientationLandscapeLeftUIInterfaceOrientationLandscapeRightUIViewControllerBasedStatusBarAppearance
================================================
FILE: ios/Runner/Runner-Bridging-Header.h
================================================
#import "GeneratedPluginRegistrant.h"
================================================
FILE: ios/Runner.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
59338DFFFAC6ED200E895419 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23107FCC4ADD2F5C1072CB90 /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
23107FCC4ADD2F5C1072CB90 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
9637645FF0BE5257435AD11B /* 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 = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
B29F88C3632740DF5E8E7E48 /* 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 = ""; };
B5485E231E2A57BAE687419C /* 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 = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
59338DFFFAC6ED200E895419 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6E0AA953ACAB9AAC9C6AC78A /* Pods */ = {
isa = PBXGroup;
children = (
B5485E231E2A57BAE687419C /* Pods-Runner.debug.xcconfig */,
9637645FF0BE5257435AD11B /* Pods-Runner.release.xcconfig */,
B29F88C3632740DF5E8E7E48 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "";
};
91917628A17759DC3FA4CA88 /* Frameworks */ = {
isa = PBXGroup;
children = (
23107FCC4ADD2F5C1072CB90 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
6E0AA953ACAB9AAC9C6AC78A /* Pods */,
91917628A17759DC3FA4CA88 /* Frameworks */,
);
sourceTree = "";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
4F4F210C2A389E9CFFBC1FDA /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
F077A86143457CB90C6E9739 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
4F4F210C2A389E9CFFBC1FDA /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
F077A86143457CB90C6E9739 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.getxCleanArchitecture;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.getxCleanArchitecture;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.getxCleanArchitecture;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
IDEDidComputeMac32BitWarning
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
================================================
PreviewsEnabled
================================================
FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
================================================
================================================
FILE: ios/Runner.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
IDEDidComputeMac32BitWarning
================================================
FILE: ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
================================================
PreviewsEnabled
================================================
FILE: lib/app/config/app_colors.dart
================================================
import 'package:flutter/material.dart';
import 'package:getx_clean_architecture/app/extensions/color.dart';
class AppColors {
static Color primary = HexColor("05101A");
static Color lightGray = HexColor("D3D3D3");
}
================================================
FILE: lib/app/config/app_constants.dart
================================================
================================================
FILE: lib/app/config/app_text_styles.dart
================================================
import 'package:flutter/material.dart';
/// AppTextStyle format as follows:
/// [fontWeight][fontSize][colorName][opacity]
/// Example: bold18White05
///
class AppTextStyles {
static TextStyle title = TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Colors.black,
);
static TextStyle body = TextStyle(
fontSize: 13,
color: Colors.grey,
);
}
================================================
FILE: lib/app/core/usecases/no_param_usecase.dart
================================================
abstract class NoParamUseCase {
Future execute();
}
================================================
FILE: lib/app/core/usecases/pram_usecase.dart
================================================
abstract class ParamUseCase {
Future execute(Params params);
}
================================================
FILE: lib/app/extensions/color.dart
================================================
import 'package:flutter/material.dart';
class HexColor extends Color {
static int _getColorFromHex(String hexColor) {
hexColor = hexColor.toUpperCase().replaceAll("#", "");
if (hexColor.length == 6) {
hexColor = "FF" + hexColor;
}
return int.parse(hexColor, radix: 16);
}
HexColor(final String hexColor) : super(_getColorFromHex(hexColor));
}
================================================
FILE: lib/app/services/local_storage.dart
================================================
import 'dart:convert';
import 'package:get/get.dart';
import 'package:getx_clean_architecture/domain/entities/user.dart';
import 'package:shared_preferences/shared_preferences.dart';
enum _Key {
user,
}
class LocalStorageService extends GetxService {
SharedPreferences? _sharedPreferences;
Future init() async {
_sharedPreferences = await SharedPreferences.getInstance();
return this;
}
User? get user {
final rawJson = _sharedPreferences?.getString(_Key.user.toString());
if (rawJson == null) {
return null;
}
Map map = jsonDecode(rawJson);
return User.fromJson(map);
}
set user(User? value) {
if (value != null) {
_sharedPreferences?.setString(
_Key.user.toString(), json.encode(value.toJson()));
} else {
_sharedPreferences?.remove(_Key.user.toString());
}
}
}
================================================
FILE: lib/app/types/category_type.dart
================================================
enum CategoryType { bitcoin, apple, earthquake, animal }
extension CategoryKeyword on CategoryType {
String get keyword {
switch (this) {
case CategoryType.bitcoin:
return "bitcoin";
case CategoryType.apple:
return "apple";
case CategoryType.earthquake:
return "earthquake";
case CategoryType.animal:
return "animal";
}
}
}
================================================
FILE: lib/app/types/tab_type.dart
================================================
import 'package:flutter/cupertino.dart';
enum TabType { headline, news, profile }
extension TabItem on TabType {
Icon get icon {
switch (this) {
case TabType.headline:
return Icon(CupertinoIcons.home, size: 25);
case TabType.news:
return Icon(CupertinoIcons.news, size: 25);
case TabType.profile:
return Icon(CupertinoIcons.person, size: 25);
}
}
String get title {
switch (this) {
case TabType.headline:
return "Headline";
case TabType.news:
return "News";
case TabType.profile:
return "Profile";
}
}
}
================================================
FILE: lib/app/util/dependency.dart
================================================
import 'package:get/get.dart';
import 'package:getx_clean_architecture/data/repositories/auth_repository.dart';
import 'package:getx_clean_architecture/data/repositories/article_repository.dart';
class DependencyCreator {
static init() {
Get.lazyPut(() => AuthenticationRepositoryIml());
Get.lazyPut(() => ArticleRepositoryIml());
}
}
================================================
FILE: lib/app/util/util.dart
================================================
class Utils {
static String getImagePath(String name, {String format: 'png'}) {
return 'assets/images/$name.$format';
}
}
================================================
FILE: lib/data/models/article_model.dart
================================================
import 'package:getx_clean_architecture/domain/entities/article.dart';
import 'package:json_annotation/json_annotation.dart';
part 'article_model.g.dart';
@JsonSerializable()
class ArticleModel extends Article {
ArticleModel({
this.author,
this.title,
this.description,
this.url,
this.urlToImage,
this.publishedAt,
this.content,
}) : super(
author: author,
title: title,
description: description,
url: url,
urlToImage: urlToImage,
publishedAt: publishedAt,
content: content);
String? author;
String? title;
String? description;
String? url;
String? urlToImage;
DateTime? publishedAt;
String? content;
factory ArticleModel.fromJson(Map json) =>
_$ArticleModelFromJson(json);
Map toJson() => _$ArticleModelToJson(this);
}
================================================
FILE: lib/data/models/article_model.g.dart
================================================
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'article_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ArticleModel _$ArticleModelFromJson(Map json) {
return ArticleModel(
author: json['author'] as String?,
title: json['title'] as String?,
description: json['description'] as String?,
url: json['url'] as String?,
urlToImage: json['urlToImage'] as String?,
publishedAt: json['publishedAt'] == null
? null
: DateTime.parse(json['publishedAt'] as String),
content: json['content'] as String?,
);
}
Map _$ArticleModelToJson(ArticleModel instance) =>
{
'author': instance.author,
'title': instance.title,
'description': instance.description,
'url': instance.url,
'urlToImage': instance.urlToImage,
'publishedAt': instance.publishedAt?.toIso8601String(),
'content': instance.content,
};
================================================
FILE: lib/data/models/paging_model.dart
================================================
import 'package:getx_clean_architecture/data/models/article_model.dart';
import 'package:getx_clean_architecture/domain/entities/paging.dart';
class PagingModel extends Paging {
PagingModel({
required this.totalResults,
required this.articles,
}) : super(articles: articles, totalResults: totalResults);
final int totalResults;
final List articles;
@override
factory PagingModel.fromJson(Map json) => PagingModel(
totalResults: json["totalResults"],
articles:
List.from(json["articles"].map((x) => ArticleModel.fromJson(x))),
);
}
================================================
FILE: lib/data/providers/database/firebase_database_provider.dart
================================================
================================================
FILE: lib/data/providers/network/api_endpoint.dart
================================================
class APIEndpoint {
static String get newsapi => "https://newsapi.org/v2";
}
================================================
FILE: lib/data/providers/network/api_provider.dart
================================================
import 'dart:async';
import 'dart:io';
import 'package:get/get_connect/connect.dart';
import 'package:getx_clean_architecture/data/providers/network/api_request_representable.dart';
class APIProvider {
static const requestTimeOut = Duration(seconds: 25);
final _client = GetConnect(timeout: requestTimeOut);
static final _singleton = APIProvider();
static APIProvider get instance => _singleton;
Future request(APIRequestRepresentable request) async {
try {
final response = await _client.request(
request.url,
request.method.string,
headers: request.headers,
query: request.query,
body: request.body,
);
return _returnResponse(response);
} on TimeoutException catch (_) {
throw TimeOutException(null);
} on SocketException {
throw FetchDataException('No Internet connection');
}
}
dynamic _returnResponse(Response response) {
switch (response.statusCode) {
case 200:
return response.body;
case 400:
throw BadRequestException(response.body.toString());
case 401:
case 403:
throw UnauthorisedException(response.body.toString());
case 404:
throw BadRequestException('Not found');
case 500:
throw FetchDataException('Internal Server Error');
default:
throw FetchDataException(
'Error occured while Communication with Server with StatusCode : ${response.statusCode}');
}
}
}
class AppException implements Exception {
final code;
final message;
final details;
AppException({this.code, this.message, this.details});
String toString() {
return "[$code]: $message \n $details";
}
}
class FetchDataException extends AppException {
FetchDataException(String? details)
: super(
code: "fetch-data",
message: "Error During Communication",
details: details,
);
}
class BadRequestException extends AppException {
BadRequestException(String? details)
: super(
code: "invalid-request",
message: "Invalid Request",
details: details,
);
}
class UnauthorisedException extends AppException {
UnauthorisedException(String? details)
: super(
code: "unauthorised",
message: "Unauthorised",
details: details,
);
}
class InvalidInputException extends AppException {
InvalidInputException(String? details)
: super(
code: "invalid-input",
message: "Invalid Input",
details: details,
);
}
class AuthenticationException extends AppException {
AuthenticationException(String? details)
: super(
code: "authentication-failed",
message: "Authentication Failed",
details: details,
);
}
class TimeOutException extends AppException {
TimeOutException(String? details)
: super(
code: "request-timeout",
message: "Request TimeOut",
details: details,
);
}
================================================
FILE: lib/data/providers/network/api_request_representable.dart
================================================
enum HTTPMethod { get, post, delete, put, patch }
extension HTTPMethodString on HTTPMethod {
String get string {
switch (this) {
case HTTPMethod.get:
return "get";
case HTTPMethod.post:
return "post";
case HTTPMethod.delete:
return "delete";
case HTTPMethod.patch:
return "patch";
case HTTPMethod.put:
return "put";
}
}
}
abstract class APIRequestRepresentable {
String get url;
String get endpoint;
String get path;
HTTPMethod get method;
Map? get headers;
Map? get query;
dynamic get body;
Future request();
}
================================================
FILE: lib/data/providers/network/apis/article_api.dart
================================================
import 'package:getx_clean_architecture/data/providers/network/api_endpoint.dart';
import 'package:getx_clean_architecture/data/providers/network/api_provider.dart';
import 'package:getx_clean_architecture/data/providers/network/api_request_representable.dart';
enum ArticleType { fetchHeadline, fetchNews }
class ArticleAPI implements APIRequestRepresentable {
final ArticleType type;
String? keyword;
int? page;
int? pageSize;
ArticleAPI._({required this.type, this.keyword, this.page, this.pageSize});
ArticleAPI.fetchHeadline(int page, int pageSize)
: this._(type: ArticleType.fetchHeadline, page: page, pageSize: pageSize);
ArticleAPI.fetchNews(String keyword, int page, int pageSize)
: this._(
type: ArticleType.fetchNews,
keyword: keyword,
page: page,
pageSize: pageSize);
@override
String get endpoint => APIEndpoint.newsapi;
String get path {
switch (type) {
case ArticleType.fetchHeadline:
return "/top-headlines";
case ArticleType.fetchNews:
return "/top-headlines";
}
}
@override
HTTPMethod get method {
return HTTPMethod.get;
}
Map get headers =>
{"X-Api-Key": "d809d6a547734a67af23365ce5bc8c02"};
Map get query {
switch (type) {
case ArticleType.fetchHeadline:
return {"country": "us", "page": "$page", "pageSize": "$pageSize"};
case ArticleType.fetchNews:
return {"page": "$page", "pageSize": "$pageSize", "q": keyword ?? ""};
}
}
@override
get body => null;
Future request() {
return APIProvider.instance.request(this);
}
@override
String get url => endpoint + path;
}
================================================
FILE: lib/data/providers/network/apis/auth_api.dart
================================================
import 'dart:io';
import 'package:getx_clean_architecture/data/providers/network/api_endpoint.dart';
import 'package:getx_clean_architecture/data/providers/network/api_provider.dart';
import 'package:getx_clean_architecture/data/providers/network/api_request_representable.dart';
enum AuthType { login, logout }
class AuthAPI implements APIRequestRepresentable {
final AuthType type;
String? username;
String? password;
AuthAPI._({required this.type, this.password, this.username});
AuthAPI.login(String username, String repo) : this._(type: AuthType.login);
AuthAPI.register(String password, String username)
: this._(type: AuthType.login, username: username, password: password);
@override
String get endpoint => APIEndpoint.newsapi;
String get path {
switch (type) {
case AuthType.login:
return "/$username/$username";
case AuthType.logout:
return "/login";
default:
return "";
}
}
@override
HTTPMethod get method {
return HTTPMethod.post;
}
Map get headers =>
{HttpHeaders.contentTypeHeader: 'application/json'};
Map get query {
return {HttpHeaders.contentTypeHeader: 'application/json'};
}
@override
get body => null;
Future request() {
return APIProvider.instance.request(this);
}
@override
String get url => endpoint + path;
}
================================================
FILE: lib/data/repositories/article_repository.dart
================================================
import 'package:getx_clean_architecture/data/models/paging_model.dart';
import 'package:getx_clean_architecture/data/providers/network/apis/article_api.dart';
import 'package:getx_clean_architecture/domain/repositories/article_repository.dart';
class ArticleRepositoryIml extends ArticleRepository {
@override
Future fetchHeadline(int page, int pageSize) async {
final response = await ArticleAPI.fetchHeadline(page, pageSize).request();
return PagingModel.fromJson(response);
}
@override
Future fetchNewsByCategory(
String keyword, int page, int pageSize) async {
final response =
await ArticleAPI.fetchNews(keyword, page, pageSize).request();
return PagingModel.fromJson(response);
}
}
================================================
FILE: lib/data/repositories/auth_repository.dart
================================================
import 'package:getx_clean_architecture/domain/entities/user.dart';
import 'package:getx_clean_architecture/domain/repositories/auth_repository.dart';
class AuthenticationRepositoryIml extends AuthenticationRepository {
@override
Future signUp(String username) async {
//Fake sign up action
await Future.delayed(Duration(seconds: 1));
return User(username: username);
}
}
================================================
FILE: lib/domain/entities/article.dart
================================================
class Article {
Article({
this.author,
this.title,
this.description,
this.url,
this.urlToImage,
this.publishedAt,
this.content,
});
String? author;
String? title;
String? description;
String? url;
String? urlToImage;
DateTime? publishedAt;
String? content;
}
================================================
FILE: lib/domain/entities/paging.dart
================================================
import 'package:getx_clean_architecture/domain/entities/article.dart';
class Paging {
Paging({
required this.totalResults,
required this.articles,
});
int totalResults;
List articles;
}
================================================
FILE: lib/domain/entities/user.dart
================================================
class User {
User({this.username});
String? username;
factory User.fromJson(Map? json) {
return User(
username: json?['username'] as String?,
);
}
Map toJson() => {
'username': username,
};
}
================================================
FILE: lib/domain/repositories/article_repository.dart
================================================
import 'package:getx_clean_architecture/domain/entities/paging.dart';
abstract class ArticleRepository {
Future fetchHeadline(int page, int pageSize);
Future fetchNewsByCategory(String keyword, int page, int pageSize);
}
================================================
FILE: lib/domain/repositories/auth_repository.dart
================================================
import 'package:getx_clean_architecture/domain/entities/user.dart';
abstract class AuthenticationRepository {
Future signUp(String username);
}
================================================
FILE: lib/domain/usecases/fetch_headline_use_case.dart
================================================
import 'package:getx_clean_architecture/app/core/usecases/pram_usecase.dart';
import 'package:getx_clean_architecture/domain/entities/paging.dart';
import 'package:getx_clean_architecture/domain/repositories/article_repository.dart';
import 'package:tuple/tuple.dart';
class FetchHeadlineUseCase extends ParamUseCase> {
final ArticleRepository _repo;
FetchHeadlineUseCase(this._repo);
@override
Future execute(Tuple2 param) {
return _repo.fetchHeadline(param.item1, param.item2);
}
}
================================================
FILE: lib/domain/usecases/fetch_news_use_case.dart
================================================
import 'package:getx_clean_architecture/app/core/usecases/pram_usecase.dart';
import 'package:getx_clean_architecture/domain/entities/paging.dart';
import 'package:getx_clean_architecture/domain/repositories/article_repository.dart';
import 'package:tuple/tuple.dart';
class FetchNewsUseCase extends ParamUseCase> {
final ArticleRepository _repo;
FetchNewsUseCase(this._repo);
@override
Future execute(Tuple3 param) {
return _repo.fetchNewsByCategory(param.item1, param.item2, param.item3);
}
}
================================================
FILE: lib/domain/usecases/signup_use_case.dart
================================================
import 'package:getx_clean_architecture/app/core/usecases/pram_usecase.dart';
import 'package:getx_clean_architecture/domain/entities/user.dart';
import 'package:getx_clean_architecture/domain/repositories/auth_repository.dart';
class SignUpUseCase extends ParamUseCase {
final AuthenticationRepository _repo;
SignUpUseCase(this._repo);
@override
Future execute(String username) {
return _repo.signUp(username);
}
}
================================================
FILE: lib/generated_plugin_registrant.dart
================================================
//
// Generated file. Do not edit.
//
// ignore_for_file: lines_longer_than_80_chars
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
SharedPreferencesPlugin.registerWith(registrar);
registrar.registerMessageHandler();
}
================================================
FILE: lib/main.dart
================================================
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_clean_architecture/app/services/local_storage.dart';
import 'package:getx_clean_architecture/app/util/dependency.dart';
import 'package:getx_clean_architecture/presentation/app.dart';
void main() async {
DependencyCreator.init();
WidgetsFlutterBinding.ensureInitialized();
await initServices();
runApp(App());
}
initServices() async {
print('starting services ...');
await Get.putAsync(() => LocalStorageService().init());
print('All services started...');
}
================================================
FILE: lib/presentation/app.dart
================================================
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_clean_architecture/presentation/controllers/auth/auth_binding.dart';
import 'package:getx_clean_architecture/presentation/pages/home/home_page.dart';
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetCupertinoApp(
initialRoute: "/",
initialBinding: AuthBinding(),
home: HomePage(),
);
}
}
================================================
FILE: lib/presentation/controllers/auth/auth_binding.dart
================================================
import 'package:get/get.dart';
import 'package:getx_clean_architecture/data/repositories/auth_repository.dart';
import 'package:getx_clean_architecture/domain/usecases/signup_use_case.dart';
import 'package:getx_clean_architecture/presentation/controllers/auth/auth_controller.dart';
class AuthBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => SignUpUseCase(Get.find()));
Get.put(AuthController(Get.find()), permanent: true);
}
}
================================================
FILE: lib/presentation/controllers/auth/auth_controller.dart
================================================
import 'package:get/get.dart';
import 'package:getx_clean_architecture/app/services/local_storage.dart';
import 'package:getx_clean_architecture/domain/entities/user.dart';
import 'package:getx_clean_architecture/domain/usecases/signup_use_case.dart';
class AuthController extends GetxController {
AuthController(this._loginUseCase);
final SignUpUseCase _loginUseCase;
final store = Get.find();
var isLoggedIn = false.obs;
User? get user => store.user;
@override
void onInit() async {
super.onInit();
isLoggedIn.value = store.user != null;
}
signUpWith(String username) async {
try {
final user = await _loginUseCase.execute(username);
store.user = user;
isLoggedIn.value = true;
isLoggedIn.refresh();
} catch (error) {}
}
logout() {
store.user = null;
isLoggedIn.value = false;
}
}
================================================
FILE: lib/presentation/controllers/headline/headline_binding.dart
================================================
import 'package:get/get.dart';
import 'package:getx_clean_architecture/domain/usecases/fetch_headline_use_case.dart';
import 'package:getx_clean_architecture/data/repositories/article_repository.dart';
import 'package:getx_clean_architecture/presentation/controllers/headline/headline_controller.dart';
class HeadlineBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => FetchHeadlineUseCase(Get.find()));
Get.lazyPut(() => HeadlineController(Get.find()));
}
}
================================================
FILE: lib/presentation/controllers/headline/headline_controller.dart
================================================
import 'package:get/get.dart';
import 'package:getx_clean_architecture/domain/entities/article.dart';
import 'package:getx_clean_architecture/domain/entities/paging.dart';
import 'package:getx_clean_architecture/domain/usecases/fetch_headline_use_case.dart';
import 'package:tuple/tuple.dart';
class HeadlineController extends GetxController {
HeadlineController(this._fetchHeadlineUseCase);
final FetchHeadlineUseCase _fetchHeadlineUseCase;
int _currentPage = 1;
int _pageSize = 20;
var _isLoadMore = false;
var _paging = Rx(null);
var articles = RxList([]);
fetchData() async {
final newPaging =
await _fetchHeadlineUseCase.execute(Tuple2(_currentPage, _pageSize));
articles.assignAll(newPaging.articles);
_paging.value = newPaging;
}
loadMore() async {
final totalResults = _paging.value?.totalResults ?? 0;
if (totalResults / _pageSize <= _currentPage) return;
if (_isLoadMore) return;
_isLoadMore = true;
_currentPage += 1;
final newPaging =
await _fetchHeadlineUseCase.execute(Tuple2(_currentPage, _pageSize));
articles.addAll(newPaging.articles);
_paging.value?.totalResults = newPaging.totalResults;
_isLoadMore = false;
}
}
================================================
FILE: lib/presentation/controllers/news/news_binding.dart
================================================
import 'package:get/get.dart';
import 'package:getx_clean_architecture/data/repositories/article_repository.dart';
import 'package:getx_clean_architecture/domain/usecases/fetch_news_use_case.dart';
import 'package:getx_clean_architecture/presentation/controllers/news/news_controller.dart';
class NewsBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => FetchNewsUseCase(Get.find()));
Get.lazyPut(() => NewsController(Get.find()));
}
}
================================================
FILE: lib/presentation/controllers/news/news_controller.dart
================================================
import 'package:get/get.dart';
import 'package:getx_clean_architecture/domain/entities/article.dart';
import 'package:getx_clean_architecture/domain/entities/paging.dart';
import 'package:getx_clean_architecture/domain/usecases/fetch_news_use_case.dart';
import 'package:tuple/tuple.dart';
class NewsController extends GetxController {
NewsController(this._fetchNewlineUseCase);
final FetchNewsUseCase _fetchNewlineUseCase;
int _currentPage = 1;
int _pageSize = 20;
var _isLoadMore = false;
var _paging = Rx(null);
var articles = RxList([]);
fetchData(String keyword) async {
_currentPage = 1;
final newPaging = await _fetchNewlineUseCase
.execute(Tuple3(keyword, _currentPage, _pageSize));
articles.assignAll(newPaging.articles);
_paging.value = newPaging;
}
loadMore(String keyword) async {
final totalResults = _paging.value?.totalResults ?? 0;
if (totalResults / _pageSize <= _currentPage) return;
if (_isLoadMore) return;
_isLoadMore = true;
_currentPage += 1;
final newPaging = await _fetchNewlineUseCase
.execute(Tuple3(keyword, _currentPage, _pageSize));
articles.addAll(newPaging.articles);
_paging.value?.totalResults = newPaging.totalResults;
_isLoadMore = false;
}
}
================================================
FILE: lib/presentation/pages/detail/detail_page.dart
================================================
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:getx_clean_architecture/app/config/app_text_styles.dart';
import 'package:getx_clean_architecture/domain/entities/article.dart';
class DetailPage extends StatelessWidget {
final Article article;
DetailPage({required this.article});
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Detail'),
),
child: SafeArea(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 5),
child: Column(
children: [
Text(
article.title ?? "",
style: AppTextStyles.title,
maxLines: null,
),
SizedBox(
height: 10,
),
AspectRatio(
aspectRatio: 16 / 9,
child: CachedNetworkImage(
memCacheHeight: 150,
memCacheWidth: 150,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
),
),
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Container(
color: Colors.grey,
),
imageUrl: article.urlToImage ?? "",
),
),
SizedBox(
height: 10,
),
Text(
article.content ?? "",
style: AppTextStyles.body,
),
],
),
),
),
);
}
}
================================================
FILE: lib/presentation/pages/headline/headline_page.dart
================================================
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:getx_clean_architecture/presentation/controllers/headline/headline_controller.dart';
import 'package:getx_clean_architecture/presentation/pages/detail/detail_page.dart';
import 'package:getx_clean_architecture/presentation/pages/headline/views/article_cell.dart';
class HeadlinePage extends GetView {
final _scrollController = ScrollController();
@override
Widget build(BuildContext context) {
return GetX(
init: controller,
initState: (state) {
controller.fetchData();
},
didUpdateWidget: (old, newState) {
_scrollController.addListener(_scrollListener);
},
dispose: (state) {
_scrollController.removeListener(_scrollListener);
},
builder: (_) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Headline'),
),
child: ListView.builder(
controller: _scrollController,
itemCount: controller.articles.length,
itemBuilder: (context, index) {
final article = controller.articles[index];
return GestureDetector(
onTap: () {
Get.to(() => DetailPage(article: article));
},
child: ArticleCell(article: article),
);
},
),
);
},
);
}
void _scrollListener() {
if (_scrollController.position.extentAfter < 500) {
print("load more");
controller.loadMore();
}
}
}
================================================
FILE: lib/presentation/pages/headline/views/article_cell.dart
================================================
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:getx_clean_architecture/app/config/app_text_styles.dart';
import 'package:jiffy/jiffy.dart';
import 'package:getx_clean_architecture/domain/entities/article.dart';
class ArticleCell extends StatelessWidget {
final Article article;
ArticleCell({required this.article});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(10),
height: 100,
child: Row(
children: [
Container(
margin: const EdgeInsets.only(right: 10),
child: CachedNetworkImage(
width: 120,
memCacheHeight: 150,
memCacheWidth: 150,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
),
),
placeholder: (context, url) => CupertinoActivityIndicator(),
errorWidget: (context, url, error) => Container(
color: Colors.grey,
),
imageUrl: article.urlToImage ?? "",
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
article.title ?? "",
maxLines: 2,
style: AppTextStyles.title,
),
Spacer(),
Text(
article.author ?? "",
maxLines: 1,
style: AppTextStyles.body,
),
Text(
Jiffy(article.publishedAt).yMMMMd,
maxLines: 1,
style: AppTextStyles.body,
),
],
),
),
],
),
);
}
}
================================================
FILE: lib/presentation/pages/home/home_page.dart
================================================
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:getx_clean_architecture/app/config/app_colors.dart';
import 'package:getx_clean_architecture/app/types/tab_type.dart';
import 'package:getx_clean_architecture/presentation/controllers/auth/auth_controller.dart';
import 'package:getx_clean_architecture/presentation/controllers/headline/headline_binding.dart';
import 'package:getx_clean_architecture/presentation/controllers/news/news_binding.dart';
import 'package:getx_clean_architecture/presentation/pages/headline/headline_page.dart';
import 'package:getx_clean_architecture/presentation/pages/news/news_page.dart';
import 'package:getx_clean_architecture/presentation/pages/profile/profile_page.dart';
class HomePage extends GetView {
@override
Widget build(BuildContext context) {
return CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: TabType.values
.map((e) => BottomNavigationBarItem(icon: e.icon, label: e.title))
.toList(),
inactiveColor: AppColors.lightGray,
activeColor: AppColors.primary,
),
tabBuilder: (context, index) {
final type = TabType.values[index];
switch (type) {
case TabType.headline:
HeadlineBinding().dependencies();
return HeadlinePage();
case TabType.news:
NewsBinding().dependencies();
return NewsPage();
case TabType.profile:
return ProfilePage();
}
},
);
}
}
================================================
FILE: lib/presentation/pages/news/news_page.dart
================================================
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_clean_architecture/app/types/category_type.dart';
import 'package:getx_clean_architecture/presentation/controllers/news/news_controller.dart';
import 'package:getx_clean_architecture/presentation/pages/detail/detail_page.dart';
import 'package:getx_clean_architecture/presentation/pages/headline/views/article_cell.dart';
class NewsPage extends StatefulWidget {
@override
_NewsPagePage createState() => _NewsPagePage();
}
class _NewsPagePage extends State {
final NewsController newsController = Get.find();
final _scrollController = ScrollController();
CategoryType _currentCategory = CategoryType.bitcoin;
@override
Widget build(BuildContext context) {
return GetX(
init: newsController,
didUpdateWidget: (old, newState) {
_scrollController.addListener(_scrollListener);
},
dispose: (state) {
_scrollController.removeListener(_scrollListener);
},
builder: (_) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: const Text('News'),
trailing: TextButton(
onPressed: () {
_selectCategory(context);
},
child: Text(_currentCategory.keyword.capitalizeFirst ?? "")),
),
child: ListView.builder(
controller: _scrollController,
itemCount: newsController.articles.length,
itemBuilder: (context, index) {
final article = newsController.articles[index];
return GestureDetector(
onTap: () {
Get.to(() => DetailPage(article: article));
},
child: ArticleCell(article: article),
);
},
),
);
},
);
}
_selectCategory(BuildContext context) {
final actions = CategoryType.values
.map(
(e) => CupertinoActionSheetAction(
child: Text(e.keyword.capitalizeFirst ?? ""),
onPressed: () {
setState(() {
_currentCategory = e;
});
newsController.fetchData(e.keyword);
Navigator.pop(context);
},
),
)
.toList();
showCupertinoModalPopup(
context: context,
builder: (BuildContext context) => CupertinoActionSheet(
title: const Text('Select category'),
actions: actions,
),
);
}
_scrollListener() {
if (_scrollController.position.extentAfter < 500) {
newsController.loadMore(_currentCategory.keyword);
}
}
}
================================================
FILE: lib/presentation/pages/profile/profile_page.dart
================================================
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_clean_architecture/app/config/app_colors.dart';
import 'package:getx_clean_architecture/app/config/app_text_styles.dart';
import 'package:getx_clean_architecture/presentation/controllers/auth/auth_controller.dart';
class ProfilePage extends GetView {
@override
Widget build(BuildContext context) {
return GetX(
init: controller,
builder: (_) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Profile'),
),
child: controller.isLoggedIn.value
? SignInView()
: SignUpView(
onRegister: (username) {
controller.signUpWith(username);
},
),
);
},
);
}
}
class SignInView extends GetView {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 50),
_buildItem(
"Username:",
Text(
controller.user?.username ?? "",
style: AppTextStyles.title,
),
),
TextButton(onPressed: controller.logout, child: Text("Logout")),
],
),
),
);
}
_buildItem(String title, Widget child) {
return Row(
children: [
Text(
title,
style: AppTextStyles.title,
),
SizedBox(
width: 10,
),
child
],
);
}
}
class SignUpView extends StatelessWidget {
final _userNameController = TextEditingController();
final Function(String) onRegister;
SignUpView({required this.onRegister});
@override
Widget build(BuildContext context) {
return SafeArea(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(height: 50),
SizedBox(
height: 50,
child: Text(
"Register your username",
style: AppTextStyles.title,
),
),
SizedBox(height: 50),
_buildLoginForm(context),
SizedBox(height: 50),
_buildLoginButton(),
],
),
),
);
}
Widget _buildLoginForm(BuildContext context) {
return Container(
height: 50,
child: CupertinoTextField(
keyboardType: TextInputType.emailAddress,
placeholder: "Enter username",
controller: _userNameController,
),
);
}
Widget _buildLoginButton() {
return MaterialButton(
onPressed: () {
onRegister(_userNameController.text);
},
child: Text(
"Register",
style: AppTextStyles.body,
),
color: AppColors.primary,
elevation: 0,
minWidth: 350,
height: 55,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
);
}
}
================================================
FILE: pubspec.yaml
================================================
name: getx_clean_architecture
description: A Flutter Clean Architecture Using GetX.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
get: ^4.1.4
tuple: ^2.0.0
cached_network_image: ^3.1.0
json_annotation:
jiffy: ^4.1.0
shared_preferences: ^2.0.6
visibility_detector: ^0.2.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/images/
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
================================================
FILE: test/data/headline_sample.json
================================================
{"status":"ok","totalResults":38,"articles":[{"source":{"id":"fox-news","name":"Fox News"},"author":"Jon Street","title":"Two more Texas Democrats test positive for COVID after fleeing election vote - Fox News","description":"Two more Texas Democrats have tested positive for coronavirus during the trip to Washington, D.C., just one day after three of their colleagues learned they had contracted the virus as well.","url":"https://www.foxnews.com/politics/texas-democrats-test-positive-for-covid-in-dc","urlToImage":"https://static.foxnews.com/foxnews.com/content/uploads/2021/07/image__9__720.png","publishedAt":"2021-07-19T01:59:01Z","content":"Two more Texas Democrats have tested positive for coronavirus during their trip to Washington, D.C., just one day after three of their colleagues learned they had contracted the virus as well. \r\nAcco… [+2105 chars]"},{"source":{"id":"cnn","name":"CNN"},"author":"Analysis by Paul LeBlanc, CNN","title":"Here's what vaccinated people need to know as Covid case counts rise - CNN ","description":"Biden takes aim at Facebook. President Joe Biden said Friday that social media platforms like Facebook are \"killing people\" with misinformation surrounding the Covid-19 pandemic.","url":"https://www.cnn.com/2021/07/18/politics/what-matters-for-july-18/index.html","urlToImage":"https://cdn.cnn.com/cnnnext/dam/assets/210714234335-vacuna-covid-variante-delta-super-tease.jpg","publishedAt":"2021-07-19T00:30:00Z","content":null},{"source":{"id":null,"name":"New York Times"},"author":"Matt Craig, Livia Albeck-Ripka","title":"Wary and Weary, Los Angeles Largely Accepts Restored Mask Mandate - The New York Times","description":"Los Angeles County on Sunday became the first major county to revert to requiring masks for all people indoors in public spaces.","url":"https://www.nytimes.com/2021/07/18/us/la-masks-covid.html","urlToImage":"https://static01.nyt.com/images/2021/07/18/us/18VIRUS-LAMASK-3/18VIRUS-LAMASK-3-facebookJumbo.jpg","publishedAt":"2021-07-19T00:23:04Z","content":"County health officials came under public pressure in January, when the decision to continue vaccinating only health care workers contradicted a state announcement of eligibility for adults age 65 an… [+1603 chars]"},{"source":{"id":null,"name":"PEOPLE"},"author":"Abigail Adams","title":"Jamie Lynn Spears Shares Cryptic Post About 'Peace' After Sister Britney Spears' Impassioned Instagram Message - Yahoo Entertainment","description":"The Zoey 101 star shared a message of her own alongside some mirror selfies in a revealing red ensemble on Sunday","url":"https://people.com/music/jamie-lynn-spears-preaches-peace-after-sister-britney-spears-message/","urlToImage":"https://imagesvc.meredithcorp.io/v3/mm/image?q=85&c=sc&poi=%5B980%2C306%5D&w=2000&h=1000&url=https%3A%2F%2Fstatic.onecms.io%2Fwp-content%2Fuploads%2Fsites%2F20%2F2020%2F11%2F11%2Fbritney-spears-2000.jpg","publishedAt":"2021-07-19T00:16:57Z","content":"Jamie Lynn Spears is taking some time to reflect.\r\nThe Zoey 101 star, 30, posed for some mirror selfies on Sunday after being publicly called out by her sister Britney Spears on Instagram Saturday.\r\n… [+3131 chars]"},{"source":{"id":"google-news","name":"Google News"},"author":null,"title":"Jeff Bezos & Blue Origin Prepare For Space Launch - NBC News","description":null,"url":"https://news.google.com/__i/rss/rd/articles/CBMiK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TFRTSlFNb1Q5MHfSAQA?oc=5","urlToImage":null,"publishedAt":"2021-07-19T00:00:07Z","content":null},{"source":{"id":null,"name":"ESPN"},"author":null,"title":"United States vs. Canada - Football Match Report - July 18, 2021 - ESPN","description":"Get a report of the United States vs. Canada 2021 CONCACAF Gold Cup, Group Stage football match.","url":"https://www.espn.com/soccer/report/_/gameId/602704","urlToImage":"https://a2.espncdn.com/combiner/i?img=%2Fphoto%2F2021%2F0718%2Fr881912_1296x729_16%2D9.jpg","publishedAt":"2021-07-18T23:33:39Z","content":"Shaq Moore scored 20 seconds in and the United States beat Canada 1-0 on Sunday to win Group B at the CONCACAF Gold Cup.\r\nMoore's goal was the fastest in Gold Cup history and the fastest for the U.S.… [+2296 chars]"},{"source":{"id":"usa-today","name":"USA Today"},"author":"Bryan Alexander, USA TODAY","title":"LeBron James dunks on 'Space Jam: A New Legacy' haters, plus that epic Michael Jordan 'cameo' - USA TODAY","description":"LeBron James trash-talked \"Space Jam: A New Legacy\" haters on Twitter. All about that box-office burn and Michael Jordan's appearance. Spoilers ahead!","url":"https://www.usatoday.com/story/entertainment/movies/2021/07/18/space-jam-lebron-james-taunts-haters-plus-michael-jordan-spoilers/7988539002/","urlToImage":"https://www.gannett-cdn.com/presto/2021/07/18/USAT/88f58ee5-3cbe-4662-8b12-4fca33f52e68-rev-1-SJM-FP-0010_High_Res_JPEG.jpeg?auto=webp&crop=2904,1634,x1300,y36&format=pjpg&width=1200","publishedAt":"2021-07-18T23:04:30Z","content":"
\"Space Jam: A New Legacy\" won the box office crown over \"Black Widow\" this weekend.
LeBron James tweeted an article about the win, writing \"Hi Haters!\" with a laughing emoji.
… [+3831 chars]"},{"source":{"id":"fox-news","name":"Fox News"},"author":"Brittany De Lea","title":"Biden poses with ice cream cone on 'national ice cream day' - Fox News","description":"President Biden on Sunday celebrated national ice cream day by posting an image of himself grabbing a large cone and posing for a selfie.","url":"https://www.foxnews.com/politics/biden-ice-cream-on-natonal-ice-cream-day","urlToImage":"https://static.foxnews.com/foxnews.com/content/uploads/2021/06/AP21166471478931.jpg","publishedAt":"2021-07-18T22:50:20Z","content":"President Joe Biden on Sunday celebrated national ice cream day by posting an image of himself grabbing a large cone and posing for a selfie.\r\nThe president posted the picture on Twitter with the cap… [+698 chars]"},{"source":{"id":null,"name":"CBS Sports"},"author":"","title":"NBA Finals: Monty Williams says Suns must be willing to 'do whatever it takes' to force Game 7 in Phoenix - CBS Sports","description":"After winning the first two games of the series, the Suns have lost three straight and are facing elimination","url":"https://www.cbssports.com/nba/news/nba-finals-monty-williams-says-suns-must-be-willing-to-do-whatever-it-takes-to-force-game-7-in-phoenix/","urlToImage":"https://sportshub.cbsistatic.com/i/r/2021/05/18/f239e087-d96b-4a20-b06c-d6355c9a4101/thumbnail/1200x675/032f88a2252f15fb9aa547c05e4b873d/monty-williams.jpg","publishedAt":"2021-07-18T22:49:00Z","content":"Things started off really well for the Phoenix Suns in the 2021 NBA Finals. They won the first two games of the series and appeared poised to win their first championship in franchise history. Howeve… [+2536 chars]"},{"source":{"id":null,"name":"NPR"},"author":"","title":"2 Weeks After Surgery, The Pope Is Back At St. Peter's Square - NPR","description":"The pope offered blessings for people affected by flooding in Western Europe, rioting in South Africa and protests in Cuba.","url":"https://www.npr.org/2021/07/18/1017646963/pope-francis-delivers-first-address-since-leaving-hospital","urlToImage":"https://media.npr.org/assets/img/2021/07/18/ap_21199392116038_wide-67bbab4e11e623e786fb3ae24ad207630f1ca775.jpg?s=1400","publishedAt":"2021-07-18T22:12:04Z","content":"Pope Francis salutes the crowd as he arrives for the Angelus noon prayer from the window of his studio overlooking St. Peter's Square at the Vatican on Sunday.\r\nAlessandra Tarantino/AP\r\nTwo weeks aft… [+2016 chars]"},{"source":{"id":"fox-news","name":"Fox News"},"author":"New York Post","title":"Athletes to sleep on ‘anti-sex’ cardboard beds at Olympic Games amid COVID - Fox News","description":"Lustful Olympic athletes should think twice before making the bed rock in Tokyo.","url":"https://www.foxnews.com/sports/athletes-to-sleep-on-anti-sex-cardboard-beds-at-olympic-games-amid-covid","urlToImage":"https://static.foxnews.com/foxnews.com/content/uploads/2020/03/Tokyo-Olympics11.jpg","publishedAt":"2021-07-18T22:07:28Z","content":"Lustful Olympic athletes should think twice before making the bed rock in Tokyo.\r\nThe worlds best sports competitors are set to spend their nights on cardboard beds allegedly designed to collapse und… [+2083 chars]"},{"source":{"id":"cnn","name":"CNN"},"author":"Rachel Trent, CNN","title":"Astronauts on International Space Station are growing chile peppers in a first for NASA - CNN ","description":"Astronauts on the International Space Station are trying to spice up their diets.","url":"https://www.cnn.com/2021/07/18/us/nasa-peppers-space-station-scn-trnd/index.html","urlToImage":"https://cdn.cnn.com/cnnnext/dam/assets/210718143641-nasa-peppers-space-station-trnd-super-tease.jpg","publishedAt":"2021-07-18T21:50:00Z","content":null},{"source":{"id":"nbc-news","name":"NBC News"},"author":"Dennis Romero, Kelcey Henderson","title":"Packing tape and empty bag of chips: NYPD officer aids stabbing victim - NBC News","description":"A New York police officer channeled MacGyver this month by using an empty chips bag go help save a Harlem stabbing victim.","url":"https://www.nbcnews.com/news/us-news/packing-tape-empty-bag-chips-nypd-officer-aids-stabbing-victim-n1274320","urlToImage":"https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/newscms/2021_28/3492086/210718-nypd-cop-aids-stabbing-victim-jm-1535.jpg","publishedAt":"2021-07-18T21:29:00Z","content":"A New York police officer took a page from ingenious TV problem solver MacGyver, using an empty potato chip bag and tape to slow the bleeding of a stabbing victim, police said Sunday.\r\nPolice body ca… [+2073 chars]"},{"source":{"id":"fox-news","name":"Fox News"},"author":"Lindsay Kornick","title":"Washington Post report neglected spyware firm's Democratic connections in hacking investigation - Fox News","description":"The Washington Post neglected to reference an Israeli firm’s Democratic connections when releasing an investigation into a hacking scandal.","url":"https://www.foxnews.com/media/wapo-neglected-spyware-democratic-hacking-investigation","urlToImage":"https://static.foxnews.com/foxnews.com/content/uploads/2021/01/Anita-Dunn-GETTY.jpg","publishedAt":"2021-07-18T21:19:20Z","content":"The Washington Post neglected to reference an Israeli firms Democratic connections when releasing an investigation into a hacking scandal.\r\nOn Sunday, the Washington Post published an article titled … [+2914 chars]"},{"source":{"id":"the-washington-post","name":"The Washington Post"},"author":"Amy B Wang, Christopher Rowland","title":"Biden's surgeon general backs localized mask mandates as delta variant drives rise in covid cases - The Washington Post","description":"Democratic and Republican officials also spoke out against coronavirus misinformation, urging people to get vaccinated.","url":"https://www.washingtonpost.com/politics/2021/07/18/vivek-murthy-covid-vaccines/","urlToImage":"https://www.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/Z4UWATXFTEI6XCGFJ7LDQLCHZM.jpg&w=1440","publishedAt":"2021-07-18T21:14:35Z","content":"Its very reasonable for counties to take more mitigation measures like the mask rules you see coming out in L.A., and I anticipate that will happen in other parts of the country too, Murthy said on A… [+4449 chars]"},{"source":{"id":"the-hill","name":"The Hill"},"author":"Caroline Vakil","title":"More evacuations ordered after California wildfire jumps highway | TheHill - The Hill","description":"A fire in the Lake Tahoe, Calif., area jumped a highway and force...","url":"https://thehill.com/policy/energy-environment/563611-more-evacuations-ordered-after-california-wildfire-jumps-highway","urlToImage":"https://thehill.com/sites/default/files/wildfire_ca_getty102720.jpg","publishedAt":"2021-07-18T21:11:07Z","content":"A fire in the Lake Tahoe, Calif., area jumped a highway and forced additional evacuations and the cancellation of an intensive bike race, The Associated Press reported.\r\nThe Tamarack Fire, just south… [+1631 chars]"},{"source":{"id":null,"name":"WJXT News4JAX"},"author":"Steve Patrick, Marilyn Parker","title":"Greater Jacksonville driving Florida's COVID-19 surge - WJXT News4JAX ","description":"The rate of infections in Jacksonville and three nearby counties is even higher than the state average and surpassing the increases seen in the state’s first coronavirus spike last summer.","url":"https://www.news4jax.com/news/local/2021/07/18/greater-jacksonville-driving-floridas-covid-19-surge/","urlToImage":"https://www.news4jax.com/resizer/r7q0b5KUtiTCTdx0kxDTD3uFViY=/800x450/smart/filters:format(jpeg):strip_exif(true):strip_icc(true):no_upscale(true):quality(65)/d1vhqlrjc8h82r.cloudfront.net/07-19-2021/t_c3acb0bb44ed49cfaede55616d01668d_name_Virus_Outbreak_US__scaled.jpg","publishedAt":"2021-07-18T20:51:06Z","content":"JACKSONVILLE, Fla. Floridas number of coronavirus cases diagnosed last week -- 45,449 -- is nearing the increases seen in last summers spike. That week-to-week growth rate of infections is the highes… [+2661 chars]"},{"source":{"id":null,"name":"Variety"},"author":"Rebecca Rubin","title":"Movie Theater Owners Blame Marvel’s ‘Black Widow’ Box Office ‘Collapse’ on Disney Plus Launch - Variety","description":"Movie theater operators did not mince words in asserting that Disney left money on the table by putting Marvel’s “Black Widow” on Disney Plus on the same day as its theatrical debut. Disney announced in March that “Black Widow,” among several of its 2021 film…","url":"https://variety.com/2021/film/news/movie-theater-owners-black-widow-disney-plus-1235022524/","urlToImage":"https://variety.com/wp-content/uploads/2021/07/Black-Widow-Marvel.jpg?w=1000","publishedAt":"2021-07-18T20:49:00Z","content":"Movie theater operators did not mince words in asserting that Disney left money on the table by putting Marvel’s “Black Widow” on Disney Plus on the same day as its theatrical debut.\r\nDisney announce… [+6149 chars]"},{"source":{"id":null,"name":"Fox Business"},"author":"Brittany De Lea","title":"Johnson & Johnson weighing bankruptcy plan as it considers offloading baby powder liabilities: report - Fox Business","description":"Retailer Johnson & Johnson is reportedly considering spinning off liabilities from its Baby Powder unit due ongoing litigation, with plans to seek bankruptcy protection for that new business.","url":"https://www.foxbusiness.com/retail/johnson-johnson-weighing-bankruptcy-plan-as-it-considers-offloading-baby-powder-liabilities-report","urlToImage":"https://a57.foxnews.com/static.foxbusiness.com/foxbusiness.com/content/uploads/2019/10/0/0/Baby-Powder-1.jpg?ve=1&tl=1","publishedAt":"2021-07-18T20:35:22Z","content":"Retailer Johnson & Johnson is reportedly considering spinning off liabilities from its Baby Powder unit due to ongoing litigation, with plans to seek bankruptcy protection for that new business.\r… [+1578 chars]"},{"source":{"id":"the-verge","name":"The Verge"},"author":"Kim Lyons","title":"New Steam Deck reservations now showing ‘expected order availability’ in Q2 and Q3 2022 - The Verge","description":"Valve revealed its handheld gaming device on Thursday, and was inundated with reservations when it first made them available. The company is planning to begin converting reservations to orders in December.","url":"https://www.theverge.com/2021/7/18/22582617/new-steam-deck-reservations-q2-q3-valve-hand-held","urlToImage":"https://cdn.vox-cdn.com/thumbor/j6TnsQXbwiyB1vypD3ZkyRZtqfY=/0x380:3684x2309/fit-in/1200x630/cdn.vox-cdn.com/uploads/chorus_asset/file/22720898/Steam_Deck_case.jpg","publishedAt":"2021-07-18T20:25:23Z","content":"Valve has opened up reservations for people without existing Steam accounts as well\r\nSteam Deck will start shipping in December 2021\r\nImage: Valve\r\nIf youre looking to reserve a Steam Deck and havent… [+1102 chars]"}]}
================================================
FILE: test/data/news_sample.json
================================================
{"status":"ok","totalResults":3,"articles":[{"source":{"id":"t3n","name":"T3n"},"author":"Jörn Brien","title":"Schlag gegen Bitcoin-Miner: Mining-Rigs im Wert von 1 Million Euro plattgewalzt","description":"Malaysische Behörden haben Bitcoin-Mining-Rigs im Wert von über einer Million Euro mit einer Straßenwalze zers","url":"https://t3n.de/news/bitcoin-mining-rigs-plattgewalzt-1392327/","urlToImage":"https://t3n.de/news/wp-content/uploads/2018/08/mining.jpg","publishedAt":"2021-07-18T17:02:47Z","content":"Hinweis: Wir haben in diesem Artikel Provisions-Links verwendet und sie durch \"*\" gekennzeichnet. Erfolgt über diese Links eine Bestellung, erhält t3n.de eine Provision.\r\nMalaysische Behörden haben B… [+2923 chars]"},{"source":{"id":"new-scientist","name":"New Scientist"},"author":null,"title":"Coal-powered bitcoin mining soars in Kazakhstan following Chinese ban","description":"A Chinese bitcoin ban has seen power-hungry miners move to Kazakhstan, where fossil fuels including coal power make up more than 90 per cent of the nation's electricity supply","url":"https://www.newscientist.com/article/2284222-coal-powered-bitcoin-mining-soars-in-kazakhstan-following-chinese-ban/","urlToImage":"https://images.newscientist.com/wp-content/uploads/2021/07/16115544/15-july_coal-powered-bitcoin-mining.jpg","publishedAt":"2021-07-16T00:00:00Z","content":"By Matthew Sparkes\r\nA coal mine in Kazakhstan\r\nMagnus Møller/Alamy\r\nChinese bitcoin mining has almost entirely ceased since the government restricted cryptocurrency use in May, meaning much of this a… [+2954 chars]"},{"source":{"id":"les-echos","name":"Les Echos"},"author":"Nessim Aït-Kacimi","title":"Dix milliards de dollars d'activités illicites financées en cryptos lors de la crise du Covid","description":"Même si cela reste une faible proportion des transactions totales sur les cryptos, les activités illicites (blanchiment, trafics…) financées en bitcoin et autres cryptos ont atteint 10 milliards de dollars l'an dernier. Les « supermarchés » de la drogue en li…","url":"https://www.lesechos.fr/finance-marches/marches-financiers/dix-milliards-de-dollars-dactivites-illicites-financees-en-cryptos-lors-de-la-crise-du-covid-1332349","urlToImage":"https://media.lesechos.com/api/v1/images/view/60f01cbcd286c273620c3a65/1280x720/0611385253350-web-tete.jpg","publishedAt":"2021-07-15T11:30:00Z","content":"La police britannique vient de frapper le crime organisé au portefeuille. Elle a saisi mardi un montant record de 210 millions d'euros en cryptomonnaies (ou cryptos). Un mois plus tôt, 133 millions d… [+4494 chars]"}]}
================================================
FILE: test/repositories/mock_article_repository.dart
================================================
import 'dart:io';
import 'package:getx_clean_architecture/data/models/paging_model.dart';
import 'package:getx_clean_architecture/domain/repositories/article_repository.dart';
import 'dart:convert';
class MockArticleRepository extends ArticleRepository {
@override
Future fetchHeadline(int page, int pageSize) async {
final file = File('test/data/headline_sample.json');
final response = await file.readAsString();
final data = await json.decode(response);
return PagingModel.fromJson(data);
}
@override
Future fetchNewsByCategory(
String keyword, int page, int pageSize) async {
final file = File('test/data/news_sample.json');
final response = await file.readAsString();
final data = await json.decode(response);
return PagingModel.fromJson(data);
}
}
================================================
FILE: test/repositories/mock_auth_repository.dart
================================================
import 'package:getx_clean_architecture/domain/entities/user.dart';
import 'package:getx_clean_architecture/domain/repositories/auth_repository.dart';
class MockAuthenticationRepository extends AuthenticationRepository {
@override
Future signUp(String username) async {
//Fake sign up action
await Future.delayed(Duration(seconds: 1));
return User(username: username);
}
}
================================================
FILE: test/widget_test.dart
================================================
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter_test/flutter_test.dart';
import 'package:getx_clean_architecture/domain/usecases/fetch_headline_use_case.dart';
import 'package:getx_clean_architecture/domain/usecases/fetch_news_use_case.dart';
import 'package:getx_clean_architecture/domain/usecases/signup_use_case.dart';
import 'package:tuple/tuple.dart';
import 'repositories/mock_article_repository.dart';
import 'repositories/mock_auth_repository.dart';
void main() {
test('Sign up test', () async {
//Mock input
final registerUserName = "test username";
//Mock data
final signUpUseCase = SignUpUseCase(MockAuthenticationRepository());
final user = await signUpUseCase.execute(registerUserName);
expect(user.username, registerUserName);
});
test('Fetch headline test', () async {
final pageSize = 20;
final currentPage = 1;
//Mock data
final fetchHeadlineUseCase = FetchHeadlineUseCase(MockArticleRepository());
final paging =
await fetchHeadlineUseCase.execute(Tuple2(currentPage, pageSize));
// Verify that data has created.
expect(paging.articles.length, 20);
});
test('Fetch news test', () async {
//Mock input
final keyword = "bitcoin";
final pageSize = 20;
final currentPage = 1;
//Mock data
final fetchHeadlineUseCase = FetchNewsUseCase(MockArticleRepository());
final paging = await fetchHeadlineUseCase
.execute(Tuple3(keyword, currentPage, pageSize));
// Verify that data has created.
expect(paging.articles.length, 3);
});
}
================================================
FILE: web/index.html
================================================
getx_clean_architecture
================================================
FILE: web/manifest.json
================================================
{
"name": "getx_clean_architecture",
"short_name": "getx_clean_architecture",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}