├── .gitignore ├── .metadata ├── README.md ├── ToDo.txt ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── cc │ │ │ │ └── fluttre_clean_coded │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── key.properties ├── local.properties └── settings.gradle ├── assets ├── animations │ ├── ch_splash.gif │ ├── coming_soon.gif │ ├── confirmed_tick.gif │ ├── en_splash.gif │ ├── error_tick.gif │ ├── house_searching.gif │ ├── locked_user.gif │ ├── payment_loading.gif │ └── searching.gif ├── font │ ├── NotoSans-Bold.ttf │ ├── NotoSans-ExtraBold.ttf │ ├── NotoSans-Italic.ttf │ ├── NotoSans-Light.ttf │ ├── NotoSans-Regular.ttf │ └── NotoSans-SemiBold.ttf ├── icons │ ├── announcement.svg │ ├── explore.svg │ ├── finance.svg │ ├── home.svg │ ├── logout.svg │ ├── notification.svg │ ├── profile.svg │ ├── search.svg │ └── shop.svg └── images │ ├── app_logo.png │ ├── app_logo_transparent.png │ ├── app_logo_wb.png │ ├── company │ └── team.png │ └── components │ └── forgot_image.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h └── RunnerTests │ └── RunnerTests.swift ├── lib ├── main.dart └── src │ ├── app.dart │ ├── core │ ├── dependencies │ │ ├── app_dep.dart │ │ ├── app_dep_injector.dart │ │ └── setup │ │ │ ├── app_config_setup.dart │ │ │ ├── app_exception_setup.dart │ │ │ ├── app_firebase_setup.dart │ │ │ └── app_notifications_setup.dart │ ├── localization │ │ ├── app_locale.dart │ │ └── languages │ │ │ └── chinese_language.dart │ ├── themes │ │ ├── app_theme.dart │ │ └── styles │ │ │ ├── app_colors.dart │ │ │ ├── app_fonts.dart │ │ │ └── app_textstyles.dart │ └── utils │ │ ├── managers │ │ ├── app_assets.dart │ │ ├── app_constants.dart │ │ ├── app_enums.dart │ │ ├── app_extensions.dart │ │ ├── app_lists.dart │ │ └── app_strings.dart │ │ └── observers │ │ └── app_bloc_obeserver.dart │ ├── data │ ├── local │ │ ├── constant │ │ │ └── local_constants.dart │ │ ├── db │ │ │ ├── local_storage_database.dart │ │ │ └── secure_storage_database.dart │ │ └── preferences │ │ │ └── app_settings.dart │ ├── remote │ │ ├── api │ │ │ ├── api_client.dart │ │ │ └── network_constants.dart │ │ ├── exception │ │ │ └── remote_error_handleing.dart │ │ └── firebase │ │ │ ├── firebase_helper.dart │ │ │ └── firebase_options.dart │ └── services │ │ ├── local_storage_service.dart │ │ └── remote_storage_service.dart │ ├── domain │ ├── models │ │ ├── authentication │ │ │ ├── login │ │ │ │ └── user_login_model.dart │ │ │ └── signup │ │ │ │ └── user_signup_model.dart │ │ ├── feedback │ │ │ └── feedback_model.dart │ │ ├── general │ │ │ ├── image_model.dart │ │ │ ├── list_response_model.dart │ │ │ └── network_response.dart │ │ ├── remote_response_model.dart │ │ └── users │ │ │ ├── user_credentials.dart │ │ │ └── user_model.dart │ └── usecases │ │ ├── notification_usecase.dart │ │ └── user_usecase.dart │ └── presentation │ ├── modules │ ├── app │ │ ├── cubit │ │ │ ├── app_module_screen_cubit.dart │ │ │ └── app_module_screen_state.dart │ │ ├── explore │ │ │ └── explore_page.dart │ │ ├── finance │ │ │ └── finance_page.dart │ │ ├── home │ │ │ └── home_page.dart │ │ ├── profile │ │ │ └── profile_page.dart │ │ ├── shop │ │ │ └── shop_page.dart │ │ └── user_app.dart │ ├── authentication │ │ ├── auth_router.dart │ │ ├── email_verification │ │ │ └── email_verification_page.dart │ │ ├── password_reset │ │ │ ├── change_password_screen.dart │ │ │ └── forgot_password_screen.dart │ │ └── user_auth │ │ │ ├── authentication_page.dart │ │ │ ├── cubit │ │ │ ├── user_auth_page_cubit.dart │ │ │ └── user_auth_page_state.dart │ │ │ └── screens │ │ │ ├── user_login_screen.dart │ │ │ └── user_signup_screen.dart │ ├── intro │ │ ├── intro_screen.dart │ │ └── intro_screen_viewmodel.dart │ └── splash │ │ ├── splash_loading_screen.dart │ │ └── splash_screen.dart │ ├── shared │ ├── app_error_handle.dart │ ├── components.dart │ ├── date_picker.dart │ ├── flow_date_picker.dart │ ├── globals.dart │ ├── maps_launcher.dart │ ├── no_connection_handleing.dart │ ├── qr_code_generate.dart │ ├── webview.dart │ └── widgets_builder.dart │ └── state │ ├── app_settings_bloc │ ├── app_settings_bloc.dart │ ├── app_settings_event.dart │ └── app_settings_state.dart │ └── navigation_cubit │ ├── navi_cubit.dart │ └── navi_state.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements └── RunnerTests │ └── RunnerTests.swift ├── pubspec.lock ├── pubspec.yaml ├── web ├── assets │ └── loading.gif ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "12fccda598477eddd19f93040a1dba24f915b9be" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 17 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 18 | - platform: android 19 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 20 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 21 | - platform: ios 22 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 23 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 24 | - platform: linux 25 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 26 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 27 | - platform: macos 28 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 29 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 30 | - platform: web 31 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 32 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 33 | - platform: windows 34 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 35 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | // START: FlutterFire Configuration 4 | id 'com.google.gms.google-services' 5 | id 'com.google.firebase.firebase-perf' 6 | id 'com.google.firebase.crashlytics' 7 | // END: FlutterFire Configuration 8 | id "kotlin-android" 9 | id "dev.flutter.flutter-gradle-plugin" 10 | } 11 | 12 | def localProperties = new Properties() 13 | def localPropertiesFile = rootProject.file('local.properties') 14 | if (localPropertiesFile.exists()) { 15 | localPropertiesFile.withReader('UTF-8') { reader -> 16 | localProperties.load(reader) 17 | } 18 | } 19 | 20 | 21 | def flutterRoot = localProperties.getProperty('flutter.sdk') 22 | if (flutterRoot == null) { 23 | throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 24 | } 25 | def keystoreProperties = new Properties() 26 | def keystorePropertiesFile = rootProject.file('key.properties') 27 | if (keystorePropertiesFile.exists()) { 28 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 29 | } 30 | 31 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 32 | if (flutterVersionCode == null) { 33 | flutterVersionCode = '1' 34 | } 35 | def FlutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion') 36 | if (FlutterTargetSdkVersion == null) { 37 | FlutterTargetSdkVersion = '33' 38 | } 39 | def FlutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion') 40 | if (FlutterMinSdkVersion == null) { 41 | FlutterMinSdkVersion = '21' 42 | } 43 | 44 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 45 | if (flutterVersionName == null) { 46 | flutterVersionName = '1.0' 47 | } 48 | 49 | 50 | android { 51 | // TODO: Specify your own namespace ID (https://developer.android.com/studio/build/application-id.html). 52 | namespace "com.saif.flutter_clean_coded" 53 | compileSdkVersion 34 54 | ndkVersion flutter.ndkVersion 55 | 56 | compileOptions { 57 | sourceCompatibility JavaVersion.VERSION_1_8 58 | targetCompatibility JavaVersion.VERSION_1_8 59 | } 60 | 61 | kotlinOptions { 62 | jvmTarget = '1.8' 63 | } 64 | 65 | sourceSets { 66 | main.java.srcDirs += 'src/main/kotlin' 67 | } 68 | 69 | defaultConfig { 70 | multiDexEnabled true 71 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 72 | applicationId "com.saif.flutter_clean_coded" 73 | minSdkVersion flutter.minSdkVersion //26 74 | targetSdkVersion flutter.targetSdkVersion //34 75 | versionCode flutterVersionCode.toInteger() 76 | versionName flutterVersionName 77 | } 78 | 79 | signingConfigs { 80 | release { 81 | keyAlias keystoreProperties['keyAlias'] 82 | keyPassword keystoreProperties['keyPassword'] 83 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null 84 | storePassword keystoreProperties['storePassword'] 85 | } 86 | } 87 | buildTypes { 88 | release { 89 | signingConfig signingConfigs.release 90 | } 91 | } 92 | } 93 | 94 | flutter { 95 | source '../..' 96 | } 97 | 98 | dependencies { 99 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 100 | implementation 'androidx.multidex:multidex:2.0.1' 101 | implementation("com.google.android.material:material:1.11.0") 102 | } 103 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 17 | 20 | 23 | 31 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/cc/fluttre_clean_coded/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.cc.fluttre_clean_coded 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 10 | // compile 'com.github.RevenueMonster:RM-Android:{latest version}' 11 | 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | // maven { url "https://jitpack.io" } 19 | mavenCentral() 20 | } 21 | } 22 | 23 | rootProject.buildDir = '../build' 24 | subprojects { 25 | project.buildDir = "${rootProject.buildDir}/${project.name}" 26 | } 27 | subprojects { 28 | project.evaluationDependsOn(':app') 29 | } 30 | 31 | tasks.register("clean", Delete) { 32 | delete rootProject.buildDir 33 | } 34 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /android/key.properties: -------------------------------------------------------------------------------- 1 | // keytool -genkey -v -keystore %location of {PROJECT PATH}\android\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload 2 | // before your run code above, change location of .\android\ 3 | 4 | storePassword=password(change this) 5 | keyPassword=password(change this) 6 | keyAlias=upload 7 | storeFile={PATH FROM DISK}/flutter_clean_coded/android/upload-keystore.jks -------------------------------------------------------------------------------- /android/local.properties: -------------------------------------------------------------------------------- 1 | sdk.dir=/Users/saifal/Library/Android/sdk 2 | flutter.sdk=/Users/saifal/Tools/flutter_sdk/flutter 3 | flutter.buildMode=release 4 | flutter.versionName=1.0.0 5 | flutter.versionCode=1 -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | } 9 | settings.ext.flutterSdkPath = flutterSdkPath() 10 | 11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") 12 | 13 | plugins { 14 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false 15 | } 16 | } 17 | 18 | include ":app" 19 | 20 | apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" 21 | -------------------------------------------------------------------------------- /assets/animations/ch_splash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/ch_splash.gif -------------------------------------------------------------------------------- /assets/animations/coming_soon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/coming_soon.gif -------------------------------------------------------------------------------- /assets/animations/confirmed_tick.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/confirmed_tick.gif -------------------------------------------------------------------------------- /assets/animations/en_splash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/en_splash.gif -------------------------------------------------------------------------------- /assets/animations/error_tick.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/error_tick.gif -------------------------------------------------------------------------------- /assets/animations/house_searching.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/house_searching.gif -------------------------------------------------------------------------------- /assets/animations/locked_user.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/locked_user.gif -------------------------------------------------------------------------------- /assets/animations/payment_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/payment_loading.gif -------------------------------------------------------------------------------- /assets/animations/searching.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/animations/searching.gif -------------------------------------------------------------------------------- /assets/font/NotoSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/font/NotoSans-Bold.ttf -------------------------------------------------------------------------------- /assets/font/NotoSans-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/font/NotoSans-ExtraBold.ttf -------------------------------------------------------------------------------- /assets/font/NotoSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/font/NotoSans-Italic.ttf -------------------------------------------------------------------------------- /assets/font/NotoSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/font/NotoSans-Light.ttf -------------------------------------------------------------------------------- /assets/font/NotoSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/font/NotoSans-Regular.ttf -------------------------------------------------------------------------------- /assets/font/NotoSans-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/font/NotoSans-SemiBold.ttf -------------------------------------------------------------------------------- /assets/icons/announcement.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/icons/explore.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/icons/finance.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/icons/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/icons/logout.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/icons/notification.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/icons/profile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | profile_round [#1346] 6 | Created with Sketch. 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /assets/icons/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/icons/shop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /assets/images/app_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/images/app_logo.png -------------------------------------------------------------------------------- /assets/images/app_logo_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/images/app_logo_transparent.png -------------------------------------------------------------------------------- /assets/images/app_logo_wb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/images/app_logo_wb.png -------------------------------------------------------------------------------- /assets/images/company/team.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/images/company/team.png -------------------------------------------------------------------------------- /assets/images/components/forgot_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/assets/images/components/forgot_image.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 4 | 5 | project 'Runner', { 6 | 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_ios_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | 34 | 35 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 36 | end 37 | 38 | post_install do |installer| 39 | installer.pods_project.targets.each do |target| 40 | flutter_additional_ios_build_settings(target) 41 | end 42 | end -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | import GoogleMaps 4 | 5 | @main 6 | @objc class AppDelegate: FlutterAppDelegate { 7 | override func application( 8 | _ application: UIApplication, 9 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 10 | ) -> Bool { 11 | GMSServices.provideAPIKey("api key here") 12 | GeneratedPluginRegistrant.register(with: self) 13 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Fluttre Clean Coded 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | fluttre_clean_coded 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:device_preview/device_preview.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_clean_coded/src/core/dependencies/app_dep.dart'; 5 | 6 | import 'src/app.dart'; 7 | 8 | void main() async { 9 | await AppDependencies.init(); 10 | 11 | runApp( 12 | DevicePreview( 13 | enabled: !kReleaseMode, 14 | builder: (context) => const MyApp(), 15 | ), 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/dependencies/app_dep.dart'; 2 | import 'package:flutter_clean_coded/src/core/themes/app_theme.dart'; 3 | import 'package:flutter_clean_coded/src/core/utils/managers/app_constants.dart'; 4 | import 'package:flutter_clean_coded/src/presentation/state/navigation_cubit/navi_cubit.dart'; 5 | import 'package:device_preview/device_preview.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_bloc/flutter_bloc.dart'; 8 | 9 | import 'presentation/modules/authentication/auth_router.dart'; 10 | 11 | class MyApp extends StatelessWidget { 12 | const MyApp({super.key}); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return MultiBlocProvider( 17 | providers: AppDependencies.appBlocProviders(), 18 | child: MaterialApp( 19 | locale: DevicePreview.locale(context), 20 | builder: DevicePreview.appBuilder, 21 | debugShowCheckedModeBanner: false, 22 | title: AppConstants.appTitle, 23 | theme: getApplicationTheme(), 24 | home: const AuthRouter())); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/core/dependencies/app_dep.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:flutter_clean_coded/src/core/dependencies/setup/app_config_setup.dart'; 4 | import 'package:flutter_clean_coded/src/core/dependencies/setup/app_exception_setup.dart'; 5 | import 'package:flutter_clean_coded/src/core/dependencies/setup/app_firebase_setup.dart'; 6 | import 'package:flutter_clean_coded/src/core/dependencies/setup/app_notifications_setup.dart'; 7 | import 'package:flutter_clean_coded/src/core/utils/observers/app_bloc_obeserver.dart'; 8 | import 'package:flutter_clean_coded/src/core/dependencies/app_dep_injector.dart'; 9 | import 'package:flutter_clean_coded/src/data/remote/api/api_client.dart'; 10 | import 'package:flutter_clean_coded/src/presentation/state/navigation_cubit/navi_cubit.dart'; 11 | import 'package:pdf/widgets.dart'; 12 | 13 | class AppDependencies { 14 | static Future init() async { 15 | await appDependencies(); 16 | } 17 | 18 | static Future appDependencies() async { 19 | WidgetsFlutterBinding.ensureInitialized(); 20 | await AppDependencyInjector.init(); 21 | await AppFirebaseSetup.init(); 22 | await AppBlocObserver.init(); 23 | await AppNotificationSetup.init(); 24 | await AppConfigSetup.init(); 25 | await AppExceptionSetup.init(); 26 | } 27 | 28 | static List appBlocProviders() { 29 | return [ 30 | BlocProvider( 31 | create: (context) => NaviCubit(), 32 | ), 33 | ]; 34 | } 35 | 36 | static void newUserPermissions() { 37 | AppNotificationSetup().requestPermission(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/core/dependencies/app_dep_injector.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 3 | import 'package:get_it/get_it.dart'; 4 | import 'package:flutter_clean_coded/src/data/local/db/local_storage_database.dart'; 5 | import 'package:flutter_clean_coded/src/data/local/db/secure_storage_database.dart'; 6 | import 'package:shared_preferences/shared_preferences.dart'; 7 | 8 | class AppDependencyInjector { 9 | static Future init() async { 10 | final getIt = getInstance(); 11 | 12 | // Initialize SharedPreferences 13 | final sharedPreferencesInstance = await SharedPreferences.getInstance(); 14 | const secureStorageInstance = FlutterSecureStorage(); 15 | 16 | getIt.registerSingleton( 17 | LocalStorageDatabase(sharedPreferences: sharedPreferencesInstance)); 18 | 19 | getIt.registerLazySingleton( 20 | () => SecureStorageDatabase( 21 | secureStorage: secureStorageInstance, 22 | )); 23 | 24 | // Register API-related services 25 | _registerApiServices(getIt); 26 | 27 | // Register other services and use cases 28 | // getIt.registerSingleton(GetUserUseCase(getIt())); 29 | } 30 | 31 | static void _registerApiServices(GetIt getIt) { 32 | getIt.registerSingleton(Dio()); 33 | 34 | // getIt.registerSingleton(ApiService(getIt())); 35 | // getIt.registerSingleton(UserService(getIt())); 36 | // getIt.registerSingleton(UserRepository(getIt())); 37 | } 38 | 39 | static GetIt getInstance() { 40 | return GetIt.instance; 41 | } 42 | 43 | static void reset() { 44 | GetIt.I.reset(); 45 | } 46 | 47 | static void dispose() { 48 | GetIt.I.reset(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/core/dependencies/setup/app_config_setup.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | 3 | class AppConfigSetup { 4 | static init() { 5 | SystemChrome.setPreferredOrientations([ 6 | DeviceOrientation.portraitUp, 7 | DeviceOrientation.portraitDown, 8 | ]); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/core/dependencies/setup/app_exception_setup.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | 3 | import '../../../presentation/Shared/app_error_handle.dart'; 4 | 5 | class AppExceptionSetup { 6 | static init() { 7 | ErrorWidget.builder = 8 | (FlutterErrorDetails details) => CustomError(errorDetails: details); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/core/dependencies/setup/app_firebase_setup.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_core/firebase_core.dart'; 2 | // import 'package:firebase_crashlytics/firebase_crashlytics.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter_clean_coded/src/data/remote/firebase/firebase_options.dart'; 5 | 6 | class AppFirebaseSetup { 7 | static init() async { 8 | await Firebase.initializeApp( 9 | options: DefaultFirebaseOptions.currentPlatform, 10 | ); 11 | // if (kReleaseMode) { 12 | // errorCrashReporting(); 13 | // } 14 | } 15 | 16 | // static errorCrashReporting() { 17 | // FlutterError.onError = (errorDetails) { 18 | // FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails); 19 | // }; 20 | // // Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics 21 | // PlatformDispatcher.instance.onError = (error, stack) { 22 | // FirebaseCrashlytics.instance.recordError(error, stack, fatal: true); 23 | // return true; 24 | // }; 25 | // } 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/core/dependencies/setup/app_notifications_setup.dart: -------------------------------------------------------------------------------- 1 | import 'package:awesome_notifications/awesome_notifications.dart'; 2 | 3 | import '../../../presentation/Shared/widgets_builder.dart'; 4 | import '../../utils/managers/app_enums.dart'; 5 | import '../../themes/styles/app_colors.dart'; 6 | 7 | class AppNotificationSetup { 8 | static init() async { 9 | // await FirebaseMessaging.instance.setAutoInitEnabled(true); 10 | 11 | // final notificationSettings = 12 | // await FirebaseMessaging.instance.requestPermission(provisional: true); 13 | // // For apple platforms, ensure the APNS token is available before making any FCM plugin API calls 14 | // final apnsToken = await FirebaseMessaging.instance.getAPNSToken(); 15 | // if (apnsToken != null) { 16 | // // APNS token is available, make FCM plugin API requests... 17 | // } 18 | 19 | await AwesomeNotifications().initialize( 20 | // set the icon to null if you want to use the default app icon 21 | null, 22 | [ 23 | NotificationChannel( 24 | channelGroupKey: 'basic_channel_group', 25 | channelKey: 'basic_channel', 26 | channelName: 'Basic notifications', 27 | channelDescription: 'Notification channel for basic tests', 28 | defaultColor: AppColors.primaryColor, 29 | ledColor: AppColors.white) 30 | ], 31 | // Channel groups are only visual and are not required 32 | channelGroups: [ 33 | NotificationChannelGroup( 34 | channelGroupKey: 'basic_channel_group', 35 | channelGroupName: 'Basic group') 36 | ], 37 | debug: true); 38 | await AppNotificationSetup.setListener(); 39 | } 40 | 41 | static setListener() { 42 | AwesomeNotifications().setListeners( 43 | onActionReceivedMethod: AppNotificationSetup.onActionReceivedMethod, 44 | onNotificationCreatedMethod: 45 | AppNotificationSetup.onNotificationCreatedMethod, 46 | onNotificationDisplayedMethod: 47 | AppNotificationSetup.onNotificationDisplayedMethod, 48 | onDismissActionReceivedMethod: 49 | AppNotificationSetup.onDismissActionReceivedMethod); 50 | } 51 | 52 | requestPermission() async { 53 | AwesomeNotifications().isNotificationAllowed().then((isAllowed) { 54 | if (!isAllowed) { 55 | AwesomeNotifications().requestPermissionToSendNotifications(); 56 | } 57 | //Welcome Message 58 | }); 59 | sendAppNotification( 60 | title: 'Welcome to LKE Group!', 61 | message: "Thank you for installing our app", 62 | notificationsType: NotificationsType.Welcome_Message); 63 | } 64 | 65 | /// Use this method to detect when a new notification or a schedule is created 66 | @pragma("vm:entry-point") 67 | static Future onNotificationCreatedMethod( 68 | ReceivedNotification receivedNotification) async { 69 | // Nothing (later add action) 70 | } 71 | 72 | /// Use this method to detect every time that a new notification is displayed 73 | @pragma("vm:entry-point") 74 | static Future onNotificationDisplayedMethod( 75 | ReceivedNotification receivedNotification) async { 76 | // Nothing (later add action) 77 | } 78 | 79 | /// Use this method to detect if the user dismissed a notification 80 | @pragma("vm:entry-point") 81 | static Future onDismissActionReceivedMethod( 82 | ReceivedAction receivedAction) async { 83 | // nothing 84 | } 85 | 86 | /// Use this method to detect when the user taps on a notification or action button 87 | @pragma("vm:entry-point") 88 | static Future onActionReceivedMethod( 89 | ReceivedAction receivedAction) async { 90 | // Nothing (later add action) 91 | // 92 | // // Navigate into pages, avoiding to open the notification details page over another details page already opened 93 | // MyApp.navigatorKey.currentState?.pushNamedAndRemoveUntil('/notification-page', 94 | // (route) => (route.settings.name != '/notification-page') || route.isFirst, 95 | // arguments: receivedAction); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /lib/src/core/localization/app_locale.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/localization/languages/chinese_language.dart'; 2 | import 'package:flutter_clean_coded/src/core/utils/managers/app_enums.dart'; 3 | 4 | AppLocale appDefaultLocale = AppLocale.english; 5 | 6 | String getLocaleText(text) { 7 | if (appDefaultLocale == AppLocale.chinese) { 8 | text = getChineseLanguage(text); 9 | } 10 | return text; 11 | } 12 | 13 | // Create a lowercase version of the map for lookups 14 | Map lowercaseChineseTranslations = { 15 | for (var entry in chineseTranslations.entries) 16 | entry.key.toLowerCase(): entry.value 17 | }; 18 | 19 | // Function to get the Chinese translation for a given key 20 | String getChineseLanguage(String key) { 21 | String normalizedKey = key.toLowerCase(); 22 | return lowercaseChineseTranslations[normalizedKey] ?? key; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/core/themes/app_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_clean_coded/src/core/utils/managers/app_constants.dart'; 3 | 4 | import 'styles/app_colors.dart'; 5 | 6 | ThemeData getApplicationTheme() { 7 | return ThemeData.light(useMaterial3: true).copyWith( 8 | appBarTheme: AppBarTheme( 9 | centerTitle: true, 10 | color: AppColors.white, 11 | surfaceTintColor: AppColors.primaryColor.withOpacity(0.1)), 12 | cardColor: Colors.white, 13 | colorScheme: const ColorScheme.light().copyWith( 14 | primary: AppColors.primaryColor, 15 | ), 16 | 17 | //App Transition 18 | pageTransitionsTheme: const PageTransitionsTheme(builders: { 19 | TargetPlatform.android: OpenUpwardsPageTransitionsBuilder(), 20 | TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), 21 | }), 22 | 23 | // main colors of the app 24 | primaryColor: AppColors.primaryColor, 25 | shadowColor: AppColors.lowPriority, 26 | primaryColorDark: AppColors.darkColor, 27 | disabledColor: AppColors.grey, 28 | scaffoldBackgroundColor: AppColors.white, 29 | 30 | //Text Theme 31 | textTheme: ThemeData.light().textTheme.apply( 32 | fontFamily: AppConstants.appFontFamily, 33 | ), 34 | primaryTextTheme: ThemeData.light().textTheme.apply( 35 | fontFamily: AppConstants.appFontFamily, 36 | ), 37 | ); 38 | } 39 | 40 | ThemeData getDarkApplicationTheme() { 41 | return ThemeData.dark(useMaterial3: true).copyWith( 42 | appBarTheme: AppBarTheme( 43 | centerTitle: true, 44 | color: AppColors.white, 45 | surfaceTintColor: AppColors.primaryColor.withOpacity(0.1)), 46 | cardColor: Colors.white, 47 | colorScheme: const ColorScheme.dark().copyWith( 48 | primary: AppColors.primaryColor, 49 | ), 50 | ); 51 | } 52 | -------------------------------------------------------------------------------- /lib/src/core/themes/styles/app_colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | abstract class AppColors { 4 | // Primary Colors 5 | static const Color primaryColor = Color(0xff02513E); // Deep green 6 | static const Color primaryDark = 7 | Color(0xff023A2D); // Darker shade of primaryColor 8 | static const Color primaryLight = 9 | Color(0xff3F7B69); // Lighter shade of primaryColor 10 | 11 | // Secondary Colors 12 | static const Color secondaryColor = Color(0xffFFBC00); //#6F5D51 13 | static const Color secondaryColorDark = Color(0xffB77F58); // #B77F58 14 | 15 | // Neutral Colors 16 | static const Color white = Color(0xffffffff); 17 | static const Color grey = Color(0xffAAAAAA); //#AAAAAA 18 | static const Color greyDark = Color(0xff898989); 19 | static const Color blackColor = Color(0xf4000000); 20 | 21 | // Accent Colors 22 | static const Color greenColor = Color(0xf461df25); 23 | static const Color goldColor = Color(0xffdcad43); 24 | static const Color blueColor = Color(0xf42550df); 25 | static const Color purpleColor = Color(0xf4ad42ee); 26 | static const Color redColor = Color(0xf4df2535); 27 | 28 | // Low Priority / Muted Colors 29 | static const Color lowPriority = Color(0xff848191); 30 | 31 | // UI Specific Colors 32 | static const Color darkColor = Color(0xff023020); 33 | static const Color scaffoldColor = Color(0xffdcad43); 34 | static const Color appBarColor = Color(0xffffffff); 35 | } 36 | 37 | extension HexColor on Color { 38 | static Color fromHex(String hexColorString) { 39 | hexColorString = hexColorString.replaceAll('#', ''); 40 | if (hexColorString.length == 6) { 41 | hexColorString = "FF$hexColorString"; // 8 char with opacity 100% 42 | } 43 | return Color(int.parse(hexColorString, radix: 16)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/src/core/themes/styles/app_fonts.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class FontConstants { 4 | static const String fontFamily = "Montserrat"; 5 | } 6 | 7 | class AppFontWeight { 8 | static const FontWeight light = FontWeight.w300; 9 | static const FontWeight regular = FontWeight.w400; 10 | static const FontWeight medium = FontWeight.w600; 11 | static const FontWeight semiBold = FontWeight.w700; 12 | static const FontWeight bold = FontWeight.w900; 13 | } 14 | 15 | class AppFontSize { 16 | static const double s10 = 10.0; 17 | static const double s12 = 12.0; 18 | static const double s14 = 14.0; 19 | static const double s16 = 16.0; 20 | static const double s17 = 17.0; 21 | static const double s18 = 18.0; 22 | static const double s20 = 20.0; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/core/themes/styles/app_textstyles.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'app_fonts.dart'; 4 | 5 | TextStyle _getTextStyle( 6 | double fontSize, String fontFamily, FontWeight fontWeight, Color color) { 7 | return TextStyle( 8 | fontSize: fontSize, 9 | fontFamily: fontFamily, 10 | color: color, 11 | fontWeight: fontWeight); 12 | } 13 | 14 | // regular style 15 | TextStyle getRegularStyle( 16 | {double fontSize = AppFontSize.s12, required Color color}) { 17 | return _getTextStyle( 18 | fontSize, FontConstants.fontFamily, AppFontWeight.regular, color); 19 | } 20 | 21 | // light text style 22 | TextStyle getLightStyle( 23 | {double fontSize = AppFontSize.s12, required Color color}) { 24 | return _getTextStyle( 25 | fontSize, FontConstants.fontFamily, AppFontWeight.light, color); 26 | } 27 | // bold text style 28 | 29 | TextStyle getBoldStyle( 30 | {double fontSize = AppFontSize.s12, required Color color}) { 31 | return _getTextStyle( 32 | fontSize, FontConstants.fontFamily, AppFontWeight.bold, color); 33 | } 34 | 35 | // semi bold text style 36 | 37 | TextStyle getSemiBoldStyle( 38 | {double fontSize = AppFontSize.s12, required Color color}) { 39 | return _getTextStyle( 40 | fontSize, FontConstants.fontFamily, AppFontWeight.semiBold, color); 41 | } 42 | 43 | // medium text style 44 | 45 | TextStyle getMediumStyle( 46 | {double fontSize = AppFontSize.s12, required Color color}) { 47 | return _getTextStyle( 48 | fontSize, FontConstants.fontFamily, AppFontWeight.medium, color); 49 | } 50 | 51 | TextStyle italic = const TextStyle( 52 | fontSize: 12, 53 | fontStyle: FontStyle.italic, 54 | fontWeight: FontWeight.w100, 55 | ); 56 | -------------------------------------------------------------------------------- /lib/src/core/utils/managers/app_constants.dart: -------------------------------------------------------------------------------- 1 | import 'app_enums.dart'; 2 | 3 | abstract class AppConstants { 4 | static const String appTitle = "LKE Group Mobile App"; 5 | static const String appVersion = "V1.0.0"; 6 | static const String noPhoto = "NOPHOTO"; 7 | static const String appFontFamily = "OpenSans"; 8 | static const int numOfItemsInNews = 30; 9 | AppLocale appDefaultLocale = AppLocale.english; 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/core/utils/managers/app_enums.dart: -------------------------------------------------------------------------------- 1 | ///FOR API Usage 2 | enum BookingStatus { 3 | CANCELLED, 4 | PAYMENT_PENDING, 5 | RESERVED, 6 | CONFIRMED, 7 | PAYMENT_FAILED 8 | } 9 | 10 | enum AuthPages { 11 | landing, 12 | login, 13 | register, 14 | } 15 | 16 | enum PaymentStatus { SUCCESS, PENDING, FAILED, REFUNDED } 17 | 18 | enum SearchType { 19 | SHORT, 20 | LONG, 21 | } 22 | 23 | enum AppLocale { 24 | english, 25 | chinese, 26 | } 27 | 28 | enum NotificationsType { 29 | Bookings_Notification, 30 | Welcome_Message, 31 | News_Notification, 32 | Feedback_Notification, 33 | } 34 | 35 | enum AppButtonsType { 36 | Allow_Home_Scrolling, 37 | } 38 | 39 | enum NewsFeedType { PROMOTION, EVENT, OTHERS } 40 | 41 | enum UserType { OWNER, TENANT, ALL, LOADING } 42 | 43 | //For App Logic Usage 44 | enum UserStatusType { 45 | newUser, 46 | existingUser, 47 | verifiedUser, 48 | unverifiedUser, 49 | inCompleteProfileUser, 50 | } 51 | 52 | enum FeedbackType { management, property, booking, payment, withdrawal, other } 53 | 54 | enum DateAvailableStatus { AVAILABLE, OCCUPIED, RESERVED, NOT_AVAILABLE } 55 | 56 | enum UnitListingType { 57 | totalRevenue, 58 | withdraw, 59 | outstanding, 60 | } 61 | 62 | enum PageViewType { 63 | homePage, 64 | feedbackPage, 65 | myBookingPage, 66 | myPropertyPage, 67 | newsPage, 68 | profilePage, 69 | } 70 | -------------------------------------------------------------------------------- /lib/src/core/utils/managers/app_extensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | extension MediaQueryExtension on BuildContext { 4 | Size get _size => MediaQuery.of(this).size; 5 | 6 | double get width => _size.width; 7 | 8 | double get height => _size.height; 9 | } 10 | 11 | extension MonthName on int { 12 | String get dateMonthName { 13 | switch (this) { 14 | case 1: 15 | return 'January'; 16 | case 2: 17 | return 'February'; 18 | case 3: 19 | return 'March'; 20 | case 4: 21 | return 'April'; 22 | case 5: 23 | return 'May'; 24 | case 6: 25 | return 'June'; 26 | case 7: 27 | return 'July'; 28 | case 8: 29 | return 'August'; 30 | case 9: 31 | return 'September'; 32 | case 10: 33 | return 'October'; 34 | case 11: 35 | return 'November'; 36 | case 12: 37 | return 'December'; 38 | default: 39 | return ''; 40 | } 41 | } 42 | } 43 | 44 | extension StringCasingExtension on String { 45 | String toCapitalize() => 46 | length > 0 ? '${this[0].toUpperCase()}${substring(1).toLowerCase()}' : ''; 47 | 48 | String toTitleCase() => replaceAll(RegExp(' +'), ' ') 49 | .split(' ') 50 | .map((str) => str.toCapitalize()) 51 | .join(' '); 52 | } 53 | -------------------------------------------------------------------------------- /lib/src/core/utils/managers/app_strings.dart: -------------------------------------------------------------------------------- 1 | abstract class AppSocialLinks { 2 | static const String playStoreURL = 3 | "https://play.google.com/store/apps/details?id=com.seiasia.LKE Group"; 4 | static const String appleStoreURL = 5 | "https://apps.apple.com/my/app/LKE Group-homes/id6526475893"; 6 | } 7 | -------------------------------------------------------------------------------- /lib/src/core/utils/observers/app_bloc_obeserver.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_bloc/flutter_bloc.dart'; 2 | 3 | import '../../../presentation/Shared/widgets_builder.dart'; 4 | 5 | class AppBlocObserver extends BlocObserver { 6 | static init() { 7 | Bloc.observer = AppBlocObserver(); 8 | } 9 | 10 | @override 11 | void onCreate(BlocBase bloc) { 12 | super.onCreate(bloc); 13 | printC('onCreate -- ${bloc.runtimeType}'); 14 | } 15 | 16 | @override 17 | void onChange(BlocBase bloc, Change change) { 18 | super.onChange(bloc, change); 19 | printC('onChange -- ${bloc.runtimeType}, $change'); 20 | } 21 | 22 | @override 23 | void onError(BlocBase bloc, Object error, StackTrace stackTrace) { 24 | printC('onError -- ${bloc.runtimeType}, $error'); 25 | super.onError(bloc, error, stackTrace); 26 | } 27 | 28 | @override 29 | void onClose(BlocBase bloc) { 30 | super.onClose(bloc); 31 | printC('onClose -- ${bloc.runtimeType}'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/src/data/local/constant/local_constants.dart: -------------------------------------------------------------------------------- 1 | class AppLocalConstants { 2 | // LocalStorage 3 | static const String currentLoginUser = "currentUser"; 4 | static const String userProfile = "userProfile"; 5 | static const String user = "user"; 6 | 7 | static const String token = "token"; 8 | static const String appLocale = "appLocale"; 9 | static const String appNotificationButtons = "appNotificationButtons"; 10 | static const String appSettingsButtons = "appSettingsButtons"; 11 | static const int tokenMinLen = 100; 12 | 13 | // Heroes 14 | static const String logoHero = "logoHero"; 15 | static const String loadingHero = "loadingHero"; 16 | static const String cancelButtonHero = "cancelButtonHero"; 17 | static const String guestModeEmail = "guest@ayatt.com"; 18 | static const String guestModeAuth = "guestpassword"; 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/data/local/db/local_storage_database.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | class LocalStorageDatabase { 6 | final SharedPreferences sharedPreferences; 7 | 8 | LocalStorageDatabase({required this.sharedPreferences}); 9 | 10 | /// Save a key-value pair as a string. 11 | Future save(String key, String value) async { 12 | return await sharedPreferences.setString(key, value); 13 | } 14 | 15 | /// Save a map (converted to JSON string) with a specified key. 16 | Future saveMap(String mapName, Map mapData) async { 17 | String jsonString = jsonEncode(mapData); 18 | return await sharedPreferences.setString(mapName, jsonString); 19 | } 20 | 21 | /// Save a list (converted to JSON string) with a specified key. 22 | Future saveList(String listName, List listData) async { 23 | String jsonString = jsonEncode(listData); 24 | return await sharedPreferences.setString(listName, jsonString); 25 | } 26 | 27 | /// Retrieve a string value by key. 28 | String? get(String key) { 29 | return sharedPreferences.getString(key); 30 | } 31 | 32 | /// Retrieve a map (decoded from JSON string) by key. 33 | Map? getMap(String mapName) { 34 | String? jsonString = sharedPreferences.getString(mapName); 35 | if (jsonString != null) { 36 | return jsonDecode(jsonString) as Map; 37 | } 38 | return null; 39 | } 40 | 41 | /// Retrieve a list (decoded from JSON string) by key. 42 | List? getList(String listName) { 43 | String? jsonString = sharedPreferences.getString(listName); 44 | if (jsonString != null) { 45 | return jsonDecode(jsonString) as List; 46 | } 47 | return null; 48 | } 49 | 50 | /// Remove a value by key. 51 | Future remove(String key) async { 52 | return await sharedPreferences.remove(key); 53 | } 54 | 55 | /// Clear all stored data. 56 | Future clear() async { 57 | return await sharedPreferences.clear(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/src/data/local/db/secure_storage_database.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 4 | import 'package:flutter_clean_coded/src/core/dependencies/app_dep_injector.dart'; 5 | 6 | class SecureStorageDatabase { 7 | final FlutterSecureStorage secureStorage; 8 | 9 | SecureStorageDatabase({required this.secureStorage}); 10 | 11 | /// Save a key-value pair as a string. 12 | Future save(String key, String value) async { 13 | await secureStorage.write(key: key, value: value); 14 | } 15 | 16 | /// Save a map (converted to JSON string) with a specified key. 17 | Future saveMap(String mapName, Map mapData) async { 18 | String jsonString = jsonEncode(mapData); 19 | await secureStorage.write(key: mapName, value: jsonString); 20 | } 21 | 22 | /// Save a list (converted to JSON string) with a specified key. 23 | Future saveList(String listName, List listData) async { 24 | String jsonString = jsonEncode(listData); 25 | await secureStorage.write(key: listName, value: jsonString); 26 | } 27 | 28 | /// Retrieve a string value by key. 29 | Future get(String key) async { 30 | return await secureStorage.read(key: key); 31 | } 32 | 33 | /// Retrieve a map (decoded from JSON string) by key. 34 | Future?> getMap(String mapName) async { 35 | String? jsonString = await secureStorage.read(key: mapName); 36 | if (jsonString != null) { 37 | return jsonDecode(jsonString) as Map; 38 | } 39 | return null; 40 | } 41 | 42 | /// Retrieve a list (decoded from JSON string) by key. 43 | Future?> getList(String listName) async { 44 | String? jsonString = await secureStorage.read(key: listName); 45 | if (jsonString != null) { 46 | return jsonDecode(jsonString) as List; 47 | } 48 | return null; 49 | } 50 | 51 | /// Remove a value by key. 52 | Future remove(String key) async { 53 | await secureStorage.delete(key: key); 54 | } 55 | 56 | /// Clear all stored data. 57 | Future clear() async { 58 | await secureStorage.deleteAll(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/src/data/local/preferences/app_settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter_clean_coded/src/domain/usecases/notification_usecase.dart'; 3 | 4 | import '../../../core/utils/managers/app_lists.dart'; 5 | 6 | ScrollPhysics getAppHomePageScrollPhysics() { 7 | bool isToggled = 8 | checkSettingsButtonToggleStatus(AppLists.appSettingsButtonsItemLists[0]); 9 | if (isToggled) { 10 | return const AlwaysScrollableScrollPhysics(); 11 | } else { 12 | return const NeverScrollableScrollPhysics(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/data/remote/api/network_constants.dart: -------------------------------------------------------------------------------- 1 | abstract class AppNetworkConstants { 2 | // API 3 | static const String networkApiUrl = "http://146.190.6.47:9090"; 4 | // static const String localApiUrl = "http://192.168.147.1:9000"; 5 | static const String baseApiUrl = networkApiUrl; 6 | static const int apiTimeOut = 60; 7 | static const String contentType = "application/json"; 8 | 9 | static const String signUpEndpoint = "/api/auths/signup"; 10 | static const String loginEndpoint = "/api/auths/login"; 11 | static const String adminAppSettingsEndPoint = "/api/settings"; 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/data/remote/exception/remote_error_handleing.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:dio/dio.dart'; 4 | 5 | class DioExceptionHandler { 6 | // Function to convert DioException to a user-friendly message 7 | static String handleError(error) { 8 | String errorDescription = ""; 9 | 10 | if (error is DioException) { 11 | switch (error.type) { 12 | case DioExceptionType.cancel: 13 | errorDescription = "Request to the server was cancelled."; 14 | break; 15 | case DioExceptionType.connectionTimeout: 16 | errorDescription = "Connection timeout with server."; 17 | break; 18 | case DioExceptionType.sendTimeout: 19 | errorDescription = "Send timeout in connection with the server."; 20 | break; 21 | case DioExceptionType.receiveTimeout: 22 | errorDescription = "Receive timeout in connection with the server."; 23 | break; 24 | case DioExceptionType.badResponse: 25 | errorDescription = _handleResponseError(error.response); 26 | break; 27 | case DioExceptionType.unknown: 28 | if (error.error != null && error.error is SocketException) { 29 | errorDescription = "No Internet connection."; 30 | } else { 31 | errorDescription = "Unexpected error occurred."; 32 | } 33 | break; 34 | case DioExceptionType.badCertificate: 35 | errorDescription = "Bad Certificate, error in the Security."; 36 | break; 37 | 38 | case DioExceptionType.connectionError: 39 | errorDescription = 40 | "Connection error, please check you data connection."; 41 | break; 42 | } 43 | } else { 44 | errorDescription = "Unexpected error occurred."; 45 | } 46 | return errorDescription; 47 | } 48 | 49 | static String _handleResponseError(response) { 50 | // You can handle specific status codes or Dio's Responses here 51 | if (response != null && response.statusCode != null) { 52 | switch (response.statusCode) { 53 | case 400: 54 | return "Oops! It looks like there was a problem with your request. Please check it and try again."; 55 | case 401: 56 | return "You need to be logged in to do that. Please login and try again."; 57 | case 403: 58 | return "Please confirm your email and password!"; 59 | case 404: 60 | return "We couldn’t find what you were looking for. It might have been moved or deleted."; 61 | case 500: 62 | return "Something went wrong on our end. We’re working to fix it, so please try again later."; 63 | default: 64 | return "Something unexpected happened (Error: ${response.statusCode}). Please try again later."; 65 | } 66 | } else { 67 | return "We encountered a problem while connecting to the server. Please check your internet connection and try again."; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/src/data/remote/firebase/firebase_helper.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/lib/src/data/remote/firebase/firebase_helper.dart -------------------------------------------------------------------------------- /lib/src/data/remote/firebase/firebase_options.dart: -------------------------------------------------------------------------------- 1 | // File generated by FlutterFire CLI. 2 | // ignore_for_file: type=lint 3 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; 4 | import 'package:flutter/foundation.dart' 5 | show defaultTargetPlatform, kIsWeb, TargetPlatform; 6 | 7 | /// Default [FirebaseOptions] for use with your Firebase apps. 8 | /// 9 | /// Example: 10 | /// ```dart 11 | /// import 'firebase_options.dart'; 12 | /// // ... 13 | /// await Firebase.initializeApp( 14 | /// options: DefaultFirebaseOptions.currentPlatform, 15 | /// ); 16 | /// ``` 17 | class DefaultFirebaseOptions { 18 | static FirebaseOptions get currentPlatform { 19 | return FirebaseOptions( 20 | apiKey: "apiKey", 21 | appId: "appId", 22 | messagingSenderId: "messagingSenderId", 23 | projectId: "projectId"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/data/services/local_storage_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/dependencies/app_dep_injector.dart'; 2 | import 'package:flutter_clean_coded/src/data/local/db/local_storage_database.dart'; 3 | import 'package:flutter_clean_coded/src/data/local/db/secure_storage_database.dart'; 4 | 5 | LocalStorageDatabase getLocalStorageService() { 6 | return AppDependencyInjector.getInstance().get(); 7 | } 8 | 9 | SecureStorageDatabase getSecureStorageService() { 10 | return AppDependencyInjector.getInstance().get(); 11 | } 12 | -------------------------------------------------------------------------------- /lib/src/data/services/remote_storage_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter_clean_coded/src/core/dependencies/app_dep_injector.dart'; 3 | import 'package:flutter_clean_coded/src/data/remote/api/network_constants.dart'; 4 | 5 | Dio getDioClient() { 6 | return AppDependencyInjector.getInstance().get(); 7 | } 8 | 9 | // Method to get API URL 10 | String getApiUrl(String endpoint) { 11 | String apiUrl = '${AppNetworkConstants.baseApiUrl}$endpoint'; 12 | return apiUrl; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/domain/models/authentication/login/user_login_model.dart: -------------------------------------------------------------------------------- 1 | class LoginModelRequest { 2 | final String email; 3 | final String password; 4 | 5 | LoginModelRequest({required this.email, required this.password}); 6 | 7 | Map toJson() { 8 | return { 9 | 'email': email, 10 | 'password': password, 11 | }; 12 | } 13 | 14 | factory LoginModelRequest.fromJson(Map json) { 15 | return LoginModelRequest( 16 | email: json['email'], 17 | password: json['password'], 18 | ); 19 | } 20 | } 21 | 22 | class LoginModelResponse { 23 | final String userType; 24 | final String email; 25 | final String message; 26 | final String userStatus; 27 | final String token; 28 | 29 | LoginModelResponse({ 30 | required this.email, 31 | required this.userStatus, 32 | required this.userType, 33 | required this.message, 34 | required this.token, 35 | }); 36 | 37 | factory LoginModelResponse.fromJson(Map json) { 38 | return LoginModelResponse( 39 | email: json['email'], 40 | message: json['message'], 41 | token: json['token'], 42 | userType: json['userType'], 43 | userStatus: json['userStatus'], 44 | ); 45 | } 46 | 47 | Map toJson() { 48 | return { 49 | 'userType': userType, 50 | 'email': email, 51 | 'userStatus': userStatus, 52 | 'message': message, 53 | 'token': token, 54 | }; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/src/domain/models/authentication/signup/user_signup_model.dart: -------------------------------------------------------------------------------- 1 | class SignUpModelRequest { 2 | final String email; 3 | final String password; 4 | final String userType; 5 | final String username; 6 | 7 | SignUpModelRequest({ 8 | required this.email, 9 | required this.username, 10 | required this.password, 11 | required this.userType, 12 | }); 13 | 14 | Map toJson() { 15 | return { 16 | "userType": userType, 17 | "email": email, 18 | "username": username, 19 | "password": password, 20 | }; 21 | } 22 | } 23 | 24 | class SignUpModelResponse { 25 | final String? userType; 26 | final String? email; 27 | final String? message; 28 | final String? userStatus; 29 | final String? token; 30 | 31 | SignUpModelResponse({ 32 | required this.email, 33 | required this.userType, 34 | required this.message, 35 | required this.userStatus, 36 | required this.token, 37 | }); 38 | 39 | factory SignUpModelResponse.fromJson(Map json) { 40 | return SignUpModelResponse( 41 | email: json['email'] ?? "NULL", 42 | message: json['message'] ?? "NULL", 43 | token: json['token'] ?? "NULL", 44 | userStatus: json['userStatus'] ?? "NULL", 45 | userType: json['userType'] ?? "NULL", 46 | ); 47 | } 48 | 49 | Map toJson() { 50 | return { 51 | 'userType': userType, 52 | 'email': email, 53 | 'message': message, 54 | 'userStatus': userStatus, 55 | 'token': token, 56 | }; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/src/domain/models/feedback/feedback_model.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_clean_coded/src/presentation/Shared/widgets_builder.dart'; 4 | 5 | import '../General/image_model.dart'; 6 | 7 | List feedbackListFromJson(dynamic parsed) { 8 | try { 9 | if (parsed is List) { 10 | return parsed.map((json) { 11 | return FeedbackModel.fromJson(json ?? {}); 12 | }).toList(); 13 | } else { 14 | throw Exception(); 15 | } 16 | } catch (e) { 17 | printC(e); 18 | throw Exception(e.toString()); 19 | } 20 | } 21 | 22 | String feedbackListToJson(List data) => 23 | json.encode(List.from(data.map((x) => x.toJson()))); 24 | 25 | class FeedbackModel { 26 | final num contactId; 27 | final num userId; 28 | final String contactType; 29 | final String firstName; 30 | final String lastName; 31 | final String email; 32 | final String mobileNo; 33 | final String enquiry; 34 | final String answer; 35 | final ImageModel image; 36 | final String contactStatus; 37 | final String createdAt; 38 | final String updatedAt; 39 | 40 | FeedbackModel({ 41 | required this.contactId, 42 | required this.userId, 43 | required this.contactType, 44 | required this.firstName, 45 | required this.lastName, 46 | required this.email, 47 | required this.mobileNo, 48 | required this.enquiry, 49 | required this.answer, 50 | required this.image, 51 | required this.contactStatus, 52 | required this.createdAt, 53 | required this.updatedAt, 54 | }); 55 | 56 | factory FeedbackModel.fromJson(Map json) { 57 | return FeedbackModel( 58 | userId: json['userId'] ?? 0, 59 | contactId: json['contactId'] ?? 0, 60 | contactType: json['contactType'] ?? "", 61 | firstName: json['firstName'] ?? "", 62 | lastName: json['lastName'] ?? "", 63 | email: json['email'] ?? "", 64 | mobileNo: json['mobileNo'] ?? "", 65 | enquiry: json['enquiry'] ?? "", 66 | answer: json['answer'] ?? "", 67 | image: 68 | ImageModel.fromJson(json['image'] ?? ImageModel.empty().toFullJson()), 69 | contactStatus: json['contactStatus'] ?? "", 70 | createdAt: json['createdAt'] ?? "", 71 | updatedAt: json['updatedAt'] ?? "", 72 | ); 73 | } 74 | 75 | Map toJson() { 76 | return { 77 | 'userId': userId, 78 | // 'contactId': contactId, 79 | 'contactType': contactType, 80 | 'firstName': firstName, 81 | 'lastName': lastName, 82 | 'email': email, 83 | 'mobileNo': mobileNo, 84 | 'enquiry': enquiry, 85 | 'answer': answer, 86 | 'image': image.toUploadJson(), 87 | 'contactStatus': contactStatus, 88 | // 'createdAt': createdAt, 89 | // 'updatedAt': updatedAt, 90 | }; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/src/domain/models/general/image_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/data/remote/api/network_constants.dart'; 2 | 3 | class ImageModel { 4 | final int imageId; 5 | final int imageIndex; 6 | final String imageUrl; 7 | final String uploadedAt; 8 | 9 | ImageModel({ 10 | required this.imageId, 11 | required this.imageIndex, 12 | required this.imageUrl, 13 | required this.uploadedAt, 14 | }); 15 | factory ImageModel.fromJson(Map? json) { 16 | if (json == null) { 17 | return ImageModel( 18 | imageId: 0, imageIndex: 0, imageUrl: '', uploadedAt: ''); 19 | } 20 | String image = json['imageUrl'] ?? ""; 21 | if (json['imageId'] != 0) { 22 | if (!image.startsWith(AppNetworkConstants.baseApiUrl)) { 23 | image = "${AppNetworkConstants.baseApiUrl}${json['imageUrl']}"; 24 | } 25 | } 26 | 27 | return ImageModel( 28 | imageId: json['imageId'] ?? 0, 29 | imageIndex: (json['imageIndex'] ?? 0.0).toInt(), 30 | imageUrl: image, 31 | uploadedAt: json['uploadedAt'] ?? '', 32 | ); 33 | } 34 | 35 | factory ImageModel.empty() { 36 | return ImageModel( 37 | imageId: 0, 38 | imageIndex: 0, 39 | imageUrl: "", 40 | uploadedAt: "", 41 | ); 42 | } 43 | 44 | Map toUploadJson() { 45 | if (imageUrl == "null") { 46 | return { 47 | 'imageIndex': null, 48 | 'imageData': null, 49 | }; 50 | } 51 | return { 52 | 'imageIndex': imageIndex, 53 | 'imageData': imageUrl, 54 | }; 55 | } 56 | 57 | Map toFullJson() { 58 | return { 59 | 'imageId': imageId, 60 | 'imageIndex': imageIndex, 61 | 'imageUrl': imageUrl, 62 | 'uploadedAt': uploadedAt, 63 | }; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/src/domain/models/general/list_response_model.dart: -------------------------------------------------------------------------------- 1 | class ListResponseModel { 2 | static getPureListData(jsonResponse) { 3 | List keys = jsonResponse.keys.toList(); 4 | for (int i = 0; i < keys.length; i++) { 5 | if (keys[i] != 'totalPages' && keys[i] != 'currentPage') { 6 | return jsonResponse[keys[i]]; 7 | } 8 | } 9 | return jsonResponse; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/src/domain/models/general/network_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | 3 | class ResponseModel { 4 | final bool _isSuccess; 5 | final String _message; 6 | final Response? _response; 7 | 8 | ResponseModel(this._isSuccess, this._message, [this._response]); 9 | 10 | String get message => _message; 11 | bool get isSuccess => _isSuccess; 12 | Response? get response => _response; 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/domain/models/remote_response_model.dart: -------------------------------------------------------------------------------- 1 | class RemoteResponseModel { 2 | final bool isSuccess; 3 | final String message; 4 | final dynamic data; 5 | 6 | RemoteResponseModel({ 7 | required this.isSuccess, 8 | required this.message, 9 | required this.data, 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /lib/src/domain/models/users/user_credentials.dart: -------------------------------------------------------------------------------- 1 | class UserCredentialsModel { 2 | final String email; 3 | final String password; 4 | 5 | UserCredentialsModel({ 6 | required this.email, 7 | required this.password, 8 | }); 9 | 10 | factory UserCredentialsModel.fromJson(Map json) { 11 | return UserCredentialsModel( 12 | email: json['email'], 13 | password: json['password'], 14 | ); 15 | } 16 | 17 | Map toJson() { 18 | return { 19 | 'email': email, 20 | 'password': password, 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/domain/models/users/user_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/domain/models/General/image_model.dart'; 2 | 3 | class UserModel { 4 | int userId; 5 | String username; 6 | String firstName; 7 | String lastName; 8 | String email; 9 | String password; 10 | String phone; 11 | String gender; 12 | String userRole; 13 | String userType; 14 | String userStatus; 15 | ImageModel image; 16 | DateTime createdAt; 17 | DateTime updatedAt; 18 | 19 | UserModel({ 20 | required this.userId, 21 | required this.username, 22 | required this.firstName, 23 | required this.lastName, 24 | required this.email, 25 | required this.password, 26 | required this.phone, 27 | required this.gender, 28 | required this.userRole, 29 | required this.userType, 30 | required this.userStatus, 31 | required this.image, 32 | required this.createdAt, 33 | required this.updatedAt, 34 | }); 35 | 36 | factory UserModel.fromJson(Map json) { 37 | return UserModel( 38 | userId: (json['userId'] ?? 0.0).toInt(), 39 | username: json['username'] ?? "", 40 | firstName: json['firstName'] ?? "", 41 | lastName: json['lastName'] ?? "", 42 | image: ImageModel.fromJson(json['image']), 43 | email: json['email'] ?? "", 44 | password: json['password'] ?? "", 45 | phone: json['phone'] ?? "", 46 | gender: json['gender'] ?? "", 47 | userRole: json['userRole'] ?? "", 48 | userStatus: json['userStatus'] ?? "", 49 | userType: json['userType'] ?? "", 50 | createdAt: json['createdAt'] != null 51 | ? DateTime.parse(json['createdAt']).toLocal() 52 | : DateTime.now(), 53 | updatedAt: json['updatedAt'] != null 54 | ? DateTime.parse(json['updatedAt']).toLocal() 55 | : DateTime.now(), 56 | ); 57 | } 58 | 59 | factory UserModel.loadingUser() { 60 | return UserModel( 61 | userId: 0, 62 | username: "Loading", 63 | firstName: "Loading", 64 | image: ImageModel( 65 | imageId: 0, 66 | imageIndex: 0, 67 | imageUrl: 'https://loading.io/assets/mod/spinner/spinner/lg.gif', 68 | uploadedAt: ''), 69 | lastName: "", 70 | email: "Loading", 71 | password: "", 72 | phone: "", 73 | gender: "", 74 | userRole: "", 75 | userType: "", 76 | createdAt: DateTime.now(), 77 | userStatus: '', 78 | updatedAt: DateTime.now(), 79 | ); 80 | } 81 | 82 | Map toLocalJson() { 83 | return { 84 | 'userId': userId, 85 | 'username': username, 86 | 'firstName': firstName, 87 | 'lastName': lastName, 88 | 'email': email, 89 | "image": image.toFullJson(), 90 | 'password': password, 91 | 'phone': phone, 92 | 'gender': gender, 93 | 'userRole': userRole, 94 | 'userStatus': userStatus, 95 | 'userType': userType, 96 | 'createdAt': createdAt.toIso8601String(), 97 | 'updatedAt': updatedAt.toIso8601String(), 98 | }; 99 | } 100 | 101 | Map toServerJson() { 102 | String? nullPass = password; 103 | if (password.isEmpty || password == "null") { 104 | nullPass = null; 105 | } 106 | 107 | return { 108 | 'username': username, 109 | 'firstName': firstName, 110 | 'lastName': lastName, 111 | 'email': email, 112 | 'phone': phone, 113 | 'password': nullPass, 114 | 'gender': gender, 115 | "image": image.toUploadJson() 116 | }; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /lib/src/domain/usecases/notification_usecase.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/utils/managers/app_lists.dart'; 2 | 3 | class ToggleButtonModel { 4 | final String name; 5 | bool isToggled; 6 | 7 | ToggleButtonModel(this.name, this.isToggled); 8 | } 9 | 10 | bool checkNotificationButtonToggleStatus(ToggleButtonModel notification) { 11 | return AppLists.notificationButtonsItemLists 12 | .any((item) => item.name == notification.name && item.isToggled == true); 13 | } 14 | 15 | bool checkSettingsButtonToggleStatus(ToggleButtonModel setting) { 16 | return AppLists.appSettingsButtonsItemLists.any((item) { 17 | return item.name == setting.name && item.isToggled == true; 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/domain/usecases/user_usecase.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/utils/managers/app_enums.dart'; 2 | import 'package:flutter_clean_coded/src/data/local/constant/local_constants.dart'; 3 | import 'package:flutter_clean_coded/src/data/services/local_storage_service.dart'; 4 | import 'package:flutter_clean_coded/src/domain/models/General/image_model.dart'; 5 | import 'package:flutter_clean_coded/src/domain/models/users/user_model.dart'; 6 | 7 | class UserUsecase { 8 | final localDataStorage = getLocalStorageService(); 9 | 10 | Future getUserProfile() async { 11 | var localUserData = localDataStorage.getMap(AppLocalConstants.user); 12 | if (localUserData != null) { 13 | return UserModel.fromJson(localUserData); 14 | } 15 | return UserModel( 16 | userId: 0, 17 | username: "", 18 | firstName: "", 19 | lastName: "", 20 | email: "", 21 | password: "", 22 | phone: "", 23 | gender: "", 24 | userRole: "", 25 | userType: "", 26 | userStatus: "", 27 | image: 28 | ImageModel(imageId: 0, imageIndex: 0, imageUrl: "", uploadedAt: ""), 29 | createdAt: DateTime.now(), 30 | updatedAt: DateTime.now(), 31 | ); 32 | } 33 | 34 | String? getUserToken() { 35 | return localDataStorage.get(AppLocalConstants.token); 36 | } 37 | 38 | Stream getUserStatus() async* { 39 | await Future.delayed(const Duration(seconds: 2)); 40 | // This is a dummy implementation 41 | yield (UserStatusType.newUser); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/app/cubit/app_module_screen_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc/bloc.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | part 'app_module_screen_state.dart'; 5 | 6 | class AppModuleScreenCubit extends Cubit { 7 | AppModuleScreenCubit() : super(AppModuleScreenInitial()); 8 | 9 | void changeScreenState(AppModuleScreenState state) => emit(state); 10 | 11 | void resetScreenState() => emit(AppModuleScreenInitial()); 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/app/cubit/app_module_screen_state.dart: -------------------------------------------------------------------------------- 1 | part of 'app_module_screen_cubit.dart'; 2 | 3 | @immutable 4 | sealed class AppModuleScreenState {} 5 | 6 | final class AppModuleScreenInitial extends AppModuleScreenState {} 7 | 8 | final class HomeAppModuleScreenInitial extends AppModuleScreenState {} 9 | 10 | final class FinanceAppModuleScreenInitial extends AppModuleScreenState {} 11 | 12 | final class ShopAppModuleScreenInitial extends AppModuleScreenState {} 13 | 14 | final class ProfileAppModuleScreenInitial extends AppModuleScreenState {} 15 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/app/finance/finance_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_chart/fl_chart.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | 5 | class FinancePage extends StatelessWidget { 6 | const FinancePage({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | body: Column( 12 | children: [ 13 | Text('Finance Page'), 14 | Container( 15 | decoration: BoxDecoration( 16 | color: Colors.red, 17 | borderRadius: BorderRadius.circular(10), 18 | ), 19 | height: 300, 20 | child: Text("300RM"), 21 | ), 22 | LineChart( 23 | LineChartData( 24 | // read about it in the LineChartData section 25 | ), 26 | swapAnimationDuration: Duration(milliseconds: 150), // Optional 27 | swapAnimationCurve: Curves.linear, // Optional 28 | ) 29 | ], 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/app/home/home_page.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/lib/src/presentation/modules/app/home/home_page.dart -------------------------------------------------------------------------------- /lib/src/presentation/modules/app/profile/profile_page.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/lib/src/presentation/modules/app/profile/profile_page.dart -------------------------------------------------------------------------------- /lib/src/presentation/modules/app/shop/shop_page.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/lib/src/presentation/modules/app/shop/shop_page.dart -------------------------------------------------------------------------------- /lib/src/presentation/modules/app/user_app.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/authentication/auth_router.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/dependencies/app_dep.dart'; 2 | import 'package:flutter_clean_coded/src/core/utils/managers/app_enums.dart'; 3 | import 'package:flutter_clean_coded/src/domain/usecases/user_usecase.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; 6 | import 'package:flutter_clean_coded/src/presentation/modules/authentication/email_verification/email_verification_page.dart'; 7 | 8 | import '../../Shared/app_error_handle.dart'; 9 | import '../../shared/no_connection_handleing.dart'; 10 | import '../splash/splash_loading_screen.dart'; 11 | import '../splash/splash_screen.dart'; 12 | 13 | class AuthRouter extends StatelessWidget { 14 | const AuthRouter({super.key}); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | bool loadStream = true; 19 | 20 | return FutureBuilder( 21 | future: InternetConnection().hasInternetAccess, 22 | builder: (context, snapshot) { 23 | if (snapshot.connectionState == ConnectionState.waiting) { 24 | return const SplashLoadingScreen(); 25 | } 26 | if (snapshot.data == false) { 27 | return const NoConnectionError(); 28 | } 29 | return loadStream 30 | ? StreamBuilder( 31 | stream: UserUsecase().getUserStatus(), 32 | builder: (context, snapshot) { 33 | if (snapshot.connectionState == ConnectionState.waiting) { 34 | return const SplashLoadingScreen(); 35 | } 36 | 37 | if (snapshot.hasError || snapshot.data == null) { 38 | return const CustomError( 39 | errorDetails: 40 | FlutterErrorDetails(exception: "Server Error"), 41 | ); 42 | } 43 | if (snapshot.data == UserStatusType.newUser) { 44 | AppDependencies.newUserPermissions(); 45 | return const SplashScreen(); 46 | } 47 | // if (snapshot.data == UserStatusType.inCompleteProfileUser) { 48 | // return const EditProfileScreen( 49 | // isFirstTimeUser: true, 50 | // title: 'Complete Profile', 51 | // ); 52 | // } 53 | if (snapshot.data == UserStatusType.unverifiedUser) { 54 | return const EmailVerificationPage(); 55 | } 56 | 57 | if (snapshot.data == UserStatusType.verifiedUser) { 58 | return const SplashScreen(); 59 | } else { 60 | return const SplashScreen(); 61 | } 62 | }, 63 | ) 64 | // ignore: dead_code 65 | : const SplashScreen(); 66 | }); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/authentication/user_auth/cubit/user_auth_page_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc/bloc.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:meta/meta.dart'; 4 | 5 | part 'user_auth_page_state.dart'; 6 | 7 | class UserAuthPageCubit extends Cubit { 8 | UserAuthPageCubit() : super(UserAuthPageInitial()); 9 | static UserAuthPageCubit get(context) => BlocProvider.of(context); 10 | 11 | void changeState(UserAuthPageState state) => emit(state); 12 | 13 | void resetState() => emit(UserAuthPageInitial()); 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/authentication/user_auth/cubit/user_auth_page_state.dart: -------------------------------------------------------------------------------- 1 | part of 'user_auth_page_cubit.dart'; 2 | 3 | @immutable 4 | sealed class UserAuthPageState {} 5 | 6 | final class UserAuthPageInitial extends UserAuthPageState {} 7 | 8 | final class GuestModeState extends UserAuthPageState {} 9 | 10 | final class UserSignupState extends UserAuthPageState {} 11 | 12 | final class UserLoginState extends UserAuthPageState {} 13 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/intro/intro_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:introduction_screen/introduction_screen.dart'; 3 | import 'package:flutter_clean_coded/src/presentation/modules/authentication/user_auth/authentication_page.dart'; 4 | import 'package:flutter_clean_coded/src/presentation/modules/intro/intro_screen_viewmodel.dart'; 5 | import 'package:flutter_clean_coded/src/presentation/state/navigation_cubit/navi_cubit.dart'; 6 | 7 | class IntroScreen extends StatelessWidget { 8 | const IntroScreen({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | IntroScreenViewmodel introScreenViewmodel = IntroScreenViewmodel(); 13 | return IntroductionScreen( 14 | pages: introScreenViewmodel.pages, 15 | // showSkipButton: true, 16 | // skip: const Icon(Icons.skip), 17 | next: const Text("Next"), 18 | done: const Text("Done", style: TextStyle(fontWeight: FontWeight.w700)), 19 | onDone: () { 20 | NaviCubit.get(context).navigate(context, const AuthenticationLayout()); 21 | // On Done button pressed 22 | }, 23 | // onSkip: () { 24 | // // On Skip button pressed 25 | // }, 26 | dotsDecorator: DotsDecorator( 27 | size: const Size.square(10.0), 28 | activeSize: const Size(20.0, 10.0), 29 | activeColor: Theme.of(context).colorScheme.secondary, 30 | color: Colors.black26, 31 | spacing: const EdgeInsets.symmetric(horizontal: 3.0), 32 | activeShape: 33 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(25.0)), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/intro/intro_screen_viewmodel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:introduction_screen/introduction_screen.dart'; 3 | import 'package:flutter_clean_coded/src/core/utils/managers/app_assets.dart'; 4 | 5 | class IntroScreenViewmodel { 6 | List? pages = [ 7 | PageViewModel( 8 | title: "Title of first page", 9 | body: 10 | "Here you can write the description of the page, to explain something...", 11 | image: Center(child: Image.asset(AppAssets.comingSoonGif, height: 175.0)), 12 | decoration: const PageDecoration( 13 | pageColor: Colors.white, 14 | titleTextStyle: TextStyle( 15 | color: Colors.black, fontSize: 24.0, fontWeight: FontWeight.w700), 16 | bodyTextStyle: TextStyle(color: Colors.black, fontSize: 18.0), 17 | ), 18 | ), 19 | PageViewModel( 20 | title: "Title of second page", 21 | body: 22 | "Here you can write the description of the page, to explain something...", 23 | image: Center(child: Image.asset(AppAssets.comingSoonGif, height: 175.0)), 24 | decoration: const PageDecoration( 25 | pageColor: Colors.white, 26 | titleTextStyle: TextStyle( 27 | color: Colors.black, fontSize: 24.0, fontWeight: FontWeight.w700), 28 | bodyTextStyle: TextStyle(color: Colors.black, fontSize: 18.0), 29 | ), 30 | ), 31 | PageViewModel( 32 | title: "Title of third page", 33 | body: 34 | "Here you can write the description of the page, to explain something...", 35 | image: 36 | Center(child: Image.asset(AppAssets.comingSoonGif, height: 175.0)), 37 | decoration: const PageDecoration( 38 | pageColor: Colors.white, titleTextStyle: TextStyle())) 39 | ]; 40 | } 41 | -------------------------------------------------------------------------------- /lib/src/presentation/modules/splash/splash_loading_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/themes/styles/app_colors.dart'; 2 | import 'package:flutter_clean_coded/src/presentation/Shared/components.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:loading_animation_widget/loading_animation_widget.dart'; 5 | 6 | import '../../Shared/widgets_builder.dart'; 7 | 8 | class SplashLoadingScreen extends StatefulWidget { 9 | const SplashLoadingScreen({super.key}); 10 | 11 | @override 12 | State createState() => _SplashLoadingScreenState(); 13 | } 14 | 15 | class _SplashLoadingScreenState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return Scaffold( 19 | body: Column( 20 | mainAxisAlignment: MainAxisAlignment.spaceAround, 21 | crossAxisAlignment: CrossAxisAlignment.center, 22 | children: [ 23 | getCube(10, context), 24 | appLogoPreview( 25 | context: context, 26 | width: getWidth(25, context), 27 | wBackground: false), 28 | Center( 29 | child: loadingAnimation( 30 | loadingType: LoadingAnimationWidget.fourRotatingDots( 31 | color: AppColors.primaryColor, size: 50)), 32 | ), 33 | fadedText(context: context, text: "Please wait..."), 34 | getCube(2, context) 35 | ], 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/presentation/shared/app_error_handle.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_clean_coded/src/core/themes/styles/app_fonts.dart'; 4 | import 'package:flutter_clean_coded/src/core/utils/managers/app_assets.dart'; 5 | 6 | class CustomError extends StatelessWidget { 7 | final FlutterErrorDetails errorDetails; 8 | 9 | const CustomError({ 10 | super.key, 11 | required this.errorDetails, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | backgroundColor: Colors.white, 18 | body: Padding( 19 | padding: const EdgeInsets.all(16.0), 20 | child: Column( 21 | mainAxisAlignment: MainAxisAlignment.center, 22 | children: [ 23 | Image.asset(AppAssets.errorGif), 24 | Text( 25 | kDebugMode 26 | ? errorDetails.summary.toString() 27 | : 'Oups! Something went wrong!', 28 | textAlign: TextAlign.center, 29 | style: const TextStyle( 30 | color: kDebugMode ? Colors.red : Colors.black, 31 | fontWeight: FontWeight.bold, 32 | fontSize: 21), 33 | ), 34 | const SizedBox(height: 12), 35 | const Text( 36 | kDebugMode 37 | ? 'https://docs.flutter.dev/testing/errors' 38 | : "We encountered an error and we've notified our engineering team about it. Sorry for the inconvenience caused.", 39 | textAlign: TextAlign.center, 40 | style: TextStyle(color: Colors.black, fontSize: AppFontSize.s14), 41 | ), 42 | ], 43 | ), 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/src/presentation/shared/date_picker.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/themes/styles/app_colors.dart'; 2 | import 'package:flutter_clean_coded/src/core/themes/styles/app_fonts.dart'; 3 | import 'package:flutter_clean_coded/src/presentation/Shared/components.dart'; 4 | import 'package:flutter_clean_coded/src/presentation/Shared/widgets_builder.dart'; 5 | import 'package:flutter_clean_coded/src/presentation/state/navigation_cubit/navi_cubit.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:syncfusion_flutter_datepicker/datepicker.dart'; 8 | 9 | class DatePicker extends StatelessWidget { 10 | final String title; 11 | final bool isFromToSelection; 12 | final Function() onDone; 13 | 14 | const DatePicker( 15 | {super.key, 16 | required this.title, 17 | required this.onDone, 18 | required this.isFromToSelection}); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar( 24 | title: textC(title), 25 | ), 26 | body: Center( 27 | child: Column( 28 | mainAxisAlignment: MainAxisAlignment.spaceAround, 29 | children: [ 30 | SizedBox( 31 | height: getHeight(60, context), 32 | width: getWidth(80, context), 33 | child: SfDateRangePicker( 34 | showTodayButton: false, 35 | enablePastDates: false, 36 | todayHighlightColor: AppColors.white, 37 | selectionMode: DateRangePickerSelectionMode.range, 38 | onSelectionChanged: (dateRangePickerSelectionChangedArgs) { 39 | setCalenderSelectedValue( 40 | dateRangePickerSelectionChangedArgs.value, 41 | ); 42 | }, 43 | ), 44 | ), 45 | loadButton( 46 | context: context, 47 | onPressed: () async { 48 | if (datesValues.startDate == null || 49 | datesValues.endDate == null) { 50 | showToast("Please choose starting and ending dates...", 51 | AppColors.primaryColor, context); 52 | return; 53 | } 54 | await onDone(); 55 | 56 | if (context.mounted) { 57 | NaviCubit.get(context).pop(context); 58 | } 59 | }, 60 | buttonText: "Select", 61 | fontSize: AppFontSize.s16, 62 | borderCurveSize: 10) 63 | ], 64 | ), 65 | ), 66 | ); 67 | } 68 | } 69 | 70 | PickerDateRange datesValues = PickerDateRange(DateTime.now(), DateTime.now()); 71 | 72 | setCalenderSelectedValue(pickerDateRange) { 73 | datesValues = pickerDateRange; 74 | } 75 | 76 | PickerDateRange getCalenderSelectedValue() { 77 | if (datesValues.startDate == null || datesValues.endDate == null) { 78 | return PickerDateRange(DateTime.now(), DateTime.now()); 79 | } 80 | return datesValues; 81 | } 82 | -------------------------------------------------------------------------------- /lib/src/presentation/shared/flow_date_picker.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:intl/intl.dart'; 3 | import 'package:flutter_clean_coded/src/core/themes/styles/app_colors.dart'; 4 | import 'package:flutter_clean_coded/src/core/themes/styles/app_fonts.dart'; 5 | 6 | class DatePickerWidget extends StatelessWidget { 7 | final String labeltext; 8 | final TextEditingController controller; 9 | 10 | const DatePickerWidget( 11 | {required this.labeltext, required this.controller, super.key}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return TextFormField( 16 | validator: (value) { 17 | if (value == null || value.isEmpty) { 18 | return 'Field is empty'; 19 | } 20 | return null; 21 | }, 22 | onTap: () async { 23 | DateTime? pickedDate = await showDatePicker( 24 | context: context, 25 | currentDate: DateTime.now(), 26 | initialDate: DateTime.now(), 27 | firstDate: DateTime.now(), 28 | lastDate: DateTime(2100)); 29 | if (pickedDate != null) { 30 | String formattedDate = DateFormat('yyyy-MM-dd').format(pickedDate); 31 | controller.text = formattedDate; 32 | } 33 | }, 34 | readOnly: true, 35 | controller: controller, 36 | textInputAction: TextInputAction.done, 37 | decoration: InputDecoration( 38 | floatingLabelBehavior: FloatingLabelBehavior.never, 39 | fillColor: AppColors.appBarColor, 40 | border: OutlineInputBorder( 41 | borderRadius: BorderRadius.circular(20), 42 | ), 43 | labelText: labeltext, 44 | labelStyle: const TextStyle( 45 | color: AppColors.darkColor, fontSize: AppFontSize.s12)), 46 | style: const TextStyle( 47 | color: AppColors.primaryColor, fontSize: AppFontSize.s12), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/presentation/shared/globals.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/src/presentation/shared/maps_launcher.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io' show Platform; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:url_launcher/url_launcher.dart'; 5 | 6 | class MapsLauncher { 7 | /// Returns a [Uri] that can be launched on the current platform 8 | /// to open a maps application showing the result of a search query. 9 | static Uri createQueryUri(String query) { 10 | Uri uri; 11 | 12 | if (kIsWeb) { 13 | uri = Uri.https( 14 | 'www.google.com', '/maps/search/', {'api': '1', 'query': query}); 15 | } else if (Platform.isAndroid) { 16 | uri = Uri(scheme: 'geo', host: '0,0', queryParameters: {'q': query}); 17 | } else if (Platform.isIOS) { 18 | uri = Uri.https('maps.apple.com', '/', {'q': query}); 19 | } else { 20 | uri = Uri.https( 21 | 'www.google.com', '/maps/search/', {'api': '1', 'query': query}); 22 | } 23 | 24 | return uri; 25 | } 26 | 27 | /// Returns a [Uri] that can be launched on the current platform 28 | /// to open a maps application showing coordinates ([latitude] and [longitude]). 29 | static Uri createCoordinatesUri(String latitude, String longitude, 30 | [String? label]) { 31 | Uri uri; 32 | 33 | if (kIsWeb) { 34 | uri = Uri.https('www.google.com', '/maps/search/', 35 | {'api': '1', 'query': '$latitude,$longitude'}); 36 | } else if (Platform.isAndroid) { 37 | var query = '$latitude,$longitude'; 38 | 39 | if (label != null) query += '($label)'; 40 | 41 | uri = Uri(scheme: 'geo', host: '0,0', queryParameters: {'q': query}); 42 | } else if (Platform.isIOS) { 43 | var params = { 44 | 'll': '$latitude,$longitude', 45 | 'q': label ?? '$latitude, $longitude', 46 | }; 47 | 48 | uri = Uri.https('maps.apple.com', '/', params); 49 | } else { 50 | uri = Uri.https('www.google.com', '/maps/search/', 51 | {'api': '1', 'query': '$latitude,$longitude'}); 52 | } 53 | 54 | return uri; 55 | } 56 | 57 | /// Launches the maps application for this platform. 58 | /// The maps application will show the result of the provided search [query]. 59 | /// Returns a Future that resolves to true if the maps application 60 | /// was launched successfully, false otherwise. 61 | static Future launchQuery(String query) { 62 | return launchUrl(createQueryUri(query)); 63 | } 64 | 65 | /// Launches the maps application for this platform. 66 | /// The maps application will show the specified coordinates. 67 | /// Returns a Future that resolves to true if the maps application 68 | /// was launched successfully, false otherwise. 69 | static Future launchCoordinates(String latitude, String longitude, 70 | [String? label]) { 71 | return launchUrl(createCoordinatesUri(latitude, longitude, label)); 72 | } 73 | } -------------------------------------------------------------------------------- /lib/src/presentation/shared/no_connection_handleing.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_clean_coded/src/core/themes/styles/app_fonts.dart'; 2 | import 'package:flutter_clean_coded/src/core/utils/managers/app_assets.dart'; 3 | import 'package:flutter_clean_coded/src/presentation/state/navigation_cubit/navi_cubit.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class NoConnectionError extends StatelessWidget { 7 | const NoConnectionError({ 8 | super.key, 9 | }); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return SizedBox( 14 | child: Scaffold( 15 | backgroundColor: Colors.white, 16 | body: Padding( 17 | padding: const EdgeInsets.all(16.0), 18 | child: Column( 19 | mainAxisAlignment: MainAxisAlignment.center, 20 | children: [ 21 | Image.asset(AppAssets.errorGif), 22 | const SizedBox(height: 10), 23 | const Text( 24 | 'Connection Error!', 25 | textAlign: TextAlign.center, 26 | style: TextStyle( 27 | color: Colors.red, 28 | fontWeight: FontWeight.bold, 29 | fontSize: 21), 30 | ), 31 | const SizedBox(height: 40), 32 | const Text( 33 | "We are unable to connect to our server, please check your connection or try again another time.", 34 | textAlign: TextAlign.center, 35 | style: 36 | TextStyle(color: Colors.black, fontSize: AppFontSize.s14), 37 | ), 38 | const SizedBox(height: 40), 39 | OutlinedButton( 40 | onPressed: () { 41 | NaviCubit.get(context).navigateToHome(context); 42 | }, 43 | child: const Text( 44 | "Retry", 45 | style: TextStyle( 46 | fontSize: AppFontSize.s16, 47 | fontWeight: FontWeight.bold, 48 | color: Colors.black), 49 | ), 50 | ) 51 | ], 52 | ), 53 | ), 54 | ), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/src/presentation/shared/qr_code_generate.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:qr_flutter/qr_flutter.dart'; 3 | 4 | class QRImageGenerator extends StatelessWidget { 5 | final EdgeInsets? margin; 6 | 7 | const QRImageGenerator(this.qrcode, {super.key, this.margin}); 8 | 9 | final String qrcode; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Card( 14 | margin: margin ?? const EdgeInsets.symmetric(horizontal: 100), 15 | elevation: 3, 16 | color: Colors.white, 17 | child: QrImageView( 18 | data: qrcode, 19 | version: QrVersions.min, 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/presentation/shared/webview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_inappwebview/flutter_inappwebview.dart'; 3 | 4 | Widget webView(String url, webController) { 5 | return InAppWebView( 6 | pullToRefreshController: PullToRefreshController( 7 | onRefresh: () {}, 8 | ), 9 | initialUrlRequest: URLRequest(url: WebUri(url)), 10 | // initialOptions: 11 | // InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions()), 12 | onWebViewCreated: (controller) { 13 | webController = controller; 14 | }, 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/presentation/state/app_settings_bloc/app_settings_bloc.dart: -------------------------------------------------------------------------------- 1 | // import 'package:flutter_bloc/flutter_bloc.dart'; 2 | // import 'package:meta/meta.dart'; 3 | 4 | // part 'app_settings_event.dart'; 5 | // part 'app_settings_state.dart'; 6 | 7 | // class AppSettingsBloc extends Bloc { 8 | // static AppSettingsBloc get(context) => BlocProvider.of(context); 9 | 10 | // AppSettingsBloc() : super(AppSettingsInitial()) { 11 | // on((event, emit) => emit(UserAppSettingsState())); 12 | // on((event, emit) => emit(UserAppSettingsState())); 13 | // on( 14 | // (event, emit) => emit(UserNotificationSettingsState())); 15 | // on((event, emit) => emit(UserProfileState())); 16 | // } 17 | 18 | // updateLocalDataState(mapName, context) { 19 | // final bloc = AppSettingsBloc.get(context); 20 | 21 | // switch (mapName) { 22 | // case AppLocalConstants.appNotificationButtons: 23 | // //DISABLED: currently not implemented 24 | // // bloc.add(UserAppNotificationEvent()); 25 | // break; 26 | // case AppLocalConstants.appSettingsButtons: 27 | // bloc.add(UserAppSettingsEvent()); 28 | // break; 29 | // case AppLocalConstants.savedLocalUser || 30 | // AppLocalConstants.currentLoginUser: 31 | // bloc.add(UserProfileEvent()); 32 | // break; 33 | // case AppLocalConstants.appLocale: 34 | // bloc.add(UserAppLanguageEvent()); 35 | // break; 36 | // default: 37 | // } 38 | // } 39 | // } 40 | -------------------------------------------------------------------------------- /lib/src/presentation/state/app_settings_bloc/app_settings_event.dart: -------------------------------------------------------------------------------- 1 | // part of 'app_settings_bloc.dart'; 2 | 3 | // @immutable 4 | // sealed class AppSettingsEvent {} 5 | 6 | // @immutable 7 | // class UserAppLanguageEvent extends AppSettingsEvent {} 8 | 9 | // @immutable 10 | // class UserAppSettingsEvent extends AppSettingsEvent {} 11 | 12 | // @immutable 13 | // class UserProfileEvent extends AppSettingsEvent {} 14 | 15 | // @immutable 16 | // class UserAppNotificationEvent extends AppSettingsEvent {} 17 | 18 | // @immutable 19 | // class UserCurrentHomeEvent extends AppSettingsEvent {} 20 | -------------------------------------------------------------------------------- /lib/src/presentation/state/app_settings_bloc/app_settings_state.dart: -------------------------------------------------------------------------------- 1 | // part of 'app_settings_bloc.dart'; 2 | 3 | // @immutable 4 | // sealed class AppSettingsState {} 5 | 6 | // final class AppSettingsInitial extends AppSettingsState {} 7 | 8 | // final class UserAppLanguage extends AppSettingsState { 9 | // final String language; 10 | 11 | // UserAppLanguage(this.language); 12 | // } 13 | 14 | // final class UserAppSettingsState extends AppSettingsState { 15 | // UserAppSettingsState(); 16 | // } 17 | 18 | // final class UserNotificationSettingsState extends AppSettingsState { 19 | // UserNotificationSettingsState(); 20 | // } 21 | 22 | // final class UserProfileState extends AppSettingsState { 23 | // UserProfileState(); 24 | // } 25 | 26 | // final class UserCurrentHomeIndexState extends AppSettingsState { 27 | // UserCurrentHomeIndexState(); 28 | // } 29 | -------------------------------------------------------------------------------- /lib/src/presentation/state/navigation_cubit/navi_state.dart: -------------------------------------------------------------------------------- 1 | part of 'navi_cubit.dart'; 2 | 3 | abstract class NaviState {} 4 | 5 | class InitialNaviState extends NaviState {} 6 | 7 | class PagePushedOff extends NaviState { 8 | String pageName; 9 | 10 | PagePushedOff({ 11 | required this.pageName, 12 | }); 13 | } 14 | 15 | class PagePushed extends NaviState { 16 | String pageName; 17 | 18 | PagePushed({ 19 | required this.pageName, 20 | }); 21 | } 22 | 23 | class PagePopped extends NaviState { 24 | String pageName; 25 | 26 | PagePopped({ 27 | required this.pageName, 28 | }); 29 | } 30 | 31 | class HomeState extends NaviState {} 32 | 33 | class BiometricLoginState extends NaviState {} 34 | 35 | class AdminState extends NaviState {} 36 | 37 | class IntoPageState extends NaviState {} 38 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | void fl_register_plugins(FlPluginRegistry* registry) { 16 | g_autoptr(FlPluginRegistrar) awesome_notifications_registrar = 17 | fl_plugin_registry_get_registrar_for_plugin(registry, "AwesomeNotificationsPlugin"); 18 | awesome_notifications_plugin_register_with_registrar(awesome_notifications_registrar); 19 | g_autoptr(FlPluginRegistrar) awesome_notifications_core_registrar = 20 | fl_plugin_registry_get_registrar_for_plugin(registry, "AwesomeNotificationsCorePlugin"); 21 | awesome_notifications_core_plugin_register_with_registrar(awesome_notifications_core_registrar); 22 | g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = 23 | fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); 24 | flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); 25 | g_autoptr(FlPluginRegistrar) rive_common_registrar = 26 | fl_plugin_registry_get_registrar_for_plugin(registry, "RivePlugin"); 27 | rive_plugin_register_with_registrar(rive_common_registrar); 28 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 29 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 30 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 31 | } 32 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | awesome_notifications 7 | awesome_notifications_core 8 | flutter_secure_storage_linux 9 | rive_common 10 | url_launcher_linux 11 | ) 12 | 13 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 14 | ) 15 | 16 | set(PLUGIN_BUNDLED_LIBRARIES) 17 | 18 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 19 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 20 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 21 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 23 | endforeach(plugin) 24 | 25 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 26 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 27 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 28 | endforeach(ffi_plugin) 29 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "fluttre_clean_coded"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "fluttre_clean_coded"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import awesome_notifications 9 | import awesome_notifications_core 10 | import connectivity_plus 11 | import firebase_auth 12 | import firebase_core 13 | import flutter_inappwebview_macos 14 | import flutter_secure_storage_macos 15 | import path_provider_foundation 16 | import rive_common 17 | import share_plus 18 | import shared_preferences_foundation 19 | import sqflite 20 | import url_launcher_macos 21 | 22 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 23 | AwesomeNotificationsPlugin.register(with: registry.registrar(forPlugin: "AwesomeNotificationsPlugin")) 24 | AwesomeNotificationsCorePlugin.register(with: registry.registrar(forPlugin: "AwesomeNotificationsCorePlugin")) 25 | ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) 26 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 27 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 28 | InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) 29 | FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) 30 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 31 | RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin")) 32 | SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) 33 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 34 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 35 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 36 | } 37 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = fluttre_clean_coded 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.cc.fluttreCleanCoded 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example.cc. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_clean_coded 2 | description: Flutter Clean Architecture Series to build a Flutter App with Clean Code! 3 | publish_to: "none" 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=3.5.0 <4.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | # Icons 14 | cupertino_icons: ^1.0.8 15 | ionicons: ^0.2.2 16 | 17 | # UI 18 | introduction_screen: ^3.1.14 19 | lottie: ^3.2.0 20 | rive: ^0.13.14 21 | 22 | 23 | # DI 24 | get_it: ^8.0.3 25 | 26 | # Networking 27 | dio: ^5.7.0 28 | internet_connection_checker_plus: ^2.6.0 29 | 30 | # State Management 31 | flutter_bloc: ^8.1.6 32 | 33 | # UI Libraries 34 | loading_animation_widget: ^1.3.0 35 | toastification: ^2.3.0 36 | animate_do: ^3.3.4 37 | pretty_dio_logger: ^1.4.0 38 | fl_chart: ^0.55.0 39 | 40 | 41 | # Notification 42 | awesome_notifications_core: ^0.9.3 43 | awesome_notifications: ^0.9.3+1 44 | 45 | 46 | # Flutter Core 47 | dart_secure: ^0.5.41 48 | flutter_secure_storage: ^9.2.2 49 | shared_preferences: ^2.3.4 50 | url_launcher: ^6.3.1 51 | share_plus: ^10.1.3 52 | pdf: ^3.10.8 53 | qr_flutter: ^4.1.0 54 | syncfusion_flutter_datepicker: ^24.2.9 55 | flutter_inappwebview: ^6.1.15 56 | 57 | 58 | # App Logging 59 | # firebase_crashlytics: ^4.2.0 60 | # firebase_analytics: ^11.3.6 61 | # firebase_performance: ^0.10.0+11 62 | 63 | # cache 64 | cached_network_image: ^3.4.1 65 | 66 | 67 | dependency_overrides: 68 | intl: ^0.20.1 69 | 70 | #dart run flutter_launcher_icons 71 | flutter_icons: 72 | android: "ic_launcher" 73 | ios: true 74 | remove_alpha_ios: true 75 | image_path: "assets/images/app_logo.png" 76 | min_sdk_android: 21 77 | web: 78 | generate: true 79 | image_path: "assets/images/app_logo.png" 80 | 81 | 82 | 83 | 84 | dev_dependencies: 85 | # Dev Core Packages 86 | device_preview: ^1.2.0 87 | flutter_test: 88 | sdk: flutter 89 | flutter_launcher_icons: "^0.12.0" 90 | 91 | # Other 92 | flutter_lints: ^5.0.0 93 | lint: ^2.3.0 94 | 95 | 96 | flutter: 97 | uses-material-design: true 98 | assets: 99 | - assets/ 100 | - assets/font/ 101 | - assets/icons/ 102 | - assets/images/ 103 | - assets/animations/ 104 | 105 | fonts: 106 | - family: OpenSans 107 | fonts: 108 | - asset: assets/font/NotoSans-ExtraBold.ttf 109 | weight: 900 110 | 111 | - asset: assets/font/NotoSans-Bold.ttf 112 | weight: 700 113 | 114 | - asset: assets/font/NotoSans-SemiBold.ttf 115 | weight: 600 116 | 117 | - asset: assets/font/NotoSans-Regular.ttf 118 | style: normal 119 | weight: 400 120 | 121 | - asset: assets/font/NotoSans-Light.ttf 122 | weight: 200 123 | 124 | - asset: assets/font/NotoSans-Italic.ttf 125 | style: italic 126 | -------------------------------------------------------------------------------- /web/assets/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/web/assets/loading.gif -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Flutter Clean Coded 26 | 27 | 28 | 61 | 62 | 63 | 64 | 65 |
66 |
67 | Loading 68 |

