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
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.getx_clean_architecture">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
================================================
FILE: android/app/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.getx_clean_architecture">
<application
android:label="getx_clean_architecture"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
================================================
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
================================================
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
================================================
FILE: android/app/src/main/res/drawable-v21/launch_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
================================================
FILE: android/app/src/main/res/values/styles.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
================================================
FILE: android/app/src/main/res/values-night/styles.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
================================================
FILE: android/app/src/profile/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.getx_clean_architecture">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
================================================
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
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>
================================================
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
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
================================================
FILE: ios/Runner/Base.lproj/Main.storyboard
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
================================================
FILE: ios/Runner/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>getx_clean_architecture</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
================================================
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 = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
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 = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
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 = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
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 = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
/* 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 = "<group>";
};
91917628A17759DC3FA4CA88 /* Frameworks */ = {
isa = PBXGroup;
children = (
23107FCC4ADD2F5C1072CB90 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
6E0AA953ACAB9AAC9C6AC78A /* Pods */,
91917628A17759DC3FA4CA88 /* Frameworks */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
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 = "<group>";
};
/* 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 = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* 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
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
================================================
FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
================================================
FILE: ios/Runner.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
================================================
FILE: ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
================================================
FILE: ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
================================================
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<Type> {
Future<Type> execute();
}
================================================
FILE: lib/app/core/usecases/pram_usecase.dart
================================================
abstract class ParamUseCase<Type, Params> {
Future<Type> 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<LocalStorageService> init() async {
_sharedPreferences = await SharedPreferences.getInstance();
return this;
}
User? get user {
final rawJson = _sharedPreferences?.getString(_Key.user.toString());
if (rawJson == null) {
return null;
}
Map<String, dynamic> 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<String, dynamic> json) =>
_$ArticleModelFromJson(json);
Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> _$ArticleModelToJson(ArticleModel instance) =>
<String, dynamic>{
'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<ArticleModel> articles;
@override
factory PagingModel.fromJson(Map<String, dynamic> 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<dynamic> 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<String, String>? get headers;
Map<String, String>? 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<String, String> get headers =>
{"X-Api-Key": "d809d6a547734a67af23365ce5bc8c02"};
Map<String, String> 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<String, String> get headers =>
{HttpHeaders.contentTypeHeader: 'application/json'};
Map<String, String> 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<PagingModel> fetchHeadline(int page, int pageSize) async {
final response = await ArticleAPI.fetchHeadline(page, pageSize).request();
return PagingModel.fromJson(response);
}
@override
Future<PagingModel> 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<User> 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<Article> articles;
}
================================================
FILE: lib/domain/entities/user.dart
================================================
class User {
User({this.username});
String? username;
factory User.fromJson(Map<String, dynamic>? json) {
return User(
username: json?['username'] as String?,
);
}
Map<String, dynamic> toJson() => {
'username': username,
};
}
================================================
FILE: lib/domain/repositories/article_repository.dart
================================================
import 'package:getx_clean_architecture/domain/entities/paging.dart';
abstract class ArticleRepository {
Future<Paging> fetchHeadline(int page, int pageSize);
Future<Paging> 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<User> 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<Paging, Tuple2<int, int>> {
final ArticleRepository _repo;
FetchHeadlineUseCase(this._repo);
@override
Future<Paging> 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<Paging, Tuple3<String, int, int>> {
final ArticleRepository _repo;
FetchNewsUseCase(this._repo);
@override
Future<Paging> 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<User, String> {
final AuthenticationRepository _repo;
SignUpUseCase(this._repo);
@override
Future<User> 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<AuthenticationRepositoryIml>()));
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<LocalStorageService>();
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<ArticleRepositoryIml>()));
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<Paging?>(null);
var articles = RxList<Article>([]);
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<ArticleRepositoryIml>()));
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<Paging?>(null);
var articles = RxList<Article>([]);
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<HeadlineController> {
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<AuthController> {
@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<NewsPage> {
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<void>(
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<AuthController> {
@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<AuthController> {
@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<em> Zoey 101</em> 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":"<ul><li>\"Space Jam: A New Legacy\" won the box office crown over \"Black Widow\" this weekend.</li><li>LeBron James tweeted an article about the win, writing \"Hi Haters!\" with a laughing emoji.</li><li>… [+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<PagingModel> 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<PagingModel> 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<User> 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
================================================
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
-->
<base href="/">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="getx_clean_architecture">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<title>getx_clean_architecture</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
var serviceWorkerVersion = null;
var scriptLoaded = false;
function loadMainDartJs() {
if (scriptLoaded) {
return;
}
scriptLoaded = true;
var scriptTag = document.createElement('script');
scriptTag.src = 'main.dart.js';
scriptTag.type = 'application/javascript';
document.body.append(scriptTag);
}
if ('serviceWorker' in navigator) {
// Service workers are supported. Use them.
window.addEventListener('load', function () {
// Wait for registration to finish before dropping the <script> tag.
// Otherwise, the browser will load the script multiple times,
// potentially different versions.
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
navigator.serviceWorker.register(serviceWorkerUrl)
.then((reg) => {
function waitForActivation(serviceWorker) {
serviceWorker.addEventListener('statechange', () => {
if (serviceWorker.state == 'activated') {
console.log('Installed new service worker.');
loadMainDartJs();
}
});
}
if (!reg.active && (reg.installing || reg.waiting)) {
// No active web worker and we have installed or are installing
// one for the first time. Simply wait for it to activate.
waitForActivation(reg.installing ?? reg.waiting);
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
// When the app updates the serviceWorkerVersion changes, so we
// need to ask the service worker to update.
console.log('New service worker available.');
reg.update();
waitForActivation(reg.installing);
} else {
// Existing service worker is still good.
console.log('Loading app from service worker.');
loadMainDartJs();
}
});
// If service worker doesn't succeed in a reasonable amount of time,
// fallback to plaint <script> tag.
setTimeout(() => {
if (!scriptLoaded) {
console.warn(
'Failed to load app from service worker. Falling back to plain <script> tag.',
);
loadMainDartJs();
}
}, 4000);
});
} else {
// Service workers not supported. Just drop the <script> tag.
loadMainDartJs();
}
</script>
</body>
</html>
================================================
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"
}
]
}
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
SYMBOL INDEX (105 symbols across 46 files)
FILE: lib/app/config/app_colors.dart
class AppColors (line 4) | class AppColors {
FILE: lib/app/config/app_text_styles.dart
class AppTextStyles (line 7) | class AppTextStyles {
FILE: lib/app/core/usecases/no_param_usecase.dart
class NoParamUseCase (line 1) | abstract class NoParamUseCase<Type> {
method execute (line 2) | Future<Type> execute()
FILE: lib/app/core/usecases/pram_usecase.dart
class ParamUseCase (line 1) | abstract class ParamUseCase<Type, Params> {
method execute (line 2) | Future<Type> execute(Params params)
FILE: lib/app/extensions/color.dart
class HexColor (line 3) | class HexColor extends Color {
method _getColorFromHex (line 4) | int _getColorFromHex(String hexColor)
FILE: lib/app/services/local_storage.dart
type _Key (line 7) | enum _Key {
class LocalStorageService (line 11) | class LocalStorageService extends GetxService {
method init (line 13) | Future<LocalStorageService> init()
FILE: lib/app/types/category_type.dart
type CategoryType (line 1) | enum CategoryType { bitcoin, apple, earthquake, animal }
FILE: lib/app/types/tab_type.dart
type TabType (line 3) | enum TabType { headline, news, profile }
FILE: lib/app/util/dependency.dart
class DependencyCreator (line 5) | class DependencyCreator {
method init (line 6) | init()
FILE: lib/app/util/util.dart
class Utils (line 1) | class Utils {
method getImagePath (line 2) | String getImagePath(String name, {String format: 'png'})
FILE: lib/data/models/article_model.dart
class ArticleModel (line 5) | @JsonSerializable()
method toJson (line 34) | Map<String, dynamic> toJson()
FILE: lib/data/models/article_model.g.dart
function _$ArticleModelFromJson (line 9) | ArticleModel _$ArticleModelFromJson(Map<String, dynamic> json)
function _$ArticleModelToJson (line 23) | Map<String, dynamic> _$ArticleModelToJson(ArticleModel instance)
FILE: lib/data/models/paging_model.dart
class PagingModel (line 4) | class PagingModel extends Paging {
FILE: lib/data/providers/network/api_endpoint.dart
class APIEndpoint (line 1) | class APIEndpoint {
FILE: lib/data/providers/network/api_provider.dart
class APIProvider (line 6) | class APIProvider {
method request (line 13) | Future request(APIRequestRepresentable request)
method _returnResponse (line 30) | dynamic _returnResponse(Response<dynamic> response)
class AppException (line 50) | class AppException implements Exception {
method toString (line 57) | String toString()
class FetchDataException (line 62) | class FetchDataException extends AppException {
class BadRequestException (line 71) | class BadRequestException extends AppException {
class UnauthorisedException (line 80) | class UnauthorisedException extends AppException {
class InvalidInputException (line 89) | class InvalidInputException extends AppException {
class AuthenticationException (line 98) | class AuthenticationException extends AppException {
class TimeOutException (line 107) | class TimeOutException extends AppException {
FILE: lib/data/providers/network/api_request_representable.dart
type HTTPMethod (line 1) | enum HTTPMethod { get, post, delete, put, patch }
class APIRequestRepresentable (line 20) | abstract class APIRequestRepresentable {
method request (line 28) | Future request()
FILE: lib/data/providers/network/apis/article_api.dart
type ArticleType (line 6) | enum ArticleType { fetchHeadline, fetchNews }
class ArticleAPI (line 8) | class ArticleAPI implements APIRequestRepresentable {
method request (line 57) | Future request()
FILE: lib/data/providers/network/apis/auth_api.dart
type AuthType (line 6) | enum AuthType { login, logout }
class AuthAPI (line 8) | class AuthAPI implements APIRequestRepresentable {
method request (line 48) | Future request()
FILE: lib/data/repositories/article_repository.dart
class ArticleRepositoryIml (line 5) | class ArticleRepositoryIml extends ArticleRepository {
method fetchHeadline (line 7) | Future<PagingModel> fetchHeadline(int page, int pageSize)
method fetchNewsByCategory (line 13) | Future<PagingModel> fetchNewsByCategory(
FILE: lib/data/repositories/auth_repository.dart
class AuthenticationRepositoryIml (line 4) | class AuthenticationRepositoryIml extends AuthenticationRepository {
method signUp (line 6) | Future<User> signUp(String username)
FILE: lib/domain/entities/article.dart
class Article (line 1) | class Article {
FILE: lib/domain/entities/paging.dart
class Paging (line 3) | class Paging {
FILE: lib/domain/entities/user.dart
class User (line 1) | class User {
method toJson (line 12) | Map<String, dynamic> toJson()
FILE: lib/domain/repositories/article_repository.dart
class ArticleRepository (line 3) | abstract class ArticleRepository {
method fetchHeadline (line 4) | Future<Paging> fetchHeadline(int page, int pageSize)
method fetchNewsByCategory (line 5) | Future<Paging> fetchNewsByCategory(String keyword, int page, int pageS...
FILE: lib/domain/repositories/auth_repository.dart
class AuthenticationRepository (line 3) | abstract class AuthenticationRepository {
method signUp (line 4) | Future<User> signUp(String username)
FILE: lib/domain/usecases/fetch_headline_use_case.dart
class FetchHeadlineUseCase (line 6) | class FetchHeadlineUseCase extends ParamUseCase<Paging, Tuple2<int, int>> {
method execute (line 11) | Future<Paging> execute(Tuple2 param)
FILE: lib/domain/usecases/fetch_news_use_case.dart
class FetchNewsUseCase (line 6) | class FetchNewsUseCase extends ParamUseCase<Paging, Tuple3<String, int, ...
method execute (line 11) | Future<Paging> execute(Tuple3 param)
FILE: lib/domain/usecases/signup_use_case.dart
class SignUpUseCase (line 5) | class SignUpUseCase extends ParamUseCase<User, String> {
method execute (line 10) | Future<User> execute(String username)
FILE: lib/generated_plugin_registrant.dart
function registerPlugins (line 12) | void registerPlugins(Registrar registrar)
FILE: lib/main.dart
function main (line 7) | void main()
function initServices (line 14) | initServices()
FILE: lib/presentation/app.dart
class App (line 6) | class App extends StatelessWidget {
method build (line 8) | Widget build(BuildContext context)
FILE: lib/presentation/controllers/auth/auth_binding.dart
class AuthBinding (line 6) | class AuthBinding extends Bindings {
method dependencies (line 8) | void dependencies()
FILE: lib/presentation/controllers/auth/auth_controller.dart
class AuthController (line 6) | class AuthController extends GetxController {
method onInit (line 15) | void onInit()
FILE: lib/presentation/controllers/headline/headline_binding.dart
class HeadlineBinding (line 6) | class HeadlineBinding extends Bindings {
method dependencies (line 8) | void dependencies()
FILE: lib/presentation/controllers/headline/headline_controller.dart
class HeadlineController (line 7) | class HeadlineController extends GetxController {
FILE: lib/presentation/controllers/news/news_binding.dart
class NewsBinding (line 6) | class NewsBinding extends Bindings {
method dependencies (line 8) | void dependencies()
FILE: lib/presentation/controllers/news/news_controller.dart
class NewsController (line 7) | class NewsController extends GetxController {
FILE: lib/presentation/pages/detail/detail_page.dart
class DetailPage (line 7) | class DetailPage extends StatelessWidget {
method build (line 13) | Widget build(BuildContext context)
FILE: lib/presentation/pages/headline/headline_page.dart
class HeadlinePage (line 7) | class HeadlinePage extends GetView<HeadlineController> {
method build (line 11) | Widget build(BuildContext context)
method _scrollListener (line 46) | void _scrollListener()
FILE: lib/presentation/pages/headline/views/article_cell.dart
class ArticleCell (line 8) | class ArticleCell extends StatelessWidget {
method build (line 12) | Widget build(BuildContext context)
FILE: lib/presentation/pages/home/home_page.dart
class HomePage (line 12) | class HomePage extends GetView<AuthController> {
method build (line 14) | Widget build(BuildContext context)
FILE: lib/presentation/pages/news/news_page.dart
class NewsPage (line 9) | class NewsPage extends StatefulWidget {
method createState (line 11) | _NewsPagePage createState()
class _NewsPagePage (line 14) | class _NewsPagePage extends State<NewsPage> {
method build (line 20) | Widget build(BuildContext context)
FILE: lib/presentation/pages/profile/profile_page.dart
class ProfilePage (line 8) | class ProfilePage extends GetView<AuthController> {
method build (line 10) | Widget build(BuildContext context)
class SignInView (line 31) | class SignInView extends GetView<AuthController> {
method build (line 33) | Widget build(BuildContext context)
class SignUpView (line 71) | class SignUpView extends StatelessWidget {
method build (line 77) | Widget build(BuildContext context)
method _buildLoginForm (line 102) | Widget _buildLoginForm(BuildContext context)
method _buildLoginButton (line 113) | Widget _buildLoginButton()
FILE: test/repositories/mock_article_repository.dart
class MockArticleRepository (line 6) | class MockArticleRepository extends ArticleRepository {
method fetchHeadline (line 8) | Future<PagingModel> fetchHeadline(int page, int pageSize)
method fetchNewsByCategory (line 16) | Future<PagingModel> fetchNewsByCategory(
FILE: test/repositories/mock_auth_repository.dart
class MockAuthenticationRepository (line 4) | class MockAuthenticationRepository extends AuthenticationRepository {
method signUp (line 6) | Future<User> signUp(String username)
FILE: test/widget_test.dart
function main (line 18) | void main()
Condensed preview — 90 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (129K chars).
[
{
"path": ".gitignore",
"chars": 700,
"preview": "# Miscellaneous\n*.class\n*.log\n*.pyc\n*.swp\n.DS_Store\n.atom/\n.buildlog/\n.history\n.svn/\nmigrate_working_dir/\n\n# IntelliJ re"
},
{
"path": "README.md",
"chars": 1105,
"preview": "# flutter-getx-clean-architecture\nA Flutter Clean Architecture Using [GetX](https://github.com/jonataslaw/getx).\n\n## Wor"
},
{
"path": "android/.gitignore",
"chars": 262,
"preview": "gradle-wrapper.jar\n/.gradle\n/captures/\n/gradlew\n/gradlew.bat\n/local.properties\nGeneratedPluginRegistrant.java\n\n# Remembe"
},
{
"path": "android/app/build.gradle",
"chars": 1724,
"preview": "def localProperties = new Properties()\ndef localPropertiesFile = rootProject.file('local.properties')\nif (localPropertie"
},
{
"path": "android/app/src/debug/AndroidManifest.xml",
"chars": 343,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.example.getx_clean_architecture\">\n"
},
{
"path": "android/app/src/main/AndroidManifest.xml",
"chars": 2174,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.example.getx_clean_architecture\">\n"
},
{
"path": "android/app/src/main/kotlin/com/example/getx_clean_architecture/MainActivity.kt",
"chars": 140,
"preview": "package com.example.getx_clean_architecture\n\nimport io.flutter.embedding.android.FlutterActivity\n\nclass MainActivity: Fl"
},
{
"path": "android/app/src/main/res/drawable/launch_background.xml",
"chars": 434,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Modify this file to customize your launch splash screen -->\n<layer-list xmln"
},
{
"path": "android/app/src/main/res/drawable-v21/launch_background.xml",
"chars": 438,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Modify this file to customize your launch splash screen -->\n<layer-list xmln"
},
{
"path": "android/app/src/main/res/values/styles.xml",
"chars": 994,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <!-- Theme applied to the Android Window while the process is sta"
},
{
"path": "android/app/src/main/res/values-night/styles.xml",
"chars": 993,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <!-- Theme applied to the Android Window while the process is sta"
},
{
"path": "android/app/src/profile/AndroidManifest.xml",
"chars": 343,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.example.getx_clean_architecture\">\n"
},
{
"path": "android/build.gradle",
"chars": 566,
"preview": "buildscript {\n ext.kotlin_version = '1.6.10'\n repositories {\n google()\n jcenter()\n }\n\n depende"
},
{
"path": "android/gradle/wrapper/gradle-wrapper.properties",
"chars": 231,
"preview": "#Fri Jun 23 08:50:38 CEST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER"
},
{
"path": "android/gradle.properties",
"chars": 82,
"preview": "org.gradle.jvmargs=-Xmx1536M\nandroid.useAndroidX=true\nandroid.enableJetifier=true\n"
},
{
"path": "android/settings.gradle",
"chars": 462,
"preview": "include ':app'\n\ndef localPropertiesFile = new File(rootProject.projectDir, \"local.properties\")\ndef properties = new Prop"
},
{
"path": "ios/.gitignore",
"chars": 561,
"preview": "*.mode1v3\n*.mode2v3\n*.moved-aside\n*.pbxuser\n*.perspectivev3\n**/*sync/\n.sconsign.dblite\n.tags*\n**/.vagrant/\n**/DerivedDat"
},
{
"path": "ios/Flutter/AppFrameworkInfo.plist",
"chars": 773,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "ios/Flutter/Debug.xcconfig",
"chars": 107,
"preview": "#include? \"Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig\"\n#include \"Generated.xcconfig\"\n"
},
{
"path": "ios/Flutter/Release.xcconfig",
"chars": 109,
"preview": "#include? \"Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig\"\n#include \"Generated.xcconfig\"\n"
},
{
"path": "ios/Podfile",
"chars": 1354,
"preview": "# Uncomment this line to define a global platform for your project\n# platform :ios, '9.0'\n\n# CocoaPods analytics sends n"
},
{
"path": "ios/Runner/AppDelegate.swift",
"chars": 404,
"preview": "import UIKit\nimport Flutter\n\n@UIApplicationMain\n@objc class AppDelegate: FlutterAppDelegate {\n override func applicatio"
},
{
"path": "ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json",
"chars": 2519,
"preview": "{\n \"images\" : [\n {\n \"size\" : \"20x20\",\n \"idiom\" : \"iphone\",\n \"filename\" : \"Icon-App-20x20@2x.png\",\n "
},
{
"path": "ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json",
"chars": 391,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"LaunchImage.png\",\n \"scale\" : \"1x\"\n },\n "
},
{
"path": "ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md",
"chars": 336,
"preview": "# Launch Screen Assets\n\nYou can customize the launch screen with your own desired assets by replacing the image files in"
},
{
"path": "ios/Runner/Base.lproj/LaunchScreen.storyboard",
"chars": 2377,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
},
{
"path": "ios/Runner/Base.lproj/Main.storyboard",
"chars": 1605,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
},
{
"path": "ios/Runner/Info.plist",
"chars": 1542,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "ios/Runner/Runner-Bridging-Header.h",
"chars": 38,
"preview": "#import \"GeneratedPluginRegistrant.h\"\n"
},
{
"path": "ios/Runner.xcodeproj/project.pbxproj",
"chars": 22185,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 135,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:\">\n </FileRef"
},
{
"path": "ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
"chars": 238,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings",
"chars": 226,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme",
"chars": 3291,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n LastUpgradeVersion = \"1020\"\n version = \"1.3\">\n <BuildAction\n "
},
{
"path": "ios/Runner.xcworkspace/contents.xcworkspacedata",
"chars": 224,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"group:Runner.xcodepr"
},
{
"path": "ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
"chars": 238,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings",
"chars": 226,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "lib/app/config/app_colors.dart",
"chars": 221,
"preview": "import 'package:flutter/material.dart';\nimport 'package:getx_clean_architecture/app/extensions/color.dart';\n\nclass AppCo"
},
{
"path": "lib/app/config/app_constants.dart",
"chars": 1,
"preview": "\n"
},
{
"path": "lib/app/config/app_text_styles.dart",
"chars": 383,
"preview": "import 'package:flutter/material.dart';\n\n/// AppTextStyle format as follows:\n/// [fontWeight][fontSize][colorName][opaci"
},
{
"path": "lib/app/core/usecases/no_param_usecase.dart",
"chars": 66,
"preview": "abstract class NoParamUseCase<Type> {\n Future<Type> execute();\n}\n"
},
{
"path": "lib/app/core/usecases/pram_usecase.dart",
"chars": 85,
"preview": "abstract class ParamUseCase<Type, Params> {\n Future<Type> execute(Params params);\n}\n"
},
{
"path": "lib/app/extensions/color.dart",
"chars": 373,
"preview": "import 'package:flutter/material.dart';\n\nclass HexColor extends Color {\n static int _getColorFromHex(String hexColor) {"
},
{
"path": "lib/app/services/local_storage.dart",
"chars": 891,
"preview": "import 'dart:convert';\n\nimport 'package:get/get.dart';\nimport 'package:getx_clean_architecture/domain/entities/user.dart"
},
{
"path": "lib/app/types/category_type.dart",
"chars": 393,
"preview": "enum CategoryType { bitcoin, apple, earthquake, animal }\n\nextension CategoryKeyword on CategoryType {\n String get keywo"
},
{
"path": "lib/app/types/tab_type.dart",
"chars": 615,
"preview": "import 'package:flutter/cupertino.dart';\n\nenum TabType { headline, news, profile }\n\nextension TabItem on TabType {\n Ico"
},
{
"path": "lib/app/util/dependency.dart",
"chars": 348,
"preview": "import 'package:get/get.dart';\nimport 'package:getx_clean_architecture/data/repositories/auth_repository.dart';\nimport '"
},
{
"path": "lib/app/util/util.dart",
"chars": 130,
"preview": "class Utils {\n static String getImagePath(String name, {String format: 'png'}) {\n return 'assets/images/$name.$forma"
},
{
"path": "lib/data/models/article_model.dart",
"chars": 897,
"preview": "import 'package:getx_clean_architecture/domain/entities/article.dart';\nimport 'package:json_annotation/json_annotation.d"
},
{
"path": "lib/data/models/article_model.g.dart",
"chars": 1089,
"preview": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'article_model.dart';\n\n// *******************************************"
},
{
"path": "lib/data/models/paging_model.dart",
"chars": 619,
"preview": "import 'package:getx_clean_architecture/data/models/article_model.dart';\nimport 'package:getx_clean_architecture/domain/"
},
{
"path": "lib/data/providers/database/firebase_database_provider.dart",
"chars": 1,
"preview": "\n"
},
{
"path": "lib/data/providers/network/api_endpoint.dart",
"chars": 79,
"preview": "class APIEndpoint {\n static String get newsapi => \"https://newsapi.org/v2\";\n}\n"
},
{
"path": "lib/data/providers/network/api_provider.dart",
"chars": 3042,
"preview": "import 'dart:async';\nimport 'dart:io';\nimport 'package:get/get_connect/connect.dart';\nimport 'package:getx_clean_archite"
},
{
"path": "lib/data/providers/network/api_request_representable.dart",
"chars": 644,
"preview": "enum HTTPMethod { get, post, delete, put, patch }\n\nextension HTTPMethodString on HTTPMethod {\n String get string {\n "
},
{
"path": "lib/data/providers/network/apis/article_api.dart",
"chars": 1722,
"preview": "\nimport 'package:getx_clean_architecture/data/providers/network/api_endpoint.dart';\nimport 'package:getx_clean_architect"
},
{
"path": "lib/data/providers/network/apis/auth_api.dart",
"chars": 1396,
"preview": "import 'dart:io';\nimport 'package:getx_clean_architecture/data/providers/network/api_endpoint.dart';\nimport 'package:get"
},
{
"path": "lib/data/repositories/article_repository.dart",
"chars": 758,
"preview": "import 'package:getx_clean_architecture/data/models/paging_model.dart';\nimport 'package:getx_clean_architecture/data/pro"
},
{
"path": "lib/data/repositories/auth_repository.dart",
"chars": 397,
"preview": "import 'package:getx_clean_architecture/domain/entities/user.dart';\nimport 'package:getx_clean_architecture/domain/repos"
},
{
"path": "lib/domain/entities/article.dart",
"chars": 306,
"preview": "class Article {\n Article({\n this.author,\n this.title,\n this.description,\n this.url,\n this.urlToImage,\n "
},
{
"path": "lib/domain/entities/paging.dart",
"chars": 213,
"preview": "import 'package:getx_clean_architecture/domain/entities/article.dart';\n\nclass Paging {\n Paging({\n required this.tota"
},
{
"path": "lib/domain/entities/user.dart",
"chars": 267,
"preview": "class User {\n User({this.username});\n\n String? username;\n\n factory User.fromJson(Map<String, dynamic>? json) {\n re"
},
{
"path": "lib/domain/repositories/article_repository.dart",
"chars": 242,
"preview": "import 'package:getx_clean_architecture/domain/entities/paging.dart';\n\nabstract class ArticleRepository {\n Future<Pagin"
},
{
"path": "lib/domain/repositories/auth_repository.dart",
"chars": 153,
"preview": "import 'package:getx_clean_architecture/domain/entities/user.dart';\n\nabstract class AuthenticationRepository {\n Future<"
},
{
"path": "lib/domain/usecases/fetch_headline_use_case.dart",
"chars": 533,
"preview": "import 'package:getx_clean_architecture/app/core/usecases/pram_usecase.dart';\nimport 'package:getx_clean_architecture/do"
},
{
"path": "lib/domain/usecases/fetch_news_use_case.dart",
"chars": 552,
"preview": "import 'package:getx_clean_architecture/app/core/usecases/pram_usecase.dart';\nimport 'package:getx_clean_architecture/do"
},
{
"path": "lib/domain/usecases/signup_use_case.dart",
"chars": 452,
"preview": "import 'package:getx_clean_architecture/app/core/usecases/pram_usecase.dart';\nimport 'package:getx_clean_architecture/do"
},
{
"path": "lib/generated_plugin_registrant.dart",
"chars": 390,
"preview": "//\n// Generated file. Do not edit.\n//\n\n// ignore_for_file: lines_longer_than_80_chars\n\nimport 'package:shared_preference"
},
{
"path": "lib/main.dart",
"chars": 567,
"preview": "import 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport 'package:getx_clean_architecture/app/servi"
},
{
"path": "lib/presentation/app.dart",
"chars": 457,
"preview": "import 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport 'package:getx_clean_architecture/presentat"
},
{
"path": "lib/presentation/controllers/auth/auth_binding.dart",
"chars": 501,
"preview": "import 'package:get/get.dart';\nimport 'package:getx_clean_architecture/data/repositories/auth_repository.dart';\nimport '"
},
{
"path": "lib/presentation/controllers/auth/auth_controller.dart",
"chars": 881,
"preview": "import 'package:get/get.dart';\nimport 'package:getx_clean_architecture/app/services/local_storage.dart';\nimport 'package"
},
{
"path": "lib/presentation/controllers/headline/headline_binding.dart",
"chars": 521,
"preview": "import 'package:get/get.dart';\nimport 'package:getx_clean_architecture/domain/usecases/fetch_headline_use_case.dart';\nim"
},
{
"path": "lib/presentation/controllers/headline/headline_controller.dart",
"chars": 1241,
"preview": "import 'package:get/get.dart';\nimport 'package:getx_clean_architecture/domain/entities/article.dart';\nimport 'package:ge"
},
{
"path": "lib/presentation/controllers/news/news_binding.dart",
"chars": 497,
"preview": "import 'package:get/get.dart';\nimport 'package:getx_clean_architecture/data/repositories/article_repository.dart';\nimpor"
},
{
"path": "lib/presentation/controllers/news/news_controller.dart",
"chars": 1291,
"preview": "import 'package:get/get.dart';\nimport 'package:getx_clean_architecture/domain/entities/article.dart';\nimport 'package:ge"
},
{
"path": "lib/presentation/pages/detail/detail_page.dart",
"chars": 2003,
"preview": "import 'package:cached_network_image/cached_network_image.dart';\nimport 'package:flutter/cupertino.dart';\nimport 'packag"
},
{
"path": "lib/presentation/pages/headline/headline_page.dart",
"chars": 1636,
"preview": "import 'package:flutter/cupertino.dart';\nimport 'package:get/get.dart';\nimport 'package:getx_clean_architecture/presenta"
},
{
"path": "lib/presentation/pages/headline/views/article_cell.dart",
"chars": 2096,
"preview": "import 'package:cached_network_image/cached_network_image.dart';\nimport 'package:flutter/cupertino.dart';\nimport 'packag"
},
{
"path": "lib/presentation/pages/home/home_page.dart",
"chars": 1554,
"preview": "import 'package:flutter/cupertino.dart';\nimport 'package:get/get.dart';\nimport 'package:getx_clean_architecture/app/conf"
},
{
"path": "lib/presentation/pages/news/news_page.dart",
"chars": 2764,
"preview": "import 'package:flutter/cupertino.dart';\nimport 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport '"
},
{
"path": "lib/presentation/pages/profile/profile_page.dart",
"chars": 3341,
"preview": "import 'package:flutter/cupertino.dart';\nimport 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport '"
},
{
"path": "pubspec.yaml",
"chars": 3102,
"preview": "name: getx_clean_architecture\ndescription: A Flutter Clean Architecture Using GetX.\n\n# The following line prevents the p"
},
{
"path": "test/data/headline_sample.json",
"chars": 16062,
"preview": "{\"status\":\"ok\",\"totalResults\":38,\"articles\":[{\"source\":{\"id\":\"fox-news\",\"name\":\"Fox News\"},\"author\":\"Jon Street\",\"title\""
},
{
"path": "test/data/news_sample.json",
"chars": 2605,
"preview": "{\"status\":\"ok\",\"totalResults\":3,\"articles\":[{\"source\":{\"id\":\"t3n\",\"name\":\"T3n\"},\"author\":\"Jörn Brien\",\"title\":\"Schlag ge"
},
{
"path": "test/repositories/mock_article_repository.dart",
"chars": 832,
"preview": "import 'dart:io';\nimport 'package:getx_clean_architecture/data/models/paging_model.dart';\nimport 'package:getx_clean_arc"
},
{
"path": "test/repositories/mock_auth_repository.dart",
"chars": 398,
"preview": "import 'package:getx_clean_architecture/domain/entities/user.dart';\nimport 'package:getx_clean_architecture/domain/repos"
},
{
"path": "test/widget_test.dart",
"chars": 1900,
"preview": "// This is a basic Flutter widget test.\n//\n// To perform an interaction with a widget in your test, use the WidgetTester"
},
{
"path": "web/index.html",
"chars": 3725,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <!--\n If you are serving your web app in a path other than the root, change the\n h"
},
{
"path": "web/manifest.json",
"chars": 602,
"preview": "{\n \"name\": \"getx_clean_architecture\",\n \"short_name\": \"getx_clean_architecture\",\n \"start_url\": \".\",\n \"display"
}
]
About this extraction
This page contains the full source code of the phamdinhduc795397/flutter-getx-clean-architecture GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 90 files (113.0 KB), approximately 32.7k tokens, and a symbol index with 105 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.