├── .gitattributes
├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── admin_app
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── store_pattern
│ │ │ │ │ └── admin_app
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable-xxxhdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable
│ │ │ │ ├── app_icon.png
│ │ │ │ └── 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
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── settings_aar.gradle
├── assets
│ ├── fonts
│ │ └── Dosis
│ │ │ ├── Dosis-Bold.ttf
│ │ │ ├── Dosis-ExtraBold.ttf
│ │ │ ├── Dosis-ExtraLight.ttf
│ │ │ ├── Dosis-Light.ttf
│ │ │ ├── Dosis-Medium.ttf
│ │ │ ├── Dosis-Regular.ttf
│ │ │ ├── Dosis-SemiBold.ttf
│ │ │ └── OFL.txt
│ ├── images
│ │ ├── account.png
│ │ ├── food.png
│ │ └── logo.png
│ └── launcher_icons
│ │ └── app_icon.png
├── flutter_native_splash.yaml
├── 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.h
│ │ ├── AppDelegate.m
│ │ ├── 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-50x50@1x.png
│ │ │ ├── Icon-App-50x50@2x.png
│ │ │ ├── Icon-App-57x57@1x.png
│ │ │ ├── Icon-App-57x57@2x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-72x72@1x.png
│ │ │ ├── Icon-App-72x72@2x.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
│ │ └── main.m
├── lib
│ ├── Constants
│ │ ├── dialog.dart
│ │ ├── evn.dart
│ │ ├── queries.dart
│ │ └── theme.dart
│ ├── Controllers
│ │ ├── account.controller.dart
│ │ ├── accountType.controller.dart
│ │ ├── bill.controller.dart
│ │ ├── category.controller.dart
│ │ ├── food.controller.dart
│ │ ├── image.controller.dart
│ │ ├── login.controller.dart
│ │ ├── profile.controller.dart
│ │ ├── report.controller.dart
│ │ └── table.controller.dart
│ ├── Models
│ │ ├── account.model.dart
│ │ ├── accountType.model.dart
│ │ ├── bill.model.dart
│ │ ├── category.model.dart
│ │ ├── connect_server.dart
│ │ ├── food.model.dart
│ │ ├── login.model.dart
│ │ ├── profile.model.dart
│ │ ├── report.model.dart
│ │ └── table.model.dart
│ ├── Views
│ │ ├── account.view.dart
│ │ ├── accountDetail.view.dart
│ │ ├── accountType.view..dart
│ │ ├── addAccount.view.dart
│ │ ├── addAccountType.view.dart
│ │ ├── addCategory.view.dart
│ │ ├── addFood.view.dart
│ │ ├── addTable.view.dart
│ │ ├── bill.view.dart
│ │ ├── billDetail.view.dart
│ │ ├── category.view.dart
│ │ ├── dashboard.view.dart
│ │ ├── editAccount.view.dart
│ │ ├── editAccountType.view.dart
│ │ ├── editCategory.view.dart
│ │ ├── editFood.view.dart
│ │ ├── editTable.view.dart
│ │ ├── food.view.dart
│ │ ├── foodDetail.view.dart
│ │ ├── login.view.dart
│ │ ├── mainPage.view.dart
│ │ ├── profile.view.dart
│ │ └── table.view.dart
│ ├── main.dart
│ └── utils
│ │ └── log.dart
├── pubspec.yaml
├── rebuild_app_icon.sh
├── test
│ ├── unit_test.dart
│ └── widget_test.dart
└── web
│ ├── favicon.png
│ ├── icons
│ ├── Icon-192.png
│ └── Icon-512.png
│ ├── index.html
│ └── manifest.json
├── database
└── mysql.sql
├── kitchen_app
├── build.xml
├── manifest.mf
├── nbproject
│ ├── build-impl.xml
│ ├── genfiles.properties
│ ├── project.properties
│ └── project.xml
├── packages
│ ├── gson
│ │ └── gson-2.8.5.jar
│ └── http
│ │ ├── commons-codec-1.10.jar
│ │ ├── commons-logging-1.2.jar
│ │ ├── fluent-hc-4.5.6.jar
│ │ ├── httpclient-4.5.6.jar
│ │ ├── httpclient-cache-4.5.6.jar
│ │ ├── httpclient-win-4.5.6.jar
│ │ ├── httpcore-4.4.10.jar
│ │ ├── httpmime-4.5.6.jar
│ │ ├── jna-4.4.0.jar
│ │ └── jna-platform-4.4.0.jar
└── src
│ ├── Constants
│ ├── CColor.java
│ ├── Constant.java
│ └── Query.java
│ ├── Controllers
│ ├── BillController.java
│ └── StructBill.java
│ ├── Models
│ ├── BillModel.java
│ └── MySqlConnection.java
│ ├── Views
│ ├── KitchenView.java
│ └── View.java
│ └── image
│ ├── info.png
│ ├── logo.png
│ └── refresh.png
├── order_app
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── store_pattern
│ │ │ │ │ └── order_app
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable-xxxhdpi
│ │ │ │ └── splash.png
│ │ │ │ ├── drawable
│ │ │ │ ├── app_icon.png
│ │ │ │ └── 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
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── settings_aar.gradle
├── assets
│ ├── fonts
│ │ └── Dosis
│ │ │ ├── Dosis-Bold.ttf
│ │ │ ├── Dosis-ExtraBold.ttf
│ │ │ ├── Dosis-ExtraLight.ttf
│ │ │ ├── Dosis-Light.ttf
│ │ │ ├── Dosis-Medium.ttf
│ │ │ ├── Dosis-Regular.ttf
│ │ │ ├── Dosis-SemiBold.ttf
│ │ │ └── OFL.txt
│ ├── images
│ │ ├── account.png
│ │ ├── food.png
│ │ └── logo.png
│ └── launcher_icons
│ │ └── app_icon.png
├── flutter_native_splash.yaml
├── 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.h
│ │ ├── AppDelegate.m
│ │ ├── 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-50x50@1x.png
│ │ │ ├── Icon-App-50x50@2x.png
│ │ │ ├── Icon-App-57x57@1x.png
│ │ │ ├── Icon-App-57x57@2x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-72x72@1x.png
│ │ │ ├── Icon-App-72x72@2x.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
│ │ └── main.m
├── lib
│ ├── Constants
│ │ ├── dialog.dart
│ │ ├── evn.dart
│ │ ├── queries.dart
│ │ └── theme.dart
│ ├── Controllers
│ │ ├── cart.controller.dart
│ │ ├── history.controller.dart
│ │ ├── home.controller.dart
│ │ ├── image.controller.dart
│ │ ├── login.controller.dart
│ │ ├── menu.controller.dart
│ │ ├── notification.controller.dart
│ │ └── profile.controller.dart
│ ├── Models
│ │ ├── cart.model.dart
│ │ ├── connect_server.dart
│ │ ├── history.model.dart
│ │ ├── home.model.dart
│ │ ├── login.model.dart
│ │ ├── menu.model.dart
│ │ └── profile.model.dart
│ ├── Views
│ │ ├── cart.view.dart
│ │ ├── history.view.dart
│ │ ├── home.view.dart
│ │ ├── invoice.view.dart
│ │ ├── login.view.dart
│ │ ├── mainpage.view.dart
│ │ ├── menu.view.dart
│ │ └── profile.view.dart
│ ├── main.dart
│ └── utils
│ │ └── log.dart
├── pubspec.yaml
├── rebuild_app_icon.sh
├── test
│ ├── unit_test.dart
│ └── widget_test.dart
└── web
│ ├── favicon.png
│ ├── icons
│ ├── Icon-192.png
│ └── Icon-512.png
│ ├── index.html
│ └── manifest.json
└── server
├── Dockerfile
├── LICENSE
├── README.md
├── analysis_options.yaml
├── bin
├── dev.dart
└── prod.dart
├── config
├── default.yaml
├── development.yaml
└── production.yaml
├── docker-compose.yml
├── lib
├── src
│ ├── config
│ │ └── config.dart
│ ├── models
│ │ └── query_request.dart
│ ├── pretty_logging.dart
│ ├── routes
│ │ ├── controllers
│ │ │ └── store_pattern_controller.dart
│ │ └── routes.dart
│ └── services
│ │ ├── mysql_connectior.dart
│ │ └── store_pattern_service.dart
└── store_pattern_service.dart
├── mysql_init
└── mysql.sql
├── pubspec.yaml
└── test
└── all_test.dart
/.gitattributes:
--------------------------------------------------------------------------------
1 | * linguist-vendored
2 | *.dart linguist-vendored=false
3 | * -text
4 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/nbproject/private/
2 | build/
3 | nbbuild/
4 | dist/
5 | nbdist/
6 | .nb-gradle/
7 | **/nbproject/private/
8 | admin_app/build/
9 | admin_app/nbbuild/
10 | admin_app/dist/
11 | admin_app/nbdist/
12 | admin_app/.nb-gradle/
13 |
14 |
15 | # Miscellaneous
16 | *.class
17 | *.lock
18 | *.log
19 | *.pyc
20 | *.swp
21 | .DS_Store
22 | .atom/
23 | .buildlog/
24 | .history
25 | .svn/
26 |
27 | # IntelliJ related
28 | *.iml
29 | *.ipr
30 | *.iws
31 | .idea/
32 |
33 | # Visual Studio Code related
34 | .vscode/
35 |
36 | # Flutter/Dart/Pub related
37 | **/doc/api/
38 | .dart_tool/
39 | .flutter-plugins
40 | .packages
41 | .pub-cache/
42 | .pub/
43 | build/
44 |
45 | # Android related
46 | **/android/**/gradle-wrapper.jar
47 | **/android/.gradle
48 | **/android/captures/
49 | **/android/gradlew
50 | **/android/gradlew.bat
51 | **/android/local.properties
52 | **/android/**/GeneratedPluginRegistrant.java
53 |
54 | # iOS/XCode related
55 | **/ios/**/*.mode1v3
56 | **/ios/**/*.mode2v3
57 | **/ios/**/*.moved-aside
58 | **/ios/**/*.pbxuser
59 | **/ios/**/*.perspectivev3
60 | **/ios/**/*sync/
61 | **/ios/**/.sconsign.dblite
62 | **/ios/**/.tags*
63 | **/ios/**/.vagrant/
64 | **/ios/**/DerivedData/
65 | **/ios/**/Icon?
66 | **/ios/**/Pods/
67 | **/ios/**/.symlinks/
68 | **/ios/**/profile
69 | **/ios/**/xcuserdata
70 | **/ios/.generated/
71 | **/ios/Flutter/App.framework
72 | **/ios/Flutter/Flutter.framework
73 | **/ios/Flutter/Generated.xcconfig
74 | **/ios/Flutter/app.flx
75 | **/ios/Flutter/app.zip
76 | **/ios/Flutter/flutter_assets/
77 | **/ios/ServiceDefinitions.json
78 | **/ios/Runner/GeneratedPluginRegistrant.*
79 |
80 | # Exceptions to above rules.
81 | !**/ios/**/default.mode1v3
82 | !**/ios/**/default.mode2v3
83 | !**/ios/**/default.pbxuser
84 | !**/ios/**/default.perspectivev3
85 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
86 | node_modules
87 | **/.idea
88 | .flutter-plugins-dependencies
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | os:
2 | - linux
3 | sudo: false
4 | addons:
5 | apt:
6 | # Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
7 | sources:
8 | - ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
9 | packages:
10 | - libstdc++6
11 | before_script:
12 | - git clone --single-branch https://github.com/flutter/flutter.git -b beta
13 | - export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
14 | - flutter doctor
15 | - flutter config --enable-web
16 | script:
17 | - cd admin_app
18 | - flutter test
19 | - cd ../order_app
20 | - flutter test
21 | cache:
22 | directories:
23 | - $HOME/.pub-cache
24 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at ndc07.it@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Nguyen Duy Cuong
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 |
--------------------------------------------------------------------------------
/admin_app/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.lock
4 | *.log
5 | *.pyc
6 | *.swp
7 | .DS_Store
8 | .atom/
9 | .buildlog/
10 | .history
11 | .svn/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # Visual Studio Code related
20 | .vscode/
21 |
22 | # Flutter/Dart/Pub related
23 | **/doc/api/
24 | .dart_tool/
25 | .flutter-plugins
26 | .packages
27 | .pub-cache/
28 | .pub/
29 | build/
30 |
31 | # Android related
32 | **/android/**/gradle-wrapper.jar
33 | **/android/.gradle
34 | **/android/captures/
35 | **/android/gradlew
36 | **/android/gradlew.bat
37 | **/android/local.properties
38 | **/android/**/GeneratedPluginRegistrant.java
39 |
40 | # iOS/XCode related
41 | **/ios/**/*.mode1v3
42 | **/ios/**/*.mode2v3
43 | **/ios/**/*.moved-aside
44 | **/ios/**/*.pbxuser
45 | **/ios/**/*.perspectivev3
46 | **/ios/**/*sync/
47 | **/ios/**/.sconsign.dblite
48 | **/ios/**/.tags*
49 | **/ios/**/.vagrant/
50 | **/ios/**/DerivedData/
51 | **/ios/**/Icon?
52 | **/ios/**/Pods/
53 | **/ios/**/.symlinks/
54 | **/ios/**/profile
55 | **/ios/**/xcuserdata
56 | **/ios/.generated/
57 | **/ios/Flutter/App.framework
58 | **/ios/Flutter/Flutter.framework
59 | **/ios/Flutter/Generated.xcconfig
60 | **/ios/Flutter/app.flx
61 | **/ios/Flutter/app.zip
62 | **/ios/Flutter/flutter_assets/
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 |
66 | # Exceptions to above rules.
67 | !**/ios/**/default.mode1v3
68 | !**/ios/**/default.mode2v3
69 | !**/ios/**/default.pbxuser
70 | !**/ios/**/default.perspectivev3
71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
72 |
--------------------------------------------------------------------------------
/admin_app/.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: f37c235c32fc15babe6dc7b7bc2ee4387e5ecf92
8 | channel: beta
9 |
--------------------------------------------------------------------------------
/admin_app/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # # Defines a default set of lint rules enforced for
2 | # # projects at Google. For details and rationale,
3 | # # see https://github.com/dart-lang/pedantic#enabled-lints.
4 | # # include: package:pedantic/analysis_options.yaml
5 |
6 | # # For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
7 | # # Uncomment to specify additional rules.
8 | linter:
9 | rules:
10 | # - avoid_as
11 | - camel_case_types
12 | - avoid_print
13 | - unnecessary_new
14 | - empty_statements
15 | - hash_and_equals
16 | - no_duplicate_case_values
17 | - prefer_void_to_null
18 | - prefer_single_quotes
19 | - always_declare_return_types
20 | # - always_specify_types
21 | - avoid_init_to_null
22 | - avoid_returning_null_for_void
23 | - avoid_shadowing_type_parameters
24 | - avoid_single_cascade_in_expression_statements
25 | - avoid_unused_constructor_parameters
26 | - cascade_invocations
27 | - directives_ordering
28 | - empty_constructor_bodies
29 | - file_names
30 | - flutter_style_todos
31 | - implementation_imports
32 | - non_constant_identifier_names
33 | - null_closures
34 | - only_throw_errors
35 | - prefer_is_empty
36 | - prefer_if_null_operators
37 | - prefer_null_aware_operators
38 | analyzer:
39 | errors:
40 | # avoid_as: error
41 | camel_case_types: error
42 | avoid_print: error
43 | unnecessary_new: error
44 | no_duplicate_case_values: error
45 | prefer_void_to_null: error
46 | avoid_init_to_null: error
47 | avoid_returning_null_for_void: error
48 | empty_constructor_bodies: error
49 | file_names: error
50 | null_closures: error
51 | invalid_use_of_protected_member: error
--------------------------------------------------------------------------------
/admin_app/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 |
--------------------------------------------------------------------------------
/admin_app/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 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.store_pattern.admin_app"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/admin_app/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
17 |
21 |
28 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
43 |
44 |
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/kotlin/com/store_pattern/admin_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.store_pattern.admin_app
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | import android.os.Build
6 | import android.view.ViewTreeObserver
7 | import android.view.WindowManager
8 | class MainActivity: FlutterActivity() {
9 | }
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/drawable-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/drawable-hdpi/splash.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/drawable-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/drawable-mdpi/splash.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/drawable-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/drawable-xhdpi/splash.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/drawable-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/drawable-xxhdpi/splash.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/drawable-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/drawable-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/drawable/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/drawable/app_icon.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 | -
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-hdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-hdpi/launcher_icon.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-mdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-mdpi/launcher_icon.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffffff
4 |
--------------------------------------------------------------------------------
/admin_app/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/admin_app/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/admin_app/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/admin_app/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/admin_app/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-5.4.1-all.zip
--------------------------------------------------------------------------------
/admin_app/android/settings.gradle:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | include ':app'
6 |
7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8 | def properties = new Properties()
9 |
10 | assert localPropertiesFile.exists()
11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12 |
13 | def flutterSdkPath = properties.getProperty("flutter.sdk")
14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
16 |
--------------------------------------------------------------------------------
/admin_app/android/settings_aar.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/admin_app/assets/fonts/Dosis/Dosis-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/fonts/Dosis/Dosis-Bold.ttf
--------------------------------------------------------------------------------
/admin_app/assets/fonts/Dosis/Dosis-ExtraBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/fonts/Dosis/Dosis-ExtraBold.ttf
--------------------------------------------------------------------------------
/admin_app/assets/fonts/Dosis/Dosis-ExtraLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/fonts/Dosis/Dosis-ExtraLight.ttf
--------------------------------------------------------------------------------
/admin_app/assets/fonts/Dosis/Dosis-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/fonts/Dosis/Dosis-Light.ttf
--------------------------------------------------------------------------------
/admin_app/assets/fonts/Dosis/Dosis-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/fonts/Dosis/Dosis-Medium.ttf
--------------------------------------------------------------------------------
/admin_app/assets/fonts/Dosis/Dosis-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/fonts/Dosis/Dosis-Regular.ttf
--------------------------------------------------------------------------------
/admin_app/assets/fonts/Dosis/Dosis-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/fonts/Dosis/Dosis-SemiBold.ttf
--------------------------------------------------------------------------------
/admin_app/assets/images/account.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/images/account.png
--------------------------------------------------------------------------------
/admin_app/assets/images/food.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/images/food.png
--------------------------------------------------------------------------------
/admin_app/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/images/logo.png
--------------------------------------------------------------------------------
/admin_app/assets/launcher_icons/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/assets/launcher_icons/app_icon.png
--------------------------------------------------------------------------------
/admin_app/flutter_native_splash.yaml:
--------------------------------------------------------------------------------
1 | flutter_native_splash:
2 | image: assets/launcher_icons/app_icon.png
3 | color: "ffffff"
--------------------------------------------------------------------------------
/admin_app/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 |
--------------------------------------------------------------------------------
/admin_app/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 |
--------------------------------------------------------------------------------
/admin_app/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/admin_app/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | int flutter_native_splash = 1;
9 | UIApplication.sharedApplication.statusBarHidden = false;
10 |
11 | [GeneratedPluginRegistrant registerWithRegistry:self];
12 | // Override point for customization after application launch.
13 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
14 | }
15 |
16 | @end
--------------------------------------------------------------------------------
/admin_app/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 |
--------------------------------------------------------------------------------
/admin_app/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 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/admin_app/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 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/admin_app/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.
--------------------------------------------------------------------------------
/admin_app/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 |
--------------------------------------------------------------------------------
/admin_app/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 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | admin_app
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 | UIStatusBarHidden
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/admin_app/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/admin_app/lib/Constants/dialog.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import './theme.dart' as theme;
4 |
5 | void errorDialog(BuildContext context, String message) {
6 | if (context != null)
7 | showDialog(
8 | context: context,
9 | builder: (BuildContext context) {
10 | return AlertDialog(
11 | title: Text('Error', style: theme.errorTitleStyle),
12 | content: Text(message, style: theme.contentStyle),
13 | actions: [
14 | FlatButton(
15 | child: Text('Ok', style: theme.okButtonStyle),
16 | onPressed: () {
17 | Navigator.of(context).pop();
18 | },
19 | )
20 | ],
21 | );
22 | });
23 | }
24 |
25 | void successDialog(BuildContext context, String message) {
26 | if (context != null)
27 | showDialog(
28 | context: context,
29 | builder: (BuildContext context) {
30 | return AlertDialog(
31 | title: Text('Notification', style: theme.titleStyle),
32 | content: Text(message, style: theme.contentStyle),
33 | actions: [
34 | FlatButton(
35 | child: Text('Ok', style: theme.okButtonStyle),
36 | onPressed: () async {
37 | Navigator.of(context).pop();
38 | },
39 | )
40 | ],
41 | );
42 | });
43 | }
44 |
--------------------------------------------------------------------------------
/admin_app/lib/Constants/evn.dart:
--------------------------------------------------------------------------------
1 | const String URL_EXECUTE = 'https://meomeocf98.000webhostapp.com/flutter/index.php';
2 | const String ID_EXECUTENONEQUERY = 'executeNoneQuery';
3 | const String ID_EXECUTEQUERY = 'executeQuery';
4 |
--------------------------------------------------------------------------------
/admin_app/lib/Constants/theme.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color primaryColor = Color.fromARGB(255, 209, 228, 252);
4 | const Color accentColor = Color.fromARGB(255, 72, 0, 250);
5 | const Color fontColor = Color.fromARGB(255, 38, 54, 70);
6 | const Color fontColorLight = Color.fromARGB(180, 38, 54, 70);
7 |
8 | /* Dialog */
9 | const TextStyle titleStyle =
10 | TextStyle(color: accentColor, fontFamily: 'Dosis', fontSize: 19.0, fontWeight: FontWeight.w600);
11 | const TextStyle errorTitleStyle =
12 | TextStyle(color: Colors.redAccent, fontFamily: 'Dosis', fontSize: 19.0, fontWeight: FontWeight.w600);
13 | const TextStyle contentStyle =
14 | TextStyle(color: fontColor, fontFamily: 'Dosis', fontSize: 16.0, fontWeight: FontWeight.w500);
15 | const TextStyle okButtonStyle =
16 | TextStyle(color: Colors.blueAccent, fontFamily: 'Dosis', fontSize: 16.0, fontWeight: FontWeight.w600);
17 | const TextStyle cancelButtonStyle =
18 | TextStyle(color: Colors.redAccent, fontFamily: 'Dosis', fontSize: 16.0, fontWeight: FontWeight.w600);
19 | const TextStyle headTable =
20 | TextStyle(color: fontColor, fontFamily: 'Dosis', fontSize: 15.0, fontWeight: FontWeight.w600);
21 | const TextStyle contentTable =
22 | TextStyle(color: fontColorLight, fontFamily: 'Dosis', fontSize: 14.0, fontWeight: FontWeight.w500);
23 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/accountType.controller.dart:
--------------------------------------------------------------------------------
1 | import './../Models/accountType.model.dart';
2 |
3 | class Controller {
4 | static Controller _instance;
5 |
6 | static Controller get instance {
7 | if (_instance == null) _instance = Controller();
8 | return _instance;
9 | }
10 |
11 | Future> _accTypes;
12 |
13 | Future> get accTypes {
14 | if (_accTypes == null) _accTypes = Model.instance.getAccTypes();
15 | return _accTypes;
16 | }
17 |
18 | Future insertAccType(String name) => Model.instance.insertAccType(name);
19 |
20 | Future updateAccType(int id, String name) => Model.instance.updateAccType(id, name);
21 |
22 | Future deleteAccType(int id) => Model.instance.deleteAccType(id);
23 |
24 | Future isAccTypeExists(int id) => Model.instance.isAccTypeExists(id);
25 |
26 | Future> searchAccTypes(String keyword) async {
27 | List items = await accTypes;
28 | if (keyword.trim() == '') return items;
29 | return items.where((item) => item.name.toUpperCase().indexOf(keyword.toUpperCase()) != -1).toList();
30 | }
31 |
32 | void insertAccTypeToLocal(String _name) async {
33 | int idMax = await Model.instance.getIDMax();
34 | AccountType accountType = AccountType(idMax, _name);
35 | (await accTypes).add(accountType);
36 | }
37 |
38 | void updateAccTypeToLocal(int _id, String _name) async {
39 | int index = await findIndex(_id);
40 | (await accTypes)[index].id = _id;
41 | (await accTypes)[index].name = _name;
42 | }
43 |
44 | void deleteAccTypeToLocal(int id) async {
45 | int index = await findIndex(id);
46 | (await accTypes).removeAt(index);
47 | }
48 |
49 | Future findIndex(int id) async {
50 | for (var i = 0; i < (await accTypes).length; i++) {
51 | if ((await accTypes)[i].id == id) return i;
52 | }
53 | return -1;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/bill.controller.dart:
--------------------------------------------------------------------------------
1 | import './../Models/bill.model.dart';
2 |
3 | class Controller {
4 | static final Controller instance = Controller();
5 |
6 | Future> _bills;
7 |
8 | Future> get bills {
9 | _bills = Model.instance.getBills();
10 | return _bills;
11 | }
12 |
13 | Future deleteBill(int id) {
14 | return Model.instance.deleteBill(id);
15 | }
16 |
17 | Future> getFoodByBill(int idBill) => Model.instance.getFoodByBill(idBill);
18 |
19 | Future> searchFoods(String keyword, DateTime dateStart, DateTime dateEnd) async {
20 | if (_bills == null) return null;
21 | List items = await _bills;
22 | if (keyword.trim() == '') return items;
23 | return items
24 | .where((item) =>
25 | item.nameTable.toUpperCase().indexOf(keyword.toUpperCase()) != -1 &&
26 | ((item.dateCheckIn.compareTo(dateStart) >= 0 && item.dateCheckIn.compareTo(dateEnd) <= 0) ||
27 | (item.dateCheckOut.compareTo(dateStart) >= 0 && item.dateCheckOut.compareTo(dateEnd) <= 0)))
28 | .toList();
29 | }
30 |
31 | void deleteLocal(int id) async {
32 | int index = await findIndex(id);
33 | if (index == -1) return;
34 | (await _bills).removeAt(index);
35 | }
36 |
37 | Future findIndex(int id) async {
38 | var bill = (await _bills);
39 | for (var i = 0; i < bill.length; ++i) {
40 | if (bill[i].id == id) return i;
41 | }
42 | return -1;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/category.controller.dart:
--------------------------------------------------------------------------------
1 | import './../Models/category.model.dart';
2 |
3 | class Controller {
4 | static Controller _instance;
5 |
6 | static Controller get instance {
7 | if (_instance == null) _instance = Controller();
8 | return _instance;
9 | }
10 |
11 | Future> _categories;
12 |
13 | Future> get categories {
14 | if (_categories == null) _categories = Model.instance.getCategories();
15 | return _categories;
16 | }
17 |
18 | Future insertCategory(String name) => Model.instance.insertCategory(name);
19 |
20 | Future updateCategory(int id, String name) => Model.instance.updateCategory(id, name);
21 |
22 | Future deleteCategory(int id) => Model.instance.deleteCategory(id);
23 |
24 | Future isCategoryExists(int id) => Model.instance.isCategoryExists(id);
25 |
26 | Future> searchCategories(String keyword) async {
27 | List items = await categories;
28 | if (keyword.trim() == '') return items;
29 | return items.where((item) => item.name.toUpperCase().indexOf(keyword.toUpperCase()) != -1).toList();
30 | }
31 |
32 | void insertCateToLocal(String name) async {
33 | int idMax = await Model.instance.getIDMax();
34 | Category cate = Category(idMax, name);
35 | (await categories).add(cate);
36 | }
37 |
38 | void updateCateToLocal(int id, String name) async {
39 | int index = await findIndex(id);
40 | (await categories)[index].name = name;
41 | }
42 |
43 | void deleteCateToLocal(int id) async {
44 | int index = await findIndex(id);
45 | (await categories).removeAt(index);
46 | }
47 |
48 | Future findIndex(int id) async {
49 | for (var i = 0; i < (await categories).length; i++) {
50 | if ((await categories)[i].id == id) return i;
51 | }
52 | return -1;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/food.controller.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import './../Models/food.model.dart';
4 |
5 | class Controller {
6 | static Controller _instance;
7 |
8 | static Controller get instance {
9 | if (_instance == null) _instance = Controller();
10 | return _instance;
11 | }
12 |
13 | Future> _foods;
14 |
15 | Future> get foods {
16 | if (_foods == null) _foods = Model.instance.getFoods();
17 | return _foods;
18 | }
19 |
20 | Future deleteFood(int id) => Model.instance.deleteFood(id);
21 |
22 | void deleteFoodToLocal(int id) async {
23 | int index = await findIndex(id);
24 | (await foods).removeAt(index);
25 | }
26 |
27 | Future findIndex(int id) async {
28 | for (var i = 0; i < (await foods).length; i++) {
29 | if ((await foods)[i].id == id) return i;
30 | }
31 | return -1;
32 | }
33 |
34 | Future insertFood(String name, double price, int idCategory, String image) {
35 | return Model.instance.insertFood(name, price, idCategory, image);
36 | }
37 |
38 | void insertFoodToLocal(
39 | String _name, int _idCategory, String _category, double _price, String _image) async {
40 | int idMax = await Model.instance.getIDMax();
41 | Food food = Food(idMax, _name, _idCategory, _category, _price, base64.decode(_image));
42 | (await foods).add(food);
43 | }
44 |
45 | Future isFoodExists(int id) => Model.instance.isFoodExists(id);
46 |
47 | Future> searchFoods(String keyword) async {
48 | List items = await foods;
49 | if (keyword.trim() == '') return items;
50 | return items.where((item) => item.name.toUpperCase().indexOf(keyword.toUpperCase()) != -1).toList();
51 | }
52 |
53 | Future updateFood(int id, String name, double price, int idCategory, String image) {
54 | return Model.instance.updateFood(id, name, price, idCategory, image);
55 | }
56 |
57 | void updateFoodToLocal(
58 | int _id, String _name, int _idCategory, String _category, double _price, String _image) async {
59 | int index = await findIndex(_id);
60 | (await foods)[index].name = _name;
61 | (await foods)[index].idCategory = _idCategory;
62 | (await foods)[index].category = _category;
63 | (await foods)[index].price = _price;
64 | (await foods)[index].image = base64.decode(_image);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/image.controller.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:image_picker/image_picker.dart';
4 |
5 | abstract class ImageController {
6 | static final imagePicker = ImagePicker();
7 |
8 | static Future getImageFromGallery() {
9 | return imagePicker.getImage(source: ImageSource.gallery).then((value) => File(value.path));
10 | }
11 |
12 | static Future getImageFromCamera() {
13 | return imagePicker.getImage(source: ImageSource.camera).then((value) => File(value.path));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/login.controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:dbcrypt/dbcrypt.dart';
2 |
3 | import './../Models/login.model.dart';
4 |
5 | class Controller {
6 | static Controller _instance;
7 |
8 | Account account;
9 |
10 | static Controller get instance {
11 | if (_instance == null) _instance = Controller();
12 | return _instance;
13 | }
14 |
15 | Future login(String username, String password) async {
16 | if (account == null || account.username != username) account = await Model.instance.login(username);
17 | return account != null ? DBCrypt().checkpw(password, account.password) : false;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/profile.controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:dbcrypt/dbcrypt.dart';
2 |
3 | import './../Models/profile.model.dart';
4 |
5 | class Controller {
6 | static Controller _instance;
7 |
8 | static Controller get instance {
9 | if (_instance == null) _instance = Controller();
10 | return _instance;
11 | }
12 |
13 | bool equalPass(String hashPass, String passCheck) => DBCrypt().checkpw(passCheck, hashPass);
14 |
15 | String toHashPass(String pass) => DBCrypt().hashpw(pass, DBCrypt().gensalt());
16 |
17 | Future updateAvatar(String username, String image) {
18 | return Model.instance.updateAvatar(username, image);
19 | }
20 |
21 | Future updateInfo(String username, String displayName, int sex, DateTime birthday, String idCard,
22 | String address, String phone) {
23 | return Model.instance.updateInfo(username, displayName, sex, birthday, idCard, address, phone);
24 | }
25 |
26 | Future updatePassword(String username, String newPass) {
27 | return Model.instance.updatePassword(username, DBCrypt().hashpw(newPass, DBCrypt().gensalt()));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/report.controller.dart:
--------------------------------------------------------------------------------
1 | import './../Models/report.model.dart';
2 |
3 | class Controller {
4 | static final instance = Controller();
5 |
6 | Future> get reportsWeek => Model.instance.getReports();
7 |
8 | Future get reportToday => Model.instance.getReportToday();
9 |
10 | Future> get reportsMonth => Model.instance.getReportsMonth();
11 |
12 | Future> get reportsYear => Model.instance.getReportsYear();
13 | }
14 |
--------------------------------------------------------------------------------
/admin_app/lib/Controllers/table.controller.dart:
--------------------------------------------------------------------------------
1 | import './../Models/table.model.dart';
2 |
3 | class Controller {
4 | static Controller _instance;
5 |
6 | static Controller get instance {
7 | if (_instance == null) _instance = Controller();
8 | return _instance;
9 | }
10 |
11 | Future> _tables;
12 |
13 | Future> get tables {
14 | if (_tables == null) _tables = Model.instance.getTables();
15 | return _tables;
16 | }
17 |
18 | Future insertTable(String name) => Model.instance.insertTable(name);
19 |
20 | Future updateTable(int id, String name) => Model.instance.updateTable(id, name);
21 |
22 | Future deleteTable(int id) => Model.instance.deleteTable(id);
23 |
24 | Future isTableExists(int id) => Model.instance.isTableExists(id);
25 |
26 | Future> searchTables(String keyword) async {
27 | List items = await tables;
28 | if (keyword.trim() == '') return items;
29 | return items.where((item) => item.name.toLowerCase().indexOf(keyword.toLowerCase()) != -1).toList();
30 | }
31 |
32 | void insertTableToLocal(String name, int status) async {
33 | int idMax = await Model.instance.getIDMax();
34 | Table table = Table(idMax, name, status);
35 | (await tables).add(table);
36 | }
37 |
38 | void updateTableToLocal(int id, String name, int status) async {
39 | int index = await findIndex(id);
40 | (await tables)[index].id = id;
41 | (await tables)[index].name = name;
42 | (await tables)[index].status = status;
43 | }
44 |
45 | void deleteTableToLocal(int id) async {
46 | int index = await findIndex(id);
47 | (await tables).removeAt(index);
48 | }
49 |
50 | Future findIndex(int id) async {
51 | for (var i = 0; i < (await tables).length; i++) {
52 | if ((await tables)[i].id == id) return i;
53 | }
54 | return -1;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/accountType.model.dart:
--------------------------------------------------------------------------------
1 | import './../Constants/queries.dart' as queries;
2 | import './account.model.dart' as accModel;
3 | import 'connect_server.dart';
4 |
5 | class Model {
6 | static Model _instance;
7 |
8 | static Model get instance {
9 | if (_instance == null) {
10 | _instance = Model();
11 | }
12 | return _instance;
13 | }
14 |
15 | Future> getAccTypes() async {
16 | Future futureAccTypes = MySqlConnection.instance.executeQuery(queries.GET_ACCTYPES);
17 | return parseAccType(futureAccTypes);
18 | }
19 |
20 | Future insertAccType(String name) {
21 | return MySqlConnection.instance.executeNoneQuery(queries.INSERT_ACCTYPE, parameter: [name]);
22 | }
23 |
24 | Future updateAccType(int id, String name) {
25 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_ACCTYPE, parameter: [id, name]);
26 | }
27 |
28 | Future deleteAccType(int id) {
29 | return MySqlConnection.instance.executeNoneQuery(queries.DELETE_ACCTYPE, parameter: [id]);
30 | }
31 |
32 | Future isAccTypeExists(int id) async {
33 | // check food exists on bill
34 | Future futureAccs =
35 | MySqlConnection.instance.executeQuery(queries.IS_ACCTYPE_EXISTS, parameter: [id]);
36 | return (await accModel.Model.parseAcc(futureAccs)).isNotEmpty;
37 | }
38 |
39 | Future getIDMax() async {
40 | Future futureAccTypes = MySqlConnection.instance.executeQuery(queries.GET_ID_ACCTYPE_MAX);
41 | return (await parseAccType(futureAccTypes))[0].id;
42 | }
43 |
44 | Future> parseAccType(Future futureAccTypes) async {
45 | List accTypes = [];
46 | await futureAccTypes.then((values) {
47 | values.forEach((value) => accTypes.add(AccountType.fromJson(value)));
48 | });
49 | return accTypes;
50 | }
51 | }
52 |
53 | class AccountType {
54 | int id;
55 | String name;
56 |
57 | AccountType(int _id, String _name) {
58 | id = _id;
59 | name = _name;
60 | }
61 |
62 | AccountType.fromJson(Map json) {
63 | id = json['ID'] != null ? int.parse(json['ID']) : -1;
64 | name = json['Name'] ?? '';
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/bill.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import './../Constants/queries.dart' as queries;
4 | import 'connect_server.dart';
5 |
6 | class Model {
7 | static final Model instance = Model();
8 |
9 | Future> getBills() async {
10 | Future futureFoods = MySqlConnection.instance.executeQuery(queries.QUERY_GET_BILLS);
11 | return parseBill(futureFoods);
12 | }
13 |
14 | Future deleteBill(int id) {
15 | return MySqlConnection.instance.executeNoneQuery(queries.QUERY_DELETE_BILLS, parameter: [id]);
16 | }
17 |
18 | Future> getFoodByBill(int idBill) async {
19 | Future futureFoods =
20 | MySqlConnection.instance.executeQuery(queries.GET_BILLDETAIL_BY_BILL, parameter: [idBill]);
21 | return parseFood(futureFoods);
22 | }
23 |
24 | Future> parseBill(Future futureBills) async {
25 | List bills = [];
26 | await futureBills.then((values) {
27 | values.forEach((value) => bills.add(Bill.fromJson(value)));
28 | });
29 | return bills;
30 | }
31 |
32 | static Future> parseFood(Future foods) async {
33 | List futureFoods = [];
34 | await foods.then((values) {
35 | values.forEach((value) {
36 | futureFoods.add(Food.fromJson(value));
37 | });
38 | });
39 | return futureFoods;
40 | }
41 | }
42 |
43 | class Bill {
44 | int id;
45 | int idTable;
46 | String nameTable;
47 | DateTime dateCheckIn;
48 | DateTime dateCheckOut;
49 | double discount;
50 | double totalPrice;
51 | String status;
52 | String userName;
53 |
54 | Bill.fromJson(Map json) {
55 | this.id = json['ID'] != null ? int.parse(json['ID']) : 0;
56 | this.idTable = json['IDTable'] != null ? int.parse(json['IDTable']) : 0;
57 | this.nameTable = json['Name'] ?? '';
58 | this.dateCheckIn = DateTime.parse(json['DateCheckIn']);
59 | this.dateCheckOut = DateTime.parse(json['DateCheckOut']);
60 | this.discount = double.parse(json['Discount']);
61 | this.totalPrice = double.parse(json['TotalPrice']);
62 | this.status = int.parse(json['Status']) > 0 ? 'Paid' : 'Unpaid';
63 | this.userName = json['Username'];
64 | }
65 | }
66 |
67 | class Food {
68 | int id;
69 | String name;
70 | int idFoodCategory;
71 | double price;
72 | int quantity;
73 | int idImange;
74 | Uint8List image;
75 |
76 | Food(Food _food) {
77 | this.id = _food.id;
78 | this.name = _food.name;
79 | this.idFoodCategory = _food.idFoodCategory;
80 | this.price = _food.price;
81 | this.quantity = _food.quantity;
82 | this.image = _food.image;
83 | }
84 |
85 | Food.fromJson(Map json) {
86 | this.id = int.parse(json['ID']);
87 | this.name = json['Name'];
88 | this.idFoodCategory = int.parse(json['IDCategory']);
89 | this.price = double.parse(json['Price']);
90 | this.quantity = json['Quantity'] != null ? int.parse(json['Quantity']) : 0;
91 | //this.image = json['Image'] != null ? base64.decode(json['Image']) : null;
92 | this.idImange = int.parse(json['IDImage']);
93 | //this.image = base64.decode(json['Image']);
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/category.model.dart:
--------------------------------------------------------------------------------
1 | import './../Constants/queries.dart' as queries;
2 | import './food.model.dart' as foodModel;
3 | import 'connect_server.dart';
4 |
5 | class Category {
6 | int id;
7 | String name;
8 |
9 | Category(int _id, String _name) {
10 | id = _id;
11 | name = _name;
12 | }
13 |
14 | Category.fromJson(Map json) {
15 | id = int.parse(json['ID']);
16 | name = json['Name'];
17 | }
18 | }
19 |
20 | class Model {
21 | static Model _instance;
22 |
23 | static Model get instance {
24 | if (_instance == null) {
25 | _instance = Model();
26 | }
27 | return _instance;
28 | }
29 |
30 | Future deleteCategory(int id) {
31 | return MySqlConnection.instance.executeNoneQuery(queries.DELETE_CATEGORY, parameter: [id]);
32 | }
33 |
34 | Future> getCategories() async {
35 | Future futureCategories = MySqlConnection.instance.executeQuery(queries.GET_CATEGORIES);
36 | return parseCategory(futureCategories);
37 | }
38 |
39 | Future getIDMax() async {
40 | Future futureFoods = MySqlConnection.instance.executeQuery(queries.GET_ID_CATEGORY_MAX);
41 | return (await parseCategory(futureFoods))[0].id;
42 | }
43 |
44 | Future insertCategory(String name) {
45 | return MySqlConnection.instance.executeNoneQuery(queries.INSERT_CATEGORY, parameter: [name]);
46 | }
47 |
48 | Future isCategoryExists(int id) async {
49 | // check category exists on food
50 | Future futureFoods =
51 | MySqlConnection.instance.executeQuery(queries.IS_CATEGORY_EXISTS, parameter: [id]);
52 | return (await foodModel.Model.parseFood(futureFoods)).isNotEmpty;
53 | }
54 |
55 | Future> parseCategory(Future futureCategories) async {
56 | List categories = [];
57 | await futureCategories.then((values) {
58 | values.forEach((value) => categories.add(Category.fromJson(value)));
59 | });
60 | return categories;
61 | }
62 |
63 | Future updateCategory(int id, String name) {
64 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_CATEGORY, parameter: [id, name]);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/connect_server.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:http/http.dart' as http;
5 |
6 | import '../Constants/evn.dart';
7 |
8 | class MySqlConnection {
9 | static MySqlConnection _instance;
10 |
11 | static MySqlConnection get instance {
12 | if (_instance == null) _instance = MySqlConnection();
13 | return _instance;
14 | }
15 |
16 | Future executeNoneQuery(String query, {List parameter}) async {
17 | if (parameter != null) {
18 | query = _addParameter(query, parameter);
19 | }
20 |
21 | http.Response response = await http.post(
22 | URL_EXECUTE,
23 | body: {ID_EXECUTENONEQUERY: query},
24 | );
25 |
26 | int number = 0;
27 | if (response.statusCode == 200) number = int.parse(response.body);
28 | return number > 0;
29 | }
30 |
31 | Future executeQuery(String query, {List parameter}) async {
32 | if (parameter != null) {
33 | query = _addParameter(query, parameter);
34 | }
35 |
36 | http.Response response = await http.post(
37 | URL_EXECUTE,
38 | body: {ID_EXECUTEQUERY: query},
39 | // headers: {'Access-Control-Allow-Origin': '*'},
40 | );
41 | if (response.statusCode == 200) return json.decode(response.body);
42 | return null;
43 | }
44 |
45 | static String _addParameter(String query, List parameter) {
46 | List list = query.split(' ');
47 | query = '';
48 | int i = 0;
49 |
50 | list.forEach((String element) {
51 | if (element.contains('@')) {
52 | if (parameter[i] is String || parameter[i] is DateTime)
53 | query += "\'" + parameter[i++].toString() + "\'";
54 | else
55 | query += parameter[i++].toString();
56 | } else
57 | query += element;
58 | query += ' ';
59 | });
60 |
61 | return query;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/food.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:typed_data';
3 |
4 | import './../Constants/queries.dart' as queries;
5 | import 'connect_server.dart';
6 |
7 | class Model {
8 | static Model _instance;
9 |
10 | static Model get instance {
11 | if (_instance == null) {
12 | _instance = Model();
13 | }
14 | return _instance;
15 | }
16 |
17 | Future> getFoods() async {
18 | Future futureFoods = MySqlConnection.instance.executeQuery(queries.GET_FOODS);
19 | return parseFood(futureFoods);
20 | }
21 |
22 | Future insertFood(String name, double price, int idCategory, String image) {
23 | return MySqlConnection.instance
24 | .executeNoneQuery(queries.INSERT_FOOD, parameter: [name, price, idCategory, image]);
25 | }
26 |
27 | Future updateFood(int id, String name, double price, int idCategory, String image) {
28 | return MySqlConnection.instance
29 | .executeNoneQuery(queries.UPDATE_FOOD, parameter: [id, name, price, idCategory, image]);
30 | }
31 |
32 | Future deleteFood(int id) {
33 | return MySqlConnection.instance.executeNoneQuery(queries.DELETE_FOOD, parameter: [id]);
34 | }
35 |
36 | Future isFoodExists(int id) async {
37 | // check food exists on bill
38 | Future futureBillDetails =
39 | MySqlConnection.instance.executeQuery(queries.IS_FOOD_EXISTS, parameter: [id]);
40 | return (await parseBillDetails(futureBillDetails)).isNotEmpty;
41 | }
42 |
43 | Future getIDMax() async {
44 | Future futureFoods = MySqlConnection.instance.executeQuery(queries.GET_ID_FOOD_MAX);
45 | return (await parseFood(futureFoods))[0].id;
46 | }
47 |
48 | static Future> parseFood(Future futureFoods) async {
49 | List foods = [];
50 | await futureFoods.then((values) {
51 | values.forEach((value) => foods.add(Food.fromJson(value)));
52 | });
53 | return foods;
54 | }
55 |
56 | Future> parseBillDetails(Future futureBillDetails) async {
57 | List billDetails = [];
58 | await futureBillDetails.then((values) {
59 | values.forEach((value) => billDetails.add(BillDetail.fromJson(value)));
60 | });
61 | return billDetails;
62 | }
63 | }
64 |
65 | class Food {
66 | int id;
67 | String name;
68 | int idCategory;
69 | String category;
70 | double price;
71 | int idImange;
72 | Uint8List image;
73 |
74 | Food(int _id, String _name, int _idCategory, String _category, double _price, Uint8List _image) {
75 | id = _id;
76 | name = _name;
77 | idCategory = _idCategory;
78 | category = _category;
79 | price = _price;
80 | image = _image;
81 | }
82 |
83 | Food.fromJson(Map json) {
84 | this.id = json['IdFood'] != null ? int.parse(json['IdFood']) : int.parse(json['ID']);
85 | this.name = json['FoodName'] ?? '';
86 | this.idCategory = json['IDCategory'] != null ? int.parse(json['IDCategory']) : -1;
87 | this.category = json['CategoryName'] ?? '';
88 | this.price = json['Price'] != null ? double.parse(json['Price']) : 0.0;
89 | this.idImange = json['IdImage'] != null ? int.parse(json['IdImage']) : -1;
90 | this.image = json['Image'] != null ? base64.decode(json['Image']) : null;
91 | }
92 | }
93 |
94 | class BillDetail {
95 | int idBill;
96 | int idFood;
97 | int quantity;
98 |
99 | BillDetail.fromJson(Map json) {
100 | this.idBill = int.parse(json['IDBill']);
101 | this.idFood = int.parse(json['IDFood']);
102 | this.quantity = int.parse(json['Quantity']);
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/login.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:typed_data';
3 |
4 | import './../Constants/queries.dart' as queries;
5 | import 'connect_server.dart';
6 |
7 | class Model {
8 | static Model _instance;
9 |
10 | static Model get instance {
11 | if (_instance == null) {
12 | _instance = Model();
13 | }
14 | return _instance;
15 | }
16 |
17 | Future login(String username) async {
18 | Future futureAccount = MySqlConnection.instance.executeQuery(queries.LOGIN, parameter: [username]);
19 | return parseAccount(futureAccount);
20 | }
21 |
22 | Future parseAccount(Future accounts) async {
23 | Account account;
24 | await accounts.then((values) {
25 | if (values.isNotEmpty) account = Account.fromJson(values[0]);
26 | });
27 | return account;
28 | }
29 | }
30 |
31 | class Account {
32 | String username;
33 | String displayName;
34 | String password;
35 | int sex;
36 | String idCard;
37 | String address;
38 | String phone;
39 | DateTime birthday;
40 | String accountType;
41 | Uint8List image;
42 |
43 | Account.fromJson(Map json) {
44 | username = json['Username'];
45 | displayName = json['DisplayName'] ?? '';
46 | password = json['Password'];
47 | sex = json['Sex'] != null ? int.parse(json['Sex']) : -1;
48 | idCard = json['IDCard'] ?? '';
49 | address = json['Address'] ?? '';
50 | phone = json['PhoneNumber'] ?? '';
51 | birthday = json['BirthDay'] != null
52 | ? DateTime.parse(json['BirthDay'])
53 | : DateTime.now().subtract(Duration(days: 365 * 18));
54 | accountType = json['Name'] ?? '';
55 | image = json['Data'] != null ? base64.decode(json['Data']) : null;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/profile.model.dart:
--------------------------------------------------------------------------------
1 | import './../Constants/queries.dart' as queries;
2 | import 'connect_server.dart';
3 |
4 | class Model {
5 | static Model _instance;
6 |
7 | static Model get instance {
8 | if (_instance == null) {
9 | _instance = Model();
10 | }
11 | return _instance;
12 | }
13 |
14 | Future updateAvatar(String username, String image) {
15 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_ACC_AVATAR, parameter: [username, image]);
16 | }
17 |
18 | Future updateInfo(String username, String displayName, int sex, DateTime birthday, String idCard,
19 | String address, String phone) {
20 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_ACC_INFO,
21 | parameter: [username, displayName, sex, birthday, idCard, address, phone]);
22 | }
23 |
24 | Future updatePassword(String username, String newPass) {
25 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_ACC_PASS, parameter: [username, newPass]);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/report.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import './../Constants/queries.dart' as queries;
4 | import 'connect_server.dart';
5 |
6 | class Model {
7 | static final instance = Model();
8 |
9 | Future> getReports() async {
10 | Future futureReports = MySqlConnection.instance.executeQuery(queries.QUERY_GET_REPORT_LASTWEEK);
11 | return _parseReports(futureReports);
12 | }
13 |
14 | Future getReportToday() async {
15 | Future futureReport = MySqlConnection.instance.executeQuery(queries.QUERY_GET_REPORT_TODAY);
16 | return _parseReport(futureReport);
17 | }
18 |
19 | Future> getReportsMonth() async {
20 | Future futureReport = MySqlConnection.instance.executeQuery(queries.QUERY_GET_REPORT_MONTH);
21 | return _parseReports(futureReport);
22 | }
23 |
24 | Future> getReportsYear() async {
25 | Future futureReport = MySqlConnection.instance.executeQuery(queries.QUERY_GET_REPORT_YEAR);
26 | return _parseReports(futureReport);
27 | }
28 |
29 | Future _parseReport(Future futureReport) async {
30 | List reports = [];
31 | await futureReport.then((values) {
32 | values.forEach((value) => reports.add(Report.fromJson(value)));
33 | });
34 | return reports[0];
35 | }
36 |
37 | Future> _parseReports(Future futureReports) async {
38 | List reports = [];
39 | await futureReports.then((values) {
40 | values.forEach((value) => reports.add(Report.fromJson(value)));
41 | });
42 | return reports;
43 | }
44 | }
45 |
46 | class Report {
47 | int id;
48 | DateTime day;
49 | double totalPrice;
50 |
51 | Report(this.day, this.totalPrice);
52 |
53 | Report.fromJson(Map json) {
54 | id = json['ID'] != null ? int.parse(json['ID']) : 0;
55 | day = DateTime.parse(json['_Date']);
56 | totalPrice = double.parse(json['TotalPrice']);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/admin_app/lib/Models/table.model.dart:
--------------------------------------------------------------------------------
1 | import './../Constants/queries.dart' as queries;
2 | import 'connect_server.dart';
3 |
4 | class Model {
5 | static Model _instance;
6 |
7 | static Model get instance {
8 | if (_instance == null) {
9 | _instance = Model();
10 | }
11 | return _instance;
12 | }
13 |
14 | Future> getTables() async {
15 | Future futureTables = MySqlConnection.instance.executeQuery(queries.GET_TABLES);
16 | return parseTable(futureTables);
17 | }
18 |
19 | Future insertTable(String name) {
20 | return MySqlConnection.instance.executeNoneQuery(queries.INSERT_TABLE, parameter: [name]);
21 | }
22 |
23 | Future updateTable(int id, String name) {
24 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_TABLE, parameter: [id, name, -1]);
25 | }
26 |
27 | Future deleteTable(int id) {
28 | return MySqlConnection.instance.executeNoneQuery(queries.DELETE_TABLE, parameter: [id]);
29 | }
30 |
31 | Future isTableExists(int id) async {
32 | // check table exists on bill
33 | Future futureBills =
34 | MySqlConnection.instance.executeQuery(queries.IS_TABLE_EXISTS, parameter: [id]);
35 | return (await parseBill(futureBills)).isNotEmpty;
36 | }
37 |
38 | Future getIDMax() async {
39 | Future futureFoods = MySqlConnection.instance.executeQuery(queries.GET_ID_TABLE_MAX);
40 | return (await parseTable(futureFoods))[0].id;
41 | }
42 |
43 | Future> parseTable(Future futureTables) async {
44 | List tables = [];
45 | await futureTables.then((values) {
46 | values.forEach((value) => tables.add(Table.fromJson(value)));
47 | });
48 | return tables;
49 | }
50 |
51 | Future> parseBill(Future futureBills) async {
52 | List bills = [];
53 | await futureBills.then((values) {
54 | values.forEach((value) => bills.add(Bill.fromJson(value)));
55 | });
56 | return bills;
57 | }
58 | }
59 |
60 | class Table {
61 | int id;
62 | String name;
63 | int status;
64 |
65 | Table(int _id, String _name, int _status) {
66 | id = _id;
67 | name = _name;
68 | status = _status;
69 | }
70 |
71 | Table.fromJson(Map json) {
72 | id = json['ID'] != null ? int.parse(json['ID']) : -1;
73 | name = json['Name'] ?? '';
74 | status = json['Status'] != null ? int.parse(json['Status']) : -1;
75 | }
76 | }
77 |
78 | class Bill {
79 | int id;
80 | int idTable;
81 | DateTime dateCheckIn;
82 | DateTime dateCheckOut;
83 | double discount;
84 | double totalPrice;
85 | int status;
86 |
87 | Bill.fromJson(Map json) {
88 | this.id = json['ID'] != null ? int.parse(json['ID']) : -1;
89 | this.idTable = json['IDTable'] != null ? int.parse(json['IDTable']) : -1;
90 | this.dateCheckIn = json['DateCheckIn'] != null ? DateTime.parse(json['DateCheckIn']) : DateTime.now();
91 | this.dateCheckOut = json['DateCheckOut'] != null ? DateTime.parse(json['DateCheckOut']) : DateTime.now();
92 | this.status = json['Status'] != null ? int.parse(json['Status']) : -1;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/admin_app/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 |
4 | import './Constants/theme.dart';
5 | import './Views/login.view.dart';
6 |
7 | void main() => {
8 | WidgetsFlutterBinding.ensureInitialized(),
9 | SystemChrome.setSystemUIOverlayStyle(
10 | SystemUiOverlayStyle(statusBarColor: primaryColor),
11 | ),
12 | runApp(MyApp()),
13 | };
14 |
15 | class MyApp extends StatelessWidget {
16 | // This widget is the root of your application.
17 | @override
18 | Widget build(BuildContext context) {
19 | return MaterialApp(
20 | title: 'Admin App',
21 | theme: ThemeData(
22 | brightness: Brightness.light,
23 | primaryColor: primaryColor,
24 | accentColor: accentColor,
25 | ),
26 | color: primaryColor,
27 | home: LoginScreen(),
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/admin_app/lib/utils/log.dart:
--------------------------------------------------------------------------------
1 | //ignore_for_file: avoid_print
2 |
3 | import 'package:ansicolor/ansicolor.dart';
4 | import 'package:flutter/foundation.dart';
5 |
6 | abstract class Log {
7 | static final _debugCode = chooseLogColor(LogLevel.DEBUG);
8 | static final _infoCode = chooseLogColor(LogLevel.INFO);
9 | static final _warnCode = chooseLogColor(LogLevel.WARN);
10 | static final _errorCode = chooseLogColor(LogLevel.ERROR);
11 |
12 | static void debug(dynamic data) {
13 | if (!kReleaseMode) _print(_debugCode, '::debug:: $data');
14 | }
15 |
16 | static void info(dynamic data) {
17 | _print(_infoCode, '::info:: $data');
18 | }
19 |
20 | static void warn(dynamic data) {
21 | _print(_warnCode, '::warn:: $data');
22 | }
23 |
24 | static void error(dynamic data) {
25 | _print(_errorCode, '::error:: $data');
26 | }
27 |
28 | static void _print([AnsiPen code, dynamic data]) {
29 | print(code(data));
30 | }
31 | }
32 |
33 | enum LogLevel {
34 | DEBUG,
35 | INFO,
36 | WARN,
37 | ERROR,
38 | ALL,
39 | }
40 |
41 | /// Chooses a color based on the logger [level].
42 | AnsiPen chooseLogColor(LogLevel level) {
43 | switch (level) {
44 | case LogLevel.ALL:
45 | return AnsiPen()..white();
46 | case LogLevel.DEBUG:
47 | return AnsiPen()..green();
48 | case LogLevel.INFO:
49 | return AnsiPen()..blue();
50 | case LogLevel.WARN:
51 | return AnsiPen()..yellow();
52 | case LogLevel.ERROR:
53 | return AnsiPen()..red();
54 | default:
55 | return AnsiPen()..white();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/admin_app/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: admin_app
2 | description: Admin for management
3 | author: Store pattern team
4 | homepage: https://github.com/uiters/store-pattern
5 | repository: https://github.com/uiters/store-pattern
6 |
7 | version: 1.0.1
8 |
9 | environment:
10 | sdk: ">=2.7.0 <3.0.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | http: 0.12.1
17 | dbcrypt: 1.0.0
18 | image_picker: 0.6.7+3
19 | charts_flutter: 0.9.0
20 | ansicolor: 1.0.2
21 |
22 | dev_dependencies:
23 | flutter_test:
24 | sdk: flutter
25 | pedantic: 1.9.0
26 | flutter_launcher_icons: 0.7.5
27 | flutter_native_splash: 0.1.9
28 |
29 |
30 | flutter_icons:
31 | android: 'launcher_icon'
32 | ios: true
33 | image_path: 'assets/launcher_icons/app_icon.png'
34 | build_runner: ^1.0.0
35 |
36 | flutter:
37 | uses-material-design: true
38 | assets:
39 | - assets/images/
40 |
41 | fonts:
42 | - family: Dosis
43 | fonts:
44 | - asset: assets/fonts/Dosis/Dosis-Regular.ttf
45 | weight: 400
46 | - asset: assets/fonts/Dosis/Dosis-Medium.ttf
47 | weight: 500
48 | - asset: assets/fonts/Dosis/Dosis-SemiBold.ttf
49 | weight: 600
50 | - asset: assets/fonts/Dosis/Dosis-Bold.ttf
51 | weight: 800
52 | - asset: assets/fonts/Dosis/Dosis-ExtraBold.ttf
53 | weight: 900
54 |
--------------------------------------------------------------------------------
/admin_app/rebuild_app_icon.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | flutter pub get
3 | flutter pub pub run flutter_launcher_icons:main
4 | flutter pub pub run flutter_native_splash:create
--------------------------------------------------------------------------------
/admin_app/test/unit_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | void main() {
4 | test('my first unit test', () {
5 | var answer = 42;
6 | expect(answer, 42);
7 | });
8 | }
9 |
--------------------------------------------------------------------------------
/admin_app/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_test/flutter_test.dart';
3 |
4 | void main() {
5 | testWidgets('my first widget test', (WidgetTester tester) async {
6 | // You can use keys to locate the widget you need to test
7 | var sliderKey = UniqueKey();
8 | var value = 0.0;
9 |
10 | // Tells the tester to build a UI based on the widget tree passed to it
11 | await tester.pumpWidget(
12 | StatefulBuilder(
13 | builder: (BuildContext context, StateSetter setState) {
14 | return MaterialApp(
15 | home: Material(
16 | child: Center(
17 | child: Slider(
18 | key: sliderKey,
19 | value: value,
20 | onChanged: (double newValue) {
21 | setState(() {
22 | value = newValue;
23 | });
24 | },
25 | ),
26 | ),
27 | ),
28 | );
29 | },
30 | ),
31 | );
32 | expect(value, equals(0.0));
33 |
34 | // Taps on the widget found by key
35 | await tester.tap(find.byKey(sliderKey));
36 |
37 | // Verifies that the widget updated the value correctly
38 | expect(value, equals(0.5));
39 | });
40 | }
--------------------------------------------------------------------------------
/admin_app/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/web/favicon.png
--------------------------------------------------------------------------------
/admin_app/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/admin_app/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/admin_app/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/admin_app/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | admin_app
18 |
19 |
20 |
21 |
24 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/admin_app/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "admin_app",
3 | "short_name": "admin_app",
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 |
--------------------------------------------------------------------------------
/kitchen_app/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
--------------------------------------------------------------------------------
/kitchen_app/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=3d5ebdf1
2 | build.xml.script.CRC32=9aadeb3a
3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.48
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=3d5ebdf1
7 | nbproject/build-impl.xml.script.CRC32=6364a714
8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
9 |
--------------------------------------------------------------------------------
/kitchen_app/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | kitchen_app
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/kitchen_app/packages/gson/gson-2.8.5.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/gson/gson-2.8.5.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/commons-codec-1.10.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/commons-codec-1.10.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/commons-logging-1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/commons-logging-1.2.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/fluent-hc-4.5.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/fluent-hc-4.5.6.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/httpclient-4.5.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/httpclient-4.5.6.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/httpclient-cache-4.5.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/httpclient-cache-4.5.6.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/httpclient-win-4.5.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/httpclient-win-4.5.6.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/httpcore-4.4.10.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/httpcore-4.4.10.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/httpmime-4.5.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/httpmime-4.5.6.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/jna-4.4.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/jna-4.4.0.jar
--------------------------------------------------------------------------------
/kitchen_app/packages/http/jna-platform-4.4.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/packages/http/jna-platform-4.4.0.jar
--------------------------------------------------------------------------------
/kitchen_app/src/Constants/CColor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package Constants;
7 |
8 | import java.awt.*;
9 |
10 | /**
11 | * @author thienlan
12 | */
13 | public class CColor {
14 | public static Color topBar = new Color(228, 249, 245);
15 | public static Color red = new Color(0xFF1654);
16 | public static Color yellow = new Color(0xF3FFBD);
17 | public static Color greenLigth = new Color(0xC9D7F8);
18 | public static Color green = new Color(0x70C1B3);
19 | public static Color blue = new Color(0x247BA0);
20 |
21 | public static Color defcolor = new Color(64, 181, 138);
22 | }
23 |
--------------------------------------------------------------------------------
/kitchen_app/src/Constants/Constant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package Constants;
7 |
8 | /**
9 | * @author thienlan
10 | */
11 | public class Constant {
12 |
13 | /**
14 | * connection with server
15 | */
16 | public static String urlConnect = "https://meomeocf98.000webhostapp.com/flutter/index.php";
17 | public static String keyNoneQuery = "executeNoneQuery";
18 | public static String keyQuery = "executeQuery";
19 | public static String defaultpass = "abc"; //mật khẩu mặc định cho việc reset pass
20 | }
21 |
--------------------------------------------------------------------------------
/kitchen_app/src/Constants/Query.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package Constants;
7 |
8 | /**
9 | * @author thienlan
10 | */
11 | public class Query {
12 | //bill
13 | public static String getOrder = "call USP_TVC12_GetOrders() ";
14 | public static String getBillInfo = "call USP_TVC12_GetFoodFromBill( @ID ) ";
15 | }
16 |
--------------------------------------------------------------------------------
/kitchen_app/src/Controllers/StructBill.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package Controllers;
7 |
8 | import Models.BillModel.Bill;
9 | import Models.BillModel.BillInfo;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | /**
15 | * @author thienlan
16 | */
17 | public class StructBill {
18 | private final Bill bill;
19 | private List billsInfo = new ArrayList<>();
20 | private List billsInfoSwap = new ArrayList<>();//for swap
21 |
22 | public StructBill(Bill bill) {
23 | this.bill = bill;
24 | }
25 |
26 | public Bill getBill() {
27 | return bill;
28 | }
29 |
30 | public List getBillsInfo() {
31 | return billsInfo;
32 | }
33 |
34 | public int getIDBill() {
35 | return bill.id;
36 | }
37 |
38 | public void addBillInfo(BillInfo billInfo) {
39 | //System.out.println("ID BILL INFO = " + billInfo.idFood + " database = " + billInfo.quantityDatabase + " now = " + billInfo.quantityNow);
40 | BillInfo exists = billsInfo.stream().filter(item -> item.idFood == billInfo.idFood).findFirst().orElse(null);
41 | if (exists == null) // don't exists
42 | {
43 | billsInfo.add(billInfo);
44 | billsInfoSwap.add(billInfo);
45 | } else // exists
46 | {
47 | if (exists.quantityDatabase != billInfo.quantityDatabase) {
48 | exists.quantityNow = billInfo.quantityDatabase - exists.totalDone;
49 | exists.quantityDatabase = billInfo.quantityDatabase;
50 | if (exists.quantityNow < 0) {
51 | exists.totalDone = 0;
52 | exists.quantityNow = billInfo.quantityDatabase;
53 | }
54 | }
55 | billsInfoSwap.add(exists);
56 | }
57 | }
58 |
59 | /*
60 | clear bill info don't exists
61 | */
62 | public void cleanBillInfo() {
63 | billsInfo = billsInfoSwap;
64 | billsInfoSwap = new ArrayList<>();
65 | }
66 |
67 | public boolean isDone() {
68 | BillInfo billInfo = billsInfo.stream().filter(item -> item.getDone() == false).findFirst().orElse(null);//find item has value false
69 | return billInfo == null;// no false => return true;
70 | }
71 |
72 | @Override
73 | public String toString() {
74 | String str = bill.toString();
75 | str += "=========================================================\n";
76 | str += "Bill Detail:\n";
77 | for (BillInfo billInfo : billsInfo) {
78 | str += billInfo.toString();
79 | }
80 | str += "=========================================================\n";
81 | str += "Total Price: " + bill.price + "\n";
82 | return str;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/kitchen_app/src/Models/MySqlConnection.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package Models;
7 |
8 | import Constants.Constant;
9 | import org.apache.http.HttpEntity;
10 | import org.apache.http.HttpResponse;
11 | import org.apache.http.NameValuePair;
12 | import org.apache.http.client.HttpClient;
13 | import org.apache.http.client.entity.UrlEncodedFormEntity;
14 | import org.apache.http.client.methods.HttpPost;
15 | import org.apache.http.impl.client.HttpClients;
16 | import org.apache.http.message.BasicNameValuePair;
17 | import org.apache.http.util.EntityUtils;
18 |
19 | import java.io.IOException;
20 | import java.io.UnsupportedEncodingException;
21 | import java.util.ArrayList;
22 |
23 |
24 | /**
25 | * @author thienlan
26 | */
27 | public class MySqlConnection {
28 | private MySqlConnection() {
29 | }
30 |
31 | private static MySqlConnection _instance = null;
32 |
33 | public static MySqlConnection getInstance() {
34 | if (_instance == null)
35 | _instance = new MySqlConnection();
36 | return _instance;
37 | }
38 |
39 |
40 | public String executeQuery(String query, Object[] parameter) throws IOException {
41 | if (parameter != null)
42 | query = addParameter(query, parameter);
43 | return openConnection(query, Constant.keyQuery);
44 | }
45 |
46 | public String executeNoneQuery(String query, Object[] parameter) throws IOException {
47 | if (parameter != null)
48 | query = addParameter(query, parameter);
49 | return openConnection(query, Constant.keyNoneQuery);
50 | }
51 |
52 | private String openConnection(String query, String keyQuery) throws UnsupportedEncodingException, IOException {
53 |
54 | HttpClient client = HttpClients.createDefault();
55 | ArrayList params = new ArrayList<>();
56 | HttpPost post = new HttpPost(Constant.urlConnect);
57 | NameValuePair data = new BasicNameValuePair(keyQuery, query);
58 | params.add(data);
59 | post.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
60 |
61 | HttpResponse respone = client.execute(post);
62 | HttpEntity entity = null;
63 | if (respone.getStatusLine().getStatusCode() == 200) {
64 | entity = respone.getEntity();
65 | }
66 | if (entity == null)
67 | return null;
68 | else
69 | return EntityUtils.toString(entity);
70 | }
71 |
72 | private String addParameter(String query, Object[] parameter) {
73 | String[] list = query.split(" ");
74 | query = "";
75 | int i = 0;
76 | for (String element : list) {
77 | if (parameter.length > i && element.contains("@")) {
78 | String prepare = "\'" + parameter[i++].toString() + "\'";
79 | if (element.contains(","))
80 | prepare += ',';
81 | query += prepare;
82 | } else query += element;
83 | query += " ";
84 | }
85 | return query;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/kitchen_app/src/Views/View.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package Views;
7 |
8 | /**
9 | * @author Thang Le
10 | */
11 | public abstract class View {
12 | abstract void insert(Object object); //for add
13 |
14 | abstract void delete(int row); //for delete
15 |
16 | abstract void update(int row, Object object);//for update
17 |
18 | abstract void loadView(Object objects); //load full
19 | }
20 |
--------------------------------------------------------------------------------
/kitchen_app/src/image/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/src/image/info.png
--------------------------------------------------------------------------------
/kitchen_app/src/image/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/src/image/logo.png
--------------------------------------------------------------------------------
/kitchen_app/src/image/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/kitchen_app/src/image/refresh.png
--------------------------------------------------------------------------------
/order_app/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.lock
4 | *.log
5 | *.pyc
6 | *.swp
7 | .DS_Store
8 | .atom/
9 | .buildlog/
10 | .history
11 | .svn/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # Visual Studio Code related
20 | .vscode/
21 |
22 | # Flutter/Dart/Pub related
23 | **/doc/api/
24 | .dart_tool/
25 | .flutter-plugins
26 | .packages
27 | .pub-cache/
28 | .pub/
29 | build/
30 |
31 | # Android related
32 | **/android/**/gradle-wrapper.jar
33 | **/android/.gradle
34 | **/android/captures/
35 | **/android/gradlew
36 | **/android/gradlew.bat
37 | **/android/local.properties
38 | **/android/**/GeneratedPluginRegistrant.java
39 |
40 | # iOS/XCode related
41 | **/ios/**/*.mode1v3
42 | **/ios/**/*.mode2v3
43 | **/ios/**/*.moved-aside
44 | **/ios/**/*.pbxuser
45 | **/ios/**/*.perspectivev3
46 | **/ios/**/*sync/
47 | **/ios/**/.sconsign.dblite
48 | **/ios/**/.tags*
49 | **/ios/**/.vagrant/
50 | **/ios/**/DerivedData/
51 | **/ios/**/Icon?
52 | **/ios/**/Pods/
53 | **/ios/**/.symlinks/
54 | **/ios/**/profile
55 | **/ios/**/xcuserdata
56 | **/ios/.generated/
57 | **/ios/Flutter/App.framework
58 | **/ios/Flutter/Flutter.framework
59 | **/ios/Flutter/Generated.xcconfig
60 | **/ios/Flutter/app.flx
61 | **/ios/Flutter/app.zip
62 | **/ios/Flutter/flutter_assets/
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 |
66 | # Exceptions to above rules.
67 | !**/ios/**/default.mode1v3
68 | !**/ios/**/default.mode2v3
69 | !**/ios/**/default.pbxuser
70 | !**/ios/**/default.perspectivev3
71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
72 |
--------------------------------------------------------------------------------
/order_app/.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: f37c235c32fc15babe6dc7b7bc2ee4387e5ecf92
8 | channel: beta
9 |
--------------------------------------------------------------------------------
/order_app/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # # Defines a default set of lint rules enforced for
2 | # # projects at Google. For details and rationale,
3 | # # see https://github.com/dart-lang/pedantic#enabled-lints.
4 | # # include: package:pedantic/analysis_options.yaml
5 |
6 | # # For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
7 | # # Uncomment to specify additional rules.
8 | linter:
9 | rules:
10 | # - avoid_as
11 | - camel_case_types
12 | - avoid_print
13 | - unnecessary_new
14 | - empty_statements
15 | - hash_and_equals
16 | - no_duplicate_case_values
17 | - prefer_void_to_null
18 | - prefer_single_quotes
19 | - always_declare_return_types
20 | # - always_specify_types
21 | - avoid_init_to_null
22 | - avoid_returning_null_for_void
23 | - avoid_shadowing_type_parameters
24 | - avoid_single_cascade_in_expression_statements
25 | - avoid_unused_constructor_parameters
26 | - cascade_invocations
27 | - directives_ordering
28 | - empty_constructor_bodies
29 | - file_names
30 | - flutter_style_todos
31 | - implementation_imports
32 | - non_constant_identifier_names
33 | - null_closures
34 | - only_throw_errors
35 | - prefer_is_empty
36 | - prefer_if_null_operators
37 | - prefer_null_aware_operators
38 | analyzer:
39 | errors:
40 | # avoid_as: error
41 | camel_case_types: error
42 | avoid_print: error
43 | unnecessary_new: error
44 | no_duplicate_case_values: error
45 | prefer_void_to_null: error
46 | avoid_init_to_null: error
47 | avoid_returning_null_for_void: error
48 | empty_constructor_bodies: error
49 | file_names: error
50 | null_closures: error
51 | invalid_use_of_protected_member: error
--------------------------------------------------------------------------------
/order_app/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 |
--------------------------------------------------------------------------------
/order_app/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 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.store_pattern.order_app"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/order_app/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/order_app/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
17 |
21 |
28 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
43 |
44 |
--------------------------------------------------------------------------------
/order_app/android/app/src/main/kotlin/com/store_pattern/order_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.store_pattern.order_app
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | import android.os.Build
6 | import android.view.ViewTreeObserver
7 | import android.view.WindowManager
8 | class MainActivity: FlutterActivity() {
9 | }
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/drawable-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/drawable-hdpi/splash.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/drawable-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/drawable-mdpi/splash.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/drawable-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/drawable-xhdpi/splash.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/drawable-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/drawable-xxhdpi/splash.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/drawable-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/drawable-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/drawable/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/drawable/app_icon.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 | -
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-hdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-hdpi/launcher_icon.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-mdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-mdpi/launcher_icon.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffffff
4 |
--------------------------------------------------------------------------------
/order_app/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/order_app/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/order_app/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/order_app/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/order_app/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-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/order_app/android/settings.gradle:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | include ':app'
6 |
7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8 | def properties = new Properties()
9 |
10 | assert localPropertiesFile.exists()
11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12 |
13 | def flutterSdkPath = properties.getProperty("flutter.sdk")
14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
16 |
--------------------------------------------------------------------------------
/order_app/android/settings_aar.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/order_app/assets/fonts/Dosis/Dosis-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/fonts/Dosis/Dosis-Bold.ttf
--------------------------------------------------------------------------------
/order_app/assets/fonts/Dosis/Dosis-ExtraBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/fonts/Dosis/Dosis-ExtraBold.ttf
--------------------------------------------------------------------------------
/order_app/assets/fonts/Dosis/Dosis-ExtraLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/fonts/Dosis/Dosis-ExtraLight.ttf
--------------------------------------------------------------------------------
/order_app/assets/fonts/Dosis/Dosis-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/fonts/Dosis/Dosis-Light.ttf
--------------------------------------------------------------------------------
/order_app/assets/fonts/Dosis/Dosis-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/fonts/Dosis/Dosis-Medium.ttf
--------------------------------------------------------------------------------
/order_app/assets/fonts/Dosis/Dosis-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/fonts/Dosis/Dosis-Regular.ttf
--------------------------------------------------------------------------------
/order_app/assets/fonts/Dosis/Dosis-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/fonts/Dosis/Dosis-SemiBold.ttf
--------------------------------------------------------------------------------
/order_app/assets/images/account.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/images/account.png
--------------------------------------------------------------------------------
/order_app/assets/images/food.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/images/food.png
--------------------------------------------------------------------------------
/order_app/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/images/logo.png
--------------------------------------------------------------------------------
/order_app/assets/launcher_icons/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/assets/launcher_icons/app_icon.png
--------------------------------------------------------------------------------
/order_app/flutter_native_splash.yaml:
--------------------------------------------------------------------------------
1 | flutter_native_splash:
2 | image: assets/launcher_icons/app_icon.png
3 | color: "ffffff"
--------------------------------------------------------------------------------
/order_app/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 |
--------------------------------------------------------------------------------
/order_app/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 |
--------------------------------------------------------------------------------
/order_app/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/order_app/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/order_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/order_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/order_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/order_app/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/order_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/order_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/order_app/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/order_app/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | int flutter_native_splash = 1;
9 | UIApplication.sharedApplication.statusBarHidden = false;
10 |
11 | [GeneratedPluginRegistrant registerWithRegistry:self];
12 | // Override point for customization after application launch.
13 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
14 | }
15 |
16 | @end
--------------------------------------------------------------------------------
/order_app/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 |
--------------------------------------------------------------------------------
/order_app/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 |
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/order_app/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 |
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/order_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/order_app/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.
--------------------------------------------------------------------------------
/order_app/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 |
--------------------------------------------------------------------------------
/order_app/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 |
--------------------------------------------------------------------------------
/order_app/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | order_app
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 | UIStatusBarHidden
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/order_app/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/order_app/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/order_app/lib/Constants/dialog.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import './theme.dart' as theme;
4 |
5 | void errorDialog(BuildContext context, String message) {
6 | if (context != null)
7 | showDialog(
8 | context: context,
9 | builder: (BuildContext context) {
10 | return AlertDialog(
11 | title: Text('Error', style: theme.errorTitleStyle),
12 | content: Text(message, style: theme.contentStyle),
13 | actions: [
14 | FlatButton(
15 | child: Text('Ok', style: theme.okButtonStyle),
16 | onPressed: () {
17 | Navigator.of(context).pop();
18 | },
19 | )
20 | ],
21 | );
22 | });
23 | }
24 |
25 | void successDialog(BuildContext context, String message) {
26 | if (context != null)
27 | showDialog(
28 | context: context,
29 | builder: (BuildContext context) {
30 | return AlertDialog(
31 | title: Text('Notification', style: theme.titleStyle),
32 | content: Text(message, style: theme.contentStyle),
33 | actions: [
34 | FlatButton(
35 | child: Text('Ok', style: theme.okButtonStyle),
36 | onPressed: () async {
37 | Navigator.of(context).pop();
38 | },
39 | )
40 | ],
41 | );
42 | });
43 | }
44 |
--------------------------------------------------------------------------------
/order_app/lib/Constants/evn.dart:
--------------------------------------------------------------------------------
1 | const String URL_EXECUTE = 'https://meomeocf98.000webhostapp.com/flutter/index.php';
2 | const String ID_EXECUTENONEQUERY = 'executeNoneQuery';
3 | const String ID_EXECUTEQUERY = 'executeQuery';
4 | // const String URL_EXECUTE = "https://meomeocf98.000webhostapp.com/test/authentication.php";
5 | // //const String URL_EXECUTE = "https://meomeocf98.000webhostapp.com/flutter/authentication.php";
6 | // const String URL_LOGIN = "https://meomeocf98.000webhostapp.com/test/index.php";
7 | // //const String URL_LOGIN = "https://meomeocf98.000webhostapp.com/flutter/index.php";
8 | // const String ID_EXECUTENONEQUERY = 'noneQuery';
9 | // const String ID_EXECUTEQUERY = 'query';
10 |
11 | // const String ID_LOGIN = 'header';
12 | // const String ID_TOKEN = 'token';
13 |
--------------------------------------------------------------------------------
/order_app/lib/Constants/queries.dart:
--------------------------------------------------------------------------------
1 | // Queries for Table
2 |
3 | const String GET_TABLES = 'CALL `USP_GetTables`();';
4 |
5 | ///////////////////////////////////////////////////////////////
6 |
7 | // Queries for Food Category
8 | const String GET_FOOD_CATEGORIES = 'CALL `USP_GetFoodCategories`();';
9 |
10 | ///////////////////////////////////////////////////////////////
11 |
12 | // Queries for Food
13 | const String GET_FOODS = 'CALL `USP_GetFoods`();';
14 | const String QUERY_GET_FOODS = 'CALL USP_GetFoods1()';
15 |
16 | ///////////////////////////////////////////////////////////////
17 |
18 | // Queries for Bill
19 | const String INSERT_BILL =
20 | 'CALL `USP_InsertBill`( @_IDTable , @_DateCheckIn , @_DateCheckOut , @_Discount , @_TotalPrice , @_Status , @_Username );';
21 | const String UPDATE_BILL =
22 | 'CALL `USP_UpdateBill`( @_ID , @_IDTable , @_DateCheckIn , @_DateCheckOut , @_Discount , @_TotalPrice , @_Status , @_Username );';
23 | const String GET_ID_MAX = 'CALL `USP_GetIdMax`();';
24 | const String GET_BILLS = 'CALL `USP_GetBills`( @currentDate );';
25 | const String DELETE_BILL = 'CALL `USP_DelBill`( @id );';
26 | const String HAS_BILL_OF_TABLE = 'CALL `USP_HasBillOfTable`( @idTable );';
27 |
28 | ///////////////////////////////////////////////////////////////
29 |
30 | // Queries for BillDetail
31 | const String INSERT_BILL_DETAIL = 'CALL `USP_InsertBillInfo`( @_IDBill , @_IDFood , @_Quantity );';
32 | const String UPDATE_BILL_DETAIL = 'CALL `USP_UpdateBillInfo`( @_IDBill , @_IDFood , @_Quantity );';
33 | const String GET_BILLDETAIL_BY_BILL = 'CALL `USP_GetBillDetailByBill`( @id );';
34 | const String HAS_BILLDETAIL_OF_BILL = 'CALL USP_HasBillDetailOfBill ( @idBill , @idFood );';
35 |
36 | ///////////////////////////////////////////////////////////////
37 |
38 | // Queries for Account
39 | const String LOGIN = 'CALL USP_Login( @username )';
40 | const String UPDATE_ACC_INFO =
41 | 'CALL USP_UpdateAccInfo ( @username , @displayName , @sex , @birthday , @idCard , @address , @phone );';
42 | const String UPDATE_ACC_PASS = 'CALL USP_UpdateAccPass ( @username , @newPass );';
43 | const String UPDATE_ACC_AVATAR = 'CALL `USP_UpdateAccAvatar`( @username , @image )';
44 |
45 | ///////////////////////////////////////////////////////////////
46 |
47 | // Query
48 | const String QUERY_GET_ID_IMAGES = 'CALL USP_GetIDImages()';
49 | const String QUERY_GET_IMAGE_BY_ID = 'CALL USP_GetImageByID( @id )';
50 |
--------------------------------------------------------------------------------
/order_app/lib/Constants/theme.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color primaryColor = Color.fromARGB(255, 209, 228, 252);
4 | const Color accentColor = Color.fromARGB(255, 72, 0, 250);
5 | const Color fontColor = Color.fromARGB(255, 38, 54, 70);
6 | const Color fontColorLight = Color.fromARGB(180, 38, 54, 70);
7 |
8 | /* Dialog */
9 | const TextStyle titleStyle =
10 | TextStyle(color: accentColor, fontFamily: 'Dosis', fontSize: 19.0, fontWeight: FontWeight.w600);
11 | const TextStyle errorTitleStyle =
12 | TextStyle(color: Colors.redAccent, fontFamily: 'Dosis', fontSize: 19.0, fontWeight: FontWeight.w600);
13 | const TextStyle contentStyle =
14 | TextStyle(color: fontColor, fontFamily: 'Dosis', fontSize: 16.0, fontWeight: FontWeight.w500);
15 | const TextStyle okButtonStyle =
16 | TextStyle(color: Colors.blueAccent, fontFamily: 'Dosis', fontSize: 16.0, fontWeight: FontWeight.w600);
17 | const TextStyle cancelButtonStyle =
18 | TextStyle(color: Colors.redAccent, fontFamily: 'Dosis', fontSize: 16.0, fontWeight: FontWeight.w600);
19 |
--------------------------------------------------------------------------------
/order_app/lib/Controllers/cart.controller.dart:
--------------------------------------------------------------------------------
1 | import './../Models/cart.model.dart';
2 |
3 | class Controller {
4 | bool isSend = false;
5 |
6 | static Controller _instance;
7 |
8 | static Controller get instance {
9 | if (_instance == null) _instance = Controller();
10 | return _instance;
11 | }
12 |
13 | Future insertBill(int idTable, DateTime dateCheckIn, DateTime dateCheckOut, double discount,
14 | double totalPrice, int status, String username) {
15 | return Model.instance
16 | .insertBill(idTable, dateCheckIn, dateCheckOut, discount, totalPrice, status, username);
17 | }
18 |
19 | Future updateBill(int id, int idTable, DateTime dateCheckIn, DateTime dateCheckOut, double discount,
20 | double totalPrice, int status, String username) {
21 | return Model.instance
22 | .updateBill(id, idTable, dateCheckIn, dateCheckOut, discount, totalPrice, status, username);
23 | }
24 |
25 | Future getIdBillMax() {
26 | return Model.instance.getIdBillMax();
27 | }
28 |
29 | Future hasBillOfTable(int idTable) {
30 | return Model.instance.hasBillOfTable(idTable);
31 | }
32 |
33 | Future getIdBillByTable(int idTable) {
34 | return Model.instance.getIdBillByTable(idTable);
35 | }
36 |
37 | Future insertBillDetail(int idBill, int idFood, int quantity) {
38 | return Model.instance.insertBillDetail(idBill, idFood, quantity);
39 | }
40 |
41 | Future updateBillDetail(int idBill, int idFood, int quantity) {
42 | return Model.instance.updateBillDetail(idBill, idFood, quantity);
43 | }
44 |
45 | Future hasBillDetailOfBill(int idBill, int idFood) {
46 | return Model.instance.hasBillDetailOfBill(idBill, idFood);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/order_app/lib/Controllers/history.controller.dart:
--------------------------------------------------------------------------------
1 | import './../Models/history.model.dart' as history;
2 | import './../Models/home.model.dart' as home;
3 | import './../Models/login.model.dart' as login;
4 |
5 | class Controller {
6 | static Controller _instance;
7 |
8 | static Controller get instance {
9 | if (_instance == null) _instance = Controller();
10 | return _instance;
11 | }
12 |
13 | Future> _bills;
14 |
15 | Future> get bills {
16 | if (_bills == null) _bills = history.Model.instance.getListBill();
17 | return _bills;
18 | }
19 |
20 | void removeBill(int id) async {
21 | int index = findIndex(await bills, id);
22 | (await bills).removeAt(index);
23 | }
24 |
25 | int findIndex(List bills, int id) {
26 | int i = 0;
27 | for (var item in bills) {
28 | if (item.id == id) return i;
29 | i++;
30 | }
31 | return -1;
32 | }
33 |
34 | void addBill(int id, home.Table table, DateTime dateCheckout, double discount, double totalPrice,
35 | login.Account account) async {
36 | history.BillPlus bill = history.BillPlus(
37 | id: id,
38 | table: table,
39 | dateCheckOut: dateCheckout,
40 | discount: discount,
41 | totalPrice: totalPrice,
42 | account: account);
43 |
44 | await this.bills.then((values) {
45 | if (findIndex(values, bill.id) == -1) values.insert(0, bill);
46 | });
47 | }
48 |
49 | Future deleteBill(int id) {
50 | return history.Model.instance.deleteBill(id);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/order_app/lib/Controllers/home.controller.dart:
--------------------------------------------------------------------------------
1 | import './../Models/home.model.dart';
2 |
3 | class Controller {
4 | static Controller _instance;
5 |
6 | static Controller get instance {
7 | if (_instance == null) _instance = Controller();
8 | return _instance;
9 | }
10 |
11 | Future> _tables;
12 |
13 | Future> get tables {
14 | if (_tables == null) _tables = Model.instance.tables;
15 | return _tables;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/order_app/lib/Controllers/image.controller.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:image_picker/image_picker.dart';
4 |
5 | abstract class ImageController {
6 | static final imagePicker = ImagePicker();
7 |
8 | static Future getImageFromGallery() {
9 | return imagePicker.getImage(source: ImageSource.gallery).then((value) => File(value.path));
10 | }
11 |
12 | static Future getImageFromCamera() {
13 | return imagePicker.getImage(source: ImageSource.camera).then((value) => File(value.path));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/order_app/lib/Controllers/login.controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:dbcrypt/dbcrypt.dart';
2 |
3 | import './../Models/login.model.dart';
4 |
5 | class Controller {
6 | static Controller _instance;
7 |
8 | Account account;
9 |
10 | static Controller get instance {
11 | if (_instance == null) _instance = Controller();
12 | return _instance;
13 | }
14 |
15 | Future login(String username, String password) async {
16 | if (account == null || account.username != username) account = await Model.instance.login(username);
17 | return account != null ? DBCrypt().checkpw(password, account.password) : false;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/order_app/lib/Controllers/notification.controller.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_local_notifications/flutter_local_notifications.dart';
5 |
6 | abstract class NotificationController {
7 | static FlutterLocalNotificationsPlugin plugin;
8 |
9 | @protected
10 | static void init() {
11 | plugin = FlutterLocalNotificationsPlugin();
12 | var android = AndroidInitializationSettings('app_icon');
13 | var ios = IOSInitializationSettings();
14 | var initSetting = InitializationSettings(android, ios);
15 | plugin.initialize(initSetting);
16 | }
17 |
18 | static Future show(String title, String body) {
19 | if (Platform.isIOS || Platform.isAndroid) {
20 | if (plugin == null) init();
21 |
22 | var androidPlatformChannelSpecifics = AndroidNotificationDetails(
23 | 'store_pattern',
24 | 'order_app',
25 | 'Order application',
26 | importance: Importance.Max,
27 | priority: Priority.High,
28 | );
29 | var iOSPlatformChannelSpecifics = IOSNotificationDetails();
30 | var platformChannelSpecifics = NotificationDetails(
31 | androidPlatformChannelSpecifics,
32 | iOSPlatformChannelSpecifics,
33 | );
34 | return plugin.show(0, title, body, platformChannelSpecifics, payload: 'item x');
35 | } else {
36 | return Future.value();
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/order_app/lib/Controllers/profile.controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:dbcrypt/dbcrypt.dart';
2 |
3 | import './../Models/profile.model.dart';
4 |
5 | class Controller {
6 | static Controller _instance;
7 |
8 | static Controller get instance {
9 | if (_instance == null) _instance = Controller();
10 | return _instance;
11 | }
12 |
13 | Future updateAvatar(String username, String image) {
14 | return Model.instance.updateAvatar(username, image);
15 | }
16 |
17 | Future updateInfo(String username, String displayName, int sex, DateTime birthday, String idCard,
18 | String address, String phone) {
19 | return Model.instance.updateInfo(username, displayName, sex, birthday, idCard, address, phone);
20 | }
21 |
22 | Future updatePassword(String username, String newPass) {
23 | return Model.instance.updatePassword(username, DBCrypt().hashpw(newPass, DBCrypt().gensalt()));
24 | }
25 |
26 | bool equalPass(String hashPass, String passCheck) => DBCrypt().checkpw(passCheck, hashPass);
27 |
28 | String toHashPass(String pass) => DBCrypt().hashpw(pass, DBCrypt().gensalt());
29 | }
30 |
--------------------------------------------------------------------------------
/order_app/lib/Models/connect_server.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:http/http.dart' as http;
5 | import 'package:order_app/utils/log.dart';
6 |
7 | import '../Constants/evn.dart';
8 |
9 | class MySqlConnection {
10 | static MySqlConnection _instance;
11 |
12 | static MySqlConnection get instance {
13 | if (_instance == null) _instance = MySqlConnection();
14 | return _instance;
15 | }
16 |
17 | Future executeNoneQuery(String query, {List parameter}) async {
18 | if (parameter != null) {
19 | query = _addParameter(query, parameter);
20 | }
21 |
22 | Log.debug('Request:: $query');
23 |
24 | http.Response response = await http.post(
25 | URL_EXECUTE,
26 | body: {ID_EXECUTENONEQUERY: query},
27 | );
28 |
29 | int number = 0;
30 | if (response.statusCode == 200) number = int.parse(response.body);
31 | return number > 0;
32 | }
33 |
34 | Future executeQuery(String query, {List parameter}) async {
35 | if (parameter != null) {
36 | query = _addParameter(query, parameter);
37 | }
38 |
39 | http.Response response = await http.post(
40 | URL_EXECUTE,
41 | body: {ID_EXECUTEQUERY: query},
42 | );
43 | if (response.statusCode == 200) return json.decode(response.body);
44 | return null;
45 | }
46 |
47 | String _addParameter(String query, List parameter) {
48 | /**To return a query have added paramete ralready
49 | *
50 | * query = "call USP_Proc( @a , @b , @c )"
51 | *
52 | * parameter = ["123" , "123" , 123 ]
53 | *
54 | * After call addParameter
55 | * so result query = "call USP_Proc( '123' , '123' , 123 )"
56 | * */
57 | List list = query.split(' ');
58 | query = '';
59 | int i = 0;
60 | list.forEach((String element) {
61 | if (element.contains('@')) {
62 | if ((parameter[i] is String || parameter[i] is DateTime) && parameter.length > i)
63 | query += "\'" + parameter[i++].toString() + "\'";
64 | else
65 | query += parameter[i++].toString();
66 | } else
67 | query += element;
68 | query += ' ';
69 | });
70 | return query;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/order_app/lib/Models/history.model.dart:
--------------------------------------------------------------------------------
1 | import './../Constants/queries.dart' as queries;
2 | import './home.model.dart' as home;
3 | import './login.model.dart' as login;
4 | import './menu.model.dart' as menu;
5 | import 'connect_server.dart';
6 |
7 | class BillPlus {
8 | int id;
9 | home.Table table;
10 | DateTime dateCheckOut;
11 | double discount;
12 | double totalPrice;
13 | login.Account account;
14 |
15 | BillPlus({this.id, this.table, this.dateCheckOut, this.discount, this.totalPrice, this.account});
16 |
17 | BillPlus.fromJson(Map json) {
18 | this.id = int.parse(json['ID']);
19 | this.dateCheckOut = DateTime.parse(json['DateCheckOut']);
20 | this.discount = double.parse(json['Discount']);
21 | this.totalPrice = double.parse(json['TotalPrice']);
22 |
23 | this.table = home.Table.noneParametter();
24 | this.table.id = int.parse(json['IDTable']);
25 | this.table.name = json['Name'];
26 | this.table.addFoods(Model.instance.getBillDetailByBill(this.id));
27 |
28 | this.account = login.Account.fromJson(json);
29 | }
30 | }
31 |
32 | class Model {
33 | static Model _instance;
34 |
35 | static Model get instance {
36 | if (_instance == null) _instance = Model();
37 | return _instance;
38 | }
39 |
40 | Future deleteBill(int id) {
41 | return MySqlConnection.instance.executeNoneQuery(queries.DELETE_BILL, parameter: [id]);
42 | }
43 |
44 | Future> getBillDetailByBill(int idBill) async {
45 | Future futureFoods =
46 | MySqlConnection.instance.executeQuery(queries.GET_BILLDETAIL_BY_BILL, parameter: [idBill]);
47 | return parseFood(futureFoods);
48 | }
49 |
50 | Future> getListBill() async {
51 | Future futureBills =
52 | MySqlConnection.instance.executeQuery(queries.GET_BILLS, parameter: [DateTime.now()]);
53 | return parseBillPlus(futureBills);
54 | }
55 |
56 | Future> parseBillPlus(Future bills) async {
57 | List futureBills = [];
58 | await bills.then((values) {
59 | values.forEach((value) {
60 | futureBills.add(BillPlus.fromJson(value));
61 | });
62 | });
63 | return futureBills;
64 | }
65 |
66 | Future> parseFood(Future foods) async {
67 | List futureFoods = [];
68 | await foods.then((values) {
69 | values.forEach((value) {
70 | futureFoods.add(menu.Food.fromJson(value));
71 | });
72 | });
73 | return futureFoods;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/order_app/lib/Models/login.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:typed_data';
3 |
4 | import './../Constants/queries.dart' as queries;
5 | import 'connect_server.dart';
6 |
7 | class Model {
8 | static Model _instance;
9 |
10 | static Model get instance {
11 | if (_instance == null) {
12 | _instance = Model();
13 | }
14 | return _instance;
15 | }
16 |
17 | Future login(String username) async {
18 | Future futureAccount = MySqlConnection.instance.executeQuery(queries.LOGIN, parameter: [username]);
19 | return parseAccount(futureAccount);
20 | }
21 |
22 | Future parseAccount(Future accounts) async {
23 | Account account;
24 | await accounts.then((values) {
25 | if (values.isNotEmpty) account = Account.fromJson(values[0]);
26 | });
27 | return account;
28 | }
29 | }
30 |
31 | class Account {
32 | String username;
33 | String displayName;
34 | String password;
35 | int sex;
36 | String idCard;
37 | String address;
38 | String phone;
39 | DateTime birthday;
40 | String accountType;
41 | Uint8List image;
42 |
43 | Account.fromJson(Map json) {
44 | username = json['Username'];
45 | displayName = json['DisplayName'] ?? '';
46 | password = json['Password'];
47 | sex = json['Sex'] != null ? int.parse(json['Sex']) : -1;
48 | idCard = json['IDCard'] ?? '';
49 | address = json['Address'] ?? '';
50 | phone = json['PhoneNumber'] ?? '';
51 | birthday = json['BirthDay'] != null
52 | ? DateTime.parse(json['BirthDay'])
53 | : DateTime.now().subtract(Duration(days: 365 * 18));
54 | accountType = json['Name'] ?? '';
55 | image = json['Data'] != null ? base64.decode(json['Data']) : null;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/order_app/lib/Models/profile.model.dart:
--------------------------------------------------------------------------------
1 | import './../Constants/queries.dart' as queries;
2 | import 'connect_server.dart';
3 |
4 | class Model {
5 | static Model _instance;
6 |
7 | static Model get instance {
8 | if (_instance == null) {
9 | _instance = Model();
10 | }
11 | return _instance;
12 | }
13 |
14 | Future updateAvatar(String username, String image) {
15 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_ACC_AVATAR, parameter: [username, image]);
16 | }
17 |
18 | Future updateInfo(String username, String displayName, int sex, DateTime birthday, String idCard,
19 | String address, String phone) {
20 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_ACC_INFO,
21 | parameter: [username, displayName, sex, birthday, idCard, address, phone]);
22 | }
23 |
24 | Future updatePassword(String username, String newPass) {
25 | return MySqlConnection.instance.executeNoneQuery(queries.UPDATE_ACC_PASS, parameter: [username, newPass]);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/order_app/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 |
4 | import './Constants/theme.dart';
5 | import './Views/login.view.dart';
6 |
7 | void main() => {
8 | WidgetsFlutterBinding.ensureInitialized(),
9 | SystemChrome.setSystemUIOverlayStyle(
10 | SystemUiOverlayStyle(statusBarColor: primaryColor),
11 | ),
12 | runApp(MyApp()),
13 | };
14 |
15 | class MyApp extends StatelessWidget {
16 | // This widget is the root of your application.
17 | @override
18 | Widget build(BuildContext context) {
19 | return MaterialApp(
20 | title: 'Order App',
21 | theme: ThemeData(
22 | brightness: Brightness.light,
23 | primaryColor: primaryColor,
24 | accentColor: accentColor,
25 | ),
26 | debugShowCheckedModeBanner: false,
27 | home: LoginScreen(),
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/order_app/lib/utils/log.dart:
--------------------------------------------------------------------------------
1 | //ignore_for_file: avoid_print
2 |
3 | import 'package:ansicolor/ansicolor.dart';
4 | import 'package:flutter/foundation.dart';
5 |
6 | abstract class Log {
7 | static final _debugCode = chooseLogColor(LogLevel.DEBUG);
8 | static final _infoCode = chooseLogColor(LogLevel.INFO);
9 | static final _warnCode = chooseLogColor(LogLevel.WARN);
10 | static final _errorCode = chooseLogColor(LogLevel.ERROR);
11 |
12 | static void debug(dynamic data) {
13 | if (!kReleaseMode) _print(_debugCode, '::debug:: $data');
14 | }
15 |
16 | static void info(dynamic data) {
17 | _print(_infoCode, '::info:: $data');
18 | }
19 |
20 | static void warn(dynamic data) {
21 | _print(_warnCode, '::warn:: $data');
22 | }
23 |
24 | static void error(dynamic data) {
25 | _print(_errorCode, '::error:: $data');
26 | }
27 |
28 | static void _print([AnsiPen code, dynamic data]) {
29 | print(code(data));
30 | }
31 | }
32 |
33 | enum LogLevel {
34 | DEBUG,
35 | INFO,
36 | WARN,
37 | ERROR,
38 | ALL,
39 | }
40 |
41 | /// Chooses a color based on the logger [level].
42 | AnsiPen chooseLogColor(LogLevel level) {
43 | switch (level) {
44 | case LogLevel.ALL:
45 | return AnsiPen()..white();
46 | case LogLevel.DEBUG:
47 | return AnsiPen()..green();
48 | case LogLevel.INFO:
49 | return AnsiPen()..blue();
50 | case LogLevel.WARN:
51 | return AnsiPen()..yellow();
52 | case LogLevel.ERROR:
53 | return AnsiPen()..red();
54 | default:
55 | return AnsiPen()..white();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/order_app/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: order_app
2 | description: Oder application.
3 | author: Store pattern team
4 | homepage: https://github.com/uiters/store-pattern
5 | repository: https://github.com/uiters/store-pattern
6 |
7 | version: 1.0.1
8 |
9 | environment:
10 | sdk: ">=2.7.0 <3.0.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | http: 0.12.1
17 | flutter_local_notifications: 1.4.4+1
18 | timeago: 2.0.26
19 | intl: 0.16.1
20 | dbcrypt: 1.0.0
21 | path_provider: 1.6.11
22 | image_picker: 0.6.7+3
23 | ansicolor: 1.0.2
24 |
25 | dev_dependencies:
26 | flutter_test:
27 | sdk: flutter
28 | flutter_launcher_icons: 0.7.5
29 | flutter_native_splash: 0.1.9
30 | pedantic: 1.9.0
31 |
32 | flutter_icons:
33 | android: "launcher_icon"
34 | ios: true
35 | image_path: "assets/launcher_icons/app_icon.png"
36 | build_runner: ^1.0.0
37 |
38 | flutter:
39 | uses-material-design: true
40 | assets:
41 | - assets/images/
42 | fonts:
43 | - family: Dosis
44 | fonts:
45 | - asset: assets/fonts/Dosis/Dosis-Regular.ttf
46 | weight: 400
47 | - asset: assets/fonts/Dosis/Dosis-Medium.ttf
48 | weight: 500
49 | - asset: assets/fonts/Dosis/Dosis-SemiBold.ttf
50 | weight: 600
51 | - asset: assets/fonts/Dosis/Dosis-Bold.ttf
52 | weight: 800
53 | - asset: assets/fonts/Dosis/Dosis-ExtraBold.ttf
54 | weight: 900
55 |
--------------------------------------------------------------------------------
/order_app/rebuild_app_icon.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | flutter pub get
3 | flutter pub pub run flutter_launcher_icons:main
4 | flutter pub pub run flutter_native_splash:create
--------------------------------------------------------------------------------
/order_app/test/unit_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | void main() {
4 | test('my first unit test', () {
5 | var answer = 42;
6 | expect(answer, 42);
7 | });
8 | }
9 |
--------------------------------------------------------------------------------
/order_app/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_test/flutter_test.dart';
3 |
4 | void main() {
5 | testWidgets('my first widget test', (WidgetTester tester) async {
6 | // You can use keys to locate the widget you need to test
7 | var sliderKey = UniqueKey();
8 | var value = 0.0;
9 |
10 | // Tells the tester to build a UI based on the widget tree passed to it
11 | await tester.pumpWidget(
12 | StatefulBuilder(
13 | builder: (BuildContext context, StateSetter setState) {
14 | return MaterialApp(
15 | home: Material(
16 | child: Center(
17 | child: Slider(
18 | key: sliderKey,
19 | value: value,
20 | onChanged: (double newValue) {
21 | setState(() {
22 | value = newValue;
23 | });
24 | },
25 | ),
26 | ),
27 | ),
28 | );
29 | },
30 | ),
31 | );
32 | expect(value, equals(0.0));
33 |
34 | // Taps on the widget found by key
35 | await tester.tap(find.byKey(sliderKey));
36 |
37 | // Verifies that the widget updated the value correctly
38 | expect(value, equals(0.5));
39 | });
40 | }
41 |
--------------------------------------------------------------------------------
/order_app/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/web/favicon.png
--------------------------------------------------------------------------------
/order_app/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/order_app/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uiters/store-pattern/d550c18f5a51e4dbb6dea9cafc7860d991de061e/order_app/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/order_app/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | order_app
18 |
19 |
20 |
21 |
24 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/order_app/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "order_app",
3 | "short_name": "order_app",
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 |
--------------------------------------------------------------------------------
/server/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM google/dart:latest
2 | WORKDIR /app
3 |
4 | COPY . /app
5 |
6 | # Install dependencies, pre-build
7 | RUN pub get
8 |
9 | # Optionally build generaed sources.
10 | # RUN pub run build_runner build
11 |
12 | # Set environment, start server
13 | ENV ANGEL_ENV=production
14 | EXPOSE 3000
15 | CMD dart bin/prod.dart --address=0.0.0.0
--------------------------------------------------------------------------------
/server/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 angel-dart
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.
--------------------------------------------------------------------------------
/server/README.md:
--------------------------------------------------------------------------------
1 | ### Store pattern server ✈
2 |
3 | #### Getting start 👍
4 |
5 | + Step 1: Add username and password of MySQL in file `server/docker-compose.yml`
6 |
7 | + Step 2: Run script
8 |
9 | ```
10 | docker-compose up -d
11 | ```
12 |
13 | + Step 3:
14 |
15 | * Edit line 1 ```evn.dart``` at ```store-pattern/admin_app/lib/Constants/```
16 | and ```store-pattern/order_app/lib/Constants/```
17 |
18 | ```dart
19 | const String URL_EXECUTE = "your domain/";
20 | ```
21 |
22 | * Edit line 17 ```store-pattern/kitchen_app/src/Constants/Constant.java```
23 |
24 | ```java
25 | public static String urlConnect = "your domain/";
26 | ```
27 |
28 | ⚠ Becareful '/' at the last url
--------------------------------------------------------------------------------
/server/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:pedantic/analysis_options.yaml
2 | analyzer:
3 | strong-mode:
4 | implicit-casts: false
5 | linter:
6 | rules:
7 | - unnecessary_const
8 | - unnecessary_new
9 |
--------------------------------------------------------------------------------
/server/bin/dev.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:store_pattern_service/src/pretty_logging.dart';
3 | import 'package:store_pattern_service/store_pattern_service.dart';
4 | import 'package:angel_container/mirrors.dart';
5 | import 'package:angel_framework/angel_framework.dart';
6 | import 'package:angel_hot/angel_hot.dart';
7 | import 'package:logging/logging.dart';
8 |
9 | void main() async {
10 | // Watch the config/ and web/ directories for changes, and hot-reload the server.
11 | hierarchicalLoggingEnabled = true;
12 |
13 | var hot = HotReloader(() async {
14 | var logger = Logger.detached('store_pattern_service')
15 | ..level = Level.ALL
16 | ..onRecord.listen(prettyLog);
17 | var app = Angel(logger: logger, reflector: MirrorsReflector());
18 | await app.configure(configureServer);
19 | return app;
20 | }, [
21 | Directory('config'),
22 | Directory('lib'),
23 | ]);
24 |
25 | var server = await hot.startServer('127.0.0.1', 3000);
26 | print(
27 | 'store_pattern_service server listening at http://${server.address.address}:${server.port}');
28 | }
29 |
--------------------------------------------------------------------------------
/server/bin/prod.dart:
--------------------------------------------------------------------------------
1 | import 'package:store_pattern_service/store_pattern_service.dart';
2 | import 'package:angel_container/mirrors.dart';
3 | import 'package:angel_production/angel_production.dart';
4 |
5 | // NOTE: By default, the Runner class does not use the `MirrorsReflector`, or any
6 | // reflector, by default.
7 | //
8 | // If your application is using any sort of functionality reliant on annotations or reflection,
9 | // either include the MirrorsReflector, or use a static reflector variant.
10 | //
11 | // The following use cases require reflection:
12 | // * Use of Controllers, via @Expose() or @ExposeWS()
13 | // * Use of dependency injection into constructors, whether in controllers or plain `container.make` calls
14 | // * Use of the `ioc` function in any route
15 | //
16 | // The `MirrorsReflector` from `package:angel_container/mirrors.dart` is by far the most convenient pattern,
17 | // so use it if possible.
18 | //
19 | // However, the following alternatives exist:
20 | // * Generation via `package:angel_container_generator`
21 | // * Creating an instance of `StaticReflector`
22 | // * Manually implementing the `Reflector` interface (cumbersome; not recommended)
23 | //
24 | // As of January 4th, 2018, the documentation has not yet been updated to state this,
25 | // so in the meantime, visit the Angel chat for further questions:
26 | //
27 | // https://gitter.im/angel_dart/discussion
28 | void main(List args) =>
29 | Runner('store_pattern_service', configureServer, reflector: MirrorsReflector())
30 | .run(args);
31 |
--------------------------------------------------------------------------------
/server/config/default.yaml:
--------------------------------------------------------------------------------
1 | # Default server configuration.
2 | host: 0.0.0.0
3 | port: 3000
--------------------------------------------------------------------------------
/server/config/development.yaml:
--------------------------------------------------------------------------------
1 | # Development-only server configuration.
2 | debug: true
--------------------------------------------------------------------------------
/server/config/production.yaml:
--------------------------------------------------------------------------------
1 | # Production-only server configuration
2 | debug: false
3 |
--------------------------------------------------------------------------------
/server/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.3'
2 | services:
3 | mysql_db:
4 | restart: always
5 | image: mysql:5.7
6 | container_name: mysql
7 | command: mysqld --user=root --verbose --lower_case_table_names=1
8 | volumes:
9 | - ./mysql_init:/docker-entrypoint-initdb.d
10 | ports:
11 | - "3306:3306"
12 | environment:
13 | MYSQL_DATABASE: "storepattern"
14 | MYSQL_USER: ""
15 | MYSQL_PASSWORD: ""
16 | MYSQL_ROOT_PASSWORD: ""
17 | MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
18 | networks:
19 | - store_pattern
20 |
21 | store_pattern_service:
22 | container_name: store_pattern_service
23 | restart: always
24 | build:
25 | context: .
26 | environment:
27 | MYSQL_HOST: "mysql_db"
28 | MYSQL_PORT: 3306
29 | MYSQL_DATABASE: "storepattern"
30 | MYSQL_USER: ""
31 | MYSQL_PASSWORD: ""
32 | depends_on:
33 | - mysql_db
34 | ports:
35 | - '3000:3000'
36 | networks:
37 | - store_pattern
38 | networks:
39 | store_pattern:
40 |
41 | volumes:
42 | mysql_db:
--------------------------------------------------------------------------------
/server/lib/src/config/config.dart:
--------------------------------------------------------------------------------
1 | library store_pattern_service.src.config;
2 |
3 | import 'package:angel_configuration/angel_configuration.dart';
4 | import 'package:angel_framework/angel_framework.dart';
5 | import 'package:file/file.dart';
6 | import 'package:store_pattern_service/src/routes/controllers/store_pattern_controller.dart';
7 | import 'package:store_pattern_service/src/services/store_pattern_service.dart';
8 |
9 | /// This is a perfect place to include configuration and load plug-ins.
10 | AngelConfigurer configureServer(FileSystem fileSystem) {
11 | return (Angel app) async {
12 | // Load configuration from the `config/` directory.
13 | //
14 | // See: https://github.com/angel-dart/configuration
15 | await app.configure(configuration(fileSystem));
16 |
17 | // conect to mySql
18 | app
19 | ..container.registerSingleton(
20 | app.container.make());
21 | await app.mountController();
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/server/lib/src/models/query_request.dart:
--------------------------------------------------------------------------------
1 | class QueryRequest {
2 | String query;
3 | bool isNoneQuery;
4 |
5 | QueryRequest.fromJson(Map map) {
6 | if (map.containsKey('executeNoneQuery')) {
7 | query = map['executeNoneQuery'].toString();
8 | isNoneQuery = true;
9 | } else if (map.containsKey('executeQuery')) {
10 | query = map['executeQuery'].toString();
11 | isNoneQuery = false;
12 | } else {
13 | throw Exception('Query incorrect');
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/server/lib/src/pretty_logging.dart:
--------------------------------------------------------------------------------
1 | import 'package:angel_http_exception/angel_http_exception.dart';
2 | import 'package:logging/logging.dart';
3 | import 'package:io/ansi.dart';
4 |
5 | /// Prints the contents of a [LogRecord] with pretty colors.
6 | void prettyLog(LogRecord record) {
7 | var code = chooseLogColor(record.level);
8 |
9 | if (record.error == null) print(code.wrap(record.toString()));
10 |
11 | if (record.error != null) {
12 | var err = record.error;
13 | if (err is AngelHttpException && err.statusCode != 500) return;
14 | print(code.wrap(record.toString() + '\n'));
15 | print(code.wrap(err.toString()));
16 |
17 | if (record.stackTrace != null) {
18 | print(code.wrap(record.stackTrace.toString()));
19 | }
20 | }
21 | }
22 |
23 | /// Chooses a color based on the logger [level].
24 | AnsiCode chooseLogColor(Level level) {
25 | if (level == Level.SHOUT) {
26 | return backgroundRed;
27 | } else if (level == Level.SEVERE) {
28 | return red;
29 | } else if (level == Level.WARNING) {
30 | return yellow;
31 | } else if (level == Level.INFO) {
32 | return cyan;
33 | } else if (level == Level.CONFIG ||
34 | level == Level.FINE ||
35 | level == Level.FINER ||
36 | level == Level.FINEST) return lightGray;
37 | return resetAll;
38 | }
39 |
--------------------------------------------------------------------------------
/server/lib/src/routes/controllers/store_pattern_controller.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:angel_framework/angel_framework.dart';
4 | import 'package:angel_serialize/angel_serialize.dart';
5 | import 'package:store_pattern_service/src/models/query_request.dart';
6 | import 'package:store_pattern_service/src/services/store_pattern_service.dart';
7 | import 'package:http_parser/http_parser.dart';
8 |
9 | @Expose('/')
10 | class StorePatternController extends Controller {
11 | final StorePatternService service;
12 | StorePatternController(this.service);
13 |
14 | @Expose('/', method: 'POST', middleware: [parseRequest])
15 | Future handleRequest(QueryRequest request, ResponseContext res) async {
16 | if (request.isNoneQuery) {
17 | return service.executeNoneQuery(request.query);
18 | } else {
19 | final value = await service.executeQuery(request.query);
20 | if (value != null) {
21 | final r = json.encode(value, toEncodable: dateTimeEncoder);
22 | res
23 | ..contentType = MediaType('application', 'json')
24 | ..write(r);
25 | } else {
26 | return 0;
27 | }
28 | }
29 | }
30 | }
31 |
32 | Future parseRequest(RequestContext req, ResponseContext res) async {
33 | return req.parseBody().then((_) {
34 | final query = QueryRequest.fromJson(req.bodyAsMap);
35 | req.params['request'] = query;
36 | req.params['res'] = res;
37 | return true;
38 | });
39 | }
40 |
41 | dynamic dateTimeEncoder(item) {
42 | print('item:: $item');
43 | if (item is DateTime) {
44 | return item.toIso8601String();
45 | }
46 | return item;
47 | }
48 |
--------------------------------------------------------------------------------
/server/lib/src/routes/routes.dart:
--------------------------------------------------------------------------------
1 | library store_pattern_service.src.routes;
2 |
3 | import 'package:angel_framework/angel_framework.dart';
4 | import 'package:file/file.dart';
5 |
6 | /// Put your app routes here!
7 | ///
8 | /// See the wiki for information about routing, requests, and responses:
9 | /// * https://github.com/angel-dart/angel/wiki/Basic-Routing
10 | /// * https://github.com/angel-dart/angel/wiki/Requests-&-Responses
11 | AngelConfigurer configureServer(FileSystem fileSystem) {
12 | return (Angel app) async {
13 | // Render `views/hello.jl` when a user visits the application root.
14 | app.get('/', (req, res) => res.json({'data': 'Hello 😍'}));
15 |
16 | // Throw a 404 if no route matched the request.
17 | app.fallback((req, res) => res.json({'data': 'Not found 😭'}));
18 |
19 | // Set our application up to handle different errors.
20 | //
21 | // Read the following for documentation:
22 | // * https://github.com/angel-dart/angel/wiki/Error-Handling
23 |
24 | app.errorHandler = (e, req, res) {
25 | res.statusCode = e.statusCode;
26 | return res.json({
27 | 'error': true,
28 | 'status': e.statusCode,
29 | 'message': 'Are you kidding me? 👍',
30 | });
31 | };
32 | };
33 | }
34 |
--------------------------------------------------------------------------------
/server/lib/src/services/mysql_connectior.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'dart:io';
4 |
5 | import 'package:mysql1/mysql1.dart';
6 |
7 | class MySQLConnector {
8 | Future _connectMySQL() async {
9 | final host = Platform.environment['MYSQL_HOST'];
10 | final port = int.tryParse(Platform.environment['MYSQL_PORT'] ?? '3306');
11 | final user = Platform.environment['MYSQL_USER'];
12 | final password = Platform.environment['MYSQL_PASSWORD'];
13 | final db = Platform.environment['MYSQL_DATABASE'] ?? 'storepattern';
14 | final settings = ConnectionSettings(
15 | host: host,
16 | port: port,
17 | user: user,
18 | password: password,
19 | db: db,
20 | characterSet: CharacterSet.UTF8,
21 | timeout: const Duration(minutes: 1),
22 | );
23 | return MySqlConnection.connect(settings);
24 | }
25 |
26 | Future getConnection(ConverterFunction converter) async {
27 | MySqlConnection con;
28 | try {
29 | con = await _connectMySQL();
30 | return await converter(con);
31 | } finally {
32 | await con?.close();
33 | }
34 | }
35 | }
36 |
37 | typedef ConverterFunction = Future Function(MySqlConnection conection);
38 |
--------------------------------------------------------------------------------
/server/lib/src/services/store_pattern_service.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:store_pattern_service/src/services/mysql_connectior.dart';
4 |
5 | abstract class StorePatternService {
6 | Future executeNoneQuery(String query);
7 | Future executeQuery(String query);
8 | }
9 |
10 | class StorePatternServiceImpl extends StorePatternService {
11 | final con = MySQLConnector();
12 |
13 | @override
14 | Future executeNoneQuery(String query) {
15 | return con.getConnection((conection) =>
16 | conection.query(query).then((value) => value.affectedRows > 0 ? 1 : 0));
17 | }
18 |
19 | @override
20 | Future executeQuery(String query) {
21 | return con.getConnection((conection) => conection
22 | .query(query)
23 | .then((value) => value.toList().map((item) => item.fields).toList()));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/server/lib/store_pattern_service.dart:
--------------------------------------------------------------------------------
1 | library store_pattern_service;
2 |
3 | import 'dart:async';
4 | import 'package:angel_framework/angel_framework.dart';
5 | import 'package:file/local.dart';
6 | import 'src/config/config.dart' as configuration;
7 | import 'src/routes/routes.dart' as routes;
8 |
9 | /// Configures the server instance.
10 | Future configureServer(Angel app) async {
11 | // Grab a handle to the file system, so that we can do things like
12 | // serve static files.
13 | var fs = const LocalFileSystem();
14 |
15 | // Set up our application, using the plug-ins defined with this project.
16 | await app.configure(configuration.configureServer(fs));
17 | await app.configure(routes.configureServer(fs));
18 | }
19 |
--------------------------------------------------------------------------------
/server/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: store_pattern_service
2 | description: Service for store pattern
3 | publish_to: none # Ensure we don't accidentally publish our private code! ;)
4 | environment:
5 | sdk: '>=2.0.0-dev <3.0.0'
6 | dependencies:
7 | angel_configuration: ^2.0.0 # Loads application configuration, along with support for .env files.
8 | angel_framework: ^2.0.0 # The core server library.
9 | angel_serialize: ^2.0.0 # Serialization runtime support
10 | angel_production: ^1.0.0 # Production application runner.
11 | mysql1: ^0.17.1
12 | dev_dependencies:
13 | angel_hot: ^2.0.0 # Hot-reloading support. :)
14 | angel_migration_runner: ^2.0.0 # Runs migrations
15 | angel_orm_generator: ^2.0.0 # Generates ORM libraries
16 | angel_test: ^2.0.0 # Utilities for testing Angel servers.
17 | io: ^0.3.2 # For pretty printing.
18 | pedantic: ^1.0.0 # Enforces Dart style conventions.
19 | test: ^1.0.0 # For unit testing.
20 |
--------------------------------------------------------------------------------
/server/test/all_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:store_pattern_service/store_pattern_service.dart';
2 | import 'package:angel_framework/angel_framework.dart';
3 | import 'package:angel_test/angel_test.dart';
4 | import 'package:test/test.dart';
5 |
6 | // Angel also includes facilities to make testing easier.
7 | //
8 | // `package:angel_test` ships a client that can test
9 | // both plain HTTP and WebSockets.
10 | //
11 | // Tests do not require your server to actually be mounted on a port,
12 | // so they will run faster than they would in other frameworks, where you
13 | // would have to first bind a socket, and then account for network latency.
14 | //
15 | // See the documentation here:
16 | // https://github.com/angel-dart/test
17 | //
18 | // If you are unfamiliar with Dart's advanced testing library, you can read up
19 | // here:
20 | // https://github.com/dart-lang/test
21 |
22 | void main() async {
23 | TestClient client;
24 |
25 | setUp(() async {
26 | var app = Angel();
27 | await app.configure(configureServer);
28 |
29 | client = await connectTo(app);
30 | });
31 |
32 | tearDown(() async {
33 | await client.close();
34 | });
35 |
36 | test('index returns 200', () async {
37 | // Request a resource at the given path.
38 | var response = await client.get('/');
39 |
40 | // Expect a 200 response.
41 | expect(response, hasStatus(200));
42 | });
43 | }
44 |
--------------------------------------------------------------------------------