├── .gitignore ├── .metadata ├── LICENSE.md ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── ebuzz │ │ │ │ └── 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 ├── ambibuzzlogo.png ├── fonts │ ├── Roboto-Bold.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-Medium.ttf │ └── Roboto-Regular.ttf ├── inf.jpg └── logo.png ├── integration_test ├── app_test.dart └── driver.dart ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── app.dart ├── bom │ ├── model │ │ └── bom_model.dart │ ├── service │ │ └── bom_api_service.dart │ └── ui │ │ └── bom_ui.dart ├── common │ ├── circular_progress.dart │ ├── colors.dart │ ├── custom_alert_dailog.dart │ ├── custom_appbar.dart │ ├── custom_toast.dart │ ├── display_helper.dart │ ├── gradient_button.dart │ ├── linear_progress.dart │ ├── navigations.dart │ ├── round_button.dart │ ├── setting_tile.dart │ └── ui_reusable_widget.dart ├── common_models │ ├── item_group.dart │ ├── item_price_model.dart │ ├── items_model.dart │ ├── product.dart │ ├── quotation_model.dart │ └── user.dart ├── common_service │ └── common_service.dart ├── config │ ├── color_palette.dart │ └── palette.dart ├── exception │ └── custom_exception.dart ├── home │ ├── model │ │ └── globaldefaultsmodel.dart │ ├── service │ │ └── home_service.dart │ └── ui │ │ └── home.dart ├── item │ ├── model │ │ ├── item.dart │ │ └── warehouse_quantity.dart │ ├── service │ │ └── item_api_service.dart │ └── ui │ │ └── item_ui.dart ├── leavebalance │ ├── service │ │ └── leave_balance_api_service.dart │ └── ui │ │ └── leave_balance_ui.dart ├── leavelist │ ├── model │ │ └── employee_leave.dart │ ├── service │ │ └── leave_list_api_service.dart │ └── ui │ │ └── leave_list_ui.dart ├── login │ ├── service │ │ └── login_api_service.dart │ └── ui │ │ └── login.dart ├── logout │ └── service │ │ └── logout_api_service.dart ├── main.dart ├── network │ └── base_dio.dart ├── purchaseorder │ ├── model │ │ └── purchase_model.dart │ ├── service │ │ └── purchase_api_service.dart │ └── ui │ │ ├── purchase_order_detail.dart │ │ └── purchase_order_ui.dart ├── purchasereciept │ ├── model │ │ └── purchase_reciept_model.dart │ ├── service │ │ └── purchase_reciept_service.dart │ └── ui │ │ └── purchase_reciept_Form_ui.dart ├── qualityinspection │ ├── model │ │ ├── quality_inspection_model.dart │ │ └── reference_type_model.dart │ ├── service │ │ └── quality_inspection_service.dart │ └── ui │ │ ├── qiform1.dart │ │ ├── qiform2.dart │ │ ├── qiform3.dart │ │ ├── qiform4.dart │ │ ├── qiform5.dart │ │ ├── quality_inspection_detail_ui.dart │ │ └── quality_inspection_list_ui.dart ├── quotation │ ├── model │ │ ├── quotation.dart │ │ └── quotation_item.dart │ ├── service │ │ └── quotation_service.dart │ └── ui │ │ ├── quotation_detail.dart │ │ └── quotation_list_ui.dart ├── salesorder │ ├── model │ │ └── sales_order.dart │ ├── service │ │ └── sales_order_service.dart │ └── ui │ │ ├── sales_order_detail_ui.dart │ │ ├── sales_order_form1.dart │ │ ├── sales_order_form2.dart │ │ └── sales_order_list_ui.dart ├── settings │ └── ui │ │ └── settings.dart ├── stockentry │ ├── model │ │ └── stockentry.dart │ ├── service │ │ └── stock_entry_service.dart │ └── ui │ │ ├── stock_entry_detail.dart │ │ └── stock_entry_list.dart ├── util │ ├── apiurls.dart │ ├── constants.dart │ ├── doctype_names.dart │ ├── linear_gradients.dart │ ├── preference.dart │ └── version.dart ├── widgets │ ├── card_list_tile.dart │ ├── custom_card.dart │ ├── custom_dropdown.dart │ ├── custom_textformformfield.dart │ ├── custom_typeahead_formfield.dart │ ├── item_detail_widget.dart │ ├── typeahead_widgets.dart │ └── unique_warehouse_list.dart └── workorder │ ├── model │ └── workorder_model.dart │ ├── service │ └── workorder_service.dart │ └── ui │ ├── workorder_detailui.dart │ └── workorder_ui.dart ├── pubspec.lock ├── pubspec.yaml ├── screenshots ├── BoMSearch-2.png ├── BoMSearch-3.png ├── BoMSearch.png ├── Dashboard.png ├── ItemSearch.png ├── ItemSearch2.png ├── LeaveBalanceDashboard.png ├── LoginScreen.png ├── Logout.png ├── PurchaseOrderDetails.png ├── PurchaseOrderList.png ├── PurchaseReceiptDetails.png ├── QualityInspectionDetails.png ├── QualityInspectionForm-2.png ├── QualityInspectionForm-3.png ├── QualityInspectionForm-4.png ├── QualityInspectionList.png ├── SalesOrderForm-2.png ├── SalesOrderForm-3-List.png ├── StockEntryDetails.png ├── StockEntryList.png └── WorkOrderDetails.png ├── test ├── bom_test.dart ├── home_test.dart ├── leave_balance_test.dart ├── login_test.dart ├── purchase_receipt_test.dart ├── quality_inspection_test.dart ├── settings_test.dart ├── unique_warehouse_list_test.dart └── work_order_test.dart └── web ├── favicon.png ├── icons ├── Icon-192.png └── Icon-512.png ├── index.html └── manifest.json /.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 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /.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: b0a22998593fc605c723dee8ff4d9315c32cfe2c 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ambibuzz Technologies LLP 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ebuzz 2 | ### A Flutter application as a ERPNext Frontend for simplified data entry and report access. 3 | 4 | ### To run code 5 | Clone the source code
6 | ```sh 7 | git clone https://github.com/Ambibuzz/ebuzz.git 8 | ``` 9 | Then go to cloned directory
10 | For installing packages
11 | ```sh 12 | pub packages get 13 | ``` 14 | To run the project
15 | ```sh 16 | flutter run 17 | ``` 18 | To run test cases
19 | ```sh 20 | flutter test 21 | ``` 22 | 23 | ### Packages Used 24 | 25 | | Package Name | Version | 26 | | ----------------------- | ------------- | 27 | | autocomplete_textfield | 1.7.3 | 28 | | cupertino_icons | 0.1.3 | 29 | | dio | 3.0.10 | 30 | | flutter_barcode_scanner | 1.0.1 | 31 | | flutter_spinkit | 4.1.2+1 | 32 | | flutter_typeahead | 1.8.8 | 33 | | fluttertoast | 7.1.1 | 34 | | get | 3.15.0 | 35 | | http | 0.12.2 | 36 | | shared_preferences | 0.5.10 | 37 | | intl | 0.16.1 | 38 | 39 | ## Modules 40 | 41 | **loginpage :** 42 | User need to enter baseurl,username and password after entering these credentials user can login
43 | Baseurl uses autocomplete functionality so when user enters url next time it suggests url which user had entered previously

44 | **Homepage :**
45 | Homepage contains bom ,item ,purchase order ,leave balance leave list ,work order ,quality inspection ,stock entry .

46 | **Bom :**
47 | Bom(Bill Of Material) takes itemcode as input and returns list of itemcode and itemname and their warehouse name and quantity.

48 | **Item:**
49 | Item takes itemcode or itemname as input or user can scan barcode which will return itemcode if valid and then user gets details about that particular item.

50 | **Purchase Order:**
51 | It returns list of purchase order which contain supplier name and id.
52 | User can press particular list item for getting detail of it which contains detail of that purchase order.

53 | User can press button in bottom right to create purchase reciept.

54 | **Purchase Reciept:**
55 | In purchase reciept form user can only edit quantity rest other fields are readable only also user can delete items and the form is saved as draft when user saves the form

56 | **Leave balance:**
57 | Based on the username it gives leave balance of particukar user.

58 | **Leave list :**
59 | Leave list displays list of leaves applied by user which contains date ,approver name and its status which can be approved or rejected green dot means approved and red means rejected.

60 | **Work Order :**
61 | Work Order displays list of work orders which shows itemcode ,itemname ,expected date and status in list tiles and when user clicks on particlar work order tile it shows complete detail of that work order.

62 | **Quality Inspection :**
63 | Quality inspection displays list of quality inspections which contains name ,inspection type ,itemcode ,status in list tiles and when user clicks on particlar quality inspection tile it shows complete detail of that quality inspection
64 | User can press button in bottom right to create quality inspection form.

65 | **Quality Inspection Form :**
66 | Form is divided into multiple screens.
67 | First screen takes date ,inspection type ,reference type as input.
68 | Second screen displays previous screen details and takes reference name as input.
69 | Third screen displays previous screen details and takes item name as input.
70 | Fourth screen displays previous screen details and takes quality inspection template ,status as input and autofills item code ,sample size based on item name.
71 | Fifth screen displays quality inspection template and takes input in form of readings based on quality inspection template and after that user can save form which is saved as draft.

72 | **Stock Entry :**
73 | Stock Entry displays list of stock entries which shows stock entry type ,posting date and status in list tiles and when user clicks on particlar entry tile it shows complete detail of that stock entry.

