├── .flutter-plugins ├── .flutter-plugins-dependencies ├── .gitignore ├── .idea ├── .gitignore ├── codeStyles │ └── Project.xml ├── flutter-crm.iml ├── libraries │ ├── Dart_Packages.xml │ ├── Dart_SDK.xml │ └── Flutter_Plugins.xml ├── modules.xml └── vcs.xml ├── .metadata ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── bottle_crm │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── settings_aar.gradle ├── assets └── images │ ├── Icon_edit_color.svg │ ├── accounts.svg │ ├── accounts_color.svg │ ├── arrow_backward.svg │ ├── arrow_forward.svg │ ├── bg-image-blue.jpg │ ├── bg-image.png │ ├── cases.svg │ ├── change_password.svg │ ├── contacts.svg │ ├── dashboard_icon.svg │ ├── documents.svg │ ├── download_icon.svg │ ├── events.svg │ ├── filter.svg │ ├── flag.svg │ ├── google-icon.png │ ├── home.svg │ ├── icon_close.svg │ ├── icon_delete_color.svg │ ├── identification.svg │ ├── invoices.svg │ ├── leads.svg │ ├── logo.svg │ ├── logo_google.svg │ ├── logout.svg │ ├── menu.svg │ ├── more.svg │ ├── new_logo.png │ ├── opportunities.svg │ ├── opportunities_color.svg │ ├── pdf_icon.svg │ ├── search.svg │ ├── settings.svg │ ├── skype.png │ ├── tasks.svg │ ├── teams.svg │ └── users.svg ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── bloc │ ├── account_bloc.dart │ ├── auth_bloc.dart │ ├── case_bloc.dart │ ├── contact_bloc.dart │ ├── dashboard_bloc.dart │ ├── document_bloc.dart │ ├── event_bloc.dart │ ├── lead_bloc.dart │ ├── opportunity_bloc.dart │ ├── setting_bloc.dart │ ├── task_bloc.dart │ ├── team_bloc.dart │ └── user_bloc.dart ├── main.dart ├── model │ ├── account.dart │ ├── case.dart │ ├── company.dart │ ├── contact.dart │ ├── document.dart │ ├── domain.dart │ ├── email.dart │ ├── events.dart │ ├── lead.dart │ ├── opportunities.dart │ ├── organization.dart │ ├── profile.dart │ ├── settings.dart │ ├── task.dart │ ├── team.dart │ └── user.dart ├── responsive.dart ├── services │ ├── crm_services.dart │ └── network_services.dart ├── splash_screen.dart ├── ui │ ├── screens │ │ ├── accounts │ │ │ ├── account_create.dart │ │ │ ├── account_details.dart │ │ │ └── accounts_list.dart │ │ ├── authentication │ │ │ ├── change_password.dart │ │ │ ├── companies_List.dart │ │ │ ├── forgot_password.dart │ │ │ ├── login.dart │ │ │ ├── profile.dart │ │ │ └── register.dart │ │ ├── cases │ │ │ ├── case_create.dart │ │ │ ├── case_details.dart │ │ │ └── cases_list.dart │ │ ├── contacts │ │ │ ├── contact_create.dart │ │ │ ├── contact_details.dart │ │ │ └── contacts_list.dart │ │ ├── dashboard │ │ │ └── dashboard.dart │ │ ├── documents │ │ │ ├── document_create.dart │ │ │ ├── document_details.dart │ │ │ └── documents_list.dart │ │ ├── events │ │ │ ├── event_create.dart │ │ │ ├── event_details.dart │ │ │ └── events_list.dart │ │ ├── http_excepion.dart │ │ ├── invoices │ │ │ ├── invoice_create.dart │ │ │ ├── invoice_details.dart │ │ │ └── invoices_list.dart │ │ ├── leads │ │ │ ├── lead_create.dart │ │ │ ├── lead_details.dart │ │ │ └── leads_list.dart │ │ ├── more_options_screen.dart │ │ ├── opportunities │ │ │ ├── opportunitie_create.dart │ │ │ ├── opportunitie_details.dart │ │ │ └── opportunities_list.dart │ │ ├── settings │ │ │ ├── settings.dart │ │ │ ├── settings_details.dart │ │ │ └── settings_userDetails.dart │ │ ├── tasks │ │ │ ├── task_create.dart │ │ │ ├── task_details.dart │ │ │ └── tasks_list.dart │ │ ├── teams │ │ │ ├── team_create.dart │ │ │ ├── team_details.dart │ │ │ └── teams_list.dart │ │ └── users │ │ │ ├── user_create.dart │ │ │ ├── user_details.dart │ │ │ └── users_list.dart │ └── widgets │ │ ├── bottom_navigation_bar.dart │ │ ├── dashboard_count_card.dart │ │ ├── loader.dart │ │ ├── profile_pic_widget.dart │ │ ├── recent_card_widget.dart │ │ └── tags_widget.dart └── utils │ ├── utils.dart │ └── validations.dart ├── pubspec.yaml └── test └── widget_test.dart /.flutter-plugins: -------------------------------------------------------------------------------- 1 | # This is a generated file; do not edit or check into version control. 2 | connectivity=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\connectivity-0.4.9+5\\ 3 | connectivity_for_web=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\connectivity_for_web-0.3.1+2\\ 4 | connectivity_macos=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\connectivity_macos-0.1.0+5\\ 5 | file_picker=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\file_picker-2.0.13\\ 6 | flutter_plugin_android_lifecycle=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_plugin_android_lifecycle-1.0.11\\ 7 | fluttertoast=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\fluttertoast-7.1.1\\ 8 | path_provider=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-1.6.24\\ 9 | path_provider_linux=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-0.0.1+2\\ 10 | path_provider_macos=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-0.0.4+6\\ 11 | path_provider_windows=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-0.0.4+1\\ 12 | shared_preferences=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences-0.5.12+2\\ 13 | shared_preferences_linux=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_linux-0.0.2+2\\ 14 | shared_preferences_macos=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_macos-0.0.1+10\\ 15 | shared_preferences_web=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_web-0.1.2+7\\ 16 | shared_preferences_windows=I:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_windows-0.0.1+1\\ 17 | -------------------------------------------------------------------------------- /.flutter-plugins-dependencies: -------------------------------------------------------------------------------- 1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity-0.4.9+5\\\\","dependencies":[]},{"name":"file_picker","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\file_picker-2.0.13\\\\","dependencies":[]},{"name":"fluttertoast","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-7.1.1\\\\","dependencies":[]},{"name":"path_provider","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.24\\\\","dependencies":[]},{"name":"shared_preferences","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.12+2\\\\","dependencies":[]}],"android":[{"name":"connectivity","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity-0.4.9+5\\\\","dependencies":[]},{"name":"file_picker","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\file_picker-2.0.13\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-1.0.11\\\\","dependencies":[]},{"name":"fluttertoast","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-7.1.1\\\\","dependencies":[]},{"name":"path_provider","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.24\\\\","dependencies":[]},{"name":"shared_preferences","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.12+2\\\\","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity_macos-0.1.0+5\\\\","dependencies":[]},{"name":"path_provider_macos","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4+6\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-0.0.1+10\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-0.0.2+2\\\\","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.4+1\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-0.0.1+1\\\\","dependencies":["path_provider_windows"]}],"web":[{"name":"connectivity_for_web","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\connectivity_for_web-0.3.1+2\\\\","dependencies":[]},{"name":"file_picker","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\file_picker-2.0.13\\\\","dependencies":[]},{"name":"fluttertoast","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-7.1.1\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"I:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-0.1.2+7\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity","dependencies":["connectivity_macos","connectivity_for_web"]},{"name":"connectivity_for_web","dependencies":[]},{"name":"connectivity_macos","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2020-11-26 15:37:27.406407","version":"1.22.2"} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | pubspec.lock 34 | .vscode 35 | 36 | # Web related 37 | lib/generated_plugin_registrant.dart 38 | 39 | # Symbolication related 40 | app.*.symbols 41 | 42 | # Obfuscation related 43 | app.*.map.json 44 | 45 | # Android Studio will place build artifacts here 46 | /android/app/debug 47 | /android/app/profile 48 | /android/app/release 49 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /.idea/flutter-crm.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.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: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BottleCRM 2 | 3 | Free CRM for startups and enterprises. 4 | 5 | 6 | # build 7 | flutter clean 8 | flutter pub get 9 | flutter build appbundle 10 | flutter build apk 11 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply plugin: 'com.google.gms.google-services' 27 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 28 | 29 | android { 30 | compileSdkVersion 31 31 | 32 | sourceSets { 33 | main.java.srcDirs += 'src/main/kotlin' 34 | } 35 | 36 | defaultConfig { 37 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 38 | applicationId "com.example.bottle_crm" 39 | minSdkVersion 21 40 | targetSdkVersion 31 41 | multiDexEnabled true 42 | versionCode flutterVersionCode.toInteger() 43 | versionName flutterVersionName 44 | } 45 | 46 | buildTypes { 47 | release { 48 | // TODO: Add your own signing config for the release build. 49 | // Signing with the debug keys for now, so `flutter run --release` works. 50 | signingConfig signingConfigs.debug 51 | } 52 | } 53 | } 54 | 55 | flutter { 56 | source '../..' 57 | } 58 | 59 | dependencies { 60 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" 61 | implementation platform('com.google.firebase:firebase-bom:29.1.0') 62 | implementation 'com.google.firebase:firebase-analytics' 63 | } 64 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "74115878447", 4 | "project_id": "bottle-crm-10074", 5 | "storage_bucket": "bottle-crm-10074.appspot.com" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:74115878447:android:858fb769df26bb2c5900da", 11 | "android_client_info": { 12 | "package_name": "com.example.bottle_crm" 13 | } 14 | }, 15 | "oauth_client": [ 16 | { 17 | "client_id": "74115878447-0r10i3hk3mma0u2vaenbsbtvvtud5sv5.apps.googleusercontent.com", 18 | "client_type": 3 19 | } 20 | ], 21 | "api_key": [ 22 | { 23 | "current_key": "AIzaSyD8es-uwk_IlZsuHWlEwfiEZfsrENKXRgA" 24 | } 25 | ], 26 | "services": { 27 | "appinvite_service": { 28 | "other_platform_oauth_client": [ 29 | { 30 | "client_id": "74115878447-0r10i3hk3mma0u2vaenbsbtvvtud5sv5.apps.googleusercontent.com", 31 | "client_type": 3 32 | } 33 | ] 34 | } 35 | } 36 | } 37 | ], 38 | "configuration_version": "1" 39 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 10 | 18 | 22 | 26 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 42 | 45 | 46 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/bottle_crm/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.bottle_crm 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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-hdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-mdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.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 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | jcenter() 6 | maven { url 'https://jitpack.io' } 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:7.0.2' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | classpath 'com.google.gms:google-services:4.3.10' 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | google() 19 | jcenter() 20 | } 21 | } 22 | 23 | rootProject.buildDir = '../build' 24 | subprojects { 25 | project.buildDir = "${rootProject.buildDir}/${project.name}" 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /android/settings_aar.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /assets/images/Icon_edit_color.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/accounts.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/images/accounts_color.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/images/arrow_backward.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/arrow_forward.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/bg-image-blue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/assets/images/bg-image-blue.jpg -------------------------------------------------------------------------------- /assets/images/bg-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/assets/images/bg-image.png -------------------------------------------------------------------------------- /assets/images/cases.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/change_password.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/images/contacts.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/images/dashboard_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /assets/images/documents.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/download_icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/images/events.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/filter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/images/flag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /assets/images/google-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/assets/images/google-icon.png -------------------------------------------------------------------------------- /assets/images/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /assets/images/icon_close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/icon_delete_color.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /assets/images/identification.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/images/invoices.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /assets/images/leads.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/images/logo.svg: -------------------------------------------------------------------------------- 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 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | CRM 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /assets/images/logo_google.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/logout.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /assets/images/more.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /assets/images/new_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/assets/images/new_logo.png -------------------------------------------------------------------------------- /assets/images/opportunities.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /assets/images/opportunities_color.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /assets/images/pdf_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 10 | 11 | 14 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /assets/images/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /assets/images/settings.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/skype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/assets/images/skype.png -------------------------------------------------------------------------------- /assets/images/tasks.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /assets/images/teams.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/users.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/ephemeral/ 22 | Flutter/app.flx 23 | Flutter/app.zip 24 | Flutter/flutter_assets/ 25 | Flutter/flutter_export_environment.sh 26 | ServiceDefinitions.json 27 | Runner/GeneratedPluginRegistrant.* 28 | 29 | # Exceptions to above rules. 30 | !default.mode1v3 31 | !default.mode2v3 32 | !default.pbxuser 33 | !default.perspectivev3 34 | -------------------------------------------------------------------------------- /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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - connectivity (0.0.1): 3 | - Flutter 4 | - Reachability 5 | - DKImagePickerController/Core (4.3.2): 6 | - DKImagePickerController/ImageDataManager 7 | - DKImagePickerController/Resource 8 | - DKImagePickerController/ImageDataManager (4.3.2) 9 | - DKImagePickerController/PhotoGallery (4.3.2): 10 | - DKImagePickerController/Core 11 | - DKPhotoGallery 12 | - DKImagePickerController/Resource (4.3.2) 13 | - DKPhotoGallery (0.0.17): 14 | - DKPhotoGallery/Core (= 0.0.17) 15 | - DKPhotoGallery/Model (= 0.0.17) 16 | - DKPhotoGallery/Preview (= 0.0.17) 17 | - DKPhotoGallery/Resource (= 0.0.17) 18 | - SDWebImage 19 | - SwiftyGif 20 | - DKPhotoGallery/Core (0.0.17): 21 | - DKPhotoGallery/Model 22 | - DKPhotoGallery/Preview 23 | - SDWebImage 24 | - SwiftyGif 25 | - DKPhotoGallery/Model (0.0.17): 26 | - SDWebImage 27 | - SwiftyGif 28 | - DKPhotoGallery/Preview (0.0.17): 29 | - DKPhotoGallery/Model 30 | - DKPhotoGallery/Resource 31 | - SDWebImage 32 | - SwiftyGif 33 | - DKPhotoGallery/Resource (0.0.17): 34 | - SDWebImage 35 | - SwiftyGif 36 | - file_picker (0.0.1): 37 | - DKImagePickerController/PhotoGallery 38 | - Flutter 39 | - Flutter (1.0.0) 40 | - Reachability (3.2) 41 | - SDWebImage (5.10.4): 42 | - SDWebImage/Core (= 5.10.4) 43 | - SDWebImage/Core (5.10.4) 44 | - shared_preferences (0.0.1): 45 | - Flutter 46 | - SwiftyGif (5.4.0) 47 | 48 | DEPENDENCIES: 49 | - connectivity (from `.symlinks/plugins/connectivity/ios`) 50 | - file_picker (from `.symlinks/plugins/file_picker/ios`) 51 | - Flutter (from `Flutter`) 52 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) 53 | 54 | SPEC REPOS: 55 | trunk: 56 | - DKImagePickerController 57 | - DKPhotoGallery 58 | - Reachability 59 | - SDWebImage 60 | - SwiftyGif 61 | 62 | EXTERNAL SOURCES: 63 | connectivity: 64 | :path: ".symlinks/plugins/connectivity/ios" 65 | file_picker: 66 | :path: ".symlinks/plugins/file_picker/ios" 67 | Flutter: 68 | :path: Flutter 69 | shared_preferences: 70 | :path: ".symlinks/plugins/shared_preferences/ios" 71 | 72 | SPEC CHECKSUMS: 73 | connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 74 | DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d 75 | DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 76 | file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1 77 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c 78 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 79 | SDWebImage: c666b97e1fa9c64b4909816a903322018f0a9c84 80 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d 81 | SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7 82 | 83 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c 84 | 85 | COCOAPODS: 1.10.1 86 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/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/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | bottle_crm 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/bloc/auth_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:bottle_crm/model/organization.dart'; 4 | import 'package:bottle_crm/model/profile.dart'; 5 | import 'package:bottle_crm/services/crm_services.dart'; 6 | import 'package:shared_preferences/shared_preferences.dart'; 7 | 8 | class AuthBloc { 9 | String? _subDomainName; 10 | String? _authToken; 11 | Profile? _userProfile; 12 | List _companies = []; 13 | Organization? _selectedOrganization; 14 | 15 | String? get subDomainName { 16 | return _subDomainName; 17 | } 18 | 19 | String? get authToken { 20 | return _authToken; 21 | } 22 | 23 | Profile? get userProfile { 24 | return _userProfile; 25 | } 26 | 27 | List get companies { 28 | return _companies; 29 | } 30 | 31 | Organization? get selectedOrganization { 32 | return _selectedOrganization; 33 | } 34 | 35 | set selectedOrganization(selectedOrganization) { 36 | _selectedOrganization = selectedOrganization; 37 | } 38 | 39 | Future validateDomain(data) async { 40 | Map? result; 41 | await CrmService().validateSubdomain(data).then((response) { 42 | var res = (json.decode(response.body)); 43 | if (res['error'] == false) { 44 | _subDomainName = data['sub_domain']; 45 | result = res; 46 | } else { 47 | result = res; 48 | } 49 | }).catchError((onError) { 50 | print("validate domain error>> $onError"); 51 | result = {"status": "error", "message": "Something went wrong"}; 52 | }); 53 | return result; 54 | } 55 | 56 | Future login(data) async { 57 | try { 58 | Map result = {}; 59 | final SharedPreferences preferences = 60 | await SharedPreferences.getInstance(); 61 | await CrmService().userLogin(data).then((response) async { 62 | var res = (json.decode(response.body)); 63 | if (res['error'] == false) { 64 | _authToken = "JWT " + res['token']; 65 | preferences.setString("authToken", _authToken!); 66 | result = res; 67 | } else { 68 | result = res; 69 | } 70 | }).catchError((onError) { 71 | print("login error>> $onError"); 72 | result = {"status": "error", "message": onError}; 73 | }); 74 | return result; 75 | } catch (e) {} 76 | } 77 | 78 | Future forgotPassword(data) async { 79 | Map? result; 80 | await CrmService().forgotPassword(data).then((response) { 81 | var res = (json.decode(response.body)); 82 | result = res; 83 | }).catchError((onError) { 84 | print("forgot password Error >> $onError"); 85 | result = {"status": "error", "message": onError}; 86 | }); 87 | return result; 88 | } 89 | 90 | Future register(data) async { 91 | Map? result = {}; 92 | await CrmService().userRegister(data).then((response) async { 93 | var res = (json.decode(response.body)); 94 | if (res['error'] == false) { 95 | result = res; 96 | } else { 97 | result = res; 98 | } 99 | }).catchError((onError) { 100 | print("register user error >> $onError"); 101 | result = {"status": "error", "message": onError}; 102 | }); 103 | return result; 104 | } 105 | 106 | Future getProfileDetails() async { 107 | await CrmService().getUserProfile().then((response) { 108 | var res = (json.decode(response.body)); 109 | if (res['user_obj'] != null) { 110 | _userProfile = Profile.fromJson(res['user_obj']); 111 | } else { 112 | _userProfile = null; 113 | } 114 | }).catchError((onError) { 115 | print("get profile Error >> $onError"); 116 | }); 117 | } 118 | 119 | Future changePassword(data) async { 120 | Map result = {}; 121 | await CrmService().changePassword(data).then((response) { 122 | var res = (json.decode(response.body)); 123 | result = res; 124 | }).catchError((onError) { 125 | print("change password Error >> $onError"); 126 | result = {"status": "error", "message": "Something went wrong"}; 127 | }); 128 | return result; 129 | } 130 | 131 | Future fetchCompanies() async { 132 | try { 133 | await CrmService().getCompanies().then((response) { 134 | var res = (json.decode(response.body)); 135 | if (res['error'] == false) { 136 | _companies.clear(); 137 | res['companies'].forEach((_company) { 138 | Organization company = Organization.fromJson(_company); 139 | _companies.add(company); 140 | }); 141 | } 142 | }).catchError((onError) { 143 | print("companies list error>> $onError"); 144 | }); 145 | } catch (e) { 146 | } 147 | 148 | } 149 | } 150 | 151 | final authBloc = AuthBloc(); 152 | -------------------------------------------------------------------------------- /lib/bloc/dashboard_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:bottle_crm/model/account.dart'; 3 | import 'package:bottle_crm/model/contact.dart'; 4 | import 'package:bottle_crm/model/opportunities.dart'; 5 | import 'package:bottle_crm/services/crm_services.dart'; 6 | 7 | class DashboardBloc { 8 | Map _dashboardData = {}; 9 | 10 | Future fetchDashboardDetails() async { 11 | await CrmService().getDashboardDetails().then((response) { 12 | var res = (json.decode(response.body)); 13 | 14 | List _accounts = []; 15 | List _opportunities = []; 16 | List _contacts = []; 17 | 18 | res['accounts'].forEach((_account) { 19 | Account account = Account.fromJson(_account); 20 | _accounts.add(account); 21 | }); 22 | 23 | res['contacts'].forEach((_contact) { 24 | Contact contact = Contact.fromJson(_contact); 25 | _contacts.add(contact); 26 | }); 27 | 28 | res['opportunities'].forEach((_opportunity) { 29 | Opportunity opportunity = Opportunity.fromJson(_opportunity); 30 | _opportunities.add(opportunity); 31 | }); 32 | 33 | _dashboardData['accounts'] = _accounts; 34 | _dashboardData['opportunities'] = _opportunities; 35 | _dashboardData['contacts'] = _contacts; 36 | _dashboardData['accountsCount'] = res['accounts_count']; 37 | _dashboardData['contactsCount'] = res['contacts_count']; 38 | _dashboardData['leadsCount'] = res['leads_count']; 39 | _dashboardData['opportunitiesCount'] = res['opportunities_count']; 40 | }); 41 | // .catchError((onError) { 42 | // print("fetchDashboardDetails Error >> $onError"); 43 | // }); 44 | } 45 | 46 | Map get dashboardData { 47 | return _dashboardData; 48 | } 49 | } 50 | 51 | final dashboardBloc = DashboardBloc(); 52 | -------------------------------------------------------------------------------- /lib/bloc/document_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:bottle_crm/model/document.dart'; 4 | import 'package:bottle_crm/model/profile.dart'; 5 | import 'package:bottle_crm/services/crm_services.dart'; 6 | 7 | class DocumentBloc { 8 | List _activeDocuments = []; 9 | List _inActiveDocuments = []; 10 | List _documents = []; 11 | List _fileSizes = []; 12 | 13 | List _statusObjforDropdown = []; 14 | List _usersObjforMultiselect = []; 15 | 16 | Document? _currentDocument; 17 | int? _currentDocumentIndex; 18 | Map _currentEditDocument = { 19 | 'title': "", 20 | 'teams': [], 21 | 'shared_to': [], 22 | 'document_file': '' 23 | }; 24 | String? _currentEditDocumentId; 25 | 26 | fetchDocuments({searchData}) async { 27 | Map? _copySearchData = searchData != null ? new Map.from(searchData) : null; 28 | 29 | await CrmService() 30 | .getDocuments(queryParams: _copySearchData) 31 | .then((response) async { 32 | _activeDocuments.clear(); 33 | _inActiveDocuments.clear(); 34 | _documents.clear(); 35 | _fileSizes.clear(); 36 | _usersObjforMultiselect.clear(); 37 | 38 | var res = jsonDecode(response.body); 39 | 40 | res['documents_active'].forEach((_document) { 41 | Document document = Document.fromJson(_document); 42 | _activeDocuments.add(document); 43 | _documents.add(document); 44 | }); 45 | res['documents_inactive'].forEach((_document) { 46 | Document document = Document.fromJson(_document); 47 | _inActiveDocuments.add(document); 48 | _documents.add(document); 49 | }); 50 | 51 | res['status_choices'].map((status) { 52 | _statusObjforDropdown.add(status); 53 | }); 54 | 55 | res['users'].forEach((_user) { 56 | Profile user = Profile.fromJson(_user); 57 | _usersObjforMultiselect.add({ 58 | "name": "${user.firstName} ${user.lastName}", 59 | "id": user.id.toString() 60 | }); 61 | }); 62 | }).catchError((onError) { 63 | print('fetchDocuments Error >> $onError'); 64 | }); 65 | 66 | // _fileSizes = await CrmService().getFileSizes(_documents); 67 | // print(fileSizes); 68 | } 69 | 70 | createDocument(file) async { 71 | Map? result; 72 | Map _copyOfCurrentEditDocument = new Map.from(_currentEditDocument); 73 | _copyOfCurrentEditDocument['teams'] = (_copyOfCurrentEditDocument['teams'] 74 | .map((team) => team.toString())).toList().toString(); 75 | _copyOfCurrentEditDocument['shared_to'] = 76 | (_copyOfCurrentEditDocument['shared_to'] 77 | .map((assignedTo) => assignedTo.toString())).toList().toString(); 78 | await CrmService() 79 | .createDocument(_copyOfCurrentEditDocument, file) 80 | .then((response) async { 81 | var res = json.decode(response); 82 | if (res["error"] == false) { 83 | await fetchDocuments(); 84 | } 85 | result = res; 86 | }).catchError((onError) { 87 | print("editDocument Error >> $onError"); 88 | result = {"status": "error", "message": "Something went wrong"}; 89 | }); 90 | return result; 91 | } 92 | 93 | Future editDocument(file) async { 94 | Map? result; 95 | Map _copyOfCurrentEditDocument = Map.from(_currentEditDocument); 96 | _copyOfCurrentEditDocument['teams'] = (_copyOfCurrentEditDocument['teams'] 97 | .map((team) => team.toString())).toList().toString(); 98 | _copyOfCurrentEditDocument['shared_to'] = 99 | (_copyOfCurrentEditDocument['shared_to'] 100 | .map((assignedTo) => assignedTo.toString())).toList().toString(); 101 | await CrmService() 102 | .editDocument(_copyOfCurrentEditDocument, file, _currentEditDocumentId) 103 | .then((response) async { 104 | var res = json.decode(response); 105 | if (res["error"] == false) { 106 | await fetchDocuments(); 107 | } 108 | result = res; 109 | }).catchError((onError) { 110 | print("editDocument Error >> $onError"); 111 | result = {"status": "error", "message": "Something went wrong"}; 112 | }); 113 | return result; 114 | } 115 | 116 | deleteDocument(Document file) async { 117 | Map? result; 118 | await CrmService().deleteDocument(file.id).then((response) async { 119 | var res = (json.decode(response.body)); 120 | await fetchDocuments(); 121 | result = res; 122 | }).catchError((onError) { 123 | print("deleteDocument Error >> $onError"); 124 | result = { 125 | "status": "error", 126 | "message": "deleteDocument : Something went wrong." 127 | }; 128 | }); 129 | return result; 130 | } 131 | 132 | cancelCurrentEditDocument() { 133 | _currentEditDocumentId = null; 134 | _currentEditDocument = {'title': "", 'teams': [], 'shared_to': []}; 135 | } 136 | 137 | updateCurrentEditDocument(Document editFile) { 138 | _currentEditDocumentId = editFile.id.toString(); 139 | List sharedToList = []; 140 | List teams = []; 141 | 142 | editFile.sharedTo!.forEach((sharee) { 143 | sharedToList.add(sharee.id.toString()); 144 | }); 145 | 146 | editFile.teams!.forEach((team) { 147 | teams.add(team.id); 148 | }); 149 | 150 | _currentEditDocument['title'] = editFile.title; 151 | _currentEditDocument['document_file'] = editFile.documentFile; 152 | _currentEditDocument['teams'] = teams; 153 | _currentEditDocument['shared_to'] = sharedToList; 154 | _currentEditDocument['status'] = editFile.status; 155 | } 156 | 157 | List get documents { 158 | return _documents; 159 | } 160 | 161 | List get activeDocuments { 162 | return _activeDocuments; 163 | } 164 | 165 | List get inActiveDocuments { 166 | return _inActiveDocuments; 167 | } 168 | 169 | List get fileSizes { 170 | return _fileSizes; 171 | } 172 | 173 | List get statusObjforDropdown { 174 | return _statusObjforDropdown; 175 | } 176 | 177 | List get usersObjforMultiselect { 178 | return _usersObjforMultiselect; 179 | } 180 | 181 | Document? get currentDocument { 182 | return _currentDocument; 183 | } 184 | 185 | set currentDocument(document) { 186 | _currentDocument = document; 187 | } 188 | 189 | int? get currentDocumentIndex { 190 | return _currentDocumentIndex; 191 | } 192 | 193 | set currentDocumentIndex(index) { 194 | _currentDocumentIndex = index; 195 | } 196 | 197 | String? get currentEditDocumentId { 198 | return _currentEditDocumentId; 199 | } 200 | 201 | Map get currentEditDocument { 202 | return _currentEditDocument; 203 | } 204 | 205 | set currentEditDocumentId(id) { 206 | _currentEditDocumentId = id; 207 | } 208 | // --------------------------DOCUMENT DOWNLOAD METHODS---------------- 209 | 210 | } 211 | 212 | final documentBLoc = DocumentBloc(); 213 | -------------------------------------------------------------------------------- /lib/bloc/event_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:bottle_crm/model/contact.dart'; 4 | import 'package:bottle_crm/model/events.dart'; 5 | import 'package:bottle_crm/services/crm_services.dart'; 6 | 7 | class EventBloc { 8 | List _events = []; 9 | Event? _currentEvent; 10 | int? _currentEventIndex; 11 | String? _currentEditEventId = ""; 12 | String _offset = ""; 13 | List _assignedToList = []; 14 | List _contacts = []; 15 | List _recurringDays = []; 16 | Map _currentEditEvent = { 17 | "name": "", 18 | "event_type": "Recurring", 19 | "start_date": null, 20 | "start_time": "", 21 | "end_date": "", 22 | "end_time": "", 23 | "description": "", 24 | "contacts": [], 25 | "teams": [], 26 | "assigned_to": [], 27 | "recurring_day": [], 28 | }; 29 | 30 | Future fetchEvents({filtersData}) async { 31 | try { 32 | Map? _copyFiltersData = 33 | filtersData != null ? new Map.from(filtersData) : null; 34 | 35 | await CrmService() 36 | .getEvents(queryParams: _copyFiltersData) 37 | .then((response) { 38 | var res = (json.decode(response.body)); 39 | _assignedToList.clear(); 40 | 41 | res['events'].forEach((_event) { 42 | Event event = Event.fromJson(_event); 43 | _events.add(event); 44 | }); 45 | if (res['recurring_days'] != null) { 46 | _recurringDays.clear(); 47 | res['recurring_days'].forEach((_recurringDay) { 48 | _recurringDays.add(_recurringDay[1]); 49 | }); 50 | } 51 | print(_recurringDays); 52 | res['contacts_list'].forEach((_contact) { 53 | Contact contact = Contact.fromJson(_contact); 54 | _contacts.add(contact); 55 | }); 56 | 57 | _offset = res['offset'] != null && res['offset'].toString() != "0" 58 | ? res['offset'].toString() 59 | : ""; 60 | }).catchError((onError) { 61 | print("fetchEvents Error>> $onError"); 62 | }); 63 | } catch (e) {} 64 | } 65 | 66 | Future createEvent() async { 67 | Map? result; 68 | Map _copyCurrentEditEvent = Map.from(_currentEditEvent); 69 | _copyCurrentEditEvent['contacts'] = (_copyCurrentEditEvent['contacts'] 70 | .map((contacts) => contacts.toString())).toList().toString(); 71 | 72 | _copyCurrentEditEvent['teams'] = (_copyCurrentEditEvent['teams'] 73 | .map((teams) => teams.toString())).toList().toString(); 74 | 75 | _copyCurrentEditEvent['assigned_to'] = (_copyCurrentEditEvent['assigned_to'] 76 | .map((assignedTo) => assignedTo.toString())).toList().toString(); 77 | 78 | await CrmService() 79 | .createEvent(_copyCurrentEditEvent) 80 | .then((response) async { 81 | var res = json.decode(response.body); 82 | if (res['error'] == false) { 83 | await fetchEvents(); 84 | } 85 | result = res; 86 | }).catchError((onError) { 87 | print('createEvents Error >> $onError'); 88 | result = {"status": "error", "message": "Something went wrong"}; 89 | }); 90 | return result; 91 | } 92 | 93 | Future editEvent() async { 94 | Map? _result; 95 | Map _copyOfCurrentEditEvent = Map.from(_currentEditEvent); 96 | 97 | _copyOfCurrentEditEvent['contacts'] = (_copyOfCurrentEditEvent['contacts'] 98 | .map((contacts) => contacts.toString())).toList().toString(); 99 | 100 | _copyOfCurrentEditEvent['teams'] = (_copyOfCurrentEditEvent['teams'] 101 | .map((teams) => teams.toString())).toList().toString(); 102 | 103 | _copyOfCurrentEditEvent['assigned_to'] = 104 | (_copyOfCurrentEditEvent['assigned_to'] 105 | .map((assignedTo) => assignedTo.toString())).toList().toString(); 106 | 107 | await CrmService() 108 | .editEvent(_copyOfCurrentEditEvent, _currentEditEventId) 109 | .then((response) async { 110 | var res = json.decode(response.body); 111 | if (res['error'] == false) { 112 | await fetchEvents(); 113 | } 114 | _result = res; 115 | }).catchError((onError) { 116 | print("editEvent Error >> $onError"); 117 | _result = {"status": "error", "message": "Something went wrong."}; 118 | }); 119 | return _result; 120 | } 121 | 122 | Future deleteEvent(Event event) async { 123 | Map? result; 124 | await CrmService().deleteEvent(event.id).then((response) async { 125 | var res = (json.decode(response.body)); 126 | await fetchEvents(); 127 | result = res; 128 | }).catchError((onError) { 129 | print("deleteEvent Error >> $onError"); 130 | result = {"status": "error", "message": "Something went wrong."}; 131 | }); 132 | return result; 133 | } 134 | 135 | updateCurrentEditEvent(Event event) { 136 | _currentEditEventId = event.id.toString(); 137 | 138 | List contacts = []; 139 | List teams = []; 140 | List assignedUsers = []; 141 | 142 | event.contacts!.forEach((contact) { 143 | contacts.add(contact.id); 144 | }); 145 | 146 | event.assignedTo!.forEach((assignedAccount) { 147 | assignedUsers.add(assignedAccount.id); 148 | }); 149 | 150 | event.teams!.forEach((team) { 151 | teams.add(team.id); 152 | }); 153 | 154 | _currentEditEvent = { 155 | "name": "", 156 | "event_type": "Recurring", 157 | "start_date": null, 158 | "start_time": "", 159 | "end_date": "", 160 | "end_time": "", 161 | "description": "", 162 | "contacts": [], 163 | "teams": [], 164 | "assigned_to": [], 165 | "recurring_day": [], 166 | }; 167 | } 168 | 169 | cancelCurrentEditEvent() { 170 | _currentEditEventId = null; 171 | _currentEditEvent = { 172 | "name": "", 173 | "event_type": "Recurring", 174 | "start_date": null, 175 | "start_time": "", 176 | "end_date": "", 177 | "end_time": "", 178 | "description": "", 179 | "contacts": [], 180 | "teams": [], 181 | "assigned_to": [], 182 | "recurring_days": [], 183 | }; 184 | } 185 | 186 | List get events { 187 | return _events; 188 | } 189 | 190 | Event? get currentEvent { 191 | return _currentEvent; 192 | } 193 | 194 | set currentEvent(event) { 195 | _currentEvent = event; 196 | } 197 | 198 | int? get currentEventIndex { 199 | return _currentEventIndex; 200 | } 201 | 202 | set currentEventIndex(index) { 203 | _currentEventIndex = index; 204 | } 205 | 206 | Map get currentEditEvent { 207 | return _currentEditEvent; 208 | } 209 | 210 | set currentEditEvent(currentEditEvent) { 211 | _currentEditEvent = currentEditEvent; 212 | } 213 | 214 | List get recurringDays { 215 | return _recurringDays; 216 | } 217 | 218 | String get offset { 219 | return _offset; 220 | } 221 | 222 | set offset(offset) { 223 | _offset = offset; 224 | } 225 | 226 | String? get currentEditEventId { 227 | return _currentEditEventId; 228 | } 229 | 230 | set currentEditEventId(id) { 231 | _currentEditEventId = id; 232 | } 233 | } 234 | 235 | final eventBloc = EventBloc(); 236 | -------------------------------------------------------------------------------- /lib/bloc/team_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:bottle_crm/model/team.dart'; 4 | import 'package:bottle_crm/services/crm_services.dart'; 5 | 6 | class TeamBloc { 7 | List _teams = []; 8 | List _users = []; 9 | List _usersObjForDropDown = []; 10 | List _teamsObjForDropdown = []; 11 | Map? _currentEditTeam = { 12 | 'name': "", 13 | 'description': "", 14 | 'assign_users': [], 15 | }; 16 | String? _currentEditTeamId; 17 | Team? _currentTeam; 18 | int? _currentTeamIndex; 19 | String _offset = ""; 20 | 21 | Future fetchTeams({filtersData}) async { 22 | Map? _copyFiltersData = 23 | filtersData != null ? new Map.from(filtersData) : null; 24 | if (_copyFiltersData != null) { 25 | _users.forEach((e) { 26 | if (_copyFiltersData['created_by'] != null) { 27 | if (e[1] == _copyFiltersData['created_by']) { 28 | _copyFiltersData['created_by'] = e[0].toString(); 29 | } 30 | } 31 | }); 32 | if (_copyFiltersData['assigne_users'].length != 0) { 33 | _copyFiltersData['assigne_users'] = (_copyFiltersData['assigne_users'] 34 | .map((assignedTo) => assignedTo.toString())).toList().toString(); 35 | } 36 | } 37 | 38 | await CrmService().getTeams(queryParams: _copyFiltersData, offset: _offset).then((response) { 39 | var res = json.decode(response.body); 40 | 41 | _teams.clear(); 42 | _users.clear(); 43 | _usersObjForDropDown.clear(); 44 | 45 | res['teams'].forEach((_team) { 46 | Team team = Team.fromJson(_team); 47 | _teams.add(team); 48 | }); 49 | 50 | _teams.forEach((_team) { 51 | Map team = {}; 52 | team['id'] = _team.id; 53 | team['name'] = _team.name!; 54 | _teamsObjForDropdown.add(team); 55 | }); 56 | // res['users'].forEach((_user) { 57 | // Profile user = Profile.fromJson(_user); 58 | // _users.add([user.id, user.firstName]); 59 | // _usersObjForDropDown.add(user.firstName); 60 | // }); 61 | }); 62 | } 63 | 64 | Future createTeam() async { 65 | Map? result; 66 | //print("----"); 67 | // print(_currentEditTeam); 68 | Map _copyCurrentEditTeam = Map.from(_currentEditTeam!); 69 | 70 | _copyCurrentEditTeam['assign_users'] = (_copyCurrentEditTeam['assign_users'] 71 | .map((assignedTo) => assignedTo.toString())).toList().toString(); 72 | //print("==="); 73 | // print(_copyCurrentEditTeam); 74 | 75 | 76 | await CrmService().createTeam(_copyCurrentEditTeam).then((response) async { 77 | print(_copyCurrentEditTeam); 78 | var res = json.decode(response.body); 79 | if (res['error'] == false) { 80 | await fetchTeams(); 81 | } 82 | result = res; 83 | }); 84 | 85 | print(result) 86 | ; // .catchError((onError) { 87 | // print('createTeam Error >> $onError'); 88 | // result = {"status": "error", "message": "Something went wrong"}; 89 | // }); 90 | return result; 91 | } 92 | 93 | Future editTeam() async { 94 | Map? _result; 95 | Map _copyOfCurrentEditTeam = Map.from(_currentEditTeam!); 96 | 97 | _copyOfCurrentEditTeam['assign_users'] = 98 | (_copyOfCurrentEditTeam['assign_users'] 99 | .map((assignedTo) => assignedTo.toString())).toList().toString(); 100 | await CrmService() 101 | .editTeam(_copyOfCurrentEditTeam, _currentEditTeamId) 102 | .then((response) async { 103 | var res = json.decode(response.body); 104 | if (res['error'] == false) { 105 | await fetchTeams(); 106 | } 107 | _result = res; 108 | }).catchError((onError) { 109 | print("editTeam Error >> $onError"); 110 | _result = {"status": "error", "message": "Something went wrong."}; 111 | }); 112 | return _result; 113 | } 114 | 115 | Future deleteTeam(Team team) async { 116 | Map? result; 117 | await CrmService().deleteTeam(team.id).then((response) async { 118 | var res = (json.decode(response.body)); 119 | await fetchTeams(); 120 | result = res; 121 | }).catchError((onError) { 122 | print("deleteTeam Error >> $onError"); 123 | result = {"status": "error", "message": "Something went wrong."}; 124 | }); 125 | return result; 126 | } 127 | 128 | cancelCurrentEditTeam() { 129 | _currentEditTeamId = null; 130 | _currentEditTeam = { 131 | 'name': "", 132 | 'description': "", 133 | 'assign_users': [], 134 | }; 135 | } 136 | 137 | updateCurrentEditTeam(Team team) { 138 | List _currUsers = []; 139 | _currentEditTeamId = team.id.toString(); 140 | _currentEditTeam = { 141 | 'name': team.name, 142 | 'description': team.description, 143 | }; 144 | team.users!.forEach((element) { 145 | _currUsers.add(element.id); 146 | }); 147 | _currentEditTeam!['assign_users'] = _currUsers; 148 | } 149 | 150 | List get teams { 151 | return _teams; 152 | } 153 | 154 | List get users { 155 | return _users; 156 | } 157 | 158 | List get userObjForDropDown { 159 | return _usersObjForDropDown; 160 | } 161 | 162 | List get teamsObjForDropdown { 163 | return _teamsObjForDropdown; 164 | } 165 | 166 | Map? get currentEditTeam { 167 | return _currentEditTeam; 168 | } 169 | 170 | String? get currentEditTeamId { 171 | return _currentEditTeamId; 172 | } 173 | 174 | set currentEditTeamId(id) { 175 | _currentEditTeamId = id; 176 | } 177 | 178 | Team? get currentTeam { 179 | return _currentTeam; 180 | } 181 | 182 | set currentTeam(team) { 183 | _currentTeam = team; 184 | } 185 | 186 | int? get currentTeamIndex { 187 | return _currentTeamIndex; 188 | } 189 | 190 | set currentTeamIndex(index) { 191 | _currentTeamIndex = index; 192 | } 193 | 194 | String get offset { 195 | return _offset; 196 | } 197 | 198 | set offset(offset) { 199 | _offset = offset; 200 | } 201 | } 202 | 203 | final teamBloc = TeamBloc(); 204 | -------------------------------------------------------------------------------- /lib/model/account.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/contact.dart'; 2 | import 'package:bottle_crm/model/lead.dart'; 3 | import 'package:bottle_crm/model/profile.dart'; 4 | import 'package:bottle_crm/model/team.dart'; 5 | import 'package:intl/intl.dart'; 6 | 7 | class Account { 8 | int? id; 9 | String? name; 10 | String? email; 11 | String? phone; 12 | String? industry; 13 | String? billingAddressLine; 14 | String? billingStreet; 15 | String? billingCity; 16 | String? billingState; 17 | String? billingPostcode; 18 | String? billingCountry; 19 | String? website; 20 | String? description; 21 | Profile? createdBy; 22 | String? createdOn; 23 | bool? isActive; 24 | List? tags; 25 | String? status; 26 | Lead? lead; 27 | String? contactName; 28 | List? contacts; 29 | List? assignedTo; 30 | List? teams; 31 | 32 | Account( 33 | {this.id, 34 | this.name, 35 | this.email, 36 | this.phone, 37 | this.industry, 38 | this.billingAddressLine, 39 | this.billingStreet, 40 | this.billingCity, 41 | this.billingState, 42 | this.billingPostcode, 43 | this.billingCountry, 44 | this.website, 45 | this.description, 46 | this.createdBy, 47 | this.assignedTo, 48 | this.createdOn, 49 | this.isActive, 50 | this.tags, 51 | this.status, 52 | this.lead, 53 | this.contactName, 54 | this.contacts, 55 | this.teams}); 56 | 57 | Account.fromJson(Map account) { 58 | this.id = account['id'] != null ? account['id'] : 0; 59 | this.name = account['name'] != null ? account['name'] : ""; 60 | this.email = account['email'] != null ? account['email'] : ""; 61 | this.phone = account['phone'] != null ? account['phone'] : ""; 62 | this.industry = account['industry'] != null ? account['industry'] : ""; 63 | this.billingAddressLine = account['billing_address_line'] != null 64 | ? account['billing_address_line'] 65 | : ""; 66 | this.billingStreet = 67 | account['billing_street'] != null ? account['billing_street'] : ""; 68 | this.billingCity = 69 | account['billing_city'] != null ? account['billing_city'] : ""; 70 | this.billingState = 71 | account['billing_state'] != null ? account['billing_state'] : ""; 72 | this.billingPostcode = 73 | account['billing_postcode'] != null ? account['billing_postcode'] : ""; 74 | this.billingCountry = 75 | account['billing_country'] != null ? account['billing_country'] : ""; 76 | this.website = account['website'] != null ? account['website'] : ""; 77 | this.description = 78 | account['description'] != null ? account['description'] : ""; 79 | this.createdBy = account['created_by'] != null 80 | ? Profile.fromJson(account['created_by']) 81 | : Profile(); 82 | this.assignedTo = account['assigned_to'] != null 83 | ? List.from( 84 | account['assigned_to'].map((x) => Profile.fromJson(x))) 85 | : []; 86 | this.createdOn = account['created_on'] != null 87 | ? DateFormat("dd-MM-yyyy") 88 | .format(DateFormat("yyyy-MM-dd").parse(account['created_on'])) 89 | : ""; 90 | this.isActive = account['is_active'] != null ? account['is_active'] : false; 91 | this.tags = account['tags'] != null ? account['tags'] : []; 92 | this.status = account['status'] != null ? account['status'] : ""; 93 | this.lead = 94 | account['lead'] != null ? Lead.fromJson(account['lead']) : Lead(); 95 | this.contactName = 96 | account['contact_name'] != null ? account['contact_name'] : ""; 97 | this.contacts = account["contacts"] != null 98 | ? List.from( 99 | account["contacts"].map((x) => Contact.fromJson(x))) 100 | : []; 101 | this.teams = account["teams"] != null 102 | ? List.from(account["teams"].map((x) => Team.fromJson(x))) 103 | : []; 104 | } 105 | 106 | toJson() { 107 | return { 108 | 'id': id, 109 | 'name': name, 110 | 'email': email, 111 | 'phone': phone, 112 | 'industry': industry, 113 | 'billing_address_line': billingAddressLine, 114 | 'billing_street': billingStreet, 115 | 'billing_city': billingCity, 116 | 'billing_state': billingState, 117 | 'billing_postcode': billingPostcode, 118 | 'billing_country': billingCountry, 119 | 'website': website, 120 | 'description': description, 121 | 'created_by': createdBy, 122 | 'assigned_to': assignedTo, 123 | 'created_on': createdOn, 124 | 'is_active': isActive, 125 | 'tags': tags, 126 | 'status': status, 127 | 'lead': lead, 128 | 'contact_name': contactName, 129 | 'contacts': contacts, 130 | 'teams': teams 131 | }; 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /lib/model/case.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/contact.dart'; 2 | import 'package:bottle_crm/model/profile.dart'; 3 | import 'package:bottle_crm/model/team.dart'; 4 | import 'package:intl/intl.dart'; 5 | 6 | import 'account.dart'; 7 | import 'company.dart'; 8 | 9 | class Case { 10 | int? id; 11 | String? name; 12 | String? status; 13 | String? priority; 14 | String? caseType; 15 | String? closedOn; 16 | String? description; 17 | Profile? createdBy; 18 | String? createdOn; 19 | bool? isActive; 20 | Account? account; 21 | List? contacts; 22 | List? teams; 23 | List? assignedTo; 24 | Company? company; 25 | String? createdOnText; 26 | List? caseAttachment; 27 | 28 | Case( 29 | {this.id, 30 | this.name, 31 | this.status, 32 | this.priority, 33 | this.caseType, 34 | this.closedOn, 35 | this.description, 36 | this.createdBy, 37 | this.createdOn, 38 | this.isActive, 39 | this.account, 40 | this.contacts, 41 | this.teams, 42 | this.assignedTo, 43 | this.company, 44 | this.createdOnText, 45 | this.caseAttachment}); 46 | 47 | Case.fromJson(Map data) { 48 | this.status = data['status'] != null ? data['status'] : ""; 49 | this.priority = data['priority'] != null ? data['priority'] : ""; 50 | this.caseType = data['type_of_case'] != null ? data['type_of_case'] : ""; 51 | this.id = data['id'] != null ? data['id'] : 0; 52 | this.name = data['name'] != null ? data['name'] : ""; 53 | this.account = 54 | data['account'] != null ? Account.fromJson(data['account']) : Account(); 55 | this.contacts = data['contacts'] != null 56 | ? List.from(data["contacts"].map((x) => Contact.fromJson(x))) 57 | : []; 58 | 59 | this.closedOn = data['closed_on'] != null ? data['closed_on'] : ""; 60 | this.description = data['description'] != null ? data['description'] : ""; 61 | this.assignedTo = data['assigned_to'] != null 62 | ? List.from( 63 | data["assigned_to"].map((x) => Profile.fromJson(x))) 64 | : []; 65 | this.createdBy = data['created_by'] != null 66 | ? Profile.fromJson(data['created_by']) 67 | : Profile(); 68 | this.createdOn = data['created_on'] != null 69 | ? DateFormat("dd-MM-yyyy") 70 | .format(DateFormat("yyyy-MM-dd").parse(data['created_on'])) 71 | : ""; 72 | this.isActive = data['is_active'] != null ? data['is_active'] : false; 73 | this.teams = data['teams'] != null 74 | ? List.from(data["teams"].map((x) => Team.fromJson(x))) 75 | : []; 76 | this.company = 77 | data['company'] != null ? Company.fromJson(data['company']) : Company(); 78 | this.createdOnText = 79 | data['created_on_arrow'] != null ? data['created_on_arrow'] : ""; 80 | this.caseAttachment = 81 | data['case_attachment'] != null ? data['case_attachment'] : []; 82 | } 83 | 84 | toJson() { 85 | return { 86 | 'id': id, 87 | 'name': name, 88 | 'status': status, 89 | 'priority': priority, 90 | 'type_of_case': caseType, 91 | 'account': account, 92 | 'contacts': contacts, 93 | 'closed_on': closedOn, 94 | 'description': description, 95 | 'assigned_to': assignedTo, 96 | 'created_by': createdBy, 97 | 'created_on': createdOn, 98 | 'is_active': isActive, 99 | 'teams': teams, 100 | 'company': company, 101 | 'created_on_arrow': createdOnText, 102 | 'case_attachment': caseAttachment 103 | }; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /lib/model/company.dart: -------------------------------------------------------------------------------- 1 | class Company { 2 | int? id; 3 | String? name; 4 | dynamic address; 5 | String? subDomain; 6 | int? userLimit; 7 | String? country; 8 | 9 | Company( 10 | {this.id, 11 | this.name, 12 | this.address, 13 | this.subDomain, 14 | this.userLimit, 15 | this.country}); 16 | 17 | Company.fromJson(Map company) { 18 | this.id = company['id'] != null ? company['id'] : 0; 19 | this.name = company['name'] != null ? company['name'] : ''; 20 | this.address = company['address'] != null ? company['address'] : ''; 21 | this.subDomain = company['sub_domain'] != null ? company['sub_domain'] : ""; 22 | this.userLimit = company['user_limit'] != null ? company['user_limit'] : 0; 23 | this.country = company['country'] != null ? company['country'] : ''; 24 | } 25 | 26 | toJson() { 27 | return { 28 | 'id': id, 29 | 'name': name, 30 | 'address': address, 31 | 'sub_domain': subDomain, 32 | 'user_limit': userLimit, 33 | 'country': country 34 | }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/model/contact.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/profile.dart'; 2 | import 'package:bottle_crm/model/team.dart'; 3 | import 'package:intl/intl.dart'; 4 | 5 | class Contact { 6 | int? id; 7 | String? salutation; 8 | String? firstName; 9 | String? lastName; 10 | String? primaryEmail; 11 | String? secondaryEmail; 12 | String? primaryMobile; 13 | String? secondaryMobile; 14 | String? dateOfBirth; 15 | String? linkedInUrl; 16 | String? facebookUrl; 17 | String? twitterUserName; 18 | String? organization; 19 | String? department; 20 | bool? doNotCall; 21 | String? title; 22 | Map? address; 23 | String? description; 24 | List? assignedTo; 25 | Profile? createdBy; 26 | String? createdOn; 27 | bool? isActive; 28 | List? teams; 29 | String? createdOnText; 30 | List? teamAndAssignedUsers; 31 | List? assignedUsersNotInTeams; 32 | 33 | Contact( 34 | {this.id, 35 | this.salutation, 36 | this.firstName, 37 | this.lastName, 38 | this.primaryMobile, 39 | this.secondaryMobile, 40 | this.primaryEmail, 41 | this.secondaryEmail, 42 | this.dateOfBirth, 43 | this.linkedInUrl, 44 | this.facebookUrl, 45 | this.twitterUserName, 46 | this.organization, 47 | this.department, 48 | this.doNotCall, 49 | this.title, 50 | this.address, 51 | this.description, 52 | this.assignedTo, 53 | this.createdBy, 54 | this.createdOn, 55 | this.isActive, 56 | this.teams, 57 | this.createdOnText, 58 | this.teamAndAssignedUsers, 59 | this.assignedUsersNotInTeams}); 60 | 61 | Contact.fromJson(Map contact) { 62 | Map address = { 63 | "address_line": "", 64 | "street": "", 65 | "city": "", 66 | "state": "", 67 | "postcode": "", 68 | "country": "" 69 | }; 70 | 71 | address['address_line'] = 72 | contact['address'] != null && contact['address']['address_line'] != null 73 | ? contact['address']['address_line'] 74 | : ""; 75 | address['street'] = 76 | contact['address'] != null && contact['address']['street'] != null 77 | ? ", " + contact['address']['street'] 78 | : ""; 79 | address['city'] = 80 | contact['address'] != null && contact['address']['city'] != null 81 | ? ", " + contact['address']['city'] 82 | : ""; 83 | address['state'] = 84 | contact['address'] != null && contact['address']['state'] != null 85 | ? ", " + contact['address']['state'] 86 | : ""; 87 | address['postcode'] = 88 | contact['address'] != null && contact['address']['postcode'] != null 89 | ? ", " + contact['address']['postcode'].toString() 90 | : ""; 91 | address['country'] = 92 | contact['address'] != null && contact['address']['country'] != null 93 | ? ", " + contact['address']['country'] 94 | : ""; 95 | 96 | this.id = contact['id'] != null ? contact['id'] : 0; 97 | this.salutation = 98 | contact['salutation'] != null ? contact['salutation'] : ''; 99 | this.firstName = contact['first_name'] != null ? contact['first_name'] : ''; 100 | this.lastName = contact['last_name'] != null ? contact['last_name'] : ''; 101 | this.primaryEmail = 102 | contact['primary_email'] != null ? contact['primary_email'] : ""; 103 | this.secondaryEmail = 104 | contact['secondary_email'] != null ? contact['secondary_email'] : ""; 105 | this.primaryMobile = 106 | contact['mobile_number'] != null ? contact['mobile_number'] : ""; 107 | this.secondaryEmail = 108 | contact['secondary_number'] != null ? contact['secondary_number'] : ""; 109 | this.linkedInUrl = 110 | contact['linked_in_url'] != null ? contact['linked_in_url'] : ""; 111 | this.facebookUrl = 112 | contact['facebook_url'] != null ? contact['facebook_url'] : ""; 113 | this.twitterUserName = 114 | contact['twitter_username'] != null ? contact['twitter_username'] : ""; 115 | this.dateOfBirth = 116 | contact['date_of_birth'] != null ? contact['date_of_birth'] : ""; 117 | this.organization = 118 | contact['organization'] != null ? contact['organization'] : ""; 119 | this.department = 120 | contact['department'] != null ? contact['department'] : ""; 121 | this.doNotCall = 122 | contact['do_not_call'] != null ? contact['do_not_call'] : ""; 123 | this.title = contact['title'] != null ? contact['title'] : ""; 124 | this.address = address; 125 | this.description = 126 | contact['description'] != null ? contact['description'] : ""; 127 | this.assignedTo = contact['assigned_to'] != null 128 | ? List.from( 129 | contact['assigned_to'].map((x) => Profile.fromJson(x))) 130 | : []; 131 | this.createdBy = contact['created_by'] != null 132 | ? Profile.fromJson(contact['created_by']) 133 | : Profile(); 134 | this.createdOn = contact['created_on'] != null 135 | ? DateFormat("dd-MM-yyyy") 136 | .format(DateFormat("yyyy-MM-dd").parse(contact['created_on'])) 137 | : ""; 138 | this.createdOnText = 139 | contact['created_on_arrow'] != null ? contact['created_on_arrow'] : ""; 140 | this.isActive = contact['is_active'] != null ? contact['is_active'] : false; 141 | this.teams = contact['teams'] != null 142 | ? List.from(contact['teams'].map((x) => Team.fromJson(x))) 143 | : []; 144 | this.teamAndAssignedUsers = contact['get_team_and_assigned_users'] != null 145 | ? List.from(contact['get_team_and_assigned_users'] 146 | .map((x) => Profile.fromJson(x))) 147 | : []; 148 | this.assignedUsersNotInTeams = 149 | contact['get_assigned_users_not_in_teams'] != null 150 | ? List.from(contact['get_assigned_users_not_in_teams'] 151 | .map((x) => Profile.fromJson(x))) 152 | : []; 153 | } 154 | 155 | toJson() { 156 | return { 157 | 'salutation': salutation, 158 | 'id': id, 159 | 'first_name': firstName, 160 | 'last_name': lastName, 161 | 'primary_email': primaryEmail, 162 | 'secondary_email': secondaryEmail, 163 | 'mobile_number': primaryMobile, 164 | 'secondary_number': secondaryMobile, 165 | 'linked_in_url': linkedInUrl, 166 | 'facebook_url': facebookUrl, 167 | 'twitter_username': twitterUserName, 168 | 'organization': organization, 169 | 'department': department, 170 | 'date_of_birth': dateOfBirth, 171 | 'do_not_call': doNotCall, 172 | 'title ': title, 173 | 'address': address, 174 | 'description': description, 175 | 'assigned_to': assignedTo, 176 | 'created_by': createdBy, 177 | 'created_on': createdOn, 178 | 'created_on_arrow': createdOnText, 179 | 'is_active': isActive, 180 | 'teams': teams, 181 | 'get_team_and_assigned_users': teamAndAssignedUsers, 182 | 'get_assigned_users_not_in_teams': assignedUsersNotInTeams 183 | }; 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /lib/model/document.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/company.dart'; 2 | import 'package:bottle_crm/model/profile.dart'; 3 | import 'package:bottle_crm/model/team.dart'; 4 | 5 | class Document { 6 | int? id; 7 | String? title; 8 | String? documentFile; 9 | String? status; 10 | List? sharedTo; 11 | List? teams; 12 | String? createdOn; 13 | Profile? createdBy; 14 | Company? company; 15 | 16 | Document( 17 | {this.id, 18 | this.title, 19 | this.documentFile, 20 | this.status, 21 | this.sharedTo, 22 | this.teams, 23 | this.createdOn, 24 | this.createdBy, 25 | this.company}); 26 | 27 | Document.fromJson(Map document) { 28 | this.id = document['id'] != null ? document['id'] : 0; 29 | this.title = document['title'] != null ? document['title'] : ""; 30 | this.documentFile = 31 | document['document_file'] != null ? document['document_file'] : ""; 32 | this.status = document['status'] != null ? document['status'] : ""; 33 | this.sharedTo = document['shared_to'] != null 34 | ? List.from( 35 | document['shared_to'].map((contact) => Profile.fromJson(contact))) 36 | : []; 37 | this.teams = document["teams"] != null 38 | ? List.from(document["teams"].map((team) => Team.fromJson(team))) 39 | : []; 40 | this.createdOn = document['created_on'] != null 41 | ? document['created_on'] 42 | // ? DateFormat("dd MMM, yyyy 'at' HH:mm") 43 | // .format(DateFormat("yyyy-MM-dd").parse(document['created_on'])) 44 | : ""; 45 | this.createdBy = document['created_by'] != null 46 | ? Profile.fromJson(document['created_by']) 47 | : Profile(); 48 | this.company = document['company'] != null 49 | ? Company.fromJson(document['company']) 50 | : Company(); 51 | } 52 | 53 | toJson() { 54 | return { 55 | "id": id, 56 | "title": title, 57 | "document_file": documentFile, 58 | "status": status, 59 | "shared_to": sharedTo, 60 | "teams": teams, 61 | "created_on": createdOn, 62 | "created_by": createdBy, 63 | "company": company 64 | }; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/model/domain.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/profile.dart'; 2 | import 'package:intl/intl.dart'; 3 | import 'company.dart'; 4 | 5 | class Domain { 6 | int? id; 7 | String? domain; 8 | String? createdOn; 9 | Profile? createdBy; 10 | Company? company; 11 | 12 | Domain({this.id, this.domain, this.createdOn, this.createdBy, this.company}); 13 | 14 | Domain.fromJson(Map domain) { 15 | this.id = domain['id'] != null ? domain['id'] : 0; 16 | this.domain = domain['domain'] != null ? domain['domain'] : ""; 17 | this.createdOn = domain['created_on'] != null 18 | ? DateFormat("dd MMM, yyyy") 19 | .format(DateFormat("yyyy-MM-dd").parse(domain['created_on'])) 20 | : ""; 21 | this.createdBy = domain['created_by'] != null 22 | ? Profile.fromJson(domain['created_by']) 23 | : Profile(); 24 | this.company = domain['company'] != null 25 | ? Company.fromJson(domain['company']) 26 | : Company(); 27 | } 28 | 29 | toJson() { 30 | return { 31 | "id": id, 32 | "domain": domain, 33 | "created_on": createdOn, 34 | "created_by": createdBy, 35 | "company": company 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/model/email.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/profile.dart'; 2 | import 'package:intl/intl.dart'; 3 | import 'company.dart'; 4 | 5 | class Email { 6 | int? id; 7 | String? email; 8 | String? createdOn; 9 | Profile? createdBy; 10 | Company? company; 11 | 12 | Email({this.id, this.email, this.createdOn, this.createdBy, this.company}); 13 | 14 | Email.fromJson(Map email) { 15 | this.id = email['id'] != null ? email['id'] : 0; 16 | this.email = email['email'] != null ? email['email'] : ""; 17 | this.createdOn = email['created_on'] != null 18 | ? DateFormat("dd MMM, yyyy") 19 | .format(DateFormat("yyyy-MM-dd").parse(email['created_on'])) 20 | : ""; 21 | this.createdBy = email['created_by'] != null 22 | ? Profile.fromJson(email['created_by']) 23 | : Profile(); 24 | this.company = email['company'] != null 25 | ? Company.fromJson(email['company']) 26 | : Company(); 27 | } 28 | 29 | toJson() { 30 | return { 31 | "id": id, 32 | "email": email, 33 | "created_on": createdOn, 34 | "created_by": createdBy, 35 | "company": company 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/model/events.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/contact.dart'; 2 | import 'package:bottle_crm/model/profile.dart'; 3 | import 'package:bottle_crm/model/team.dart'; 4 | import 'package:intl/intl.dart'; 5 | 6 | class Event { 7 | int? id; 8 | String? name; 9 | String? eventType; 10 | String? startDate; 11 | String? startTime; 12 | String? endDate; 13 | String? endTime; 14 | String? description; 15 | String? dateOfMeeting; 16 | String? createdOn; 17 | Profile? createdBy; 18 | List? contacts; 19 | List? assignedTo; 20 | List? teams; 21 | bool? isActive; 22 | String? status; 23 | 24 | Event( 25 | {this.id, 26 | this.name, 27 | this.eventType, 28 | this.startDate, 29 | this.startTime, 30 | this.endDate, 31 | this.endTime, 32 | this.description, 33 | this.dateOfMeeting, 34 | this.contacts, 35 | this.assignedTo, 36 | this.teams, 37 | this.createdOn, 38 | this.isActive, 39 | this.status, 40 | this.createdBy}); 41 | 42 | Event.fromJson(Map event) { 43 | this.id = event['id'] != null ? event['id'] : 0; 44 | this.name = event['name'] != null ? event['name'] : ""; 45 | this.description = event['description'] != null ? event['description'] : ""; 46 | this.createdBy = event['created_by'] != null 47 | ? Profile.fromJson(event['created_by']) 48 | : Profile(); 49 | this.assignedTo = event['assigned_to'] != null 50 | ? List.from( 51 | event['assigned_to'].map((x) => Profile.fromJson(x))) 52 | : []; 53 | this.createdOn = event['created_on'] != null 54 | ? DateFormat("dd-MM-yyyy") 55 | .format(DateFormat("yyyy-MM-dd").parse(event['created_on'])) 56 | : ""; 57 | this.contacts = event["contacts"] != null 58 | ? List.from(event["contacts"].map((x) => Contact.fromJson(x))) 59 | : []; 60 | this.teams = event["teams"] != null 61 | ? List.from(event["teams"].map((x) => Team.fromJson(x))) 62 | : []; 63 | this.isActive = event['is_active'] != null ? event['is_active'] : false; 64 | this.status = event['status'] != null ? event['status'] : ""; 65 | this.eventType = event['event_type'] != null ? event['event_type'] : ""; 66 | this.startDate = event['start_date'] != null ? event['start_date'] : ""; 67 | this.startTime = event['start_time'] != null ? event['start_time'] : ""; 68 | this.endDate = event['end_date'] != null ? event['end_date'] : ""; 69 | this.endTime = event['end_time'] != null ? event['end_time'] : ""; 70 | this.dateOfMeeting= 71 | event['date_of_meeting'] != null ? event['date_of_meeting'] : ""; 72 | } 73 | 74 | toJson() { 75 | return { 76 | 'id': id, 77 | 'name': name, 78 | 'event_type': eventType, 79 | 'status': status, 80 | 'is_active': isActive, 81 | 'start_date': startDate, 82 | 'start_time': startTime, 83 | 'end_date': endDate, 84 | 'end_time': endTime, 85 | 'description': description, 86 | 'date_of_meeting': dateOfMeeting, 87 | 'created_by': createdBy, 88 | 'created_on': createdOn, 89 | 'contacts': contacts, 90 | 'teams': teams, 91 | 'assigned_to': assignedTo, 92 | }; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/model/lead.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/profile.dart'; 2 | import 'package:bottle_crm/model/team.dart'; 3 | import 'package:intl/intl.dart'; 4 | 5 | import 'contact.dart'; 6 | 7 | class Lead { 8 | int? id; 9 | String? title; 10 | String? firstName; 11 | String? lastName; 12 | String? email; 13 | String? phone; 14 | String? status; 15 | String? source; 16 | String? addressLine; 17 | String? street; 18 | String? city; 19 | String? state; 20 | String? postcode; 21 | String? country; 22 | String? website; 23 | String? skypeID; 24 | String? description; 25 | List? assignedTo; 26 | String? accountName; 27 | String? opportunityAmount; 28 | Profile? createdBy; 29 | String? createdOn; 30 | bool? isActive; 31 | dynamic enqueryType; 32 | List? tags; 33 | List? contacts; 34 | bool? createdFromSite; 35 | List? teams; 36 | // Company company; 37 | 38 | Lead({ 39 | this.id, 40 | this.title, 41 | this.firstName, 42 | this.lastName, 43 | this.email, 44 | this.phone, 45 | this.status, 46 | this.source, 47 | this.addressLine, 48 | this.street, 49 | this.city, 50 | this.state, 51 | this.postcode, 52 | this.country, 53 | this.website, 54 | this.skypeID, 55 | this.description, 56 | this.assignedTo, 57 | this.accountName, 58 | this.opportunityAmount, 59 | this.createdBy, 60 | this.createdOn, 61 | this.isActive, 62 | this.enqueryType, 63 | this.tags, 64 | this.contacts, 65 | this.createdFromSite, 66 | this.teams, 67 | // this.company, 68 | }); 69 | 70 | factory Lead.fromJson(Map lead) => Lead( 71 | id: lead["id"] != null ? lead["id"] : 0, 72 | title: lead["title"] != null ? lead["title"] : "", 73 | firstName: lead["first_name"] != null ? lead["first_name"] : "", 74 | lastName: lead["last_name"] != null ? lead["last_name"] : "", 75 | email: lead["email"] != null ? lead["email"] : "", 76 | phone: lead["phone"] != null ? lead['phone'] : "", 77 | status: lead["status"] != null ? lead["status"] : "", 78 | source: lead["source"] != null ? lead["source"] : "", 79 | addressLine: lead["address_line"] != null ? lead["address_line"] : "", 80 | street: lead["street"] != null ? lead["street"] : "", 81 | city: lead["city"] != null ? lead["city"] : "", 82 | state: lead["state"] != null ? lead["state"] : "", 83 | postcode: lead["postcode"] != null ? lead["postcode"] : "", 84 | country: lead["country"] != null ? lead["country"] : "", 85 | website: lead["website"] != null ? lead["website"] : "", 86 | skypeID: lead["skype_ID"] != null ? lead["skype_ID"] : "", 87 | description: lead["description"] != null ? lead["description"] : "", 88 | assignedTo: lead["assigned_to"] != null 89 | ? List.from(lead["assigned_to"] 90 | .map((_profile) => Profile.fromJson(_profile))) 91 | : [], 92 | accountName: lead["account_name"] != null ? lead["account_name"] : "", 93 | opportunityAmount: lead["opportunity_amount"] != null 94 | ? lead["opportunity_amount"] 95 | : "", 96 | createdBy: lead["created_by"] != null 97 | ? Profile.fromJson(lead["created_by"]) 98 | : Profile(), 99 | createdOn: lead["created_on"] != null 100 | ? DateFormat("dd-MM-yyyy") 101 | .format(DateFormat("yyyy-MM-dd").parse(lead['created_on'])) 102 | : "", 103 | isActive: lead["is_active"] != null ? lead["is_active"] : false, 104 | enqueryType: lead["enquery_type"] != null ? lead["enquery_type"] : "", 105 | tags: lead["tags"] != null ? lead["tags"] : [], 106 | contacts: lead["contacts"] != null 107 | ? List.from( 108 | lead["contacts"].map((x) => Contact.fromJson(x))) 109 | : [], 110 | createdFromSite: lead["created_from_site"] != null 111 | ? lead["created_from_site"] 112 | : false, 113 | teams: lead["teams"] != null 114 | ? List.from(lead["teams"].map((x) => Team.fromJson(x))) 115 | : [], 116 | // teams: lead 117 | // company: lead["company"] != null ? lead["company"] : Company(), 118 | ); 119 | 120 | Map toJson() => { 121 | "id": id, 122 | "title": title, 123 | "first_name": firstName, 124 | "last_name": lastName, 125 | "email": email, 126 | "phone": phone, 127 | "status": status, 128 | "source": source, 129 | "address_line": addressLine, 130 | "street": street, 131 | "city": city, 132 | "state": state, 133 | "postcode": postcode, 134 | "country": country, 135 | "website": website, 136 | "skype_ID":skypeID, 137 | "description": description, 138 | "assigned_to": List.from(assignedTo!.map((x) => x.toJson())), 139 | "account_name": accountName, 140 | "opportunity_amount": opportunityAmount, 141 | "created_by": createdBy!.toJson(), 142 | "created_on": createdOn, 143 | "is_active": isActive, 144 | "enquery_type": enqueryType, 145 | "tags": tags, 146 | "contacts": List.from(contacts!.map((x) => x)), 147 | "created_from_site": createdFromSite, 148 | // "teams": List.from(teams.map((x) => x)), 149 | // "company": company, 150 | }; 151 | } 152 | -------------------------------------------------------------------------------- /lib/model/opportunities.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/contact.dart'; 2 | import 'package:bottle_crm/model/profile.dart'; 3 | import 'package:bottle_crm/model/team.dart'; 4 | import 'package:intl/intl.dart'; 5 | 6 | import 'account.dart'; 7 | import 'company.dart'; 8 | 9 | class Opportunity { 10 | int? id; 11 | String? name; 12 | Account? account; 13 | String? stage; 14 | String? currency; 15 | String? amount; 16 | String? leadSource; 17 | int? probability; 18 | List? contacts; 19 | Profile? closedBy; 20 | String? closedOn; 21 | String? dueDate; 22 | String? description; 23 | List? assignedTo; 24 | Profile? createdBy; 25 | String? createdOn; 26 | bool? isActive; 27 | List? tags; 28 | List? teams; 29 | Company? company; 30 | String? createdOnText; 31 | List? opportunityAttachment; 32 | 33 | Opportunity( 34 | {this.id, 35 | this.name, 36 | this.account, 37 | this.amount, 38 | this.closedBy, 39 | this.closedOn, 40 | this.dueDate, 41 | this.company, 42 | this.createdBy, 43 | this.createdOn, 44 | this.createdOnText, 45 | this.currency, 46 | this.description, 47 | this.isActive, 48 | this.leadSource, 49 | this.probability, 50 | this.stage, 51 | this.tags, 52 | this.contacts, 53 | this.assignedTo, 54 | this.teams, 55 | this.opportunityAttachment}); 56 | 57 | Opportunity.fromJson(Map opportunity) { 58 | this.id = opportunity['id'] != null ? opportunity['id'] : 0; 59 | this.name = opportunity['name'] != null ? opportunity['name'] : ""; 60 | this.account = opportunity['account'] != null 61 | ? Account.fromJson(opportunity['account']) 62 | : Account(); 63 | this.stage = opportunity['stage'] != null ? opportunity['stage'] : ""; 64 | this.currency = 65 | opportunity['currency'] != null ? opportunity['currency'] : ""; 66 | this.amount = opportunity['amount'] != null ? opportunity['amount'] : ""; 67 | this.leadSource = 68 | opportunity['lead_source'] != null ? opportunity['lead_source'] : ""; 69 | this.probability = 70 | opportunity['probability'] != null ? opportunity['probability'] : 0; 71 | this.contacts = opportunity['contacts'] != null 72 | ? List.from( 73 | opportunity["contacts"].map((x) => Contact.fromJson(x))) 74 | : []; 75 | this.closedBy = opportunity['closed_by'] != null 76 | ? Profile.fromJson(opportunity['closed_by']) 77 | : Profile(); 78 | this.closedOn = 79 | opportunity['closed_on'] != null ? opportunity['closed_on'] : ""; 80 | this.dueDate = 81 | opportunity['due_date'] != null ? opportunity['due_date'] : ""; 82 | this.description = 83 | opportunity['description'] != null ? opportunity['description'] : ""; 84 | this.description = 85 | opportunity['description'] != null ? opportunity['description'] : ""; 86 | this.assignedTo = opportunity['assigned_to'] != null 87 | ? List.from( 88 | opportunity["assigned_to"].map((x) => Profile.fromJson(x))) 89 | : []; 90 | this.createdBy = opportunity['created_by'] != null 91 | ? Profile.fromJson(opportunity['created_by']) 92 | : Profile(); 93 | this.createdOn = opportunity['created_on'] != null 94 | ? DateFormat("dd-MM-yyyy") 95 | .format(DateFormat("yyyy-MM-dd").parse(opportunity['created_on'])) 96 | : ""; 97 | this.isActive = 98 | opportunity['is_active'] != null ? opportunity['is_active'] : false; 99 | this.tags = opportunity['tags'] != null ? opportunity['tags'] : []; 100 | this.teams = opportunity['teams'] != null 101 | ? List.from(opportunity["teams"].map((x) => Team.fromJson(x))) 102 | : []; 103 | this.company = opportunity['company'] != null 104 | ? Company.fromJson(opportunity['company']) 105 | : Company(); 106 | this.createdOnText = opportunity['created_on_arrow'] != null 107 | ? opportunity['created_on_arrow'] 108 | : ""; 109 | this.opportunityAttachment = 110 | opportunity['opportunity_attachment'].length != 0 111 | ? opportunity['opportunity_attachment'] 112 | : []; 113 | } 114 | 115 | toJson() { 116 | return { 117 | 'id': id, 118 | 'name': name, 119 | 'account': account, 120 | 'stage': stage, 121 | 'currency': currency, 122 | 'amount': amount, 123 | 'lead_source': leadSource, 124 | 'probability': probability, 125 | 'contacts': contacts, 126 | 'closed_by': closedBy, 127 | 'closed_on': closedOn, 128 | 'due_date': dueDate, 129 | 'description': description, 130 | 'assigned_to': assignedTo, 131 | 'created_by': createdBy, 132 | 'created_on': createdOn, 133 | 'is_active': isActive, 134 | 'tags': tags, 135 | 'teams': teams, 136 | 'company': company, 137 | 'created_on_arrow': createdOnText, 138 | 'opportunity_attachment': opportunityAttachment 139 | }; 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /lib/model/organization.dart: -------------------------------------------------------------------------------- 1 | class Organization { 2 | int? id; 3 | String? name; 4 | 5 | Organization({this.id, this.name}); 6 | 7 | Organization.fromJson(Map data) { 8 | this.id = data['id'] != null ? data['id'] : 0; 9 | this.name = data['name'] != null ? data['name'] : ""; 10 | } 11 | 12 | toJson() { 13 | return {'id': id, 'name': name}; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/model/profile.dart: -------------------------------------------------------------------------------- 1 | class Profile { 2 | int? id; 3 | String? email; 4 | String? firstName; 5 | String? lastName; 6 | String? profileUrl; 7 | String? role; 8 | bool? isActive; 9 | bool? isAdmin; 10 | bool? isStaff; 11 | bool? hasSalesAccess; 12 | bool? hasMarketingAccess; 13 | String? dateOfJoin; 14 | 15 | Profile( 16 | {this.id, 17 | this.email, 18 | this.firstName, 19 | this.lastName, 20 | this.profileUrl, 21 | this.role, 22 | this.dateOfJoin, 23 | this.hasMarketingAccess, 24 | this.hasSalesAccess, 25 | this.isActive, 26 | this.isAdmin, 27 | this.isStaff}); 28 | 29 | Profile.fromJson(Map profile) { 30 | this.id = profile['user_details']['id'] != null 31 | ? profile['user_details']['id'] 32 | : 0; 33 | this.role = profile['role'] != null ? profile['role'] : ""; 34 | this.profileUrl = profile['user_details']['profile_pic'] != null 35 | ? profile['user_details']['profile_pic'] 36 | : ""; 37 | this.dateOfJoin = 38 | profile['date_of_joining'] != null ? profile['date_of_joining'] : ""; 39 | this.email = profile['user_details']['email'] != null 40 | ? profile['user_details']['email'] 41 | : ""; 42 | this.firstName = profile['user_details']['first_name'] != null 43 | ? profile['user_details']['first_name'] 44 | : ""; 45 | this.lastName = profile['user_details']['last_name'] != null 46 | ? profile['user_details']['last_name'] 47 | : ""; 48 | this.hasMarketingAccess = profile['has_marketing_access'] != null 49 | ? profile['has_marketing_access'] 50 | : false; 51 | this.hasSalesAccess = profile['has_sales_access'] != null 52 | ? profile['has_sales_access'] 53 | : false; 54 | this.isActive = profile['is_active'] != null ? profile['is_active'] : false; 55 | this.isAdmin = profile['is_admin'] != null ? profile['is_admin'] : false; 56 | this.isStaff = profile['is_staff'] != null ? profile['is_staff'] : false; 57 | } 58 | 59 | toJson() { 60 | return { 61 | 'id': id, 62 | 'role': role, 63 | 'profile_pic': profileUrl, 64 | 'date_joined': dateOfJoin, 65 | 'email': email, 66 | 'first_name': firstName, 67 | 'last_name': lastName, 68 | 'has_marketing_access': hasMarketingAccess, 69 | 'has_sales_access': hasSalesAccess, 70 | 'is_active': isActive, 71 | 'is_admin': isAdmin, 72 | 'is_staff': isStaff 73 | }; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/model/settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/lead.dart'; 2 | import 'package:bottle_crm/model/organization.dart'; 3 | import 'package:bottle_crm/model/profile.dart'; 4 | import 'package:intl/intl.dart'; 5 | 6 | class Settings { 7 | int? id; 8 | String? title; 9 | String? website; 10 | Profile? createdBy; 11 | String? createdOn; 12 | List? leadAssignedTo; 13 | List? tags; 14 | Organization? org; 15 | 16 | Settings( 17 | {this.id, 18 | this.title, 19 | this.website, 20 | this.createdBy, 21 | this.createdOn, 22 | this.leadAssignedTo, 23 | this.tags, 24 | this.org}); 25 | 26 | Settings.fromJson(Map settings) { 27 | this.id = settings['id'] != null ? settings['id'] : 0; 28 | this.title = settings['title'] != null ? settings['title'] : ""; 29 | this.website = settings['website'] != null ? settings['website'] : ""; 30 | this.createdBy = settings['created_by'] != null 31 | ? Profile.fromJson(settings['created_by']) 32 | : Profile(); 33 | this.createdOn = settings['created_on'] != null 34 | ? DateFormat("dd-MM-yyyy") 35 | .format(DateFormat("yyyy-MM-dd").parse(settings['created_on'])) 36 | : ""; 37 | 38 | this.leadAssignedTo = settings['lead_assigned_to'] != null 39 | ? List.from( 40 | settings['lead_assigned_to'].map((x) => Lead.fromJson(x))) 41 | : []; 42 | this.tags = settings['tags'] != null ? settings['tags'] : []; 43 | this.org = settings['org'] != null 44 | ? Organization.fromJson(settings['org']) 45 | : Organization(); 46 | } 47 | 48 | toJson() { 49 | return { 50 | 'id': id, 51 | 'title': title, 52 | 'website': website, 53 | 'created_by': createdBy, 54 | 'created_on': createdOn, 55 | 'lead_assigned_to': leadAssignedTo, 56 | 'tags': tags, 57 | 'org': org 58 | }; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/model/task.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/company.dart'; 2 | import 'package:bottle_crm/model/profile.dart'; 3 | import 'package:intl/intl.dart'; 4 | 5 | import 'account.dart'; 6 | import 'company.dart'; 7 | import 'contact.dart'; 8 | import 'profile.dart'; 9 | import 'team.dart'; 10 | 11 | class Task { 12 | int? id; 13 | String? title; 14 | String? status; 15 | String? priority; 16 | String? dueDate; 17 | Account? account; 18 | Profile? createdBy; 19 | String? createdOn; 20 | List? contacts; 21 | List? teams; 22 | List? assignedTo; 23 | Company? company; 24 | 25 | Task( 26 | {this.id, 27 | this.title, 28 | this.status, 29 | this.priority, 30 | this.dueDate, 31 | this.account, 32 | this.createdBy, 33 | this.createdOn, 34 | this.contacts, 35 | this.teams, 36 | this.assignedTo, 37 | this.company}); 38 | 39 | Task.fromJson(Map task) { 40 | this.id = task['id'] != null ? task['id'] : 0; 41 | this.title = task['title'] != null ? task['title'] : ""; 42 | this.status = task['status'] != null ? task['status'] : ""; 43 | this.priority = task['priority'] != null ? task['priority'] : ""; 44 | this.dueDate = task['due_date'] != null ? task['due_date'] : ""; 45 | this.account = task['account'] != null ? task['account'] : Account(); 46 | this.createdBy = task['created_by'] != null 47 | ? Profile.fromJson(task['created_by']) 48 | : Profile(); 49 | this.createdOn = task['created_on'] != null 50 | ? DateFormat("dd-MM-yyyy") 51 | .format(DateFormat("yyyy-MM-dd").parse(task['created_on'])) 52 | : ""; 53 | this.contacts = task['contacts'] != null 54 | ? List.from(task['contacts'].map((x) => Contact.fromJson(x))) 55 | : []; 56 | this.teams = task['teams'] != null 57 | ? List.from(task['teams'].map((x) => Team.fromJson(x))) 58 | : []; 59 | this.assignedTo = task['assigned_to'] != null 60 | ? List.from( 61 | task['assigned_to'].map((x) => Profile.fromJson(x))) 62 | : []; 63 | this.company = 64 | task['company'] != null ? Company.fromJson(task['company']) : Company(); 65 | } 66 | 67 | toJson() { 68 | return { 69 | 'id': id, 70 | 'title': title, 71 | 'status': status, 72 | 'priority': priority, 73 | 'due_date': dueDate, 74 | 'account': account, 75 | 'created_by': createdBy, 76 | 'created_on': createdOn, 77 | 'contacts': contacts, 78 | 'teams': teams, 79 | 'assigned_to': assignedTo, 80 | 'company': company 81 | }; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/model/team.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/model/company.dart'; 2 | import 'package:bottle_crm/model/profile.dart'; 3 | import 'package:intl/intl.dart'; 4 | 5 | class Team { 6 | int? id; 7 | String? name; 8 | String? description; 9 | List? users; 10 | String? createdOn; 11 | Profile? createdBy; 12 | int? createdById; 13 | Company? company; 14 | int? companyId; 15 | String? createdOnText; 16 | 17 | Team( 18 | {this.id, 19 | this.name, 20 | this.description, 21 | this.users, 22 | this.createdOn, 23 | this.createdBy, 24 | this.createdById, 25 | this.company, 26 | this.companyId, 27 | this.createdOnText}); 28 | 29 | Team.fromJson(Map team) { 30 | this.id = team['id'] != null ? team['id'] : 0; 31 | this.name = team['name'] != null ? team['name'] : ""; 32 | this.description = team['description'] != null ? team['description'] : ""; 33 | this.users = team['users'] != null 34 | ? List.from(team['users'].map((x) => Profile.fromJson(x))) 35 | : []; 36 | this.createdOn = team['created_on'] != null 37 | ? DateFormat("dd-MM-yyyy") 38 | .format(DateFormat("yyyy-MM-dd").parse(team['created_on'])) 39 | : ""; 40 | this.createdBy = team['created_by'] != null 41 | ? Profile.fromJson(team['created_by']) 42 | : Profile(); 43 | this.createdById = 44 | team['created_by'] != null ? team['created_by']['id'] : 0; 45 | this.company = 46 | team['company'] != null ? Company.fromJson(team['company']) : Company(); 47 | this.companyId = team['company'] != null ? team['company']['id'] : 0; 48 | this.createdOnText = 49 | team['created_on_arrow'] != null ? team['created_on_arrow'] : ""; 50 | } 51 | 52 | toJson() { 53 | return { 54 | 'id': id, 55 | 'name': name, 56 | 'description': description, 57 | 'users': users, 58 | 'created_on': createdOn, 59 | 'created_by': createdBy, 60 | 'created_by_id': createdById, 61 | 'company': company, 62 | 'company_id': companyId, 63 | 'created_on_arrow': createdOnText, 64 | }; 65 | } 66 | 67 | void forEach(Null Function(dynamic _user) param0) {} 68 | } 69 | -------------------------------------------------------------------------------- /lib/model/user.dart: -------------------------------------------------------------------------------- 1 | class User { 2 | int? id; 3 | String? firstName; 4 | String? lastName; 5 | String? role; 6 | String? email; 7 | String? alternateEmail; 8 | String? phone; 9 | String? alternatePhone; 10 | String? skypeID; 11 | String? profilePic; 12 | bool? hasSalesAccess; 13 | bool? hasMarktingAccess; 14 | String? isMarketingAdmin; 15 | bool? isActive; 16 | String? status; 17 | String? adressLine; 18 | String? street; 19 | String? city; 20 | String? state; 21 | String? pincode; 22 | String? country; 23 | String? description; 24 | 25 | User({ 26 | this.id, 27 | this.firstName, 28 | this.lastName, 29 | this.role, 30 | this.phone, 31 | this.alternatePhone, 32 | this.email, 33 | this.alternateEmail, 34 | this.skypeID, 35 | this.profilePic, 36 | this.hasSalesAccess, 37 | this.hasMarktingAccess, 38 | this.isMarketingAdmin, 39 | this.isActive, 40 | this.status, 41 | this.adressLine, 42 | this.street, 43 | this.city, 44 | this.state, 45 | this.pincode, 46 | this.country, 47 | this.description, 48 | }); 49 | 50 | User.fromJson(Map user) { 51 | this.id = user['id'] != null ? user['id'] : 0; 52 | this.firstName = user['user_details']['first_name'] != null 53 | ? user['user_details']['first_name'] 54 | : ""; 55 | this.lastName = user['user_details']['last_name'] != null 56 | ? user['user_details']['last_name'] 57 | : ""; 58 | this.role = user['role'] != null ? user['role'] : ""; 59 | this.email = user['user_details']['email'] != null 60 | ? user['user_details']['email'] 61 | : ""; 62 | this.alternateEmail = user['user_details']['alternate_email'] != null 63 | ? user['user_details']['alternate_email'] 64 | : ""; 65 | this.phone = user['phone'] != null ? user['phone'] : ""; 66 | this.alternatePhone = 67 | user['alternate_phone'] != null ? user['alternate_phone'] : ""; 68 | this.skypeID = user['user_details']['skype_ID'] != null 69 | ? user['user_details']['skype_ID'] 70 | : ""; 71 | this.profilePic = user['user_details']['profile_pic '] != null 72 | ? user['user_details']['profile_pic '] 73 | : ""; 74 | this.hasSalesAccess = 75 | user['has_sales_access'] != null ? user['has_sales_access'] : ""; 76 | this.hasMarktingAccess = user['has_marketing_access'] != null 77 | ? user['has_marketing_access'] 78 | : ""; 79 | this.isMarketingAdmin = user['is_organization_admin'] != null 80 | ? user['is_organization_admin'] 81 | : ""; 82 | this.description = user['user_details']['description'] != null 83 | ? user['user_details']['description'] 84 | : ""; 85 | this.isActive = user['is_active'] != null ? user['is_active'] : false; 86 | this.status = user['status'] != null ? user['status'] : ""; 87 | this.adressLine = user['address_line'] != null ? user['address_line'] : ""; 88 | this.street = user['street'] != null ? user['street'] : ""; 89 | this.city = user['city'] != null ? user['city'] : ""; 90 | this.state = user['state'] != null ? user['state'] : ""; 91 | this.pincode = user['pincode'] != null ? user['pincode'] : ""; 92 | this.country = user['country'] != null ? user['country'] : ""; 93 | } 94 | 95 | toJson() { 96 | return { 97 | 'id': id, 98 | 'first_name': firstName, 99 | 'last_name': lastName, 100 | 'role': role, 101 | 'email': email, 102 | 'alternate_email': alternateEmail, 103 | 'phone': phone, 104 | 'alternate_phone': alternatePhone, 105 | 'profile_pic': profilePic, 106 | 'skype_ID': skypeID, 107 | 'has_sales_access ': hasSalesAccess, 108 | 'has_marketing_access': hasMarktingAccess, 109 | 'is_organization_admin': isMarketingAdmin, 110 | 'is_active':isActive, 111 | 'status':status, 112 | 'description': description, 113 | 'address_line': adressLine, 114 | 'street': street, 115 | 'state': state, 116 | 'city': city, 117 | 'pincode': pincode, 118 | 'country': country, 119 | }; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /lib/responsive.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Responsive extends StatelessWidget { 4 | final Widget mobile; 5 | final Widget tablet; 6 | final Widget desktop; 7 | 8 | const Responsive({ 9 | Key? key, 10 | required this.mobile, 11 | required this.tablet, 12 | required this.desktop, 13 | }) : super(key: key); 14 | 15 | // This size work fine on my design, maybe you need some customization depends on your design 16 | 17 | // This isMobile, isTablet, isDesktop helep us later 18 | static bool isMobile(BuildContext context) => 19 | MediaQuery.of(context).size.width < 650; 20 | 21 | static bool isTablet(BuildContext context) => 22 | MediaQuery.of(context).size.width < 1100 && 23 | MediaQuery.of(context).size.width >= 650; 24 | 25 | static bool isDesktop(BuildContext context) => 26 | MediaQuery.of(context).size.width >= 1100; 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return LayoutBuilder( 31 | // If our width is more than 1100 then we consider it a desktop 32 | builder: (context, constraints) { 33 | if (constraints.maxWidth >= 1100) { 34 | return desktop; 35 | } 36 | // If width it less then 1100 and more then 650 we consider it as tablet 37 | else if (constraints.maxWidth >= 650) { 38 | return tablet; 39 | } 40 | // Or less then that we called it mobile 41 | else { 42 | return mobile; 43 | } 44 | }, 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/services/network_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:bottle_crm/ui/screens/http_excepion.dart'; 5 | 6 | class NetworkService { 7 | static NetworkService _instance = new NetworkService.internal(); 8 | factory NetworkService() => _instance; 9 | http.Response? response; 10 | var client = http.Client(); 11 | 12 | NetworkService.internal(); 13 | 14 | Future get(var url, {Map? headers}) async { 15 | try { 16 | return client.get(url, headers: headers).then((http.Response response) { 17 | return handleResponse(response); 18 | }); 19 | } on SocketException { 20 | print("=======socket exceptiom"); 21 | throw HttpException("Network Error, check your internet"); 22 | } catch (e) { 23 | print("=======ache"); 24 | throw HttpException("Something Went Wrong"); 25 | } finally { 26 | // client.close(); 27 | } 28 | } 29 | 30 | Future post(Uri url, 31 | {Map? headers, body, encoding}) { 32 | try { 33 | return client 34 | .post(url, headers: headers, body: body, encoding: encoding) 35 | .then((http.Response response) { 36 | return handleResponse(response); 37 | }); 38 | } on FormatException { 39 | print("=========Format Excepion"); 40 | throw HttpException("Server issue"); 41 | } on SocketException { 42 | print("=======socket exceptiom"); 43 | throw HttpException("Network Error, check your internet"); 44 | } catch (e) { 45 | print("=======ache"); 46 | throw HttpException("Something Went Wrongggg"); 47 | } finally { 48 | // client.close(); 49 | } 50 | } 51 | 52 | Future put(Uri url, 53 | {Map? headers, body, encoding}) { 54 | try { 55 | return client 56 | .put(url, headers: headers, body: body, encoding: encoding) 57 | .then((http.Response response) { 58 | return handleResponse(response); 59 | }); 60 | } finally { 61 | // client.close(); 62 | } 63 | } 64 | 65 | Future delete(Uri url, {Map? headers}) { 66 | try { 67 | return client 68 | .delete(url, headers: headers) 69 | .then((http.Response response) { 70 | return handleResponse(response); 71 | }); 72 | } finally { 73 | // client.close(); 74 | } 75 | } 76 | 77 | http.Response handleResponse(http.Response response) { 78 | return response; 79 | } 80 | 81 | // Future get(String url, {Map headers, Map queryParameters}) async { 82 | // _connectivityResult = await (Connectivity().checkConnectivity()); 83 | // if(_connectivityResult == ConnectivityResult.none) { 84 | // response = Response( 85 | // data: { 86 | // 'message' : 'Please check internet connection' 87 | // }, 88 | // statusCode: 0 89 | // ); 90 | // } else { 91 | // response = await dio.get(url, options: Options(headers: headers), queryParameters: queryParameters); 92 | // } 93 | // return handleResponse(response); 94 | // } 95 | } 96 | -------------------------------------------------------------------------------- /lib/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:bottle_crm/responsive.dart'; 4 | import 'package:bottle_crm/utils/utils.dart'; 5 | import 'package:flutter/material.dart'; 6 | //import 'package:connectivity/connectivity.dart'; 7 | import 'package:connectivity_plus/connectivity_plus.dart'; 8 | 9 | import 'package:flutter_svg/svg.dart'; 10 | import 'package:shared_preferences/shared_preferences.dart'; 11 | 12 | import 'bloc/auth_bloc.dart'; 13 | 14 | class SplashScreen extends StatefulWidget { 15 | SplashScreen(); 16 | @override 17 | State createState() => _SplashScreenState(); 18 | } 19 | 20 | class _SplashScreenState extends State { 21 | @override 22 | void initState() { 23 | Timer(Duration(seconds: 3), () => checkInternet()); 24 | super.initState(); 25 | } 26 | 27 | checkInternet() async { 28 | final SharedPreferences preferences = await SharedPreferences.getInstance(); 29 | var connectivityResult = await (Connectivity().checkConnectivity()); 30 | if (connectivityResult == ConnectivityResult.mobile || 31 | connectivityResult == ConnectivityResult.wifi) { 32 | if (preferences.getString('authToken') != null && 33 | preferences.getString('authToken') != "") { 34 | await authBloc.fetchCompanies(); 35 | Navigator.pushReplacementNamed(context, '/companies_List'); 36 | } else { 37 | Navigator.pushReplacementNamed(context, '/login'); 38 | } 39 | } else { 40 | showNoInternet(context); 41 | } 42 | } 43 | 44 | showNoInternet(BuildContext context) { 45 | return showDialog( 46 | context: context, 47 | builder: (_) => AlertDialog( 48 | title: Text('No Internet'), 49 | content: Text('No internet connection!'), 50 | actions: [ 51 | TextButton( 52 | onPressed: () { 53 | Navigator.pop(context); 54 | checkInternet(); 55 | }, 56 | child: Text('RETRY')) 57 | ], 58 | )); 59 | } 60 | 61 | buildMobileScreen() { 62 | return Column( 63 | mainAxisAlignment: MainAxisAlignment.center, 64 | children: [ 65 | SizedBox(height: screenHeight * 0.4), 66 | Container( 67 | margin: EdgeInsets.only(bottom: 30.0), 68 | child: SvgPicture.asset('assets/images/logo.svg', 69 | width: screenWidth * 0.5)), 70 | CircularProgressIndicator( 71 | valueColor: new AlwaysStoppedAnimation(Colors.white)), 72 | SizedBox(height: screenHeight * 0.25), 73 | Container( 74 | child: Column( 75 | children: [ 76 | Text('Free CRM for startups and enterprises.', 77 | style: TextStyle( 78 | color: Colors.white, 79 | fontSize: screenWidth / 25, 80 | fontWeight: FontWeight.bold)), 81 | SizedBox(height: 3.0), 82 | Text('Released as Opensource under MIT License', 83 | style: TextStyle( 84 | color: Colors.white, 85 | fontSize: screenWidth / 25, 86 | fontWeight: FontWeight.bold)) 87 | ], 88 | ), 89 | ) 90 | ], 91 | ); 92 | } 93 | 94 | buildTabletScreen() { 95 | return Column( 96 | mainAxisAlignment: MainAxisAlignment.center, 97 | children: [ 98 | SizedBox(height: screenHeight * 0.4), 99 | Container( 100 | margin: EdgeInsets.only(bottom: 30.0), 101 | child: SvgPicture.asset( 102 | 'assets/images/logo.svg', 103 | width: screenWidth * 0.3, 104 | )), 105 | CircularProgressIndicator( 106 | valueColor: new AlwaysStoppedAnimation(Colors.white)), 107 | SizedBox(height: screenHeight * 0.25), 108 | Container( 109 | child: Column( 110 | children: [ 111 | Text('Free CRM for startups and enterprises.', 112 | style: TextStyle( 113 | color: Colors.white, 114 | fontSize: screenWidth / 40, 115 | fontWeight: FontWeight.bold)), 116 | SizedBox(height: 3.0), 117 | Text('Released as Opensource under MIT License', 118 | style: TextStyle( 119 | color: Colors.white, 120 | fontSize: screenWidth / 40, 121 | fontWeight: FontWeight.bold)) 122 | ], 123 | ), 124 | ) 125 | ], 126 | ); 127 | } 128 | 129 | @override 130 | Widget build(BuildContext context) { 131 | screenWidth = MediaQuery.of(context).size.width; 132 | screenHeight = MediaQuery.of(context).size.height; 133 | return Scaffold( 134 | body: Container( 135 | width: screenWidth, 136 | height: screenHeight, 137 | decoration: BoxDecoration( 138 | image: DecorationImage( 139 | image: AssetImage("assets/images/bg-image-blue.jpg"), 140 | fit: BoxFit.cover, 141 | ), 142 | ), 143 | child: Responsive( 144 | mobile: buildMobileScreen(), 145 | tablet: buildTabletScreen(), 146 | desktop: Container()), 147 | ), 148 | ); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /lib/ui/screens/documents/document_create.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/lib/ui/screens/documents/document_create.dart -------------------------------------------------------------------------------- /lib/ui/screens/documents/document_details.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/lib/ui/screens/documents/document_details.dart -------------------------------------------------------------------------------- /lib/ui/screens/documents/documents_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:bottle_crm/ui/widgets/bottom_navigation_bar.dart'; 3 | 4 | class DocumentsList extends StatefulWidget { 5 | DocumentsList(); 6 | @override 7 | State createState() => _DocumentsListState(); 8 | } 9 | 10 | class _DocumentsListState extends State { 11 | @override 12 | void initState() { 13 | super.initState(); 14 | } 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Scaffold( 19 | appBar: AppBar( 20 | title: Text('Documents List'), 21 | ), 22 | body: Center( 23 | child: Text('No Documents Found'), 24 | ), 25 | bottomNavigationBar: BottomNavigationBarWidget()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/ui/screens/http_excepion.dart: -------------------------------------------------------------------------------- 1 | class HttpException implements Exception { 2 | final String errorMessage; 3 | 4 | HttpException(this.errorMessage); 5 | 6 | @override 7 | String toString() { 8 | return errorMessage; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/ui/screens/invoices/invoice_create.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/lib/ui/screens/invoices/invoice_create.dart -------------------------------------------------------------------------------- /lib/ui/screens/invoices/invoice_details.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroPyramid/flutter-crm/632ee4cef15ccdb80b689399b6f6d4096b11bb82/lib/ui/screens/invoices/invoice_details.dart -------------------------------------------------------------------------------- /lib/ui/screens/invoices/invoices_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:bottle_crm/ui/widgets/bottom_navigation_bar.dart'; 3 | 4 | class InvoicesList extends StatefulWidget { 5 | InvoicesList(); 6 | @override 7 | State createState() => _InvoicesListState(); 8 | } 9 | 10 | class _InvoicesListState extends State { 11 | @override 12 | void initState() { 13 | super.initState(); 14 | } 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Scaffold( 19 | appBar: AppBar( 20 | title: Text('Invoices List'), 21 | ), 22 | body: Center( 23 | child: Text('NO Invoice Found'), 24 | ), 25 | bottomNavigationBar: BottomNavigationBarWidget()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/ui/widgets/dashboard_count_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:bottle_crm/utils/utils.dart'; 3 | import 'package:flutter_svg/svg.dart'; 4 | 5 | class CountCard extends StatelessWidget { 6 | final String? icon; 7 | final Color? color; 8 | final String? lable; 9 | final int? count; 10 | final String? routeName; 11 | final int? index; 12 | CountCard( 13 | {this.icon, 14 | this.color, 15 | this.lable, 16 | this.count, 17 | this.routeName, 18 | this.index}); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return GestureDetector( 23 | onTap: () { 24 | currentBottomNavigationIndex = index.toString(); 25 | Navigator.pushNamed(context, routeName!); 26 | }, 27 | child: Container( 28 | width: screenWidth * 0.46, 29 | height: screenHeight * 0.12, 30 | decoration: BoxDecoration( 31 | color: color, 32 | borderRadius: BorderRadius.all(Radius.circular(10.0)), 33 | border: Border.all(color: Colors.grey.shade300, width: 2.0)), 34 | padding: EdgeInsets.all(10.0), 35 | child: Row( 36 | children: [ 37 | CircleAvatar( 38 | radius: screenWidth / 14, 39 | child: SvgPicture.asset( 40 | icon!, 41 | color: Colors.blueGrey[800], 42 | width: screenWidth / 12, 43 | ), 44 | backgroundColor: Colors.white, 45 | ), 46 | Container( 47 | margin: EdgeInsets.only(left: 10.0), 48 | child: Column( 49 | mainAxisAlignment: MainAxisAlignment.center, 50 | crossAxisAlignment: CrossAxisAlignment.start, 51 | children: [ 52 | Container( 53 | margin: EdgeInsets.only(bottom: 5.0), 54 | child: Text(lable!, 55 | style: TextStyle( 56 | color: Colors.blueGrey[800], 57 | fontWeight: FontWeight.w500, 58 | fontSize: lable == "Opportunities" 59 | ? screenWidth / 30 60 | : screenWidth / 25)), 61 | ), 62 | Container( 63 | child: Text( 64 | count!.toString(), 65 | style: TextStyle( 66 | color: Colors.blueGrey[800], 67 | fontSize: screenWidth / 15, 68 | fontWeight: FontWeight.bold), 69 | ), 70 | ) 71 | ], 72 | ), 73 | ), 74 | ], 75 | ), 76 | ), 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/ui/widgets/loader.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Loader extends StatelessWidget { 4 | Loader(); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | color: Colors.transparent, 10 | width: 300.0, 11 | height: 300.0, 12 | child: new Padding( 13 | padding: const EdgeInsets.all(5.0), 14 | child: new Center(child: new CircularProgressIndicator())), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/ui/widgets/profile_pic_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:bottle_crm/utils/utils.dart'; 3 | import 'package:random_color/random_color.dart'; 4 | 5 | class ProfilePicViewWidget extends StatelessWidget { 6 | final List profilePicsList; 7 | ProfilePicViewWidget(this.profilePicsList); 8 | 9 | List buildProfile() { 10 | List tagWidgets = []; 11 | for (int i = 0; i < profilePicsList.length; i++) { 12 | tagWidgets.add(createProfile(i)); 13 | } 14 | return tagWidgets; 15 | } 16 | 17 | Widget createProfile(profilePicIndex) { 18 | return Container( 19 | margin: EdgeInsets.only(bottom: 5.0), 20 | padding: EdgeInsets.symmetric(horizontal: 1.0, vertical: 2.0), 21 | child: profilePicsList[profilePicIndex] != null && 22 | profilePicsList[profilePicIndex] != "" && 23 | Uri.parse(profilePicsList[profilePicIndex]).isAbsolute 24 | ? CircleAvatar( 25 | radius: screenWidth / 20, 26 | backgroundImage: NetworkImage(profilePicsList[profilePicIndex]), 27 | ) 28 | : CircleAvatar( 29 | radius: screenWidth / 20, 30 | child: Text(profilePicsList[profilePicIndex], 31 | style: TextStyle( 32 | color: Colors.white, fontWeight: FontWeight.bold)), 33 | backgroundColor: randomColor.randomColor( 34 | colorBrightness: ColorBrightness.dark), 35 | ), 36 | ); 37 | } 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | return SingleChildScrollView( 42 | child: Wrap( 43 | alignment: WrapAlignment.start, 44 | spacing: 5.0, 45 | direction: Axis.horizontal, 46 | children: buildProfile(), 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/ui/widgets/recent_card_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:bottle_crm/ui/widgets/tags_widget.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:bottle_crm/utils/utils.dart'; 4 | 5 | class RecentCardWidget extends StatelessWidget { 6 | final String? source; 7 | final String? name; 8 | final String? date; 9 | final String? city; 10 | final String? email; 11 | final String? photoUrl; 12 | final String? createdBy; 13 | final List? tags; 14 | 15 | RecentCardWidget( 16 | {this.source, 17 | this.name, 18 | this.date, 19 | this.city, 20 | this.email, 21 | this.photoUrl, 22 | this.createdBy, 23 | this.tags}); 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Container( 28 | // height: screenHeight * 0.09, 29 | //color: Colors.white, 30 | padding: EdgeInsets.all(10.0), 31 | margin: EdgeInsets.symmetric(horizontal: 10.0, vertical: 5.0), 32 | decoration: BoxDecoration( 33 | border: Border.all(width: 1.0, color: Colors.grey), 34 | borderRadius: BorderRadius.all(Radius.circular(5.0)), 35 | ), 36 | child: Column( 37 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 38 | children: [ 39 | Row( 40 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 41 | children: [ 42 | Container( 43 | width: screenWidth * 0.5, 44 | child: Text(name!.capitalizeFirstofEach(), 45 | style: TextStyle( 46 | overflow: TextOverflow.ellipsis, 47 | color: Colors.black87, 48 | fontWeight: FontWeight.w600, 49 | fontSize: screenWidth / 21))), 50 | Container( 51 | width: screenWidth * 0.3, 52 | child: Row( 53 | mainAxisAlignment: MainAxisAlignment.end, 54 | children: [ 55 | photoUrl != "" 56 | ? CircleAvatar( 57 | radius: screenWidth / 28, 58 | backgroundImage: NetworkImage(photoUrl!), 59 | ) 60 | : CircleAvatar( 61 | radius: screenWidth / 30, 62 | backgroundColor: Theme.of(context).primaryColor, 63 | child: Text( 64 | createdBy![0].allInCaps, 65 | style: TextStyle( 66 | color: Colors.white, 67 | fontWeight: FontWeight.bold), 68 | ), 69 | ), 70 | SizedBox(width: 5.0), 71 | Text(createdBy!.capitalizeFirstofEach(), 72 | style: TextStyle( 73 | overflow: TextOverflow.ellipsis, 74 | color: Colors.blueGrey[800], 75 | fontWeight: FontWeight.w500, 76 | fontSize: screenWidth / 25)) 77 | ], 78 | ), 79 | ) 80 | ], 81 | ), 82 | Row( 83 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 84 | children: [ 85 | Container(width: screenWidth * 0.5, child: TagViewWidget(tags!)), 86 | Text(date!, 87 | overflow: TextOverflow.ellipsis, 88 | style: TextStyle( 89 | color: bottomNavBarTextColor, 90 | fontSize: screenWidth / 26)), 91 | ], 92 | ), 93 | ], 94 | ), 95 | ); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /lib/ui/widgets/tags_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:bottle_crm/utils/utils.dart'; 3 | import 'package:random_color/random_color.dart'; 4 | 5 | class TagViewWidget extends StatelessWidget { 6 | final List tags; 7 | TagViewWidget(this.tags); 8 | 9 | List buildTags() { 10 | List tagWidgets = []; 11 | for (int i = 0; i < tags.length; i++) { 12 | tagWidgets.add(createTag(i)); 13 | } 14 | return tagWidgets; 15 | } 16 | 17 | Widget createTag(tagIndex) { 18 | return Container( 19 | margin: EdgeInsets.only(bottom: 5.0), 20 | padding: EdgeInsets.symmetric(horizontal: 5.0, vertical: 3.0), 21 | color: randomColor.randomColor(colorBrightness: ColorBrightness.light), 22 | child: Text( 23 | tags[tagIndex]['name'], 24 | style: TextStyle(color: Colors.white, fontSize: 12.0), 25 | ), 26 | ); 27 | } 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return SingleChildScrollView( 32 | child: Wrap( 33 | alignment: WrapAlignment.start, 34 | spacing: 5.0, 35 | direction: Axis.horizontal, 36 | children: buildTags(), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/utils/utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:bottle_crm/bloc/account_bloc.dart'; 4 | import 'package:bottle_crm/bloc/auth_bloc.dart'; 5 | import 'package:bottle_crm/bloc/case_bloc.dart'; 6 | import 'package:bottle_crm/bloc/contact_bloc.dart'; 7 | import 'package:bottle_crm/bloc/dashboard_bloc.dart'; 8 | import 'package:bottle_crm/bloc/event_bloc.dart'; 9 | import 'package:bottle_crm/bloc/lead_bloc.dart'; 10 | import 'package:bottle_crm/bloc/opportunity_bloc.dart'; 11 | import 'package:bottle_crm/bloc/setting_bloc.dart'; 12 | import 'package:bottle_crm/bloc/task_bloc.dart'; 13 | import 'package:bottle_crm/bloc/team_bloc.dart'; 14 | import 'package:bottle_crm/bloc/user_bloc.dart'; 15 | import 'package:flutter/material.dart'; 16 | import 'package:fluttertoast/fluttertoast.dart'; 17 | import 'package:random_color/random_color.dart'; 18 | import 'package:flutter_styled_toast/flutter_styled_toast.dart'; 19 | 20 | var screenWidth; 21 | var screenHeight; 22 | // Color submitButtonColor = Color.fromRGBO(75, 153, 90, 1); 23 | // Color bottomNavBarSelectedBGColor = Color.fromRGBO(219, 232, 249, 1); 24 | // Color bottomNavBarSelectedTextColor = Color.fromRGBO(15, 36, 62, 1); 25 | // Color bottomNavBarTextColor = Color.fromRGBO(75, 75, 78, 1); 26 | String currentBottomNavigationIndex = "0"; 27 | String currentTopBarModuleName = "Dashboard"; 28 | Color bottomNavBarTextColor = Color.fromRGBO(75, 75, 78, 1); 29 | Color submitButtonColor = Color.fromRGBO(75, 153, 90, 1); 30 | Color bottomNavBarSelectedBGColor = Color.fromRGBO(219, 232, 249, 1); 31 | Color bottomNavBarSelectedTextColor = Color.fromRGBO(15, 36, 62, 1); 32 | 33 | RandomColor randomColor = RandomColor(); 34 | 35 | fetchRequiredData() async { 36 | print("fetching data ▁ ▂ ▃ ▄ ▅ ▆"); 37 | await authBloc.getProfileDetails(); 38 | await dashboardBloc.fetchDashboardDetails(); 39 | await leadBloc.fetchLeads(); 40 | await accountBloc.fetchAccounts(); 41 | await contactBloc.fetchContacts(); 42 | await opportunityBloc.fetchOpportunities(); 43 | await caseBloc.fetchCases(); 44 | await userBloc.fetchUsers(); 45 | await taskBloc.fetchTasks(); 46 | await teamBloc.fetchTeams(); 47 | await eventBloc.fetchEvents(); 48 | await settingsBloc.fetchApiSettings(); 49 | print("✓ data fetched successfully"); 50 | } 51 | 52 | OutlineInputBorder boxBorder() { 53 | return OutlineInputBorder( 54 | // borderRadius: BorderRadius.all(Radius.circular(15)), 55 | borderSide: BorderSide(width: 0, color: Colors.white), 56 | ); 57 | } 58 | 59 | extension CapExtension on String { 60 | String get inCaps => '${this[0].toUpperCase()}${this.substring(1)}'; 61 | String get allInCaps => this.toUpperCase(); 62 | String capitalizeFirstofEach() => 63 | this.split(" ").map((str) => str.inCaps).join(" "); 64 | } 65 | 66 | DateTime? currentBackPressTime; 67 | Future onWillPop() { 68 | DateTime now = DateTime.now(); 69 | if (currentBackPressTime == null || 70 | now.difference(currentBackPressTime!) > Duration(seconds: 2)) { 71 | currentBackPressTime = now; 72 | Fluttertoast.showToast(msg: 'Press again to close Bottle CRM'); 73 | return Future.value(false); 74 | } 75 | exit(0); 76 | } 77 | 78 | // showToast(message) { 79 | // Fluttertoast.showToast( 80 | // msg: message, 81 | // toastLength: Toast.LENGTH_LONG, 82 | // gravity: ToastGravity.CENTER, 83 | // timeInSecForIosWeb: 1, 84 | // backgroundColor: Colors.blue, 85 | // textColor: Colors.white, 86 | // fontSize: screenWidth / 26, 87 | // ); 88 | // } 89 | 90 | showToaster(message, context) { 91 | showToast( 92 | message, 93 | context: context, 94 | animation: StyledToastAnimation.scale, 95 | reverseAnimation: StyledToastAnimation.fade, 96 | position: StyledToastPosition.bottom, 97 | animDuration: Duration(seconds: 1), 98 | duration: Duration(seconds: 4), 99 | curve: Curves.elasticOut, 100 | reverseCurve: Curves.linear, 101 | ); 102 | } 103 | 104 | TextStyle buildLableTextStyle() { 105 | return TextStyle( 106 | fontSize: screenWidth / 25, 107 | fontWeight: FontWeight.w500, 108 | color: Colors.blueGrey); 109 | } 110 | -------------------------------------------------------------------------------- /lib/utils/validations.dart: -------------------------------------------------------------------------------- 1 | class FieldValidators { 2 | static String? emailFieldValidation(String value) { 3 | if (value.isEmpty) return "Please Enter Email "; 4 | 5 | RegExp regExp = new RegExp( 6 | r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)*$"); 7 | 8 | if (value.isNotEmpty && !regExp.hasMatch(value)) { 9 | return "Please Enter Valid Email "; 10 | } 11 | return null; 12 | } 13 | 14 | static String? passwordValidation(String value) { 15 | if (value.isEmpty) return "Please Enter Password"; 16 | return null; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: bottle_crm 2 | description: A new Flutter project. 3 | 4 | publish_to: 'none' 5 | 6 | version: 1.0.16+16 7 | 8 | environment: 9 | sdk: '>=2.12.2 <3.0.0' 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | cupertino_icons: ^1.0.4 16 | http: ^0.13.4 17 | file_picker: ^4.6.1 18 | connectivity_plus: ^2.3.5 19 | flutter_svg: ^1.1.0 20 | intl: ^0.17.0 21 | shared_preferences: ^2.0.15 22 | fluttertoast: ^8.0.9 23 | flutter_styled_toast: ^2.1.3 24 | random_color: ^1.0.6-nullsafety 25 | dropdown_search: ^5.0.2 26 | textfield_tags: ^2.0.1 27 | multiselect_formfield: ^0.1.7 28 | flutter_quill: ^5.0.3 29 | firebase_analytics: ^9.1.12 30 | firebase_core: ^1.19.1 31 | flutter_swipe_detector: ^2.0.0 32 | 33 | 34 | flutter_icons: 35 | android: "launcher_icon" 36 | ios: true 37 | image_path: "assets/images/new_logo.png" 38 | 39 | dev_dependencies: 40 | flutter_test: 41 | sdk: flutter 42 | 43 | flutter_launcher_icons: ^0.9.2 44 | 45 | flutter: 46 | 47 | uses-material-design: true 48 | 49 | assets: 50 | - assets/images/ 51 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:bottle_crm/bloc/auth_bloc.dart'; 9 | import 'package:bottle_crm/main.dart'; 10 | import 'package:bottle_crm/utils/validations.dart'; 11 | import 'package:flutter/material.dart'; 12 | import 'package:flutter_test/flutter_test.dart'; 13 | 14 | // import 'package:mobile2/main.dart'; 15 | 16 | void main() { 17 | group("Login Page", () { 18 | test("Email should Not be Empty", () async{ 19 | Map result = await authBloc.login({"email": "", "password": ""}); 20 | expect(true, result['error']); 21 | }); 22 | 23 | test("Password should Not be Empty", () { 24 | var result = FieldValidators.passwordValidation(""); 25 | expect("Please Enter Password", result); 26 | }); 27 | }); 28 | // testWidgets('Counter increments smoke test', (WidgetTester tester) async { 29 | // // Build our app and trigger a frame. 30 | // await tester.pumpWidget(MyApp()); 31 | 32 | // // Verify that our counter starts at 0. 33 | // expect(find.text('0'), findsOneWidget); 34 | // expect(find.text('1'), findsNothing); 35 | 36 | // // Tap the '+' icon and trigger a frame. 37 | // await tester.tap(find.byIcon(Icons.add)); 38 | // await tester.pump(); 39 | 40 | // // Verify that our counter has incremented. 41 | // expect(find.text('0'), findsNothing); 42 | // expect(find.text('1'), findsOneWidget); 43 | // }); 44 | } 45 | --------------------------------------------------------------------------------