Loading...

69 |
70 |
73 | 80 | 83 | 84 | 85 | 95 | 96 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fluttre_clean_coded", 3 | "short_name": "fluttre_clean_coded", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A Clean Flutter Architecture.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(fluttre_clean_coded LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "fluttre_clean_coded") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(VERSION 3.14...3.25) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | 56 | # Generated plugin build rules, which manage building the plugins and adding 57 | # them to the application. 58 | include(flutter/generated_plugins.cmake) 59 | 60 | 61 | # === Installation === 62 | # Support files are copied into place next to the executable, so that it can 63 | # run in place. This is done instead of making a separate bundle (as on Linux) 64 | # so that building and running from within Visual Studio will work. 65 | set(BUILD_BUNDLE_DIR "$") 66 | # Make the "install" step default, as it's required to run. 67 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 68 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 69 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 70 | endif() 71 | 72 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 73 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 74 | 75 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 76 | COMPONENT Runtime) 77 | 78 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 79 | COMPONENT Runtime) 80 | 81 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 82 | COMPONENT Runtime) 83 | 84 | if(PLUGIN_BUNDLED_LIBRARIES) 85 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 86 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 87 | COMPONENT Runtime) 88 | endif() 89 | 90 | # Fully re-copy the assets directory on each build to avoid having stale files 91 | # from a previous install. 92 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 93 | install(CODE " 94 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 95 | " COMPONENT Runtime) 96 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 97 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 98 | 99 | # Install the AOT library on non-Debug builds only. 100 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 101 | CONFIGURATIONS Profile;Release 102 | COMPONENT Runtime) 103 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | void RegisterPlugins(flutter::PluginRegistry* registry) { 22 | AwesomeNotificationsPluginCApiRegisterWithRegistrar( 23 | registry->GetRegistrarForPlugin("AwesomeNotificationsPluginCApi")); 24 | AwesomeNotificationsCorePluginCApiRegisterWithRegistrar( 25 | registry->GetRegistrarForPlugin("AwesomeNotificationsCorePluginCApi")); 26 | ConnectivityPlusWindowsPluginRegisterWithRegistrar( 27 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); 28 | FirebaseAuthPluginCApiRegisterWithRegistrar( 29 | registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); 30 | FirebaseCorePluginCApiRegisterWithRegistrar( 31 | registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); 32 | FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar( 33 | registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi")); 34 | FlutterSecureStorageWindowsPluginRegisterWithRegistrar( 35 | registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); 36 | LocalAuthPluginRegisterWithRegistrar( 37 | registry->GetRegistrarForPlugin("LocalAuthPlugin")); 38 | RivePluginRegisterWithRegistrar( 39 | registry->GetRegistrarForPlugin("RivePlugin")); 40 | SharePlusWindowsPluginCApiRegisterWithRegistrar( 41 | registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); 42 | UrlLauncherWindowsRegisterWithRegistrar( 43 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 44 | } 45 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | awesome_notifications 7 | awesome_notifications_core 8 | connectivity_plus 9 | firebase_auth 10 | firebase_core 11 | flutter_inappwebview_windows 12 | flutter_secure_storage_windows 13 | local_auth_windows 14 | rive_common 15 | share_plus 16 | url_launcher_windows 17 | ) 18 | 19 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 20 | ) 21 | 22 | set(PLUGIN_BUNDLED_LIBRARIES) 23 | 24 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 25 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 26 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 27 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 28 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 29 | endforeach(plugin) 30 | 31 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 32 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 33 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 34 | endforeach(ffi_plugin) 35 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example.cc" "\0" 93 | VALUE "FileDescription", "fluttre_clean_coded" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "fluttre_clean_coded" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 com.example.cc. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "fluttre_clean_coded.exe" "\0" 98 | VALUE "ProductName", "fluttre_clean_coded" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"fluttre_clean_coded", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syf-Almjd/flutter_clean_coded/e59f3ecc569e46a50be69f0487b315b90a335207/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length <= 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | --------------------------------------------------------------------------------