74 | 75 | ### Future Plans 76 | Configuration for ios 77 | 78 | ### License 79 | MIT 80 | -------------------------------------------------------------------------------- /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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | sourceSets { 31 | main.java.srcDirs += 'src/main/kotlin' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.app.ebuzz" 37 | minSdkVersion 19 38 | targetSdkVersion 30 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | multiDexEnabled true 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | shrinkResources false 50 | minifyEnabled false 51 | useProguard true 52 | } 53 | } 54 | } 55 | 56 | flutter { 57 | source '../..' 58 | } 59 | 60 | dependencies { 61 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 62 | implementation 'com.android.support:multidex:2.0.1' 63 | } 64 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 9 | 16 | 20 | 24 | 29 | 33 | 34 | 35 | 36 | 37 | 38 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/ebuzz/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.app.ebuzz 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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-hdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-mdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:4.1.0' 9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | } 18 | } 19 | 20 | rootProject.buildDir = '../build' 21 | subprojects { 22 | project.buildDir = "${rootProject.buildDir}/${project.name}" 23 | } 24 | subprojects { 25 | project.evaluationDependsOn(':app') 26 | } 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true -------------------------------------------------------------------------------- /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-6.7-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/ambibuzzlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/assets/ambibuzzlogo.png -------------------------------------------------------------------------------- /assets/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/assets/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/assets/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/assets/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/assets/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /assets/inf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/assets/inf.jpg -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/assets/logo.png -------------------------------------------------------------------------------- /integration_test/app_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter integration 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:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | import 'package:ebuzz/main.dart' as app; 11 | 12 | void main() => _testMain; 13 | 14 | void _testMain() { 15 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 16 | // Build our app and trigger a frame. 17 | app.main(); 18 | 19 | // Trigger a frame. 20 | await tester.pumpAndSettle(); 21 | 22 | // Verify that our counter starts at 0. 23 | expect(find.text('0'), findsOneWidget); 24 | expect(find.text('1'), findsNothing); 25 | 26 | // Tap the '+' icon and trigger a frame. 27 | await tester.tap(find.byIcon(Icons.add)); 28 | await tester.pump(); 29 | 30 | // Verify that our counter has incremented. 31 | expect(find.text('0'), findsNothing); 32 | expect(find.text('1'), findsOneWidget); 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /integration_test/driver.dart: -------------------------------------------------------------------------------- 1 | // This file is provided as a convenience for running integration tests via the 2 | // flutter drive command. 3 | // 4 | // flutter drive --driver integration_test/driver.dart --target integration_test/app_test.dart 5 | 6 | import 'package:integration_test/integration_test_driver.dart'; 7 | 8 | Future main() => integrationDriver(); 9 | -------------------------------------------------------------------------------- /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/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /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 "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 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 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/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 | ebuzz 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/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/home/ui/home.dart'; 2 | import 'package:ebuzz/login/ui/login.dart'; 3 | import 'package:ebuzz/util/constants.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | import 'package:get/get.dart'; 7 | import 'package:get/get_navigation/get_navigation.dart'; 8 | import 'package:google_fonts/google_fonts.dart'; 9 | 10 | class App extends StatelessWidget { 11 | final bool? login; 12 | const App({this.login}); 13 | @override 14 | Widget build(BuildContext context) { 15 | return ProviderScope( 16 | child: GetMaterialApp( 17 | title: Constants.appName, 18 | debugShowCheckedModeBanner: false, 19 | theme: ThemeData( 20 | textTheme: GoogleFonts.interTextTheme( 21 | Theme.of(context).textTheme.apply(), 22 | ), 23 | disabledColor: Colors.black, 24 | primaryColor: Colors.white, 25 | accentColor: Colors.white, 26 | ), 27 | home: login == true ? Home() : Login(), 28 | ), 29 | ); 30 | } 31 | } -------------------------------------------------------------------------------- /lib/bom/model/bom_model.dart: -------------------------------------------------------------------------------- 1 | //BomModel class contains model to store data of Bom api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | 4 | class BomModel { 5 | final String? itemCode; 6 | final String? name; 7 | BomModel({this.itemCode, this.name}); 8 | 9 | //For fetching json data from bom api and storing it in bom model 10 | factory BomModel.fromJson(Map json) { 11 | return BomModel( 12 | itemCode: json['item_code'] ?? '', 13 | name: json['item_name'] ?? '', 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/bom/service/bom_api_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:dio/dio.dart'; 3 | import 'package:ebuzz/bom/model/bom_model.dart'; 4 | import 'package:ebuzz/common/colors.dart'; 5 | import 'package:ebuzz/exception/custom_exception.dart'; 6 | import 'package:ebuzz/network/base_dio.dart'; 7 | import 'package:ebuzz/util/apiurls.dart'; 8 | import 'package:flutter/cupertino.dart'; 9 | import 'package:fluttertoast/fluttertoast.dart'; 10 | 11 | //BomApiService class contains function for fetching data or posting data 12 | class BomApiService { 13 | //For fetching list of itemcodes for bom 14 | Future> getBomItemCodeList(String text, BuildContext context) async { 15 | List bomList = []; 16 | try { 17 | Dio _dio = await BaseDio().getBaseDio(); 18 | final String itemList = itemDataUrl(text); 19 | final response = await _dio.get( 20 | itemList, 21 | ); 22 | var data = response.data; 23 | String bomName = data['data']['default_bom']; 24 | if (bomName.isNotEmpty) { 25 | final String bomurl = bomUrl(bomName); 26 | final bomResponse = await _dio.get( 27 | bomurl, 28 | ); 29 | var bomData = bomResponse.data; 30 | List list = bomData['data']['items']; 31 | for (int i = 0; i < list.length; i++) { 32 | bomList.add(list[i]['item_code']); 33 | } 34 | } 35 | if (bomName.isEmpty) { 36 | Fluttertoast.showToast( 37 | msg: 'No Bom Data Found', 38 | textColor: whiteColor, 39 | backgroundColor: blueAccent, 40 | gravity: ToastGravity.BOTTOM, 41 | toastLength: Toast.LENGTH_LONG); 42 | } 43 | return bomList; 44 | } catch (e) { 45 | exception(e,context); 46 | } 47 | return bomList; 48 | } 49 | 50 | //For fetching list of itemcodes and itemnames for bom 51 | Future> getBomItemCodeAndNameList(String text, BuildContext context) async { 52 | List bomNameAndCodeList = []; 53 | try { 54 | Dio _dio = await BaseDio().getBaseDio(); 55 | final String itemList = itemDataUrl(text); 56 | final response = await _dio.get( 57 | itemList, 58 | ); 59 | var data = response.data; 60 | String bomName = data['data']['default_bom']; 61 | if (bomName.isNotEmpty) { 62 | final String bomurl = bomUrl(bomName); 63 | final bomResponse = await _dio.get( 64 | bomurl, 65 | ); 66 | var bomData = bomResponse.data; 67 | List list = bomData['data']['items']; 68 | bomNameAndCodeList = 69 | list.map((item) => BomModel.fromJson(item)).toList(); 70 | } 71 | if (bomName.isEmpty) { 72 | Fluttertoast.showToast( 73 | msg: 'No Bom Data Found', 74 | textColor: whiteColor, 75 | backgroundColor: blueAccent, 76 | gravity: ToastGravity.BOTTOM, 77 | toastLength: Toast.LENGTH_LONG); 78 | } 79 | return bomNameAndCodeList; 80 | } catch (e) { 81 | exception(e,context); 82 | } 83 | return bomNameAndCodeList; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/common/circular_progress.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | //CircularProgress class displays circular progress indicator or loader in app 5 | class CircularProgress extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Center( 9 | child: CircularProgressIndicator(backgroundColor: blueAccent,), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/common/colors.dart: -------------------------------------------------------------------------------- 1 | //It contains all colors used in app 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | Color blueColor = Color(0xFF3282b8); 6 | Color bgColor = Color(0xFFF3F3F3); 7 | Color blueAccent = Colors.blueAccent; 8 | Color blackColor = Colors.black; 9 | Color whiteColor = Colors.white; 10 | Color greyLightColor = Colors.grey; 11 | Color greyColor = Color(0xFFE7E5E5); 12 | Color greyDarkColor = Colors.grey; 13 | Color skyColor = Color(0xFFbbe1fa); 14 | Color darkBlueColor = Color(0xFF0f4c75); 15 | Color violetColor = Color(0xFF1b262c); 16 | Color redColor = Colors.red; 17 | Color greenColor = Colors.green; 18 | Color orangeColor = Colors.orange; 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /lib/common/custom_alert_dailog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void customAlertDialog({ 4 | required BuildContext context, 5 | required Widget content, 6 | required Widget title, 7 | required List actions}) { 8 | showDialog( 9 | context: context, 10 | builder: (ctx) { 11 | return AlertDialog( 12 | elevation: 2, 13 | content: content, 14 | title: title, 15 | actions: actions, 16 | ); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /lib/common/custom_appbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | //It contains appbar which is used throughout the app 5 | class CustomAppBar extends StatelessWidget { 6 | final List? actions; 7 | final double? elevation; 8 | final bool? centerTitle; 9 | final Widget? title; 10 | final Widget? leading; 11 | final bool automaticallyImplyLeading; 12 | CustomAppBar( 13 | {required this.title, 14 | this.actions, 15 | this.elevation = 1, 16 | this.centerTitle = false, 17 | this.leading, 18 | this.automaticallyImplyLeading = true}); 19 | @override 20 | Widget build(BuildContext context) { 21 | return AppBar( 22 | backgroundColor: blueAccent, 23 | actions: actions, 24 | leading: leading, 25 | automaticallyImplyLeading: automaticallyImplyLeading, 26 | elevation: elevation, 27 | centerTitle: centerTitle, 28 | title: title, 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/common/custom_toast.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:fluttertoast/fluttertoast.dart'; 3 | 4 | //It displays toast message throughout the app 5 | 6 | fluttertoast(Color textColor, Color backgroundColor, String message) { 7 | return Fluttertoast.showToast( 8 | msg: message, 9 | textColor: textColor, 10 | backgroundColor: backgroundColor, 11 | gravity: ToastGravity.BOTTOM, 12 | toastLength: Toast.LENGTH_LONG); 13 | } 14 | -------------------------------------------------------------------------------- /lib/common/display_helper.dart: -------------------------------------------------------------------------------- 1 | //It is used for setting width and height based on the the device in the app 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | Size displaySize(BuildContext context) { 6 | return MediaQuery.of(context).size; 7 | } 8 | 9 | double displayHeight(BuildContext context) { 10 | return displaySize(context).height; 11 | } 12 | 13 | double displayWidth(BuildContext context) { 14 | return displaySize(context).width; 15 | } -------------------------------------------------------------------------------- /lib/common/gradient_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GradientButton extends StatefulWidget { 4 | final void Function()? onPressed; 5 | final Widget? child; 6 | final Gradient? gradient; 7 | final double? width; 8 | final double? height; 9 | const GradientButton( 10 | {@required this.onPressed, 11 | @required this.child, 12 | @required this.gradient, 13 | this.width, 14 | this.height}); 15 | 16 | @override 17 | _GradientButtonState createState() => _GradientButtonState(); 18 | } 19 | 20 | class _GradientButtonState extends State { 21 | @override 22 | Widget build(BuildContext context) { 23 | return Container( 24 | width: widget.width, 25 | height: widget.height, 26 | decoration: BoxDecoration( 27 | gradient: widget.gradient, 28 | borderRadius: BorderRadius.circular(10), 29 | ), 30 | child: Material( 31 | color: Colors.transparent, 32 | child: GestureDetector( 33 | onTap: widget.onPressed, 34 | child: widget.child, 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/common/linear_progress.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'colors.dart'; 3 | 4 | //LinearProgress class displays linear progress indicator or loader which is not circular but linear in app 5 | class LinearProgress extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Center( 9 | child: LinearProgressIndicator( 10 | backgroundColor: blueAccent, 11 | ), 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/common/navigations.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //It contains reusable function which can be used for navigation purpose by reducing boiler plate code 4 | pushScreen(BuildContext context, Widget route) { 5 | Navigator.push( 6 | context, 7 | MaterialPageRoute(builder: (context) => route), 8 | ); 9 | } 10 | 11 | pushReplacementScreen(BuildContext context, Widget route) { 12 | Navigator.pushReplacement( 13 | context, 14 | MaterialPageRoute(builder: (context) => route), 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /lib/common/round_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class RoundButton extends StatelessWidget { 4 | final void Function()? onPressed; 5 | final Widget? child; 6 | final Color? primaryColor; 7 | final Color? onPrimaryColor; 8 | final double elevation; 9 | const RoundButton( 10 | {required this.onPressed, 11 | required this.child, 12 | required this.primaryColor, 13 | required this.onPrimaryColor, 14 | this.elevation = 1, 15 | }); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return ElevatedButton( 20 | onPressed: onPressed, 21 | child: child, 22 | style: ElevatedButton.styleFrom( 23 | elevation: elevation, 24 | primary: primaryColor, 25 | onPrimary: onPrimaryColor, 26 | shape: const RoundedRectangleBorder( 27 | borderRadius: BorderRadius.all( 28 | Radius.circular(5), 29 | ), 30 | ), 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/common/setting_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | //It contains ui of tile used in settings 5 | class SettingsTile extends StatelessWidget { 6 | final String text; 7 | SettingsTile({this.text=''}); 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | children: [ 12 | ListTile( 13 | title: Text(text), 14 | ), 15 | Divider( 16 | color: blackColor, 17 | height: 1, 18 | ), 19 | ], 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/common/ui_reusable_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:ebuzz/util/version.dart'; 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | //datail ui widgets 7 | Widget textFieldName(BuildContext context, String name) { 8 | return Container( 9 | height: 40, 10 | child: Text( 11 | name, 12 | style: TextStyle(fontSize: 16), 13 | overflow: TextOverflow.ellipsis, 14 | maxLines: 2, 15 | ), 16 | ); 17 | } 18 | 19 | Widget colon(BuildContext context) { 20 | return Container( 21 | height: 40, 22 | child: Text( 23 | ':', 24 | style: TextStyle(fontSize: 16), 25 | ), 26 | ); 27 | } 28 | 29 | Widget scrollToViewTableBelow(BuildContext context) { 30 | return Padding( 31 | padding: EdgeInsets.symmetric(horizontal: 16), 32 | child: Row( 33 | children: [ 34 | Text( 35 | 'Scroll ', 36 | style: TextStyle(fontSize: 18, color: blackColor), 37 | ), 38 | Icon( 39 | Icons.arrow_back, 40 | color: blackColor, 41 | size: 25, 42 | ), 43 | Text( 44 | ' or ', 45 | style: TextStyle(fontSize: 18, color: blackColor), 46 | ), 47 | Icon( 48 | Icons.arrow_forward, 49 | color: blackColor, 50 | size: 25, 51 | ), 52 | Text( 53 | ' to view table below', 54 | style: TextStyle(fontSize: 18, color: blackColor), 55 | ), 56 | ], 57 | ), 58 | ); 59 | } 60 | 61 | DataColumn tableColumnText(BuildContext context, String text) { 62 | return DataColumn( 63 | label: Text(text), 64 | ); 65 | } 66 | 67 | DataCell dataCellText(BuildContext context, String text, double width, 68 | {int? maxlines = 5, TextOverflow? overflow = TextOverflow.ellipsis}) { 69 | return DataCell(Container( 70 | width: width, 71 | child: Text( 72 | text, 73 | maxLines: maxlines, 74 | overflow: overflow, 75 | ), 76 | )); 77 | } 78 | 79 | Widget versionText() { 80 | return Text( 81 | version, 82 | style: TextStyle(fontSize: 10), 83 | ); 84 | } 85 | -------------------------------------------------------------------------------- /lib/common_models/item_group.dart: -------------------------------------------------------------------------------- 1 | class ItemGroupModel{ 2 | final String? name; 3 | 4 | ItemGroupModel({this.name}); 5 | 6 | factory ItemGroupModel.fromJson(Map json){ 7 | return ItemGroupModel(name: json['name']??''); 8 | } 9 | } -------------------------------------------------------------------------------- /lib/common_models/item_price_model.dart: -------------------------------------------------------------------------------- 1 | class ItemPriceModel{ 2 | final String? doctype; 3 | final String? company; 4 | final String? itemcode; 5 | final double? conversionrate; 6 | final String? pricelist; 7 | final String? customer; 8 | 9 | ItemPriceModel({this.doctype, this.company, this.itemcode, this.conversionrate, this.pricelist,this.customer}); 10 | 11 | 12 | Map toJson() { 13 | return { 14 | "args": { 15 | "doctype": doctype, 16 | "item_code": itemcode, 17 | "customer": customer, 18 | "company": company, 19 | "conversion_rate": conversionrate, 20 | "price_list": pricelist 21 | } 22 | }; 23 | } 24 | } -------------------------------------------------------------------------------- /lib/common_models/items_model.dart: -------------------------------------------------------------------------------- 1 | class ItemsModel { 2 | final String itemName; 3 | final String itemCode; 4 | final int quantity; 5 | final String image; 6 | 7 | ItemsModel(this.itemName, this.itemCode, this.image, {this.quantity=1}); 8 | 9 | factory ItemsModel.fromJson(Map json) { 10 | return ItemsModel(json['item_name'] ?? '', json['item_code'] ?? '',json['image']??'',quantity:1); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/common_models/product.dart: -------------------------------------------------------------------------------- 1 | //Product class contains model to store data of Item api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | class Product { 4 | final String? itemName; 5 | final String? itemGroup; 6 | final String hsn; 7 | final String brand; 8 | final String description; 9 | final int shellLife; 10 | final String slideShow; 11 | final String image; 12 | final String? itemCode; 13 | final int sampleSize; 14 | final double valuationRate; 15 | final String defaultUnitOfMeasure; 16 | 17 | Product({ 18 | this.valuationRate=0, 19 | this.itemCode, 20 | this.image='', 21 | this.slideShow='', 22 | this.itemName, 23 | this.itemGroup, 24 | this.hsn='', 25 | this.brand='', 26 | this.description='', 27 | this.shellLife=0, 28 | this.sampleSize=0, 29 | this.defaultUnitOfMeasure='' 30 | }); 31 | 32 | //For fetching json data from item api and storing it in Product model 33 | factory Product.fromJson(Map json) { 34 | return Product( 35 | itemCode: json['item_code'] ?? '', 36 | brand: json['brand'] ?? '', 37 | itemName: json['item_name'] ?? '', 38 | itemGroup: json['item_group'] ?? '', 39 | hsn: json['gst_hsn_code'] ?? '', 40 | description: json['description'] ?? '', 41 | shellLife: json['shelf_life_in_days'] ?? 0, 42 | slideShow: json['slideshow'] ?? '', 43 | image: json['image'], 44 | sampleSize: json['sample_quantity'] ?? 0, 45 | valuationRate: json['valuation_rate'] ?? 0, 46 | defaultUnitOfMeasure: json['stock_uom'] ?? 0 47 | 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/common_models/quotation_model.dart: -------------------------------------------------------------------------------- 1 | class QuotationModel { 2 | final String? currency; 3 | final List? quotationitems; 4 | final String customerName; 5 | final String? quotationTo; 6 | final String partyName; 7 | final String contactDisplay; 8 | final String contactEmail; 9 | final String contactPerson; 10 | final String contactMobile; 11 | final String customerAddress; 12 | final String territory; 13 | 14 | QuotationModel({ 15 | this.currency, 16 | this.quotationitems, 17 | this.customerName='', 18 | this.quotationTo, 19 | this.partyName='', 20 | this.contactDisplay='', 21 | this.contactEmail='', 22 | this.contactMobile='', 23 | this.contactPerson='', 24 | this.customerAddress='', 25 | this.territory='', 26 | }); 27 | 28 | Map toJson() { 29 | List? qoitems = this.quotationitems == null 30 | ? null 31 | : this.quotationitems!.map((i) => i.toJson()).toList(); 32 | return { 33 | 'currency': this.currency, 34 | 'items': qoitems, 35 | 'customer_name': this.customerName, 36 | 'party_name': this.partyName, 37 | 'quotation_to': this.quotationTo, 38 | 'contact_display': this.contactDisplay, 39 | 'contact_email': this.contactEmail, 40 | 'contact_mobile': this.contactMobile, 41 | 'contact_person': this.contactPerson, 42 | 'customer_address': this.customerAddress, 43 | 'territory': this.territory 44 | }; 45 | } 46 | } 47 | 48 | class QuotationItems { 49 | final String itemcode; 50 | final int quantity; 51 | final double rate; 52 | 53 | QuotationItems( 54 | {required this.itemcode, required this.quantity, required this.rate}); 55 | 56 | Map toJson() { 57 | return {'item_code': itemcode, 'qty': quantity, 'rate': rate}; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/common_models/user.dart: -------------------------------------------------------------------------------- 1 | class User { 2 | final String email; 3 | final String firstname; 4 | final String fullname; 5 | final String username; 6 | 7 | User( 8 | {this.email = '', 9 | this.firstname = '', 10 | this.fullname = '', 11 | this.username = ''}); 12 | 13 | factory User.fromJson(Map json) { 14 | return User( 15 | email: json['email'] ?? '', 16 | firstname: json['first_name'] ?? '', 17 | username: json['username'] ?? '', 18 | fullname: json['full_name'] ?? '', 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/config/color_palette.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ColorPalette { 4 | static List colors = [ 5 | grey, 6 | blue, 7 | yellow, 8 | darkGreen, 9 | red, 10 | orange, 11 | ]; 12 | 13 | static const MaterialColor grey = MaterialColor( 14 | _greyPrimaryValue, 15 | { 16 | 50: Color(0xFFF9FAFA), 17 | 100: Color(0xFFF4F5F6), 18 | 200: Color(0xFFEEF0F2), 19 | 300: Color(0xFFE2E6E9), 20 | 400: Color(0xFFC8CFD5), 21 | 500: Color(_greyPrimaryValue), 22 | 600: Color(0xFF74808B), 23 | 700: Color(0xFF4C5A67), 24 | 800: Color(0xFF313B44), 25 | 900: Color(0xFF192734), 26 | }, 27 | ); 28 | static const int _greyPrimaryValue = 0xFFA6B1B9; 29 | 30 | static const MaterialColor blue = MaterialColor( 31 | _bluePrimaryValue, 32 | { 33 | 50: Color(0xFFF5FAFF), 34 | 100: Color(0xFFEBF5FF), 35 | 200: Color(0xFFBFDDF7), 36 | 300: Color(0xFF90C5F4), 37 | 400: Color(0xFF62B2F9), 38 | 500: Color(_bluePrimaryValue), 39 | 600: Color(0xFF318AD8), 40 | 700: Color(0xFF096CC3), 41 | 800: Color(0xFF2C5477), 42 | 900: Color(0xFF2A4965), 43 | }, 44 | ); 45 | static const int _bluePrimaryValue = 0XFF2D95F0; 46 | 47 | static const MaterialColor red = MaterialColor( 48 | _redPrimaryValue, 49 | { 50 | 50: Color(0xFFFEF6F6), 51 | 100: Color(0xFFFEECEC), 52 | 200: Color(0xFFF6DFDF), 53 | 300: Color(0xFFFEB9B9), 54 | 400: Color(0xFFFC8888), 55 | 500: Color(_redPrimaryValue), 56 | 600: Color(0xFFE24C4C), 57 | 700: Color(0xFFC53B3B), 58 | 800: Color(0xFF9B4646), 59 | 900: Color(0xFF742525), 60 | }, 61 | ); 62 | static const int _redPrimaryValue = 0xFFF56B6B; 63 | 64 | static const MaterialColor orange = MaterialColor( 65 | _orangePrimaryValue, 66 | { 67 | 50: Color(0xFFFFF5F0), 68 | 100: Color(0xFFFFEAE1), 69 | 200: Color(0xFFFECDB8), 70 | 300: Color(0xFFFDAE8C), 71 | 400: Color(0xFFF9966C), 72 | 500: Color(_orangePrimaryValue), 73 | 600: Color(0xFFCB5A2A), 74 | 700: Color(0xFF9C4621), 75 | 800: Color(0xFF7B3A1E), 76 | 900: Color(0xFF653019), 77 | }, 78 | ); 79 | static const int _orangePrimaryValue = 0xFFF8814F; 80 | 81 | static const MaterialColor yellow = MaterialColor( 82 | _yellowPrimaryValue, 83 | { 84 | 50: Color(0xFFFDF9F2), 85 | 100: Color(0xFFFEF4E2), 86 | 200: Color(0xFFFEE9BF), 87 | 300: Color(0xFFFCDA97), 88 | 400: Color(0xFFFACF7A), 89 | 500: Color(_yellowPrimaryValue), 90 | 600: Color(0xFFD6932E), 91 | 700: Color(0xFFCA8012), 92 | 800: Color(0xFF976417), 93 | 900: Color(0xFF744C11), 94 | }, 95 | ); 96 | static const int _yellowPrimaryValue = 0xFFECAC4B; 97 | 98 | static const MaterialColor darkGreen = MaterialColor( 99 | _darkGreenPrimaryValue, 100 | { 101 | 50: Color(0xFFF5FAF7), 102 | 100: Color(0xFFEEF7F1), 103 | 200: Color(0xFFC6F1D6), 104 | 300: Color(0xFF9AE5B6), 105 | 400: Color(0xFF68D391), 106 | 500: Color(_darkGreenPrimaryValue), 107 | 600: Color(0xFF38A160), 108 | 700: Color(0xFF1B984B), 109 | 800: Color(0xFF276840), 110 | 900: Color(0xFF225335), 111 | }, 112 | ); 113 | static const int _darkGreenPrimaryValue = 0xFF48BB74; 114 | } 115 | -------------------------------------------------------------------------------- /lib/config/palette.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ebuzz/config/color_palette.dart'; 3 | class Palette { 4 | static Color bgColor = ColorPalette.grey[50]!; 5 | static Color fieldBgColor = ColorPalette.grey[100]!; 6 | static Color iconColor = ColorPalette.grey[700]!; 7 | static Color primaryButtonColor = ColorPalette.blue; 8 | static Color secondaryButtonColor = ColorPalette.grey[200]!; 9 | static Color disabledButonColor = ColorPalette.grey; 10 | static const Color iconColor2 = Color(0xFF1F272E); 11 | 12 | static Color dangerTxtColor = ColorPalette.red[600]!; 13 | static Color dangerBgColor = ColorPalette.red[100]!; 14 | static Color warningTxtColor = ColorPalette.orange[600]!; 15 | static Color warningBgColor = ColorPalette.orange[100]!; 16 | static Color completeTxtColor = ColorPalette.blue[600]!; 17 | static Color completeBgColor = ColorPalette.blue[100]!; 18 | static Color undefinedTxtColor = ColorPalette.grey[600]!; 19 | static Color undefinedBgColor = ColorPalette.grey[100]!; 20 | static Color successTxtColor = ColorPalette.darkGreen[600]!; 21 | static Color successBgColor = ColorPalette.darkGreen[100]!; 22 | 23 | static Color secondaryTxtColor = Color(0xFFB9C0C7); 24 | static Color newIndicatorColor = Color.fromRGBO(255, 252, 231, 1); 25 | 26 | static EdgeInsets fieldPadding = const EdgeInsets.only(bottom: 24.0); 27 | static EdgeInsets labelPadding = const EdgeInsets.only(bottom: 6.0); 28 | 29 | 30 | static TextStyle secondaryTxtStyle = TextStyle( 31 | color: Palette.secondaryTxtColor, 32 | fontWeight: FontWeight.bold, 33 | fontSize: 12, 34 | ); 35 | 36 | static TextStyle altTextStyle = TextStyle( 37 | fontStyle: FontStyle.italic, 38 | color: Palette.secondaryTxtColor, 39 | ); 40 | 41 | 42 | static InputDecoration formFieldDecoration({ 43 | String? label, 44 | Widget? suffixIcon, 45 | Widget? prefixIcon, 46 | bool filled = true, 47 | String? field, 48 | }) { 49 | return InputDecoration( 50 | suffixIcon: suffixIcon, 51 | prefixIcon: prefixIcon, 52 | contentPadding: field == "check" 53 | ? EdgeInsets.zero 54 | : EdgeInsets.symmetric( 55 | horizontal: 10, 56 | ), 57 | border: OutlineInputBorder( 58 | borderSide: BorderSide.none, 59 | borderRadius: const BorderRadius.all( 60 | const Radius.circular(6.0), 61 | ), 62 | ), 63 | errorBorder: OutlineInputBorder( 64 | borderSide: BorderSide(color: Colors.red), 65 | borderRadius: const BorderRadius.all( 66 | const Radius.circular(6.0), 67 | ), 68 | ), 69 | // hintText: label, 70 | filled: filled, 71 | fillColor: Palette.fieldBgColor, 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/home/model/globaldefaultsmodel.dart: -------------------------------------------------------------------------------- 1 | class GlobalDefaults { 2 | final String? currency; 3 | final String? company; 4 | final String? distanceunit; 5 | 6 | GlobalDefaults({this.currency, this.company, this.distanceunit}); 7 | 8 | factory GlobalDefaults.fromJson(Map json) { 9 | return GlobalDefaults( 10 | company: json['default_company'], 11 | currency: json['default_currency'], 12 | distanceunit: json['default_distance_unit'], 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/home/service/home_service.dart: -------------------------------------------------------------------------------- 1 | 2 | //HomeService class contains function to check login status 3 | class HomeService { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /lib/item/model/item.dart: -------------------------------------------------------------------------------- 1 | //Item class contains model to store data of Item api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | class Item { 4 | final String? itemName; 5 | final String? itemCode; 6 | 7 | Item({ 8 | this.itemCode, 9 | this.itemName, 10 | }); 11 | 12 | //For fetching json data from item api and storing it in item model 13 | factory Item.fromJson(Map json) { 14 | return Item( 15 | itemCode: json['item_code'] ?? '', 16 | itemName: json['item_name'] ?? '', 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/item/model/warehouse_quantity.dart: -------------------------------------------------------------------------------- 1 | //WarehouseQuantity class contains model to store data from stock ledger entry api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | class WarehouseQuantity { 4 | WarehouseQuantity({ 5 | this.actualQty, 6 | this.warehouse, 7 | }); 8 | 9 | double? actualQty; 10 | String? warehouse; 11 | 12 | //For fetching json data from stock ledger entry api and storing it in warehouse quantity model 13 | factory WarehouseQuantity.fromJson(Map json) => 14 | WarehouseQuantity( 15 | actualQty: json["qty_after_transaction"].toDouble() ?? 0.0, 16 | warehouse: json["warehouse"] ?? '', 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /lib/item/service/item_api_service.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:dio/dio.dart'; 3 | import 'package:ebuzz/common_models/product.dart'; 4 | 5 | import 'package:ebuzz/exception/custom_exception.dart'; 6 | import 'package:ebuzz/network/base_dio.dart'; 7 | import 'package:ebuzz/util/apiurls.dart'; 8 | import 'package:flutter/cupertino.dart'; 9 | 10 | //ItemApiService class contains function for fetching data or posting data 11 | class ItemApiService { 12 | 13 | //For fetching data from item api in product model 14 | Future getData(String text,BuildContext context) async { 15 | try { 16 | Dio _dio = await BaseDio().getBaseDio(); 17 | final String url = itemDataUrl(text); 18 | final response = await _dio.get( 19 | url, 20 | ); 21 | if (response.statusCode == 200) { 22 | return Product.fromJson(response.data['data']); 23 | } else { 24 | throw Exception('Failed to load data'); 25 | } 26 | } catch (e) { 27 | exception(e,context); 28 | } 29 | return Product(); 30 | } 31 | 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lib/leavebalance/service/leave_balance_api_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/exception/custom_exception.dart'; 3 | import 'package:ebuzz/network/base_dio.dart'; 4 | import 'package:ebuzz/util/apiurls.dart'; 5 | import 'package:ebuzz/util/preference.dart'; 6 | import 'package:flutter/cupertino.dart'; 7 | 8 | //LeaveApiService class contains function for fetching data or posting data 9 | class LeaveApiService { 10 | //For fetching leaves based on username 11 | Future fetchLeave(BuildContext context) async { 12 | List list = []; 13 | try { 14 | Dio _dio = await BaseDio().getBaseDio(); 15 | String? name = await getName(); 16 | final String itemList = leaveLedgerEntryUrl(name!); 17 | final response = await _dio.get(itemList); 18 | var data = response.data; 19 | list = data['data']; 20 | return list; 21 | } catch (e) { 22 | exception(e,context); 23 | } 24 | return list; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/leavebalance/ui/leave_balance_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:ebuzz/common/custom_appbar.dart'; 3 | import 'package:ebuzz/common/display_helper.dart'; 4 | import 'package:ebuzz/leavebalance/service/leave_balance_api_service.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | //LeaveUi class contains ui of leave balance 8 | class LeaveUi extends StatefulWidget { 9 | @override 10 | _LeaveUiState createState() => _LeaveUiState(); 11 | } 12 | 13 | class _LeaveUiState extends State { 14 | List privilegeLeaveList = []; 15 | List concessionalLeaveList = []; 16 | List leaveWithoutPayList = []; 17 | List compensatoryOffList = []; 18 | LeaveApiService _leaveApiService = LeaveApiService(); 19 | List list = []; 20 | double privilegeSum = 0; 21 | double concessionalSum = 0; 22 | double leaveWithoutPaySum = 0; 23 | double compensatoryOffSum = 0; 24 | @override 25 | void initState() { 26 | super.initState(); 27 | fetchLeave(); 28 | } 29 | 30 | //for fetching leave based on each leave type 31 | fetchLeave() async { 32 | String privilegeLeave = "Privilege Leave"; 33 | String concessionalLeave = "Concessional Leave"; 34 | String leaveWithoutPay = "Leave Without Pay"; 35 | String compensatoryOff = "Compensatory Off"; 36 | list = await _leaveApiService.fetchLeave(context); 37 | 38 | for (var listJson in list) { 39 | if (listJson['leave_type'] == privilegeLeave) { 40 | privilegeLeaveList.add(listJson['leaves']); 41 | } 42 | if (listJson['leave_type'] == concessionalLeave) { 43 | concessionalLeaveList.add(listJson['leaves']); 44 | } 45 | if (listJson['leave_type'] == leaveWithoutPay) { 46 | leaveWithoutPayList.add(listJson['leaves']); 47 | } 48 | if (listJson['leave_type'] == compensatoryOff) { 49 | compensatoryOffList.add(listJson['leaves']); 50 | } 51 | } 52 | for (double sum in privilegeLeaveList) { 53 | privilegeSum += sum; 54 | } 55 | for (double sum in concessionalLeaveList) { 56 | concessionalSum += sum; 57 | } 58 | for (double sum in leaveWithoutPayList) { 59 | leaveWithoutPaySum += sum; 60 | } 61 | for (double sum in compensatoryOffList) { 62 | compensatoryOffSum += sum; 63 | } 64 | if (!mounted) return; 65 | setState(() {}); 66 | } 67 | 68 | @override 69 | Widget build(BuildContext context) { 70 | return Scaffold( 71 | backgroundColor: bgColor, 72 | appBar: PreferredSize( 73 | preferredSize: Size.fromHeight( 55), 74 | child: CustomAppBar( 75 | title: Text('Leave Balance', style: TextStyle(color: whiteColor)), 76 | leading: IconButton( 77 | onPressed: () => Navigator.pop(context), 78 | icon: Icon( 79 | Icons.arrow_back, 80 | color: whiteColor, 81 | ), 82 | ), 83 | )), 84 | body: Padding( 85 | padding: EdgeInsets.all(10.0), 86 | child: GridView( 87 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 88 | crossAxisCount: 2, crossAxisSpacing: 5, mainAxisSpacing: 5), 89 | children: [ 90 | cardUi('Privilege Leave', privilegeSum), 91 | cardUi('Concessional Leave', concessionalSum), 92 | cardUi('Leave Without Pay', leaveWithoutPaySum), 93 | cardUi('Compensatory Off', compensatoryOffSum), 94 | ], 95 | ), 96 | ), 97 | ); 98 | } 99 | 100 | //it is a reusable widget for displaying ui of each leave type 101 | Widget cardUi(String text, double leaveType) { 102 | return Container( 103 | width: displayWidth(context) * 0.45, 104 | height: displayWidth(context) * 0.45, 105 | child: Card( 106 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), 107 | elevation: 2, 108 | child: Stack( 109 | children: [ 110 | Align( 111 | alignment: Alignment.topCenter, 112 | child: Padding( 113 | padding: 114 | EdgeInsets.only(top: 15), 115 | child: Text( 116 | text, 117 | style: TextStyle(fontSize: 16, color: blackColor), 118 | maxLines: 3, 119 | ), 120 | ), 121 | ), 122 | Align( 123 | alignment: Alignment.center, 124 | child: Text( 125 | leaveType.toString(), 126 | style: TextStyle( 127 | color: blueAccent, 128 | fontSize: 35, 129 | fontWeight: FontWeight.bold), 130 | ), 131 | ), 132 | ], 133 | ), 134 | ), 135 | ); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /lib/leavelist/model/employee_leave.dart: -------------------------------------------------------------------------------- 1 | //EmployeeLeave class contains model to store data of Employee Leave api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | 4 | class EmployeeLeave { 5 | final String? postingDate; 6 | final String? status; 7 | final String? leaveApprover; 8 | final String? description; 9 | final double? totalLeaveDays; 10 | final String? fromDate; 11 | final String? toDate; 12 | final int? halfDay; 13 | final String? halfDayDate; 14 | final String? leaveType; 15 | final double? leaveBalance; 16 | final String? employeeName; 17 | final String? employee; 18 | 19 | EmployeeLeave( 20 | {this.postingDate, 21 | this.status, 22 | this.leaveApprover, 23 | this.description, 24 | this.totalLeaveDays, 25 | this.fromDate, 26 | this.toDate, 27 | this.halfDay, 28 | this.halfDayDate, 29 | this.leaveType, 30 | this.leaveBalance, 31 | this.employeeName, 32 | this.employee}); 33 | 34 | //For fetching json data from leave application api and storing it in employee leave model 35 | factory EmployeeLeave.fromJson(Map json) { 36 | return EmployeeLeave( 37 | description: json['description'] ?? '', 38 | employee: json['employee'] ?? '', 39 | employeeName: json['employee_name'] ?? '', 40 | fromDate: json['from_date'] ?? '', 41 | halfDay: json['half_day'] ?? 0, 42 | halfDayDate: json['half_day_date'] ?? '', 43 | leaveApprover: json['leave_approver_name'] ?? '', 44 | leaveBalance: json['leave_balance'] ?? 0, 45 | leaveType: json['leave_type'] ?? '', 46 | postingDate: json['posting_date'] ?? '', 47 | status: json['status'] ?? '', 48 | toDate: json['to_date'] ?? '', 49 | totalLeaveDays: json['total_leave_days'] ?? 0); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/leavelist/service/leave_list_api_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/exception/custom_exception.dart'; 3 | import 'package:ebuzz/leavelist/model/employee_leave.dart'; 4 | import 'package:ebuzz/network/base_dio.dart'; 5 | import 'package:ebuzz/util/apiurls.dart'; 6 | import 'package:flutter/cupertino.dart'; 7 | 8 | //EmployeeApiService class contains function for fetching data or posting data 9 | class EmployeeApiService { 10 | //For fetching employee leave list from leave application api 11 | Future> fetchEmployeeLeavelist(String text,BuildContext context) async { 12 | List list = []; 13 | try { 14 | Dio dio = await BaseDio().getBaseDio(); 15 | final String employeeleavelisturl = particularEmployeeListUrl(text); 16 | final response = await dio.get( 17 | employeeleavelisturl, 18 | ); 19 | if (response.statusCode == 200) { 20 | var data = response.data; 21 | var listData = data['data']; 22 | for (var listJson in listData) { 23 | list.add(EmployeeLeave.fromJson(listJson)); 24 | } 25 | } else { 26 | return []; 27 | } 28 | return list; 29 | } catch (e) { 30 | exception(e,context); 31 | } 32 | return list; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/login/service/login_api_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | import 'package:ebuzz/common/colors.dart'; 4 | import 'package:ebuzz/common/custom_toast.dart'; 5 | import 'package:ebuzz/common/navigations.dart'; 6 | import 'package:ebuzz/common_service/common_service.dart'; 7 | import 'package:ebuzz/home/ui/home.dart'; 8 | import 'package:ebuzz/util/preference.dart'; 9 | import 'package:http/http.dart' as http; 10 | import 'package:flutter/material.dart'; 11 | import 'package:ebuzz/util/apiurls.dart'; 12 | 13 | //LoginApiService class contains function login 14 | class LoginApiService { 15 | 16 | //For doing login based on the username and password 17 | Future login( 18 | {required String username, 19 | required String password, 20 | required BuildContext context, 21 | required String baseUrl}) async { 22 | try { 23 | List? baseurllist = await getBaseUrlList(); 24 | // HomeService _homeService=HomeService(); 25 | final String url = loginUrl(baseUrl); 26 | var uri=Uri.parse(url); 27 | final response = await http.post( 28 | uri, 29 | headers: { 30 | 'Content-Type': 'application/json; charset=UTF-8', 31 | }, 32 | body: jsonEncode({ 33 | 'usr': username, 34 | 'pwd': password, 35 | }), 36 | ); 37 | if (response.statusCode == 200) { 38 | if (baseurllist != null) { 39 | if (!baseurllist.contains(baseUrl)) { 40 | baseurllist.add(baseUrl); 41 | setBaseUrlList(baseurllist); 42 | } 43 | } 44 | if (baseurllist == null) { 45 | List list = []; 46 | list.add(baseUrl); 47 | setBaseUrlList(list); 48 | } 49 | var data = jsonDecode(response.body); 50 | String fullname = data['full_name']; 51 | setApiUrl(baseUrl); 52 | setUserName(username); 53 | setLoggedIn(true); 54 | setName(fullname); 55 | var cookie = response.headers['set-cookie']; 56 | String cookieSid = cookie!.split(';').first.toString(); 57 | setCookie(cookieSid); 58 | await CommonService().setGlobalDefaults(context); 59 | pushReplacementScreen(context, Home()); 60 | } 61 | if (response.statusCode == 400) { 62 | fluttertoast(whiteColor, redColor, 'Incorrect username or password'); 63 | } 64 | if (response.statusCode == 401) { 65 | fluttertoast(whiteColor, redColor, 'Incorrect username or password'); 66 | } 67 | } catch (e) { 68 | if (e is SocketException) { 69 | fluttertoast(whiteColor, blueAccent, 'No Internet Connection'); 70 | } else { 71 | fluttertoast(whiteColor, blueAccent, 'Unexpected Error'); 72 | } 73 | } 74 | } 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /lib/logout/service/logout_api_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/custom_toast.dart'; 2 | import 'package:ebuzz/common/navigations.dart'; 3 | import 'package:ebuzz/login/ui/login.dart'; 4 | 5 | import 'package:ebuzz/util/preference.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:http/http.dart' as http; 8 | import 'package:ebuzz/common/colors.dart'; 9 | import 'package:ebuzz/util/apiurls.dart'; 10 | 11 | //LogoutApiService class contains function for fetching data or posting data 12 | class LogOutApiService { 13 | Future logOut(BuildContext context, String apiurl) async { 14 | try { 15 | final String logOutUrl = logoutUrl(apiurl); 16 | var uri = Uri.parse(logOutUrl); 17 | var response = await http.get( 18 | uri, 19 | ); 20 | if (response.statusCode == 200) { 21 | removeLoggedIn(); 22 | removeApiUrl(); 23 | removeCookie(); 24 | removeName(); 25 | removeCompany(); 26 | removeCurrency(); 27 | removeUserName(); 28 | pushReplacementScreen(context, Login()); 29 | } else { 30 | if (response.statusCode == 400) { 31 | fluttertoast(whiteColor, redColor, 'Error Ocurred while LogOut'); 32 | } else if (response.statusCode == 401) { 33 | fluttertoast(whiteColor, redColor, 'Error Ocurred while LogOut'); 34 | } else { 35 | fluttertoast(whiteColor, redColor, 'Error Ocurred while LogOut'); 36 | } 37 | } 38 | } catch (e) { 39 | throw Exception(e.toString()); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/app.dart'; 2 | import 'package:ebuzz/util/preference.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | 6 | void main() async { 7 | WidgetsFlutterBinding.ensureInitialized(); 8 | bool? login=false; 9 | login = await getLoggedIn(); 10 | runApp(App(login: login)); 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /lib/network/base_dio.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/util/preference.dart'; 3 | 4 | //BaseDio class stores cookie value in headers and it will be used in each api calls 5 | class BaseDio { 6 | Future getBaseDio() async { 7 | String? cookie = await getCookie(); 8 | String? baseurl = await getApiUrl(); 9 | final BaseOptions options = new BaseOptions( 10 | baseUrl: baseurl!, 11 | connectTimeout: 50000, 12 | receiveTimeout: 50000, 13 | ); 14 | Dio _dio = new Dio(options); 15 | _dio.interceptors 16 | .add(InterceptorsWrapper(onRequest: (options,handler) { 17 | _dio.interceptors.requestLock.lock(); 18 | options.headers["cookie"] = cookie; 19 | handler.next(options); 20 | _dio.interceptors.requestLock.unlock(); 21 | })); 22 | return _dio; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/purchaseorder/model/purchase_model.dart: -------------------------------------------------------------------------------- 1 | //PurchaseModel class contains model to store data of Purchase Order api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | 4 | class PurchaseModel { 5 | final String supplier; 6 | final String date; 7 | final String requiredByDate; 8 | PurchaseModel({required this.supplier,required this.date,required this.requiredByDate}); 9 | 10 | //For fetching json data from purchase order api and storing it in purchase model 11 | factory PurchaseModel.fromJson(Map json) { 12 | return PurchaseModel( 13 | supplier: json['supplier'] ?? '', 14 | date: json['transaction_date'] ?? '', 15 | requiredByDate: json['schedule_date'] ?? '', 16 | ); 17 | } 18 | } 19 | 20 | //ItemsModel class contains model to store data of Purchase Order api 21 | class ItemsModel { 22 | final String? itemCode; 23 | final String? itemName; 24 | final double? quantity; 25 | final double? quantityRecieved; 26 | final String? purchaseOrder; 27 | final String? purchaseOrderModel; 28 | ItemsModel( 29 | {this.purchaseOrder, 30 | this.purchaseOrderModel, 31 | this.itemCode, 32 | this.itemName, 33 | this.quantity, 34 | this.quantityRecieved}); 35 | 36 | //For fetching json data from purchase order api and storing it in items model 37 | factory ItemsModel.fromJson(Map json) { 38 | return ItemsModel( 39 | itemCode: json['item_code'] ?? '', 40 | itemName: json['item_name'] ?? '', 41 | quantity: json['qty'] ?? 0, 42 | quantityRecieved: json['received_qty'] ?? 0, 43 | purchaseOrder: json['name'] ?? '', 44 | purchaseOrderModel: json['parent'] ?? '', 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/purchaseorder/service/purchase_api_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/exception/custom_exception.dart'; 3 | import 'package:ebuzz/network/base_dio.dart'; 4 | import 'package:ebuzz/purchaseorder/model/purchase_model.dart'; 5 | import 'package:ebuzz/util/apiurls.dart'; 6 | import 'package:flutter/cupertino.dart'; 7 | 8 | //PurchaseApiService class contains function for fetching data or posting data 9 | class PurchaseApiService { 10 | //For fetching purchase order data 11 | Future getPurchaseOrderData(String name,BuildContext context) async { 12 | PurchaseModel purchaseModelData=PurchaseModel(supplier: '', date: '', requiredByDate: ''); 13 | try { 14 | Dio dio = await BaseDio().getBaseDio(); 15 | final String pourl = purchaseOrderDetailUrl(name); 16 | final response = await dio.get(pourl); 17 | var decData = response.data; 18 | var data = decData['data']; 19 | purchaseModelData = PurchaseModel.fromJson(data); 20 | return purchaseModelData; 21 | } catch (e) { 22 | exception(e,context); 23 | } 24 | return purchaseModelData; 25 | } 26 | 27 | //For fetching purchase order item list 28 | Future> getPurchaseOrderItemList(String name,BuildContext context) async { 29 | List items = []; 30 | try { 31 | Dio dio = await BaseDio().getBaseDio(); 32 | 33 | final String itemList = purchaseOrderDetailUrl(name); 34 | final response = await dio.get(itemList); 35 | var data = response.data; 36 | List list = data['data']['items']; 37 | for (var listJson in list) { 38 | items.add(ItemsModel.fromJson(listJson)); 39 | } 40 | return items; 41 | } catch (e) { 42 | exception(e,context); 43 | } 44 | return items; 45 | } 46 | 47 | //For fetching names list 48 | Future> getNameList(BuildContext context) async { 49 | List list = []; 50 | List unsortedName=[]; 51 | List name=[]; 52 | try { 53 | final String itemList = purchaseOrderListUrl(); 54 | 55 | Dio dio = await BaseDio().getBaseDio(); 56 | 57 | var response = await dio.get(itemList); 58 | var data = response.data; 59 | list = data['data']; 60 | for (int i = 0; i < list.length; i++) { 61 | unsortedName.add(list[i]['name']); 62 | } 63 | unsortedName.sort(); 64 | for (int i = unsortedName.length - 1; i >= 0; i--) { 65 | name.add(unsortedName[i]); 66 | } 67 | print(name.length); 68 | return name; 69 | } catch (e) { 70 | exception(e,context); 71 | } 72 | return name; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/purchaseorder/ui/purchase_order_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/circular_progress.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | import 'package:ebuzz/common/custom_appbar.dart'; 4 | import 'package:ebuzz/common/navigations.dart'; 5 | import 'package:ebuzz/purchaseorder/model/purchase_model.dart'; 6 | import 'package:ebuzz/purchaseorder/service/purchase_api_service.dart'; 7 | import 'package:ebuzz/purchaseorder/ui/purchase_order_detail.dart'; 8 | import 'package:flutter/material.dart'; 9 | 10 | //PurchaseOrderUi class contains ui of purchase order list 11 | class PurchaseOrderUi extends StatefulWidget { 12 | @override 13 | _PurchaseOrderUiState createState() => _PurchaseOrderUiState(); 14 | } 15 | 16 | class _PurchaseOrderUiState extends State { 17 | List unsortedName = []; 18 | List name = []; 19 | bool loading = false; 20 | 21 | PurchaseApiService _purchaseApiService = PurchaseApiService(); 22 | @override 23 | void initState() { 24 | super.initState(); 25 | getNameList(); 26 | } 27 | 28 | //For fetching list of sorted purchase order names 29 | void getNameList() async { 30 | setState(() { 31 | loading = true; 32 | }); 33 | name = await _purchaseApiService.getNameList(context); 34 | setState(() { 35 | loading = false; 36 | }); 37 | if (!mounted) return; 38 | setState(() {}); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return Scaffold( 44 | backgroundColor: bgColor, 45 | appBar: PreferredSize( 46 | preferredSize: Size.fromHeight(55), 47 | child: CustomAppBar( 48 | title: Text('Purchase Order', style: TextStyle(color: whiteColor)), 49 | leading: IconButton( 50 | onPressed: () => Navigator.pop(context), 51 | icon: Icon( 52 | Icons.arrow_back, 53 | color: whiteColor, 54 | ), 55 | ), 56 | ), 57 | ), 58 | body: loading 59 | ? CircularProgress() 60 | : name.length == 0 61 | ? CircularProgress() 62 | : ListView.builder( 63 | itemCount: name.length, 64 | itemBuilder: (context, index) { 65 | return PurchaseOrderInfo( 66 | name: name[index], 67 | ); 68 | }, 69 | ), 70 | ); 71 | } 72 | } 73 | 74 | //PurchaseOrderInfo class is a reusble widget which contains ui of purchase order list 75 | class PurchaseOrderInfo extends StatefulWidget { 76 | final String name; 77 | const PurchaseOrderInfo({required this.name}); 78 | @override 79 | _PurchaseOrderInfoState createState() => _PurchaseOrderInfoState(); 80 | } 81 | 82 | class _PurchaseOrderInfoState extends State { 83 | PurchaseModel purchaseModelData = 84 | PurchaseModel(date: '', requiredByDate: '', supplier: ''); 85 | PurchaseApiService _purchaseApiService = PurchaseApiService(); 86 | 87 | @override 88 | void initState() { 89 | super.initState(); 90 | getPurchaseOrderData(); 91 | } 92 | 93 | getPurchaseOrderData() async { 94 | purchaseModelData = 95 | await _purchaseApiService.getPurchaseOrderData(widget.name, context); 96 | if (!mounted) return; 97 | setState(() {}); 98 | } 99 | 100 | @override 101 | Widget build(BuildContext context) { 102 | return Card( 103 | elevation: 3, 104 | margin: EdgeInsets.symmetric(horizontal: 5, vertical: 5), 105 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), 106 | child: ListTile( 107 | onTap: () { 108 | pushScreen( 109 | context, 110 | PurchaseOrderDetail( 111 | name: widget.name, 112 | date: purchaseModelData.date, 113 | requiredDate: purchaseModelData.requiredByDate, 114 | supplier: purchaseModelData.supplier, 115 | ), 116 | ); 117 | }, 118 | title: Padding( 119 | padding: const EdgeInsets.only(bottom: 6), 120 | child: Text(purchaseModelData.supplier, 121 | style: TextStyle(fontSize: 14, color: blackColor)), 122 | ), 123 | subtitle: Text(widget.name, 124 | style: TextStyle(fontSize: 14, color: blackColor)), 125 | ), 126 | ); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /lib/purchasereciept/model/purchase_reciept_model.dart: -------------------------------------------------------------------------------- 1 | //PRItem class contains model to store data of purchase receipt api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | 4 | class PRItem { 5 | String? itemName; 6 | String? itemCode; 7 | double? quantity; 8 | double? quantityRecieved; 9 | String? purchaseOrder; 10 | String? purchaseOrderItem; 11 | 12 | PRItem( 13 | {this.itemName, 14 | this.itemCode, 15 | this.quantity, 16 | this.purchaseOrder, 17 | this.purchaseOrderItem, 18 | this.quantityRecieved}); 19 | 20 | //For fetching json data from purchase receipt api and storing it in purchase receipt item model 21 | factory PRItem.fromJson(Map json) { 22 | return PRItem( 23 | itemCode: json['item_code'] ?? '', 24 | itemName: json['item_name'] ?? '', 25 | purchaseOrderItem: json['name'] ?? '', 26 | purchaseOrder: json['parent'] ?? '', 27 | quantity: json['qty'] ?? 0, 28 | quantityRecieved: json['received_qty'] ?? 0); 29 | } 30 | 31 | //For converting model to json format for storing it in purchase receipt item model 32 | Map toJson() => { 33 | 'item_name': itemName, 34 | 'item_code': itemCode, 35 | 'qty': quantity, 36 | 'purchase_order': purchaseOrder, 37 | 'purchase_order_item': purchaseOrderItem 38 | }; 39 | } 40 | 41 | //PurchaseRecieptModel class contains model to store data of purchase receipt api 42 | class PurchaseReceiptModel { 43 | int? docStatus; 44 | String? workflowState; 45 | String? supplier; 46 | List? prItems; 47 | 48 | PurchaseReceiptModel( 49 | {this.docStatus, this.workflowState, this.supplier, this.prItems}); 50 | 51 | //For converting model to json format for storing it in purchase receipt model 52 | Map toJson() { 53 | List? prItems = this.prItems != null 54 | ? this.prItems!.map((i) => i.toJson()).toList() 55 | : null; 56 | return { 57 | 'docstatus': docStatus, 58 | 'workflow_state': workflowState, 59 | 'supplier': supplier, 60 | 'items': prItems 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/purchasereciept/service/purchase_reciept_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | import 'package:ebuzz/common/custom_toast.dart'; 4 | import 'package:ebuzz/exception/custom_exception.dart'; 5 | import 'package:ebuzz/network/base_dio.dart'; 6 | import 'package:ebuzz/purchasereciept/model/purchase_reciept_model.dart'; 7 | import 'package:ebuzz/util/apiurls.dart'; 8 | import 'package:flutter/cupertino.dart'; 9 | 10 | //PurchaseReceiptService class contains function for fetching data or posting data 11 | class PurchaseRecieptService { 12 | //for fetching purchase receipt item list 13 | Future> getPurchaseRecieptItemList(String name,BuildContext context) async { 14 | List items = []; 15 | 16 | try { 17 | Dio _dio = await BaseDio().getBaseDio(); 18 | 19 | final String itemList = purchaseOrderDetailUrl(name); 20 | var response = await _dio.get( 21 | itemList, 22 | ); 23 | var data = response.data; 24 | List list = data['data']['items']; 25 | for (var listJson in list) { 26 | items.add(PRItem.fromJson(listJson)); 27 | } 28 | return items; 29 | } catch (e) { 30 | exception(e,context); 31 | } 32 | return items; 33 | } 34 | 35 | //for posting data to purchase receipt item api 36 | Future post({required List items,required String supplier,required BuildContext context}) async { 37 | try { 38 | Dio _dio = await BaseDio().getBaseDio(); 39 | PurchaseReceiptModel purchaseRecieptModel = PurchaseReceiptModel( 40 | docStatus: 0, 41 | prItems: items, 42 | supplier: supplier, 43 | workflowState: 'Draft'); 44 | final String url = purchaseRecieptUrl(); 45 | final response = await _dio.post(url, data: purchaseRecieptModel); 46 | if (response.statusCode == 200) { 47 | fluttertoast(whiteColor, blueAccent, 'Data posted successfully'); 48 | } 49 | } catch (e) { 50 | exception(e,context); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/qualityinspection/model/quality_inspection_model.dart: -------------------------------------------------------------------------------- 1 | //QualityInspectionModel class contains model to store data of quality inspection api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | 4 | class QualityInspectionModel { 5 | final String? batchNo; 6 | final String? description; 7 | final String? itemCode; 8 | final String? itemname; 9 | final String? inspectionType; 10 | final String? inspectedBy; 11 | final String? name; 12 | final String? qualityInspectionTemplate; 13 | final String? referenceType; 14 | final String? referenceName; 15 | final String? reportDate; 16 | final String? remarks; 17 | final double? sampleSize; 18 | final String? status; 19 | final List? qiReadings; 20 | final int? docstatus; 21 | 22 | QualityInspectionModel( 23 | {this.batchNo, 24 | this.description, 25 | this.docstatus, 26 | this.itemCode, 27 | this.itemname, 28 | this.inspectionType, 29 | this.inspectedBy, 30 | this.name, 31 | this.qualityInspectionTemplate, 32 | this.referenceType, 33 | this.referenceName, 34 | this.reportDate, 35 | this.remarks, 36 | this.sampleSize, 37 | this.qiReadings, 38 | this.status}); 39 | 40 | //For fetching json data from quality inspection api and storing it in quality inspection model 41 | factory QualityInspectionModel.fromJson(Map json) { 42 | return QualityInspectionModel( 43 | batchNo: json['batch_no'] ?? '', 44 | description: json['description'] ?? '', 45 | inspectedBy: json['inspected_by'] ?? '', 46 | inspectionType: json['inspection_type'] ?? '', 47 | itemCode: json['item_code'] ?? '', 48 | itemname: json['item_name'] ?? '', 49 | name: json['name'] ?? '', 50 | qualityInspectionTemplate: json['quality_inspection_template'] ?? '', 51 | referenceName: json['reference_name'] ?? '', 52 | referenceType: json['reference_type'] ?? '', 53 | reportDate: json['report_date'] ?? '', 54 | sampleSize: json['sample_size'] ?? '', 55 | remarks: json['remarks'] ?? '', 56 | status: json['status'] ?? '', 57 | 58 | ); 59 | } 60 | //For converting model to json format for storing it in quality inspection model 61 | Map toJson() { 62 | List? qualityInspectionReadings = this.qiReadings != null 63 | ? this.qiReadings!.map((i) => i.toJson()).toList() 64 | : null; 65 | return { 66 | 'docstatus': docstatus, 67 | 'batch_no': null, 68 | 'inspection_type': inspectionType, 69 | 'item_code': itemCode, 70 | 'item_name': itemname, 71 | "inspected_by": inspectedBy, 72 | 'quality_inspection_template': qualityInspectionTemplate, 73 | 'reference_name': referenceName, 74 | 'reference_type': referenceType, 75 | 'posting_date': reportDate, 76 | 'sample_size': sampleSize, 77 | 'status': status, 78 | "remarks": null, 79 | 'readings': qualityInspectionReadings 80 | }; 81 | } 82 | } 83 | //QualityInspectionReadings class contains model to store data of quality inspection api 84 | class QualityInspectionReadings { 85 | String? parameter; 86 | String? acceptanceCriteria; 87 | String? status; 88 | String? reading1; 89 | String? reading2; 90 | String? reading3; 91 | String? reading4; 92 | String? reading5; 93 | String? reading6; 94 | 95 | QualityInspectionReadings({ 96 | this.parameter, 97 | this.acceptanceCriteria, 98 | this.status, 99 | this.reading1, 100 | this.reading2, 101 | this.reading3, 102 | this.reading4, 103 | this.reading5, 104 | this.reading6, 105 | }); 106 | //For fetching json data from quality inspection api and storing it in quality inspection readings 107 | factory QualityInspectionReadings.fromJson(Map json) { 108 | return QualityInspectionReadings( 109 | acceptanceCriteria: json['value'] ?? '', 110 | parameter: json['specification'] ?? '', 111 | reading1: json['reading_1'] ?? '', 112 | reading2: json['reading_2'] ?? '', 113 | reading3: json['reading_3'] ?? '', 114 | reading4: json['reading_4'] ?? '', 115 | reading5: json['reading_5'] ?? '', 116 | reading6: json['reading_6'] ?? '', 117 | status: json['status'] ?? '', 118 | ); 119 | } 120 | 121 | //For converting model to json format for storing it in quality inspection readings 122 | Map toJson() => { 123 | 'specification': parameter, 124 | 'value': acceptanceCriteria, 125 | 'status': status, 126 | 'reading_1': reading1, 127 | 'reading_2': reading2, 128 | 'reading_3': reading3, 129 | 'reading_4': reading4, 130 | 'reading_5': reading5, 131 | 'reading_6': reading6, 132 | }; 133 | } 134 | -------------------------------------------------------------------------------- /lib/qualityinspection/model/reference_type_model.dart: -------------------------------------------------------------------------------- 1 | //StockEntry class contains model to store data of stock entry api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | 4 | class StockEntry { 5 | final String? name; 6 | final String? toWarehouse; 7 | final String? fromWarehouse; 8 | final String? postingDate; 9 | 10 | StockEntry( 11 | {this.name, this.toWarehouse, this.fromWarehouse, this.postingDate}); 12 | //For fetching json data from stock entry api and storing it in stock entry model 13 | factory StockEntry.fromJson(Map json) { 14 | return StockEntry( 15 | name: json['name'] ?? '', 16 | fromWarehouse: json['from_warehouse'] ?? '', 17 | postingDate: json['posting_date'] ?? '', 18 | toWarehouse: json['to_warehouse'] ?? ''); 19 | } 20 | } 21 | 22 | class PurchaseInvoice { 23 | final String? name; 24 | final String? supplierName; 25 | final double? grandtotal; 26 | final double? outstanding; 27 | 28 | PurchaseInvoice( 29 | {this.name, this.supplierName, this.grandtotal, this.outstanding}); 30 | factory PurchaseInvoice.fromJson(Map json) { 31 | return PurchaseInvoice( 32 | name: json['name'] ?? '', 33 | grandtotal: json['base_grand_total'] ?? 0, 34 | outstanding: json['outstanding_amount'] ?? 0, 35 | supplierName: json['supplier_name'] ?? ''); 36 | } 37 | } 38 | 39 | class PurchaseReciept { 40 | final String? name; 41 | final String? status; 42 | final String? supplierName; 43 | final String? postingDate; 44 | 45 | PurchaseReciept( 46 | {this.name, this.status, this.supplierName, this.postingDate}); 47 | factory PurchaseReciept.fromJson(Map json) { 48 | return PurchaseReciept( 49 | name: json['name'] ?? '', 50 | supplierName: json['supplier_name'] ?? '', 51 | postingDate: json['posting_date'] ?? '', 52 | status: json['status'] ?? ''); 53 | } 54 | } 55 | 56 | class SalesOrder { 57 | final String? name; 58 | final String? customer; 59 | final String? postingDate; 60 | final String? dueDate; 61 | final double? baseTotal; 62 | final double? roundedTotal; 63 | 64 | SalesOrder( 65 | {this.name, 66 | this.customer, 67 | this.postingDate, 68 | this.dueDate, 69 | this.baseTotal, 70 | this.roundedTotal}); 71 | factory SalesOrder.fromJson(Map json) { 72 | return SalesOrder( 73 | name: json['name'] ?? '', 74 | postingDate: json['posting_date'] ?? '', 75 | dueDate: json['due_date'] ?? '', 76 | baseTotal: json['base_total'] ?? '', 77 | roundedTotal: json['rounded_total'] ?? '', 78 | customer: json['customer'] ?? ''); 79 | } 80 | } 81 | 82 | class DeliveryNote { 83 | final String? name; 84 | final String? status; 85 | final String? customerName; 86 | final double? baseTotal; 87 | final String? territories; 88 | 89 | DeliveryNote( 90 | {this.territories, 91 | this.name, 92 | this.status, 93 | this.customerName, 94 | this.baseTotal}); 95 | factory DeliveryNote.fromJson(Map json) { 96 | return DeliveryNote( 97 | name: json['name'] ?? '', 98 | customerName: json['customer_name'] ?? '', 99 | baseTotal: json['base_total'] ?? '', 100 | territories: json['territory'] ?? '', 101 | status: json['status'] ?? ''); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /lib/qualityinspection/service/quality_inspection_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | import 'package:ebuzz/common/custom_toast.dart'; 4 | import 'package:ebuzz/exception/custom_exception.dart'; 5 | import 'package:ebuzz/network/base_dio.dart'; 6 | import 'package:ebuzz/qualityinspection/model/quality_inspection_model.dart'; 7 | import 'package:ebuzz/util/apiurls.dart'; 8 | import 'package:flutter/cupertino.dart'; 9 | 10 | //QualityInspectionService class contains function for fetching data or posting data 11 | class QualityInspectionService { 12 | //for fetching quality inpsection readings list 13 | Future> getQIReadingsList( 14 | String qiteplate,BuildContext context) async { 15 | List list = []; 16 | List qilist = []; 17 | try { 18 | Dio _dio = await BaseDio().getBaseDio(); 19 | final String qi = qualityInspectionTemplateReadingsListUrl(qiteplate); 20 | final response = await _dio.get(qi); 21 | var data = response.data; 22 | list = data['data']['item_quality_inspection_parameter']; 23 | for (var listJson in list) { 24 | qilist.add(QualityInspectionReadings.fromJson(listJson)); 25 | } 26 | return qilist; 27 | } catch (e) { 28 | exception(e,context); 29 | } 30 | return qilist; 31 | } 32 | 33 | //for posting data to quality inpsection api 34 | Future post(QualityInspectionModel qualityInspection,BuildContext context) async { 35 | try { 36 | Dio _dio = await BaseDio().getBaseDio(); 37 | final String url = qualityInspectionUrl(); 38 | final response = await _dio.post(url, data: qualityInspection); 39 | if (response.statusCode == 200) { 40 | fluttertoast(whiteColor, blueAccent, 'Data posted successfully'); 41 | } 42 | } catch (e) { 43 | exception(e,context); 44 | } 45 | } 46 | 47 | //for fetching quality inpsection template 48 | Future getQITemplate(String text,BuildContext context) async { 49 | String qitemplate = ''; 50 | try { 51 | Dio _dio = await BaseDio().getBaseDio(); 52 | final String url = itemDataUrl(text); 53 | final response = await _dio.get(url); 54 | var data = response.data; 55 | qitemplate = data['data']['quality_inspection_template'] ?? ''; 56 | return qitemplate; 57 | } catch (e) { 58 | exception(e,context); 59 | } 60 | return qitemplate; 61 | } 62 | 63 | //for fetching quality inpsection model list 64 | Future> getQualityInspectionModelList(BuildContext context) async { 65 | List list = []; 66 | List qilist = []; 67 | try { 68 | Dio _dio = await BaseDio().getBaseDio(); 69 | final String qi = qualityInspectionListUrl(); 70 | final response = await _dio.get(qi); 71 | var data = response.data; 72 | list = data['data']; 73 | for (var listJson in list) { 74 | qilist.add(QualityInspectionModel.fromJson(listJson)); 75 | } 76 | return qilist; 77 | } catch (e) { 78 | exception(e,context); 79 | } 80 | return qilist; 81 | } 82 | 83 | //for fetching quality inpsection readings list 84 | Future> getQualityInspectionReadingList( 85 | String name,BuildContext context) async { 86 | List list = []; 87 | List qireadinglist = []; 88 | try { 89 | Dio _dio = await BaseDio().getBaseDio(); 90 | final String qi = qualityInspectionDetailUrl(name); 91 | final response = await _dio.get(qi); 92 | var data = response.data; 93 | list = data['data']['readings']; 94 | for (var listJson in list) { 95 | qireadinglist.add(QualityInspectionReadings.fromJson(listJson)); 96 | } 97 | return qireadinglist; 98 | } catch (e) { 99 | exception(e,context); 100 | } 101 | return qireadinglist; 102 | } 103 | 104 | //for fetching quality inspection template list 105 | Future> qualityInspectionTemplateList( 106 | BuildContext context) async { 107 | List salesInvoiceList = []; 108 | try { 109 | Dio _dio = await BaseDio().getBaseDio(); 110 | final String sn = qualityinspectionTemplateUrl(); 111 | final response = await _dio.get(sn); 112 | var data = response.data; 113 | var list = data['data']; 114 | for (var listJson in list) { 115 | salesInvoiceList.add(listJson['name']); 116 | } 117 | return salesInvoiceList; 118 | } catch (e) { 119 | exception(e,context); 120 | } 121 | return salesInvoiceList; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /lib/qualityinspection/ui/quality_inspection_list_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/circular_progress.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | import 'package:ebuzz/common/custom_appbar.dart'; 4 | import 'package:ebuzz/common/navigations.dart'; 5 | import 'package:ebuzz/qualityinspection/model/quality_inspection_model.dart'; 6 | import 'package:ebuzz/qualityinspection/service/quality_inspection_service.dart'; 7 | import 'package:ebuzz/qualityinspection/ui/qiform1.dart'; 8 | import 'package:ebuzz/qualityinspection/ui/quality_inspection_detail_ui.dart'; 9 | import 'package:flutter/material.dart'; 10 | 11 | //QualityInspectionListUi class contains ui of list of quality inpsections 12 | class QualityInspectionListUi extends StatefulWidget { 13 | @override 14 | _QualityInspectionListUiState createState() => 15 | _QualityInspectionListUiState(); 16 | } 17 | 18 | class _QualityInspectionListUiState extends State { 19 | List _qualityInspectionList = []; 20 | bool _loading = false; 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | getQualityInspectionModelList(); 26 | } 27 | 28 | getQualityInspectionModelList() async { 29 | setState(() { 30 | _loading = true; 31 | }); 32 | _qualityInspectionList = 33 | await QualityInspectionService().getQualityInspectionModelList(context); 34 | setState(() {}); 35 | setState(() { 36 | _loading = false; 37 | }); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | backgroundColor: bgColor, 44 | appBar: PreferredSize( 45 | preferredSize: Size.fromHeight(55), 46 | child: CustomAppBar( 47 | title: 48 | Text('Quality Inspection', style: TextStyle(color: whiteColor)), 49 | leading: IconButton( 50 | onPressed: () => Navigator.pop(context), 51 | icon: Icon( 52 | Icons.arrow_back, 53 | color: whiteColor, 54 | ), 55 | ), 56 | ), 57 | ), 58 | floatingActionButton: FloatingActionButton( 59 | backgroundColor: blueAccent, 60 | onPressed: () { 61 | pushScreen(context, QiForm1()); 62 | }, 63 | child: Icon( 64 | Icons.add, 65 | color: whiteColor, 66 | ), 67 | ), 68 | body: _loading 69 | ? CircularProgress() 70 | : Padding( 71 | padding: EdgeInsets.symmetric(vertical: 5), 72 | child: ListView.builder( 73 | itemCount: _qualityInspectionList.length, 74 | itemBuilder: (context, index) { 75 | return GestureDetector( 76 | onTap: () { 77 | pushScreen( 78 | context, 79 | QualityInspectionDetailUi( 80 | qiData: _qualityInspectionList[index], 81 | ), 82 | ); 83 | }, 84 | child: QITileUi( 85 | qiData: _qualityInspectionList[index], 86 | ), 87 | ); 88 | }, 89 | ), 90 | ), 91 | ); 92 | } 93 | } 94 | 95 | //QITileUi class is a reusable widget which contains ui of list of quality inspection 96 | 97 | class QITileUi extends StatelessWidget { 98 | final QualityInspectionModel qiData; 99 | const QITileUi({required this.qiData}); 100 | @override 101 | Widget build(BuildContext context) { 102 | return Padding( 103 | padding: EdgeInsets.symmetric(horizontal: 5), 104 | child: Card( 105 | elevation: 3, 106 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), 107 | child: Padding( 108 | padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10), 109 | child: Row( 110 | children: [ 111 | Column( 112 | mainAxisAlignment: MainAxisAlignment.center, 113 | crossAxisAlignment: CrossAxisAlignment.start, 114 | children: [ 115 | Text( 116 | qiData.name!, 117 | style: TextStyle(fontSize: 18, color: blackColor), 118 | ), 119 | SizedBox( 120 | height: 5, 121 | ), 122 | Text( 123 | 'Report Date : ' + qiData.reportDate!, 124 | ), 125 | SizedBox( 126 | height: 5, 127 | ), 128 | Text( 129 | 'Inspection Type : ' + qiData.inspectionType!, 130 | ), 131 | SizedBox( 132 | height: 5, 133 | ), 134 | Text( 135 | 'Item Code : ' + qiData.itemCode!, 136 | ), 137 | ], 138 | ), 139 | Spacer(), 140 | SizedBox( 141 | width: 5, 142 | ), 143 | Container( 144 | width: 15, 145 | height: 15, 146 | decoration: BoxDecoration( 147 | shape: BoxShape.circle, 148 | color: 149 | qiData.status == 'Accepted' ? greenColor : blackColor), 150 | ), 151 | ], 152 | ), 153 | ), 154 | ), 155 | ); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /lib/quotation/model/quotation.dart: -------------------------------------------------------------------------------- 1 | 2 | class Quotation { 3 | final String quotationTo; 4 | final String partyName; 5 | final String customerName; 6 | final String company; 7 | final String date; 8 | final String validTill; 9 | final String orderType; 10 | final String currency; 11 | final String priceList; 12 | final double totalQuantity; 13 | final double totalINR; 14 | final double totalNetWeight; 15 | final double grandTotal; 16 | final double roundedTotal; 17 | final String inWords; 18 | final String doctype; 19 | final String status; 20 | final String name; 21 | final String contactEmail; 22 | final String contactNumber; 23 | 24 | Quotation({ 25 | this.quotationTo='', 26 | this.partyName='', 27 | this.customerName='', 28 | this.company='', 29 | this.date='', 30 | this.validTill='', 31 | this.orderType='', 32 | this.currency='', 33 | this.priceList='', 34 | this.totalQuantity=0, 35 | this.totalINR=0, 36 | this.totalNetWeight=0, 37 | this.grandTotal=0, 38 | this.roundedTotal=0, 39 | this.inWords='', 40 | this.doctype='', 41 | this.status='', 42 | this.name='', 43 | this.contactEmail='', 44 | this.contactNumber='', 45 | }); 46 | 47 | factory Quotation.fromJson(Map json) { 48 | return Quotation( 49 | company: json['company'] ?? '', 50 | currency: json['currency'] ?? '', 51 | customerName: json['customer_name'] ?? '', 52 | date: json['transaction_date'] ?? '', 53 | doctype: json['doctype'] ?? '', 54 | grandTotal: json['grand_total'] ?? 0, 55 | inWords: json['in_words'] ?? '', 56 | orderType: json['order_type'] ?? '', 57 | partyName: json['party_name'] ?? '', 58 | priceList: json['selling_price_list'] ?? '', 59 | quotationTo: json['quotation_to'] ?? '', 60 | roundedTotal: json['rounded_total'] ?? 0, 61 | totalINR: json['total'] ?? 0, 62 | totalNetWeight: json['total_net_weight'] ?? 0, 63 | totalQuantity: json['total_qty'] ?? 0, 64 | validTill: json['valid_till'] ?? '', 65 | status: json['workflow_state'] ?? '', 66 | name: json['name'] ?? '', 67 | contactEmail: json['contact_email'] ?? '', 68 | contactNumber: json['contact_mobile'] ?? ''); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/quotation/model/quotation_item.dart: -------------------------------------------------------------------------------- 1 | class QuotationItem { 2 | final double? qty; 3 | final String? itemName; 4 | final String? itemCode; 5 | final String? itemGroup; 6 | final double? rate; 7 | final String? stockUom; 8 | final String? weightUom; 9 | final double? amount; 10 | final String description; 11 | 12 | QuotationItem({ 13 | this.qty, 14 | this.itemName, 15 | this.itemCode, 16 | this.itemGroup, 17 | this.rate, 18 | this.stockUom, 19 | this.weightUom, 20 | this.amount, 21 | this.description='', 22 | }); 23 | 24 | factory QuotationItem.fromJson(Map json) { 25 | return QuotationItem( 26 | amount: json['amount'] ?? 0, 27 | description: json['description'] ?? '', 28 | itemCode: json['item_code'] ?? '', 29 | itemGroup: json['item_group'] ?? '', 30 | itemName: json['item_name'] ?? '', 31 | qty: json['qty'] ?? 0, 32 | rate: json['rate'] ?? 0, 33 | stockUom: json['stock_uom'] ?? '', 34 | weightUom: json['weight_uom'] ?? '', 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/quotation/service/quotation_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/exception/custom_exception.dart'; 3 | import 'package:ebuzz/network/base_dio.dart'; 4 | import 'package:ebuzz/quotation/model/quotation.dart'; 5 | import 'package:ebuzz/quotation/model/quotation_item.dart'; 6 | import 'package:ebuzz/util/apiurls.dart'; 7 | import 'package:flutter/cupertino.dart'; 8 | 9 | class QuotationService { 10 | Future> getQuotationList(BuildContext context) async { 11 | List qolist = []; 12 | try { 13 | Dio _dio = await BaseDio().getBaseDio(); 14 | final String qo = quotationListUrl(); 15 | final response = await _dio.get(qo); 16 | var data = response.data; 17 | var list = data['data'] as List; 18 | qolist = list.map((qo) => Quotation.fromJson(qo)).toList(); 19 | return qolist; 20 | } catch (e) { 21 | exception(e, context); 22 | } 23 | return qolist; 24 | } 25 | 26 | Future> getQuotationItemsList( 27 | String quotation, BuildContext context) async { 28 | List qolist = []; 29 | try { 30 | Dio _dio = await BaseDio().getBaseDio(); 31 | final String qo = quotationIndividualUrl(quotation); 32 | final response = await _dio.get(qo); 33 | var data = response.data; 34 | var list = data['data']['items'] as List; 35 | qolist = list.map((qo) => QuotationItem.fromJson(qo)).toList(); 36 | return qolist; 37 | } catch (e) { 38 | exception(e, context); 39 | } 40 | return qolist; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/quotation/ui/quotation_list_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:ebuzz/common/custom_appbar.dart'; 3 | import 'package:ebuzz/common/display_helper.dart'; 4 | import 'package:ebuzz/common/navigations.dart'; 5 | import 'package:ebuzz/common/ui_reusable_widget.dart'; 6 | import 'package:ebuzz/quotation/model/quotation.dart'; 7 | import 'package:ebuzz/quotation/model/quotation_item.dart'; 8 | import 'package:ebuzz/quotation/service/quotation_service.dart'; 9 | import 'package:ebuzz/quotation/ui/quotation_detail.dart'; 10 | import 'package:flutter/material.dart'; 11 | 12 | class QuotationListUi extends StatefulWidget { 13 | @override 14 | _QuotationListUiState createState() => _QuotationListUiState(); 15 | } 16 | 17 | class _QuotationListUiState extends State { 18 | List quotations = []; 19 | QuotationService _quotationService = QuotationService(); 20 | 21 | void fetchQuotations() async { 22 | quotations = await _quotationService.getQuotationList(context); 23 | setState(() {}); 24 | } 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | fetchQuotations(); 30 | } 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return Scaffold( 35 | backgroundColor: bgColor, 36 | appBar: PreferredSize( 37 | preferredSize: Size.fromHeight(55), 38 | child: CustomAppBar( 39 | title: Text('Quotations List', style: TextStyle(color: whiteColor)), 40 | leading: IconButton( 41 | onPressed: () => Navigator.pop(context, false), 42 | icon: Icon( 43 | Icons.arrow_back, 44 | color: whiteColor, 45 | ), 46 | ), 47 | ), 48 | ), 49 | body: Stack( 50 | children: [ 51 | Align( 52 | alignment: Alignment.bottomRight, 53 | child: versionText(), 54 | ), 55 | Padding( 56 | padding: const EdgeInsets.only(top: 10), 57 | child: ListView.builder( 58 | itemCount: quotations.length, 59 | shrinkWrap: true, 60 | itemBuilder: (context, index) { 61 | Quotation quotation = quotations[index]; 62 | return GestureDetector( 63 | onTap: () async { 64 | List qoItems = await _quotationService 65 | .getQuotationItemsList(quotation.name, context); 66 | pushScreen( 67 | context, 68 | QuotationDetail( 69 | quotation: quotations[index], 70 | quotationItems: qoItems, 71 | )); 72 | }, 73 | child: QuotationTileUi( 74 | quotation: quotation, 75 | ), 76 | ); 77 | }), 78 | ), 79 | ], 80 | ), 81 | ); 82 | } 83 | } 84 | 85 | class QuotationTileUi extends StatelessWidget { 86 | final Quotation quotation; 87 | const QuotationTileUi({required this.quotation}); 88 | @override 89 | Widget build(BuildContext context) { 90 | return Container( 91 | width: displayWidth(context) * 0.99, 92 | height: 90, 93 | child: Padding( 94 | padding: EdgeInsets.only(left: 5, right: 5), 95 | child: Card( 96 | shape: 97 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), 98 | elevation: 2, 99 | child: Padding( 100 | padding: const EdgeInsets.all(8.0), 101 | child: Row( 102 | children: [ 103 | Column( 104 | mainAxisAlignment: MainAxisAlignment.center, 105 | crossAxisAlignment: CrossAxisAlignment.start, 106 | children: [ 107 | Text( 108 | 'Name : ' + quotation.name, 109 | ), 110 | SizedBox( 111 | height: 5, 112 | ), 113 | Text( 114 | 'Date : ' + quotation.date, 115 | ), 116 | ], 117 | ), 118 | Spacer(), 119 | SizedBox( 120 | width: 5, 121 | ), 122 | Container( 123 | width: 15, 124 | height: 15, 125 | decoration: BoxDecoration( 126 | shape: BoxShape.circle, 127 | color: quotation.status == 'Submitted' 128 | ? greenColor 129 | : blackColor), 130 | ), 131 | ], 132 | ), 133 | ), 134 | ), 135 | ), 136 | ); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /lib/salesorder/model/sales_order.dart: -------------------------------------------------------------------------------- 1 | class SalesOrder { 2 | final String? name; 3 | final int? docstatus; 4 | final double? perbilled; 5 | final double? perdelivered; 6 | final String? customer; 7 | final String? company; 8 | final String? ordertype; 9 | final String? transactiondate; 10 | final String? deliverydate; 11 | final double? advancepaid; 12 | final double? grandtotal; 13 | final double? basegrandtotal; 14 | final String? portofdischarge; 15 | final double? totalnetweight; 16 | final double? totalqty; 17 | final String? status; 18 | final String? podate; 19 | final String? pono; 20 | final String? setwarehouse; 21 | final List? salesOrderItems; 22 | 23 | SalesOrder( 24 | {this.docstatus, 25 | this.salesOrderItems, 26 | this.setwarehouse, 27 | this.podate, 28 | this.pono, 29 | this.perdelivered, 30 | this.perbilled, 31 | this.status, 32 | this.customer, 33 | this.company, 34 | this.ordertype, 35 | this.transactiondate, 36 | this.deliverydate, 37 | this.advancepaid, 38 | this.grandtotal, 39 | this.basegrandtotal, 40 | this.portofdischarge, 41 | this.totalnetweight, 42 | this.totalqty, 43 | this.name}); 44 | factory SalesOrder.fromJson(Map json) { 45 | return SalesOrder( 46 | advancepaid: json['advance_paid'] ?? 0, 47 | basegrandtotal: json['base_grand_total'] ?? 0, 48 | company: json['company'] ?? '', 49 | customer: json['customer'] ?? '', 50 | deliverydate: json['delivery_date'] ?? '', 51 | grandtotal: json['grand_total'] ?? 0, 52 | ordertype: json['order_type'] ?? '', 53 | portofdischarge: json['port_of_discharge'] ?? '', 54 | totalnetweight: json['total_net_weight'] ?? 0, 55 | totalqty: json['total_qty'] ?? 0, 56 | transactiondate: json['transaction_date'] ?? '', 57 | status: json['status'] ?? 'Draft', 58 | name: json['name'] ?? '', 59 | perbilled: json['per_billed'] ?? 0, 60 | podate: json['podate'] ?? '', 61 | pono: json['pono'] ?? '', 62 | perdelivered: json['per_delivered'] ?? 0, 63 | setwarehouse: json['set_warehouse'] ?? '', 64 | salesOrderItems: json['items'] ?? null, 65 | ); 66 | } 67 | 68 | //For converting model to json format for storing it in quality inspection model 69 | Map toJson() { 70 | List? salesOrderItemsList = this.salesOrderItems != null 71 | ? this.salesOrderItems!.map((i) => i.toJson()).toList() 72 | : null; 73 | return { 74 | 'docstatus': docstatus, 75 | 'company': company, 76 | 'customer': customer, 77 | 'set_warehouse': setwarehouse, 78 | 'delivery_date': deliverydate, 79 | 'items': salesOrderItemsList 80 | }; 81 | } 82 | } 83 | 84 | class SalesOrderItems { 85 | double? qty; 86 | String? deliverydate; 87 | String? itemcode; 88 | String? itemname; 89 | double? amount; 90 | double? rate; 91 | 92 | SalesOrderItems({ 93 | this.qty, 94 | this.deliverydate, 95 | this.itemcode, 96 | this.itemname, 97 | this.amount, 98 | this.rate, 99 | }); 100 | 101 | factory SalesOrderItems.fromJson(Map json) { 102 | return SalesOrderItems( 103 | amount: json['amount'] ?? 0, 104 | deliverydate: json['delivery_date'] ?? '', 105 | itemcode: json['item_code'] ?? '', 106 | itemname: json['item_name'] ?? '', 107 | qty: json['qty'] ?? 0, 108 | rate: json['rate'] ?? 0, 109 | ); 110 | } 111 | 112 | //For converting model to json format for storing it in quality inspection readings 113 | Map toJson() => { 114 | 'delivery_date': deliverydate, 115 | 'item_code': itemcode, 116 | 'qty': qty, 117 | }; 118 | 119 | } 120 | 121 | class SalesOrderPaymentSchedule { 122 | final String? paymentterm; 123 | final double? paymentamount; 124 | final String? duedate; 125 | final double? invoiceportion; 126 | final String? description; 127 | 128 | SalesOrderPaymentSchedule( 129 | {this.paymentterm, 130 | this.paymentamount, 131 | this.duedate, 132 | this.invoiceportion, 133 | this.description}); 134 | factory SalesOrderPaymentSchedule.fromJson(Map json) { 135 | return SalesOrderPaymentSchedule( 136 | description: json['description'] ?? '', 137 | duedate: json['due_date'] ?? '', 138 | invoiceportion: json['invoice_portion'] ?? 0, 139 | paymentamount: json['payment_amount'] ?? 0, 140 | paymentterm: json['payment_term'] ?? '', 141 | ); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /lib/salesorder/service/sales_order_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | import 'package:ebuzz/common/custom_toast.dart'; 4 | import 'package:ebuzz/exception/custom_exception.dart'; 5 | import 'package:ebuzz/network/base_dio.dart'; 6 | import 'package:ebuzz/salesorder/model/sales_order.dart'; 7 | import 'package:ebuzz/util/apiurls.dart'; 8 | import 'package:flutter/cupertino.dart'; 9 | 10 | class SalesOrderService { 11 | 12 | //for posting data to quality inpsection api 13 | Future post(SalesOrder salesOrder, BuildContext context) async { 14 | try { 15 | Dio _dio = await BaseDio().getBaseDio(); 16 | final String url = salesOrderUrl(); 17 | final response = await _dio.post(url, data: salesOrder); 18 | if (response.statusCode == 200) { 19 | fluttertoast(whiteColor, blueAccent, 'Data posted successfully'); 20 | } 21 | } catch (e) { 22 | exception(e,context); 23 | } 24 | } 25 | 26 | //for fetching sales order list 27 | Future> getSalesOrderList(BuildContext context) async { 28 | List list = []; 29 | List solist = []; 30 | try { 31 | Dio _dio = await BaseDio().getBaseDio(); 32 | final String so = salesOrderListUrl(); 33 | final response = await _dio.get(so); 34 | var data = response.data; 35 | list = data['data']; 36 | for (var listJson in list) { 37 | solist.add(SalesOrder.fromJson(listJson)); 38 | } 39 | return solist; 40 | } catch (e) { 41 | exception(e,context); 42 | } 43 | return solist; 44 | } 45 | 46 | //for fetching sales order item list 47 | Future> getSalesOrderItemList(String name, BuildContext context) async { 48 | List items = []; 49 | 50 | try { 51 | Dio _dio = await BaseDio().getBaseDio(); 52 | 53 | final String itemList = salesOrderDetailUrl(name); 54 | var response = await _dio.get( 55 | itemList, 56 | ); 57 | var data = response.data; 58 | List list = data['data']['items']; 59 | for (var listJson in list) { 60 | items.add(SalesOrderItems.fromJson(listJson)); 61 | } 62 | return items; 63 | } catch (e) { 64 | exception(e,context); 65 | } 66 | return items; 67 | } 68 | 69 | //for fetching sales order payment schedule list 70 | Future> getSalesOrderPaymentScheduleList( 71 | String name, BuildContext context) async { 72 | List ps = []; 73 | 74 | try { 75 | Dio _dio = await BaseDio().getBaseDio(); 76 | 77 | final String itemList = salesOrderDetailUrl(name); 78 | var response = await _dio.get( 79 | itemList, 80 | ); 81 | var data = response.data; 82 | List list = data['data']['payment_schedule']; 83 | for (var listJson in list) { 84 | ps.add(SalesOrderPaymentSchedule.fromJson(listJson)); 85 | } 86 | return ps; 87 | } catch (e) { 88 | exception(e,context); 89 | } 90 | return ps; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/salesorder/ui/sales_order_list_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:ebuzz/common/custom_appbar.dart'; 3 | import 'package:ebuzz/common/navigations.dart'; 4 | import 'package:ebuzz/salesorder/model/sales_order.dart'; 5 | import 'package:ebuzz/salesorder/service/sales_order_service.dart'; 6 | import 'package:ebuzz/salesorder/ui/sales_order_detail_ui.dart'; 7 | import 'package:ebuzz/salesorder/ui/sales_order_form1.dart'; 8 | import 'package:flutter/material.dart'; 9 | 10 | class SalesOrderListUi extends StatefulWidget { 11 | @override 12 | _SalesOrderListUiState createState() => _SalesOrderListUiState(); 13 | } 14 | 15 | class _SalesOrderListUiState extends State { 16 | List _salesOrderList = []; 17 | @override 18 | void initState() { 19 | super.initState(); 20 | getSalesOrderList(); 21 | } 22 | 23 | getSalesOrderList() async { 24 | _salesOrderList = await SalesOrderService().getSalesOrderList(context); 25 | setState(() {}); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | backgroundColor: bgColor, 32 | appBar: PreferredSize( 33 | preferredSize: Size.fromHeight(55), 34 | child: CustomAppBar( 35 | title: 36 | Text('Sales Order List', style: TextStyle(color: whiteColor)), 37 | leading: IconButton( 38 | onPressed: () => Navigator.pop(context), 39 | icon: Icon( 40 | Icons.arrow_back, 41 | color: whiteColor, 42 | ), 43 | ), 44 | )), 45 | body: Padding( 46 | padding: EdgeInsets.symmetric(vertical: 5), 47 | child: ListView.builder( 48 | itemCount: _salesOrderList.length, 49 | itemBuilder: (context, index) { 50 | return GestureDetector( 51 | onTap: () { 52 | pushScreen( 53 | context, 54 | SalesOrderDetail( 55 | salesOrder: _salesOrderList[index], 56 | ), 57 | ); 58 | }, 59 | child: SOTileUi( 60 | soData: _salesOrderList[index], 61 | ), 62 | ); 63 | }, 64 | ), 65 | ), 66 | floatingActionButton: FloatingActionButton( 67 | backgroundColor: blueAccent, 68 | onPressed: () { 69 | pushScreen(context, SalesOrderForm1()); 70 | }, 71 | child: Icon( 72 | Icons.add, 73 | color: whiteColor, 74 | ), 75 | ), 76 | ); 77 | } 78 | } 79 | 80 | //SOTileUi class is a reusable widget which contains ui of list of sales order 81 | class SOTileUi extends StatelessWidget { 82 | final SalesOrder soData; 83 | const SOTileUi({required this.soData}); 84 | @override 85 | Widget build(BuildContext context) { 86 | return Padding( 87 | padding: EdgeInsets.symmetric(horizontal: 5), 88 | child: Card( 89 | elevation: 3, 90 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), 91 | child: Padding( 92 | padding: EdgeInsets.all(8.0), 93 | child: Row( 94 | children: [ 95 | Column( 96 | mainAxisAlignment: MainAxisAlignment.center, 97 | crossAxisAlignment: CrossAxisAlignment.start, 98 | children: [ 99 | Text( 100 | soData.customer ?? '', 101 | style: TextStyle(fontSize: 16, color: blackColor), 102 | ), 103 | SizedBox(height: 5), 104 | Text( 105 | 'Delivery Date : ' + soData.deliverydate!, 106 | ), 107 | SizedBox(height: 5), 108 | Text( 109 | 'Grand Total : \$' + soData.grandtotal.toString(), 110 | ), 111 | SizedBox(height: 5), 112 | Row( 113 | children: [ 114 | Text( 115 | 'Percent Billed : ' + 116 | soData.perbilled!.toStringAsPrecision(2) + 117 | '% ', 118 | ), 119 | Text( 120 | 'Percent Delivered : ' + 121 | soData.perdelivered!.toStringAsPrecision(2) + 122 | '%', 123 | ), 124 | ], 125 | ), 126 | SizedBox(height: 5), 127 | Text( 128 | 'Status : ' + soData.status!, 129 | ), 130 | ], 131 | ), 132 | Spacer(), 133 | SizedBox(width: 5), 134 | ], 135 | ), 136 | ), 137 | ), 138 | ); 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /lib/settings/ui/settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:ebuzz/common/custom_appbar.dart'; 3 | import 'package:ebuzz/common/setting_tile.dart'; 4 | import 'package:ebuzz/util/version.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class Settings extends StatefulWidget { 8 | @override 9 | _SettingsState createState() => _SettingsState(); 10 | } 11 | 12 | class _SettingsState extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | appBar: PreferredSize( 17 | preferredSize: Size.fromHeight(55), 18 | child: CustomAppBar( 19 | title: Text('Settings', style: TextStyle(color: whiteColor)), 20 | leading: IconButton( 21 | onPressed: () => Navigator.pop(context), 22 | icon: Icon( 23 | Icons.arrow_back, 24 | color: whiteColor, 25 | ), 26 | ), 27 | ), 28 | ), 29 | body: Column( 30 | children: [ 31 | SettingsTile( 32 | text: 'Version : $version', 33 | ) 34 | ], 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/stockentry/model/stockentry.dart: -------------------------------------------------------------------------------- 1 | //StockEntryModel class contains model to store data of stock entry api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | 4 | class StockEntryModel { 5 | final String? stockEntryType; 6 | final String? postingDate; 7 | final String? company; 8 | final String? postingTime; 9 | final String? workOrder; 10 | final String? bomNo; 11 | final String? purchaseOrder; 12 | final double? forQuantity; 13 | final String? defaultSourceWarehouse; 14 | final String? defaultTargetWarehouse; 15 | final double? totalIncomingValue; 16 | final double? totalOutgoingValue; 17 | final double? totalValueDifference; 18 | final double? totalAdditionalCosts; 19 | final String? name; 20 | final String? workflowState; 21 | 22 | StockEntryModel({ 23 | this.stockEntryType, 24 | this.postingDate, 25 | this.company, 26 | this.postingTime, 27 | this.workOrder, 28 | this.bomNo, 29 | this.forQuantity, 30 | this.defaultSourceWarehouse, 31 | this.defaultTargetWarehouse, 32 | this.totalIncomingValue, 33 | this.totalOutgoingValue, 34 | this.name, 35 | this.purchaseOrder, 36 | this.totalValueDifference, 37 | this.totalAdditionalCosts, 38 | this.workflowState, 39 | }); 40 | 41 | //For fetching json data from stock entry api and storing it in stock entry model 42 | factory StockEntryModel.fromJson(Map json) { 43 | return StockEntryModel( 44 | bomNo: json['bom_no'] ?? '', 45 | company: json['company'] ?? '', 46 | defaultSourceWarehouse: json['from_warehouse'] ?? '', 47 | defaultTargetWarehouse: json['to_warehouse'] ?? '', 48 | forQuantity: json['fg_completed_qty'] ?? 0, 49 | postingDate: json['posting_date'] ?? '', 50 | postingTime: json['posting_time'] ?? '', 51 | stockEntryType: json['stock_entry_type'] ?? '', 52 | totalAdditionalCosts: json['total_additional_costs'] ?? 0, 53 | totalIncomingValue: json['total_incoming_value'] ?? 0, 54 | totalOutgoingValue: json['total_outgoing_value'] ?? 0, 55 | totalValueDifference: json['value_difference'] ?? 0, 56 | workOrder: json['work_order'] ?? '', 57 | purchaseOrder: json['purchase_order'] ?? '', 58 | name: json['name'] ?? '', 59 | workflowState: json['workflow_state'] ?? ''); 60 | } 61 | } 62 | 63 | //StockEntryItem class contains model to store item data of stock entry api 64 | class StockEntryItem { 65 | final String? defaultSourceWarehouse; 66 | final String? defaultTargetWarehouse; 67 | final String? itemCode; 68 | final String? itemName; 69 | final String? itemGroup; 70 | final double? quantity; 71 | 72 | StockEntryItem( 73 | {this.defaultSourceWarehouse, 74 | this.defaultTargetWarehouse, 75 | this.itemCode, 76 | this.itemName, 77 | this.itemGroup, 78 | this.quantity}); 79 | 80 | //For fetching json data from stock entry api and storing it in stock entry item model 81 | factory StockEntryItem.fromJson(Map json) { 82 | return StockEntryItem( 83 | defaultSourceWarehouse: json['s_warehouse'] ?? '', 84 | defaultTargetWarehouse: json['t_warehouse'] ?? '', 85 | itemCode: json['item_code'] ?? '', 86 | itemGroup: json['item_group'] ?? '', 87 | itemName: json['item_name'] ?? '', 88 | quantity: json['qty'] ?? 0, 89 | ); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /lib/stockentry/service/stock_entry_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/exception/custom_exception.dart'; 3 | import 'package:ebuzz/network/base_dio.dart'; 4 | import 'package:ebuzz/stockentry/model/stockentry.dart'; 5 | import 'package:ebuzz/util/apiurls.dart'; 6 | import 'package:flutter/cupertino.dart'; 7 | 8 | //StockEntryService class contains function for fetching data or posting data 9 | class StockEntryService { 10 | //for fetching stock entry list 11 | Future> getStockEntryList(BuildContext context) async { 12 | List list = []; 13 | List selist = []; 14 | try { 15 | Dio _dio = await BaseDio().getBaseDio(); 16 | final String qi = stockEntryUrl(); 17 | final response = await _dio.get(qi); 18 | var data = response.data; 19 | list = data['data']; 20 | for (var listJson in list) { 21 | selist.add(StockEntryModel.fromJson(listJson)); 22 | } 23 | return selist; 24 | } catch (e) { 25 | exception(e,context); 26 | } 27 | return selist; 28 | } 29 | 30 | //for fetching stock entry item list 31 | Future> getStockEntryitemList(String name, BuildContext context) async { 32 | List list = []; 33 | List qilist = []; 34 | try { 35 | Dio _dio = await BaseDio().getBaseDio(); 36 | final String qi = stockEntryDetailUrl(name); 37 | final response = await _dio.get(qi); 38 | var data = response.data; 39 | list = data['data']['items']; 40 | for (var listJson in list) { 41 | qilist.add(StockEntryItem.fromJson(listJson)); 42 | } 43 | return qilist; 44 | } catch (e) { 45 | exception(e,context); 46 | } 47 | return qilist; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/stockentry/ui/stock_entry_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/circular_progress.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | import 'package:ebuzz/common/custom_appbar.dart'; 4 | import 'package:ebuzz/common/display_helper.dart'; 5 | import 'package:ebuzz/common/navigations.dart'; 6 | import 'package:ebuzz/stockentry/service/stock_entry_service.dart'; 7 | import 'package:ebuzz/stockentry/ui/stock_entry_detail.dart'; 8 | import 'package:flutter/material.dart'; 9 | import 'package:ebuzz/stockentry/model/stockentry.dart'; 10 | 11 | //StockEntryList class contains ui of list of stock entries 12 | class StockEntryList extends StatefulWidget { 13 | @override 14 | _StockEntryListState createState() => _StockEntryListState(); 15 | } 16 | 17 | class _StockEntryListState extends State { 18 | List list = []; 19 | bool _loading = false; 20 | @override 21 | void initState() { 22 | super.initState(); 23 | getData(); 24 | } 25 | 26 | getData() async { 27 | setState(() { 28 | _loading = true; 29 | }); 30 | list = await StockEntryService().getStockEntryList(context); 31 | setState(() { 32 | _loading = false; 33 | }); 34 | setState(() {}); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return Scaffold( 40 | backgroundColor: bgColor, 41 | appBar: PreferredSize( 42 | preferredSize: Size.fromHeight(55), 43 | child: CustomAppBar( 44 | title: Text('Stock Entry List', style: TextStyle(color: whiteColor)), 45 | leading: IconButton( 46 | onPressed: () => Navigator.pop(context), 47 | icon: Icon( 48 | Icons.arrow_back, 49 | color: whiteColor, 50 | ), 51 | ), 52 | ), 53 | ), 54 | body: _loading 55 | ? CircularProgress() 56 | : Padding( 57 | padding: EdgeInsets.symmetric(vertical: 5), 58 | child: ListView.builder( 59 | shrinkWrap: true, 60 | itemCount: list.length, 61 | itemBuilder: (context, index) { 62 | return GestureDetector( 63 | onTap: () { 64 | pushScreen( 65 | context, 66 | StockEntryDetail( 67 | name: list[index].name!, 68 | stockEntryModelData: list[index], 69 | ), 70 | ); 71 | }, 72 | child: StockEntryTileUi( 73 | seData: list[index], 74 | ), 75 | ); 76 | }), 77 | ), 78 | ); 79 | } 80 | } 81 | 82 | class StockEntryTileUi extends StatelessWidget { 83 | final StockEntryModel seData; 84 | const StockEntryTileUi({required this.seData}); 85 | @override 86 | Widget build(BuildContext context) { 87 | return Container( 88 | width: displayWidth(context) * 0.99, 89 | height: 90, 90 | child: Padding( 91 | padding: EdgeInsets.symmetric(horizontal: 5), 92 | child: Card( 93 | elevation: 3, 94 | shape: 95 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), 96 | child: Padding( 97 | padding: const EdgeInsets.all(8.0), 98 | child: Row( 99 | children: [ 100 | Column( 101 | mainAxisAlignment: MainAxisAlignment.center, 102 | crossAxisAlignment: CrossAxisAlignment.start, 103 | children: [ 104 | Text( 105 | 'Type : ' + seData.stockEntryType!, 106 | style: TextStyle(fontSize: 14, color: blackColor), 107 | ), 108 | SizedBox( 109 | height: 5, 110 | ), 111 | Text( 112 | 'Posting Date : ' + seData.postingDate!, 113 | ), 114 | ], 115 | ), 116 | Spacer(), 117 | SizedBox( 118 | width: 5, 119 | ), 120 | Container( 121 | width: 15, 122 | height: 15, 123 | decoration: BoxDecoration( 124 | shape: BoxShape.circle, 125 | color: seData.workflowState == 'Submitted' 126 | ? greenColor 127 | : blackColor), 128 | ), 129 | ], 130 | ), 131 | ), 132 | ), 133 | ), 134 | ); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /lib/util/constants.dart: -------------------------------------------------------------------------------- 1 | class Constants{ 2 | static const cartKey = 'cart'; 3 | static const appName= 'Ebuzz'; 4 | 5 | } 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /lib/util/doctype_names.dart: -------------------------------------------------------------------------------- 1 | class DoctypeNames { 2 | static const String batch = 'Batch'; 3 | static const String bom = 'BOM'; 4 | static const String brand = 'Brand'; 5 | static const String company = 'Company'; 6 | static const String currency = 'Currency'; 7 | static const String customer = 'Customer'; 8 | static const String customerGroup = 'Customer Group'; 9 | static const String deliveryNote = 'Delivery Note'; 10 | static const String evaluasiStaff = 'Evaluasi Staff'; // 11 | static const String globalDefaults = 'Global Defaults'; // 12 | static const String item = 'Item'; 13 | static const String itemGroup = 'Item Group'; 14 | static const String lead = 'Lead'; 15 | static const String leaveApplication = 'Leave Application'; 16 | static const String leaveLedgerEntry = 'Leave Ledger Entry'; // 17 | static const String location = 'Location'; 18 | static const String purchaseInvoice = 'Purchase Invoice'; 19 | static const String purchaseOrder = 'Purchase Order'; 20 | static const String purchaseReceipt = 'Purchase Receipt'; 21 | static const String qualityInspection = 'Quality Inspection'; 22 | static const String qualityInspectionTemplate = 'Quality Inspection Template'; 23 | static const String quotation = 'Quotation'; 24 | static const String salesInvoice = 'Sales Invoice'; 25 | static const String salesOrder = 'Sales Order'; 26 | static const String stockEntry = 'Stock Entry'; 27 | static const String stockLedger = 'Stock Ledger'; 28 | static const String stockLedgerEntry = 'Stock Ledger Entry'; 29 | static const String territory = 'Territory'; 30 | static const String uom = 'Unit of Measure (UOM)'; // Unit of Measure (UOM) 31 | static const String user = 'User'; 32 | static const String warehouse = 'Warehouse'; 33 | static const String workOrder = 'Work Order'; 34 | } 35 | -------------------------------------------------------------------------------- /lib/util/linear_gradients.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class LinearGradientCustom extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | backgroundColor: greyColor, 9 | body: Padding( 10 | padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 5), 11 | child: GridView.count( 12 | crossAxisCount: 2, 13 | mainAxisSpacing: 5, 14 | crossAxisSpacing: 5, 15 | children: [ 16 | gradientCard(0xFF5753FF, 0xFF5CBFF1), 17 | gradientCard(0xFFEA778D, 0xFFF64BA6), 18 | gradientCard(0xFF4774E2, 0xFF84C7A5), 19 | gradientCard(0xFFBA92FB, 0xFF5E83F5), 20 | gradientCard(0xFF5753FF, 0xFFEA778D), 21 | gradientCard(0xFFF27381, 0xFFFFC785), 22 | gradientCard(0xFF878BDD, 0xFFA5EFE7), 23 | gradientCard(0xFF1CD5DA, 0xFF5385E7), 24 | gradientCard(0xFFF6539A, 0xFFFD707C), 25 | gradientCard(0xFF39DC97, 0xFF3CB8B2), 26 | gradientCard(0xFFA3C7FD, 0xFFBCE2FB), 27 | gradientCard(0xFFF8C76D, 0xFFF7A685), 28 | gradientCard(0xFF7BDFD5, 0xFFAF91CD), 29 | ], 30 | ), 31 | ), 32 | ); 33 | } 34 | 35 | Widget gradientCard(int color1, int color2) { 36 | return Container( 37 | decoration: BoxDecoration( 38 | borderRadius: BorderRadius.circular(10), 39 | gradient: LinearGradient( 40 | begin: Alignment.centerLeft, 41 | end: Alignment.centerRight, 42 | colors: [ 43 | Color(color1), 44 | Color(color2), 45 | ], 46 | ), 47 | ), 48 | child: Center( 49 | child: Text( 50 | 'Quality Inspection', 51 | style: TextStyle( 52 | fontSize: 18, fontWeight: FontWeight.w600, color: whiteColor), 53 | ), 54 | ), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/util/preference.dart: -------------------------------------------------------------------------------- 1 | //Storing shared preferences values 2 | 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | Future getApiUrl() async { 6 | SharedPreferences prefs = await SharedPreferences.getInstance(); 7 | return prefs.getString('apiUrl'); 8 | } 9 | 10 | Future?> getBaseUrlList() async { 11 | List? list =[]; 12 | SharedPreferences prefs = await SharedPreferences.getInstance(); 13 | list= prefs.getStringList('url'); 14 | return list; 15 | } 16 | 17 | Future getCookie() async { 18 | SharedPreferences prefs = await SharedPreferences.getInstance(); 19 | return prefs.getString('cookie'); 20 | } 21 | 22 | Future getCompany() async { 23 | SharedPreferences prefs = await SharedPreferences.getInstance(); 24 | return prefs.getString('company'); 25 | } 26 | 27 | Future getCurrency() async { 28 | SharedPreferences prefs = await SharedPreferences.getInstance(); 29 | return prefs.getString('currency'); 30 | } 31 | 32 | Future getName() async { 33 | SharedPreferences prefs = await SharedPreferences.getInstance(); 34 | return prefs.getString('name'); 35 | } 36 | 37 | Future getLoggedIn() async { 38 | SharedPreferences prefs = await SharedPreferences.getInstance(); 39 | return prefs.getBool('loggedIn'); 40 | } 41 | 42 | Future getUserName() async { 43 | SharedPreferences prefs = await SharedPreferences.getInstance(); 44 | return prefs.getString('username'); 45 | } 46 | 47 | setApiUrl(String apiurl) async { 48 | SharedPreferences prefs = await SharedPreferences.getInstance(); 49 | prefs.setString('apiUrl', apiurl); 50 | } 51 | 52 | setBaseUrlList(List apiurl) async { 53 | SharedPreferences prefs = await SharedPreferences.getInstance(); 54 | prefs.setStringList('url', apiurl); 55 | } 56 | 57 | setCookie(String cookie) async { 58 | SharedPreferences prefs = await SharedPreferences.getInstance(); 59 | prefs.setString('cookie', cookie); 60 | } 61 | 62 | setCompany(String company) async { 63 | SharedPreferences prefs = await SharedPreferences.getInstance(); 64 | prefs.setString('company', company); 65 | } 66 | 67 | setCurrency(String currency) async { 68 | SharedPreferences prefs = await SharedPreferences.getInstance(); 69 | prefs.setString('currency', currency); 70 | } 71 | 72 | setName(String fullname) async { 73 | SharedPreferences prefs = await SharedPreferences.getInstance(); 74 | prefs.setString('name', fullname); 75 | } 76 | 77 | setLoggedIn(bool value) async { 78 | SharedPreferences prefs = await SharedPreferences.getInstance(); 79 | prefs.setBool('loggedIn', value); 80 | } 81 | 82 | setUserName(String name) async { 83 | SharedPreferences prefs = await SharedPreferences.getInstance(); 84 | prefs.setString('username', name); 85 | } 86 | 87 | removeApiUrl() async { 88 | SharedPreferences prefs = await SharedPreferences.getInstance(); 89 | prefs.remove('apiUrl'); 90 | } 91 | 92 | removeCookie() async { 93 | SharedPreferences prefs = await SharedPreferences.getInstance(); 94 | prefs.remove('cookie'); 95 | } 96 | 97 | removeCompany() async { 98 | SharedPreferences prefs = await SharedPreferences.getInstance(); 99 | prefs.remove('company'); 100 | } 101 | 102 | removeCurrency() async { 103 | SharedPreferences prefs = await SharedPreferences.getInstance(); 104 | prefs.remove('currency'); 105 | } 106 | 107 | removeName() async { 108 | SharedPreferences prefs = await SharedPreferences.getInstance(); 109 | prefs.remove('name'); 110 | } 111 | 112 | removeLoggedIn() async { 113 | SharedPreferences prefs = await SharedPreferences.getInstance(); 114 | prefs.remove('loggedIn'); 115 | } 116 | 117 | removeUserName() async { 118 | SharedPreferences prefs = await SharedPreferences.getInstance(); 119 | prefs.remove('username'); 120 | } 121 | -------------------------------------------------------------------------------- /lib/util/version.dart: -------------------------------------------------------------------------------- 1 | //Version value 2 | 3 | String version = 'v0.2.0'; 4 | -------------------------------------------------------------------------------- /lib/widgets/card_list_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CardListTile extends StatelessWidget { 4 | final Widget? leading; 5 | final Widget? trailing; 6 | final double? elevation; 7 | final void Function()? onTap; 8 | final Color? color; 9 | final EdgeInsetsGeometry? margin; 10 | final Widget? title; 11 | final Widget? subtitle; 12 | 13 | const CardListTile({ 14 | this.leading, 15 | this.trailing, 16 | this.elevation=1, 17 | this.onTap, 18 | this.color, 19 | this.margin=EdgeInsets.zero, 20 | this.title, 21 | this.subtitle, 22 | }); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Card( 27 | elevation: elevation, 28 | color: color, 29 | margin: margin, 30 | child: ListTile( 31 | leading: leading, 32 | trailing: trailing, 33 | title: title, 34 | subtitle: subtitle, 35 | onTap: onTap, 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/widgets/custom_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomCard extends StatelessWidget { 4 | const CustomCard({ 5 | this.child, 6 | this.elevation = 1, 7 | this.color = Colors.white, 8 | this.margin = EdgeInsets.zero, 9 | this.shape, 10 | }); 11 | final Widget? child; 12 | final double? elevation; 13 | final Color? color; 14 | final EdgeInsetsGeometry? margin; 15 | final ShapeBorder? shape; 16 | @override 17 | Widget build(BuildContext context) { 18 | return Card( 19 | elevation: elevation, 20 | child: child, 21 | color: color, 22 | margin: margin, 23 | shape: shape, 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/widgets/custom_dropdown.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | import 'package:ebuzz/common/display_helper.dart'; 4 | 5 | class CustomDropDown extends StatelessWidget { 6 | const CustomDropDown({ 7 | this.alignment = CrossAxisAlignment.center, 8 | this.decoration, 9 | this.label, 10 | this.required, 11 | this.labelStyle, 12 | this.onChanged, 13 | this.value, 14 | this.elevation = 1, 15 | this.focusNode, 16 | this.dropdownColor, 17 | this.focusColor, 18 | this.hint, 19 | this.icon, 20 | this.iconDisabledColor, 21 | this.iconEnabledColor, 22 | this.iconSize = 25, 23 | this.items, 24 | this.margin=EdgeInsets.zero, 25 | this.padding=EdgeInsets.zero, 26 | }); 27 | 28 | final String? label; 29 | final bool? required; 30 | final TextStyle? labelStyle; 31 | final void Function(String?)? onChanged; 32 | final String? value; 33 | final int elevation; 34 | final FocusNode? focusNode; 35 | final Color? dropdownColor; 36 | final Color? focusColor; 37 | final Widget? hint; 38 | final Widget? icon; 39 | final Color? iconDisabledColor; 40 | final Color? iconEnabledColor; 41 | final double iconSize; 42 | final List>? items; 43 | final Decoration? decoration; 44 | final CrossAxisAlignment alignment; 45 | final EdgeInsetsGeometry? margin; 46 | final EdgeInsetsGeometry padding; 47 | 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | return Column( 52 | crossAxisAlignment: alignment, 53 | children: [ 54 | Row( 55 | children: [ 56 | Text( 57 | label!, 58 | style: labelStyle, 59 | ), 60 | SizedBox(width: 8), 61 | required == true 62 | ? Text( 63 | '*', 64 | style: TextStyle(color: redColor), 65 | ) 66 | : Container() 67 | ], 68 | ), 69 | SizedBox( 70 | height: 10, 71 | ), 72 | Container( 73 | decoration: decoration, 74 | margin: margin, 75 | width: displayWidth(context), 76 | child: Padding( 77 | padding: padding, 78 | child: DropdownButtonHideUnderline( 79 | child: DropdownButton( 80 | value: value, 81 | elevation: elevation, 82 | onChanged: onChanged, 83 | focusNode: focusNode, 84 | dropdownColor: dropdownColor, 85 | focusColor: focusColor, 86 | hint: hint, 87 | icon: icon, 88 | iconDisabledColor: iconDisabledColor, 89 | iconEnabledColor: iconEnabledColor, 90 | iconSize: iconSize, 91 | items: items, 92 | ), 93 | ), 94 | ), 95 | ), 96 | ], 97 | ); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /lib/widgets/custom_textformformfield.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | 4 | class CustomTextFormField extends StatelessWidget { 5 | CustomTextFormField({ 6 | required this.label, 7 | this.labelStyle, 8 | this.required = false, 9 | this.controller, 10 | this.obscureText = false, 11 | this.keyboardType = TextInputType.text, 12 | this.style, 13 | this.validator, 14 | this.onEditingComplete, 15 | this.focusNode, 16 | this.padding = EdgeInsets.zero, 17 | this.decoration, 18 | this.textInputAction = TextInputAction.next, 19 | this.readOnly = false, 20 | this.onChanged, 21 | this.initialValue, 22 | }); 23 | 24 | final String? label; 25 | final bool? required; 26 | final TextEditingController? controller; 27 | final TextInputType? keyboardType; 28 | final TextStyle? style; 29 | final String? Function(String?)? validator; 30 | final void Function()? onEditingComplete; 31 | final FocusNode? focusNode; 32 | final EdgeInsetsGeometry padding; 33 | final InputDecoration? decoration; 34 | final TextStyle? labelStyle; 35 | final TextInputAction textInputAction; 36 | final bool obscureText; 37 | final bool readOnly; 38 | final void Function(String)? onChanged; 39 | final String? initialValue; 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return Padding( 44 | padding: padding, 45 | child: Column( 46 | children: [ 47 | Row( 48 | children: [ 49 | Text( 50 | label!, 51 | style: labelStyle, 52 | ), 53 | SizedBox(width: 8), 54 | required == true 55 | ? Text( 56 | '*', 57 | style: TextStyle(color: redColor), 58 | ) 59 | : Container() 60 | ], 61 | ), 62 | SizedBox( 63 | height: 10, 64 | ), 65 | TextFormField( 66 | controller: controller, 67 | keyboardType: keyboardType, 68 | focusNode: focusNode, 69 | obscureText: obscureText, 70 | onChanged: onChanged, 71 | style: style, 72 | validator: validator, 73 | initialValue: initialValue, 74 | textInputAction: textInputAction, 75 | onEditingComplete: onEditingComplete, 76 | decoration: decoration, 77 | readOnly: readOnly, 78 | ), 79 | ], 80 | ), 81 | ); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/widgets/custom_typeahead_formfield.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_typeahead/flutter_typeahead.dart'; 5 | import 'package:ebuzz/common/colors.dart'; 6 | 7 | class CustomTypeAheadFormField extends StatelessWidget { 8 | const CustomTypeAheadFormField({ 9 | this.autoFlipDirection=true, 10 | required this.label, 11 | this.labelStyle, 12 | this.required = false, 13 | this.hideSuggestionOnKeyboardHide = false, 14 | this.controller, 15 | this.focusNode, 16 | this.onEditingComplete, 17 | required this.decoration, 18 | this.keyboardType = TextInputType.text, 19 | this.padding = EdgeInsets.zero, 20 | this.style, 21 | this.textInputAction = TextInputAction.next, 22 | this.validator, 23 | required this.onSuggestionSelected, 24 | required this.itemBuilder, 25 | required this.suggestionsCallback, 26 | this.transitionBuilder, 27 | }); 28 | final String? label; 29 | final TextStyle? labelStyle; 30 | final bool? required; 31 | final bool hideSuggestionOnKeyboardHide; 32 | final TextEditingController? controller; 33 | final FocusNode? focusNode; 34 | final void Function()? onEditingComplete; 35 | final InputDecoration decoration; 36 | final TextInputType keyboardType; 37 | final EdgeInsetsGeometry padding; 38 | final TextStyle? style; 39 | final TextInputAction? textInputAction; 40 | final String? Function(String?)? validator; 41 | final void Function(dynamic) onSuggestionSelected; 42 | final Widget Function(BuildContext, dynamic) itemBuilder; 43 | final FutureOr> Function(String) suggestionsCallback; 44 | final dynamic Function(BuildContext, Widget, AnimationController?)? 45 | transitionBuilder; 46 | final bool autoFlipDirection; 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | return Padding( 51 | padding: padding, 52 | child: Column( 53 | children: [ 54 | Row( 55 | children: [ 56 | Text( 57 | label!, 58 | style: labelStyle, 59 | ), 60 | SizedBox(width: 8), 61 | required == true 62 | ? Text( 63 | '*', 64 | style: TextStyle(color: redColor), 65 | ) 66 | : Container() 67 | ], 68 | ), 69 | SizedBox( 70 | height: 10, 71 | ), 72 | TypeAheadFormField( 73 | autoFlipDirection: autoFlipDirection, 74 | textFieldConfiguration: TextFieldConfiguration( 75 | controller: controller, 76 | focusNode: focusNode, 77 | textInputAction: textInputAction, 78 | onEditingComplete: onEditingComplete, 79 | decoration: decoration, 80 | keyboardType: keyboardType, 81 | style: style, 82 | ), 83 | hideSuggestionsOnKeyboardHide: hideSuggestionOnKeyboardHide, 84 | onSuggestionSelected: onSuggestionSelected, 85 | itemBuilder: itemBuilder, 86 | suggestionsCallback: suggestionsCallback, 87 | transitionBuilder: transitionBuilder, 88 | validator: validator, 89 | ), 90 | ], 91 | ), 92 | ); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/widgets/item_detail_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:ebuzz/common/ui_reusable_widget.dart'; 3 | import 'package:ebuzz/common_models/product.dart'; 4 | import 'package:ebuzz/widgets/custom_textformformfield.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | //ItemDetailWidget class is a reusable widget for displaying data from item api 8 | 9 | class ItemDetailWidget extends StatelessWidget { 10 | final AsyncSnapshot snapshot; 11 | final String apiurl; 12 | const ItemDetailWidget({required this.snapshot,required this.apiurl}); 13 | @override 14 | Widget build(BuildContext context) { 15 | return Column( 16 | children: [ 17 | Stack( 18 | children: [ 19 | Align( 20 | alignment: Alignment.bottomRight, 21 | child: versionText(), 22 | ), 23 | SingleChildScrollView( 24 | child: Padding( 25 | padding: const EdgeInsets.symmetric(horizontal: 0,vertical: 16), 26 | child: Column( 27 | children: [ 28 | itemDetailWidget( 29 | 'Item Code', snapshot.data?.itemCode), 30 | SizedBox(height: 15), 31 | itemDetailWidget('Item Name', 32 | snapshot.data?.itemName), 33 | SizedBox(height: 15), 34 | itemDetailWidget( 35 | 'Item Group', snapshot.data?.itemGroup), 36 | SizedBox(height: 15), 37 | itemDetailWidget('HSN/SAC', snapshot.data?.hsn), 38 | SizedBox(height: 15), 39 | itemDetailWidget('Brand', 40 | snapshot.data?.brand), 41 | SizedBox(height: 15), 42 | itemDetailWidget( 43 | 'Decscription', 44 | snapshot.data?.description), 45 | SizedBox(height: 15), 46 | itemDetailWidget('Shell Life (Days)', 47 | snapshot.data?.shellLife.toString()), 48 | 49 | SizedBox(height: 15), 50 | 51 | ], 52 | ), 53 | ), 54 | ), 55 | ], 56 | ), 57 | 58 | ], 59 | ); 60 | } 61 | Widget itemDetailWidget(String label, String? value) { 62 | return CustomTextFormField( 63 | decoration: InputDecoration( 64 | fillColor: greyColor, 65 | filled: true, 66 | isDense: true, 67 | border: OutlineInputBorder( 68 | borderSide: BorderSide.none, 69 | borderRadius: BorderRadius.circular(5), 70 | )), 71 | label: label, 72 | readOnly: true, 73 | initialValue: value, 74 | labelStyle: TextStyle(color: blackColor), 75 | style: TextStyle(fontSize: 14, color: blackColor), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/widgets/typeahead_widgets.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TypeAheadWidgets { 4 | static Widget itemUi(String item) { 5 | return ListTile( 6 | title: Text( 7 | item, 8 | style: TextStyle(fontSize: 14), 9 | ), 10 | ); 11 | } 12 | 13 | static List getSuggestions(String query, List list) { 14 | List matches = []; 15 | matches.addAll(list); 16 | matches.retainWhere((s) => s.toLowerCase().contains(query.toLowerCase())); 17 | return matches; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/widgets/unique_warehouse_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/colors.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | //UniqueWarehouseList class is a reusble widget for displaying data of list of unique warehouse 5 | class UniqueWarehouseList extends StatelessWidget { 6 | final List? warehouseName; 7 | final List? warehouseQty; 8 | 9 | UniqueWarehouseList({this.warehouseName, this.warehouseQty}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Column( 14 | children: [ 15 | Divider( 16 | color: blackColor, 17 | height: 5, 18 | ), 19 | Row( 20 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 21 | children: [ 22 | Expanded( 23 | flex: 4, 24 | child: Text( 25 | 'Name', 26 | textAlign: TextAlign.center, 27 | style: TextStyle(fontSize: 14, color: blackColor), 28 | ), 29 | ), 30 | Expanded( 31 | flex: 1, 32 | child: Text( 33 | 'Quantity', 34 | textAlign: TextAlign.center, 35 | style: TextStyle(fontSize: 14, color: blackColor), 36 | ), 37 | ), 38 | ], 39 | ), 40 | Divider( 41 | color: blackColor, 42 | height: 5, 43 | ), 44 | ListView.builder( 45 | scrollDirection: Axis.vertical, 46 | shrinkWrap: true, 47 | itemCount: warehouseName!.length, 48 | itemBuilder: (context, index) { 49 | return Column( 50 | children: [ 51 | Row( 52 | mainAxisAlignment: MainAxisAlignment.start, 53 | children: [ 54 | Expanded( 55 | flex: 4, 56 | child: Text( 57 | warehouseName![index].toString(), 58 | style: TextStyle(fontSize: 14, color: blackColor), 59 | textAlign: TextAlign.left, 60 | maxLines: 3, 61 | overflow: TextOverflow.ellipsis, 62 | ), 63 | ), 64 | Expanded( 65 | flex: 1, 66 | child: Padding( 67 | padding: EdgeInsets.symmetric(vertical: 2), 68 | child: Text( 69 | warehouseQty![index].toStringAsFixed(2), 70 | textAlign: TextAlign.center, 71 | maxLines: 3, 72 | overflow: TextOverflow.ellipsis, 73 | style: TextStyle(fontSize: 14, color: blackColor), 74 | ), 75 | ), 76 | ), 77 | ], 78 | ), 79 | ], 80 | ); 81 | }), 82 | ], 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/workorder/model/workorder_model.dart: -------------------------------------------------------------------------------- 1 | //WorkOrderModel class contains model to store data of work order api 2 | //All fields are not been used only limited fields which were useful in app have been used 3 | 4 | class WorkOrderModel { 5 | final String? status; 6 | final String? company; 7 | final String? productionItem; 8 | final String? description; 9 | final double? qtyToManufacture; 10 | final String? itemName; 11 | final double? materialTransfForManuf; 12 | final String? bomNo; 13 | final double? manufacturedQty; 14 | final String? salesOrder; 15 | final String? workInProgressWarehouse; 16 | final String? targetWarehouse; 17 | final String? plannedStartDate; 18 | final String? expectedDeliveryDate; 19 | final String? name; 20 | 21 | WorkOrderModel( 22 | {this.productionItem, 23 | this.name, 24 | this.description, 25 | this.status, 26 | this.company, 27 | this.qtyToManufacture, 28 | this.itemName, 29 | this.materialTransfForManuf, 30 | this.bomNo, 31 | this.manufacturedQty, 32 | this.salesOrder, 33 | this.workInProgressWarehouse, 34 | this.targetWarehouse, 35 | this.plannedStartDate, 36 | this.expectedDeliveryDate}); 37 | 38 | //For fetching json data from work order api and storing it in work order model 39 | factory WorkOrderModel.fromJson(Map json) { 40 | return WorkOrderModel( 41 | bomNo: json['bom_no'] ?? '', 42 | name: json['name'] ?? '', 43 | company: json['company'] ?? '', 44 | expectedDeliveryDate: json['expected_delivery_date'] ?? '', 45 | itemName: json['item_name'] ?? '', 46 | description: json['description'] ?? '', 47 | productionItem: json['production_item'] ?? '', 48 | manufacturedQty: json['produced_qty'] ?? 0, 49 | materialTransfForManuf: 50 | json['material_transferred_for_manufacturing'] ?? 0, 51 | plannedStartDate: json['planned_start_date'] ?? '', 52 | qtyToManufacture: json['qty'] ?? 0, 53 | salesOrder: json['sales_order'] ?? '', 54 | status: json['status'] ?? '', 55 | targetWarehouse: json['fg_warehouse'] ?? '', 56 | workInProgressWarehouse: json['wip_warehouse'] ?? '', 57 | ); 58 | } 59 | } 60 | 61 | //WorkOrderItems class contains model to store item data of work order api 62 | class WorkOrderItems { 63 | final String? itemCode; 64 | final String? itemName; 65 | final String? sourceWarehouse; 66 | final double? requiredQty; 67 | final double? transferedQuantity; 68 | final double? consumedQuantity; 69 | 70 | WorkOrderItems( 71 | {this.itemCode, 72 | this.itemName, 73 | this.sourceWarehouse, 74 | this.requiredQty, 75 | this.transferedQuantity, 76 | this.consumedQuantity}); 77 | factory WorkOrderItems.fromJson(Map json) { 78 | return WorkOrderItems( 79 | consumedQuantity: json['consumed_qty'] ?? 0, 80 | itemCode: json['item_code'] ?? '', 81 | itemName: json['item_name'] ?? '', 82 | requiredQty: json['required_qty'] ?? 0, 83 | sourceWarehouse: json['source_warehouse'] ?? '', 84 | transferedQuantity: json['transferred_qty'] ?? 0, 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/workorder/service/workorder_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:ebuzz/exception/custom_exception.dart'; 3 | import 'package:ebuzz/network/base_dio.dart'; 4 | import 'package:ebuzz/util/apiurls.dart'; 5 | import 'package:ebuzz/workorder/model/workorder_model.dart'; 6 | import 'package:flutter/cupertino.dart'; 7 | 8 | //WorkOrderService class contains function for fetching data or posting data 9 | class WorkOrderService { 10 | //For fetching list of work orders 11 | Future> getWorkOrderModelList( 12 | BuildContext context) async { 13 | List list = []; 14 | List workorderlist = []; 15 | try { 16 | Dio _dio = await BaseDio().getBaseDio(); 17 | final String workOrder = workOrderListUrl(); 18 | final response = await _dio.get(workOrder); 19 | var data = response.data; 20 | list = data['data']; 21 | for (var listJson in list) { 22 | workorderlist.add(WorkOrderModel.fromJson(listJson)); 23 | } 24 | return workorderlist; 25 | } catch (e) { 26 | exception(e,context); 27 | } 28 | return workorderlist; 29 | } 30 | 31 | //For fetching list of workorderitems in particular work order 32 | Future> getWorkOrderItemList(String name, BuildContext context) async { 33 | List list = []; 34 | List workorderlist = []; 35 | try { 36 | Dio _dio = await BaseDio().getBaseDio(); 37 | final String workOrder = workOrderUrl(name); 38 | final response = await _dio.get(workOrder); 39 | var data = response.data; 40 | list = data['data']['required_items']; 41 | for (var listJson in list) { 42 | workorderlist.add(WorkOrderItems.fromJson(listJson)); 43 | } 44 | return workorderlist; 45 | } catch (e) { 46 | exception(e,context); 47 | } 48 | return workorderlist; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/workorder/ui/workorder_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/common/circular_progress.dart'; 2 | import 'package:ebuzz/common/colors.dart'; 3 | import 'package:ebuzz/common/custom_appbar.dart'; 4 | import 'package:ebuzz/common/display_helper.dart'; 5 | import 'package:ebuzz/common/navigations.dart'; 6 | import 'package:ebuzz/workorder/model/workorder_model.dart'; 7 | import 'package:ebuzz/workorder/service/workorder_service.dart'; 8 | import 'package:ebuzz/workorder/ui/workorder_detailui.dart'; 9 | import 'package:flutter/material.dart'; 10 | 11 | //WorkOrderUi consist of ui of list of work orders 12 | class WorkOrderUi extends StatefulWidget { 13 | @override 14 | _WorkOrderUiState createState() => _WorkOrderUiState(); 15 | } 16 | 17 | class _WorkOrderUiState extends State { 18 | List _workOrderModelList = []; 19 | //loading variable is used for displaying circular progress indicator 20 | bool _loading = false; 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | getWorkOrderListData(); 26 | } 27 | 28 | getWorkOrderListData() async { 29 | setState(() { 30 | _loading = true; 31 | }); 32 | _workOrderModelList = 33 | await WorkOrderService().getWorkOrderModelList(context); 34 | setState(() {}); 35 | setState(() { 36 | _loading = false; 37 | }); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | backgroundColor: bgColor, 44 | appBar: PreferredSize( 45 | preferredSize: Size.fromHeight( 55), 46 | child: CustomAppBar( 47 | title: Text('Work Order List', style: TextStyle(color: whiteColor)), 48 | leading: IconButton( 49 | onPressed: () => Navigator.pop(context, false), 50 | icon: Icon( 51 | Icons.arrow_back, 52 | color: whiteColor, 53 | ), 54 | ), 55 | )), 56 | body: 57 | _loading 58 | ? CircularProgress() 59 | : Padding( 60 | padding: EdgeInsets.symmetric(vertical: 5), 61 | child: ListView.builder( 62 | itemCount: _workOrderModelList.length, 63 | itemBuilder: (context, index) { 64 | return GestureDetector( 65 | onTap: () { 66 | pushScreen( 67 | context, 68 | WorkOrderDetailUi( 69 | workOrderData: _workOrderModelList[index], 70 | )); 71 | }, 72 | child: WorkTileUi( 73 | workorderData: _workOrderModelList[index], 74 | ), 75 | ); 76 | }, 77 | ), 78 | ), 79 | ); 80 | } 81 | } 82 | 83 | class WorkTileUi extends StatelessWidget { 84 | final WorkOrderModel workorderData; 85 | 86 | const WorkTileUi({required this.workorderData}); 87 | @override 88 | Widget build(BuildContext context) { 89 | return Container( 90 | width: displayWidth(context) * 0.99, 91 | height: 110, 92 | child: Padding( 93 | padding: EdgeInsets.symmetric(horizontal: 5), 94 | child: Card( 95 | elevation: 3, 96 | shape: 97 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), 98 | child: Padding( 99 | padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), 100 | child: Row( 101 | children: [ 102 | Column( 103 | mainAxisAlignment: MainAxisAlignment.center, 104 | crossAxisAlignment: CrossAxisAlignment.start, 105 | children: [ 106 | Text( 107 | workorderData.productionItem!, 108 | style: TextStyle(fontSize: 20, color: blackColor), 109 | ), 110 | SizedBox( 111 | height: 5, 112 | ), 113 | Container( 114 | width: displayWidth(context) * 0.85, 115 | child: Text( 116 | workorderData.itemName!, 117 | maxLines: 1, 118 | overflow: TextOverflow.ellipsis, 119 | ), 120 | ), 121 | SizedBox( 122 | height: 5, 123 | ), 124 | Text( 125 | 'Expected Date : ' + workorderData.expectedDeliveryDate!, 126 | ), 127 | ], 128 | ), 129 | Spacer(), 130 | SizedBox( 131 | width: 5, 132 | ), 133 | Container( 134 | width: 15, 135 | height: 15, 136 | decoration: BoxDecoration( 137 | shape: BoxShape.circle, 138 | color: workorderData.status == 'Completed' 139 | ? greenColor 140 | : blackColor), 141 | ), 142 | ], 143 | ), 144 | ), 145 | ), 146 | ), 147 | ); 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: ebuzz 2 | description: A new Flutter project. 3 | 4 | publish_to: 'none' 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: '>=2.12.0 <3.0.0' 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | badges: ^2.0.1 15 | cupertino_icons: ^1.0.3 16 | dio: ^4.0.0 17 | flutter_barcode_scanner: ^2.0.0 18 | flutter_local_notifications: ^5.0.0+4 19 | flutter_riverpod: ^0.13.1 20 | flutter_secure_storage: ^4.2.0 21 | flutter_slidable: ^0.6.0 22 | flutter_typeahead: ^3.1.3 23 | fluttertoast: ^8.0.7 24 | get: ^4.1.4 25 | http: ^0.13.3 26 | image_picker: ^0.7.5 27 | intl: ^0.17.0 28 | path: ^1.8.0 29 | path_provider: ^2.0.1 30 | shared_preferences: ^2.0.5 31 | uuid: ^3.0.4 32 | flutter_uploader: ^1.2.1 33 | flutter_email_sender: ^5.0.0 34 | permission_handler: ^8.0.0+2 35 | file_utils: ^1.0.0 36 | downloads_path_provider: ^0.1.0 37 | google_fonts: ^2.0.0 38 | 39 | dev_dependencies: 40 | flutter_driver: 41 | sdk: flutter 42 | flutter_test: 43 | sdk: flutter 44 | integration_test: 45 | sdk: flutter 46 | flutter_launcher_icons: '^0.9.0' 47 | test: null 48 | build_runner: ^1.12.2 49 | build_web_compilers: ^2.16.5 50 | 51 | flutter_icons: 52 | android: 'launcher_icon' 53 | ios: true 54 | image_path: 'assets/logo.png' 55 | 56 | flutter: 57 | uses-material-design: true 58 | 59 | assets: 60 | - assets/ 61 | -------------------------------------------------------------------------------- /screenshots/BoMSearch-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/BoMSearch-2.png -------------------------------------------------------------------------------- /screenshots/BoMSearch-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/BoMSearch-3.png -------------------------------------------------------------------------------- /screenshots/BoMSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/BoMSearch.png -------------------------------------------------------------------------------- /screenshots/Dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/Dashboard.png -------------------------------------------------------------------------------- /screenshots/ItemSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/ItemSearch.png -------------------------------------------------------------------------------- /screenshots/ItemSearch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/ItemSearch2.png -------------------------------------------------------------------------------- /screenshots/LeaveBalanceDashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/LeaveBalanceDashboard.png -------------------------------------------------------------------------------- /screenshots/LoginScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/LoginScreen.png -------------------------------------------------------------------------------- /screenshots/Logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/Logout.png -------------------------------------------------------------------------------- /screenshots/PurchaseOrderDetails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/PurchaseOrderDetails.png -------------------------------------------------------------------------------- /screenshots/PurchaseOrderList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/PurchaseOrderList.png -------------------------------------------------------------------------------- /screenshots/PurchaseReceiptDetails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/PurchaseReceiptDetails.png -------------------------------------------------------------------------------- /screenshots/QualityInspectionDetails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/QualityInspectionDetails.png -------------------------------------------------------------------------------- /screenshots/QualityInspectionForm-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/QualityInspectionForm-2.png -------------------------------------------------------------------------------- /screenshots/QualityInspectionForm-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/QualityInspectionForm-3.png -------------------------------------------------------------------------------- /screenshots/QualityInspectionForm-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/QualityInspectionForm-4.png -------------------------------------------------------------------------------- /screenshots/QualityInspectionList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/QualityInspectionList.png -------------------------------------------------------------------------------- /screenshots/SalesOrderForm-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/SalesOrderForm-2.png -------------------------------------------------------------------------------- /screenshots/SalesOrderForm-3-List.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/SalesOrderForm-3-List.png -------------------------------------------------------------------------------- /screenshots/StockEntryDetails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/StockEntryDetails.png -------------------------------------------------------------------------------- /screenshots/StockEntryList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/StockEntryList.png -------------------------------------------------------------------------------- /screenshots/WorkOrderDetails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/screenshots/WorkOrderDetails.png -------------------------------------------------------------------------------- /test/bom_test.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | void main() { 4 | // testWidgets('bom test', (WidgetTester tester) async { 5 | // await tester.pumpWidget(MaterialApp(home: Bom())); 6 | // expect(find.text('BOM'), findsOneWidget); 7 | // }); 8 | } 9 | -------------------------------------------------------------------------------- /test/home_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/home/ui/home.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | testWidgets('Check if homepage contains all widgets', 7 | (WidgetTester tester) async { 8 | await tester.pumpWidget(MaterialApp(home: Home())); 9 | expect(find.text('BOM'), findsOneWidget); 10 | expect(find.text('Item'), findsOneWidget); 11 | expect(find.text('Purchase Order'), findsOneWidget); 12 | expect(find.text('Leave Balance'), findsOneWidget); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /test/leave_balance_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/leavebalance/ui/leave_balance_ui.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | testWidgets('work order test', (WidgetTester tester) async { 7 | await tester.pumpWidget(MaterialApp(home: LeaveUi())); 8 | expect(find.text('Leave Balance'), findsOneWidget); 9 | expect(find.text('Privilege Leave'), findsOneWidget); 10 | expect(find.text('Concessional Leave'), findsOneWidget); 11 | expect(find.text('Leave Without Pay'), findsOneWidget); 12 | expect(find.text('Compensatory Off'), findsOneWidget); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /test/login_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/login/ui/login.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | var usernameField = find.byKey(Key('username-field')); 7 | var passwordField = find.byKey(Key('password-field')); 8 | // var baseurlField = find.byKey(Key('baseurl-field')); 9 | var loginButton = find.text('Login'); 10 | testWidgets('login page widgets test', (WidgetTester tester) async { 11 | await tester.pumpWidget(MaterialApp(home: Scaffold(body: Login()))); 12 | expect(usernameField, findsOneWidget); 13 | expect(passwordField, findsOneWidget); 14 | expect(loginButton, findsOneWidget); 15 | // expect(baseurlField, findsOneWidget); 16 | }); 17 | 18 | // testWidgets('check validation', (WidgetTester tester) async { 19 | // await tester.pumpWidget(MaterialApp(home: Login())); 20 | // final login = find.text('Login'); 21 | // final usernameError= find.text('Username or email should not be empty'); 22 | // final baseurlError=find.text('Baseurl should not be empty'); 23 | // final passwordError=find.text('Password should not be empty'); 24 | // await tester.pumpAndSettle(); 25 | // await tester.tap(login); 26 | // await tester.pump(const Duration(milliseconds: 100)); // add delay 27 | // expect(usernameError, findsOneWidget); 28 | // expect(baseurlError, findsOneWidget); 29 | // expect(passwordError, findsOneWidget); 30 | // }); 31 | 32 | testWidgets( 33 | 'check login method when baseurl and username and password is entered', 34 | (WidgetTester tester) async { 35 | await tester.pumpWidget(MaterialApp(home: Login())); 36 | // await tester.enterText(baseurlField, 'http://agfsandbox.ambibuzz.com'); 37 | await tester.enterText(usernameField, 'mohit.yadav@ambibuzz.com'); 38 | await tester.enterText(passwordField, 'MohiT_!23'); 39 | await tester.tap(loginButton); 40 | await tester.pump(); 41 | }); 42 | } 43 | -------------------------------------------------------------------------------- /test/purchase_receipt_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/purchasereciept/ui/purchase_reciept_Form_ui.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | testWidgets('purchase receipt test', (WidgetTester tester) async { 7 | await tester.pumpWidget(MaterialApp( 8 | home: PurchaseRecieptFormUi( 9 | name: 'a', 10 | supplier: 'a', 11 | ))); 12 | expect(find.text('Purchase Reciept'), findsOneWidget); 13 | }); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/quality_inspection_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/qualityinspection/ui/qiform1.dart'; 2 | import 'package:ebuzz/qualityinspection/ui/qiform2.dart'; 3 | import 'package:ebuzz/qualityinspection/ui/qiform3.dart'; 4 | import 'package:ebuzz/qualityinspection/ui/qiform4.dart'; 5 | import 'package:ebuzz/qualityinspection/ui/qiform5.dart'; 6 | import 'package:ebuzz/qualityinspection/ui/quality_inspection_list_ui.dart'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | void main() { 11 | testWidgets('quality inspection list test', (WidgetTester tester) async { 12 | await tester.pumpWidget(MaterialApp(home: QualityInspectionListUi())); 13 | expect(find.text('Quality Inspection'), findsOneWidget); 14 | }); 15 | 16 | testWidgets('quality inspection form1 test', (WidgetTester tester) async { 17 | await tester.pumpWidget(MaterialApp(home: QiForm1())); 18 | expect(find.text('Quality Inspection Form'), findsOneWidget); 19 | expect(find.byKey(Key('date-field-form1')), findsOneWidget); 20 | expect(find.byKey(Key('inspection-type-field-form1')), findsOneWidget); 21 | expect(find.byKey(Key('reference-type-field-form1')), findsOneWidget); 22 | }); 23 | 24 | testWidgets('quality inspection form2 test', (WidgetTester tester) async { 25 | await tester.pumpWidget(MaterialApp( 26 | home: QiForm2( 27 | date: 'a', 28 | inspectionType: 'a', 29 | referenceType: 'a', 30 | ), 31 | )); 32 | expect(find.text('Quality Inspection Form'), findsOneWidget); 33 | expect(find.text('Report Date'), findsOneWidget); 34 | expect(find.text('Inspection Type'), findsOneWidget); 35 | expect(find.text('Reference Type'), findsOneWidget); 36 | expect(find.byKey(Key('reference-name-field-form2')), findsOneWidget); 37 | }); 38 | 39 | testWidgets('quality inspection form3 test', (WidgetTester tester) async { 40 | await tester.pumpWidget(MaterialApp( 41 | home: QiForm3( 42 | date: 'a', 43 | inspectionType: 'a', 44 | referenceType: 'a', 45 | referenceName: 'a', 46 | ), 47 | )); 48 | expect(find.text('Quality Inspection Form'), findsOneWidget); 49 | expect(find.text('Report Date'), findsOneWidget); 50 | expect(find.text('Inspection Type'), findsOneWidget); 51 | expect(find.text('Reference Type'), findsOneWidget); 52 | expect(find.text('Reference Name'), findsOneWidget); 53 | expect(find.byKey(Key('item-name-field-form3')), findsOneWidget); 54 | }); 55 | 56 | testWidgets('quality inspection form4 test', (WidgetTester tester) async { 57 | await tester.pumpWidget( 58 | MaterialApp( 59 | home: QiForm4( 60 | date: 'a', 61 | inspectionType: 'a', 62 | referenceType: 'a', 63 | referenceName: 'a', 64 | itemCode: 'a', 65 | ), 66 | ), 67 | ); 68 | expect(find.text('Quality Inspection Form'), findsOneWidget); 69 | }); 70 | 71 | testWidgets('quality inspection form5 test', (WidgetTester tester) async { 72 | await tester.pumpWidget(MaterialApp( 73 | home: QiForm5( 74 | date: 'a', 75 | inspectionType: 'a', 76 | referenceType: 'a', 77 | referenceName: 'a', 78 | itemCode: 'a', 79 | itemName: 'a', 80 | qiTemplate: 'a', 81 | sampleSize: 0, 82 | status: 'a', 83 | ), 84 | )); 85 | expect(find.text('Save'), findsOneWidget); 86 | }); 87 | } 88 | -------------------------------------------------------------------------------- /test/settings_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/settings/ui/settings.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | testWidgets('settings test', (WidgetTester tester) async { 7 | await tester.pumpWidget(MaterialApp(home: Settings())); 8 | expect(find.text('Settings'), findsOneWidget); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /test/unique_warehouse_list_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/widgets/unique_warehouse_list.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | testWidgets('unique warehouse test', (WidgetTester tester) async { 7 | await tester.pumpWidget(MaterialApp( 8 | home: UniqueWarehouseList( 9 | warehouseName: ['A'], 10 | warehouseQty: [100], 11 | ))); 12 | expect(find.text('Name'), findsOneWidget); 13 | expect(find.text('Quantity'), findsOneWidget); 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /test/work_order_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:ebuzz/workorder/ui/workorder_ui.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | testWidgets('work order test', (WidgetTester tester) async { 7 | await tester.pumpWidget(MaterialApp(home: WorkOrderUi())); 8 | expect(find.text('Work Order'), findsOneWidget); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ambibuzz/ebuzz/3f65c81eacfe6178dbfe86950dc6c802b8be3a39/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ebuzz 30 | 31 | 32 | 33 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ebuzz", 3 | "short_name": "ebuzz", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | --------------------------------------------------------------------------------