├── .env.example ├── .github ├── FUNDING.yml └── workflows │ └── build.yml ├── .gitignore ├── .metadata ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── lakasir │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── icons │ ├── lakasir.jpg │ └── lakasir.png ├── no-image-100.png ├── no-image-50.png └── onboards │ ├── onboarding-image-1.png │ ├── onboarding-image-2.png │ ├── onboarding-image-3.png │ ├── onboarding-image-4.png │ ├── onboarding-image-5.png │ └── onboarding-image-6.png ├── firebase.json ├── fonts ├── Poppins-Black.ttf ├── Poppins-BlackItalic.ttf ├── Poppins-Bold.ttf ├── Poppins-BoldItalic.ttf ├── Poppins-ExtraBold.ttf ├── Poppins-ExtraBoldItalic.ttf ├── Poppins-ExtraLight.ttf ├── Poppins-ExtraLightItalic.ttf ├── Poppins-Italic.ttf ├── Poppins-Light.ttf ├── Poppins-LightItalic.ttf ├── Poppins-Medium.ttf ├── Poppins-MediumItalic.ttf ├── Poppins-Regular.ttf ├── Poppins-SemiBold.ttf ├── Poppins-SemiBoldItalic.ttf ├── Poppins-Thin.ttf ├── Poppins-ThinItalic.ttf ├── SourceSans3-Black.ttf ├── SourceSans3-BlackItalic.ttf ├── SourceSans3-Bold.ttf ├── SourceSans3-BoldItalic.ttf ├── SourceSans3-ExtraBold.ttf ├── SourceSans3-ExtraBoldItalic.ttf ├── SourceSans3-ExtraLight.ttf ├── SourceSans3-ExtraLightItalic.ttf ├── SourceSans3-Italic-VariableFont_wght.ttf ├── SourceSans3-Italic.ttf ├── SourceSans3-Light.ttf ├── SourceSans3-LightItalic.ttf ├── SourceSans3-Medium.ttf ├── SourceSans3-MediumItalic.ttf ├── SourceSans3-Regular.ttf ├── SourceSans3-SemiBold.ttf ├── SourceSans3-SemiBoldItalic.ttf └── SourceSans3-VariableFont_wght.ttf ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-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 │ ├── GoogleService-Info.plist │ ├── Info.plist │ └── Runner-Bridging-Header.h └── RunnerTests │ └── RunnerTests.swift ├── lib ├── Exceptions │ ├── unauthenticated.dart │ └── validation.dart ├── api │ ├── api_service.dart │ ├── requests │ │ ├── about_request.dart │ │ ├── cash_drawer_request.dart │ │ ├── cashier_report_request.dart │ │ ├── login_request.dart │ │ ├── member_request.dart │ │ ├── pagination_request.dart │ │ ├── payment_request.dart │ │ ├── product_request.dart │ │ ├── product_stock_request.dart │ │ └── profile_request.dart │ └── responses │ │ ├── abouts │ │ ├── about_error_response.dart │ │ └── about_response.dart │ │ ├── api_response.dart │ │ ├── auths │ │ ├── forgot_password_error_response.dart │ │ ├── login_error_response.dart │ │ ├── login_response.dart │ │ ├── profile_error_response.dart │ │ └── profile_response.dart │ │ ├── carts │ │ └── cart_response.dart │ │ ├── cash_drawers │ │ └── cash_drawer_response.dart │ │ ├── categories │ │ ├── category_error_response.dart │ │ └── category_response.dart │ │ ├── domain │ │ ├── register_error_response.dart │ │ └── setup_error_response.dart │ │ ├── error_response.dart │ │ ├── members │ │ ├── member_error_response.dart │ │ └── member_response.dart │ │ ├── notifications │ │ ├── notification_response.dart │ │ └── stock_runs_out_response.dart │ │ ├── pagination_response.dart │ │ ├── payment_methods │ │ └── payment_method_response.dart │ │ ├── products │ │ ├── product_response.dart │ │ ├── produect_error_response.dart │ │ └── stocks │ │ │ ├── stock_error_response.dart │ │ │ └── stock_response.dart │ │ ├── setting_response.dart │ │ └── transactions │ │ ├── analytics │ │ ├── total_gross_profit_response.dart │ │ ├── total_revenue_response.dart │ │ └── total_sales_response.dart │ │ ├── history_response.dart │ │ ├── reports │ │ └── cashier_report_response.dart │ │ └── selling_detail.dart ├── config │ └── app.dart ├── controllers │ ├── abouts │ │ ├── about_controller.dart │ │ └── about_edit_controller.dart │ ├── auths │ │ ├── auth_controller.dart │ │ └── login_controller.dart │ ├── category_controller.dart │ ├── members │ │ ├── member_add_controller.dart │ │ ├── member_controller.dart │ │ └── member_update_controller.dart │ ├── notification_controller.dart │ ├── payment_method_controller.dart │ ├── products │ │ ├── product_add_controller.dart │ │ ├── product_controller.dart │ │ ├── product_detail_controller.dart │ │ ├── stocks │ │ │ └── product_stock_controller.dart │ │ └── unit_controller.dart │ ├── profiles │ │ ├── profile_controller.dart │ │ └── profile_edit_controller.dart │ ├── setting_controller.dart │ ├── settings │ │ ├── print_controller.dart │ │ └── secure_initial_price_controller.dart │ └── transactions │ │ ├── analytics │ │ └── analytics_controller.dart │ │ ├── cart_controller.dart │ │ ├── cash_drawer_controller.dart │ │ ├── history_controller.dart │ │ ├── payment_controller.dart │ │ └── reports │ │ └── cashier_report_controller.dart ├── firebase_options.dart ├── main.dart ├── messages.dart ├── models │ ├── lakasir_database.dart │ ├── printer.dart │ ├── printer.g.dart │ ├── unit.dart │ └── unit.g.dart ├── my_app.dart ├── screens │ ├── about │ │ ├── about_screen.dart │ │ └── edit_screen.dart │ ├── auth_screen.dart │ ├── domain │ │ ├── register_domain_screen.dart │ │ └── setup_screen.dart │ ├── forgot_screen.dart │ ├── login_screen.dart │ ├── members │ │ ├── add_screen.dart │ │ ├── edit_screen.dart │ │ ├── member_form.dart │ │ └── member_screen.dart │ ├── menu_screen.dart │ ├── notifications │ │ └── notification_screen.dart │ ├── onboard_screen.dart │ ├── products │ │ ├── add_screen.dart │ │ ├── detail_screen.dart │ │ ├── detail_stock_screen.dart │ │ ├── edit_screen.dart │ │ ├── product_detail_widget.dart │ │ ├── product_form.dart │ │ └── product_screen.dart │ ├── profile │ │ ├── edit_screen.dart │ │ └── profile_screen.dart │ ├── setting │ │ ├── category_screen.dart │ │ ├── hide_initial_price_screen.dart │ │ ├── layout_screen.dart │ │ ├── menus │ │ │ ├── auth.dart │ │ │ ├── general.dart │ │ │ ├── product.dart │ │ │ ├── system.dart │ │ │ └── transaction.dart │ │ ├── notifications │ │ │ └── setting_notification_screen.dart │ │ ├── printers │ │ │ ├── add_printer_page_screen.dart │ │ │ ├── print_receipt.dart │ │ │ └── printer_page_screen.dart │ │ ├── selling_method_screen.dart │ │ ├── selling_methods │ │ │ ├── fifo_screen.dart │ │ │ ├── lifo_screen.dart │ │ │ └── normal_screen.dart │ │ └── setting_screen.dart │ └── transactions │ │ ├── carts │ │ ├── cart_menu_scren │ │ │ ├── cart_control_widget.dart │ │ │ ├── cart_list.dart │ │ │ ├── detail_field.dart │ │ │ ├── payment_calculator.dart │ │ │ └── sub_total_field.dart │ │ ├── cashier_cart_menu_screen.dart │ │ ├── dialog │ │ │ ├── confirm_alert_dialog.dart │ │ │ └── edit_alert_dialog.dart │ │ ├── payment_screen.dart │ │ └── payment_success_screen.dart │ │ ├── cashier_menu_screen.dart │ │ ├── history │ │ ├── detail_screen.dart │ │ └── history_screen.dart │ │ ├── invoice_screen.dart │ │ ├── reports │ │ └── cashier_screen.dart │ │ └── transaction_menu_screen.dart ├── services │ ├── about_service.dart │ ├── analytics_service.dart │ ├── cash_drawer_service.dart │ ├── cashier_report_service.dart │ ├── category_service.dart │ ├── history_service.dart │ ├── login_service.dart │ ├── member_service.dart │ ├── notification_service.dart │ ├── payment_method_service.dart │ ├── payment_service.dart │ ├── product_service.dart │ ├── product_stock_service.dart │ ├── profile_service.dart │ ├── secure_initial_price_service.dart │ └── setting_service.dart ├── utils │ ├── auth.dart │ ├── colors.dart │ └── utils.dart └── widgets │ ├── analytics_card.dart │ ├── build_list_image.dart │ ├── calculator_payment_button.dart │ ├── card.dart │ ├── checkbox.dart │ ├── confirm_dialog.dart │ ├── date_picker.dart │ ├── detail_transaction.dart │ ├── dialog.dart │ ├── filled_button.dart │ ├── image_picker.dart │ ├── layout.dart │ ├── my_bottom_bar.dart │ ├── my_bottom_bar_actions.dart │ ├── my_card_list.dart │ ├── onboarding_page.dart │ ├── radio_group_field.dart │ ├── read_more.dart │ ├── select_input_feld.dart │ ├── shimmer_loading.dart │ ├── simple_button.dart │ ├── text_field.dart │ └── upgrade_popup.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements └── RunnerTests │ └── RunnerTests.swift ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_DEBUG=true 3 | BASE_URL=http://localhost:8000 4 | 5 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [lakasir] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: sheenazien8 # Replace with a single Buy Me a Coffee username 14 | thanks_dev: # Replace with a single thanks.dev username 15 | custom: ["https://trakteer.id/sheenazien8/tip"] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 16 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build and Release 2 | env: 3 | APP_ENV: "production" 4 | APP_DEBUG: false 5 | BASE_URL: "https://lakasir.com" 6 | on: 7 | push: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout code 16 | uses: actions/checkout@v2 17 | 18 | - name: Set up Flutter 19 | uses: subosito/flutter-action@v2 20 | with: 21 | flutter-version: '3.x' 22 | 23 | - name: Get packages 24 | run: flutter pub get 25 | 26 | - name: Setup .env 27 | run: cp .env.example .env 28 | 29 | - name: Build APK 30 | run: flutter build apk --release 31 | 32 | - name: Upload APK 33 | uses: actions/upload-artifact@v2 34 | with: 35 | name: release-apk 36 | path: build/app/outputs/flutter-apk/app-release.apk 37 | 38 | - name: Create Release Tag 39 | id: create_release 40 | uses: actions/create-release@v1 41 | env: 42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 43 | with: 44 | tag_name: v${{ github.run_number }} 45 | release_name: Release v${{ github.run_number }} 46 | draft: false 47 | prerelease: false 48 | 49 | - name: Upload Release Asset 50 | id: upload-release-asset 51 | uses: actions/upload-release-asset@v1 52 | env: 53 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 54 | with: 55 | upload_url: ${{ steps.create_release.outputs.upload_url }} 56 | asset_path: build/app/outputs/flutter-apk/app-release.apk 57 | asset_name: MyReleaseApp.apk 58 | asset_content_type: application/vnd.android.package-archive 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | .env 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Android Studio will place build artifacts here 43 | /android/app/debug 44 | /android/app/profile 45 | /android/app/release 46 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "12fccda598477eddd19f93040a1dba24f915b9be" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 17 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 18 | - platform: android 19 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 20 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 21 | - platform: ios 22 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 23 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 24 | - platform: linux 25 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 26 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 27 | - platform: macos 28 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 29 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 30 | - platform: web 31 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 32 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 33 | - platform: windows 34 | create_revision: 12fccda598477eddd19f93040a1dba24f915b9be 35 | base_revision: 12fccda598477eddd19f93040a1dba24f915b9be 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "98840745074", 4 | "project_id": "lakasir-pos", 5 | "storage_bucket": "lakasir-pos.appspot.com" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:98840745074:android:16d26e821ce5c512dddeeb", 11 | "android_client_info": { 12 | "package_name": "com.lakasir.lakasir" 13 | } 14 | }, 15 | "oauth_client": [], 16 | "api_key": [ 17 | { 18 | "current_key": "AIzaSyCEeawbXxkbIRYGvnkalmYhn2zybp6mD-Y" 19 | } 20 | ], 21 | "services": { 22 | "appinvite_service": { 23 | "other_platform_oauth_client": [] 24 | } 25 | } 26 | } 27 | ], 28 | "configuration_version": "1" 29 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/lakasir/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.lakasir 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-hdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-mdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | // START: FlutterFire Configuration 10 | classpath 'com.google.gms:google-services:4.3.15' 11 | // END: FlutterFire Configuration 12 | classpath 'com.android.tools.build:gradle:7.3.0' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | } 23 | 24 | rootProject.buildDir = '../build' 25 | subprojects { 26 | project.buildDir = "${rootProject.buildDir}/${project.name}" 27 | } 28 | subprojects { 29 | project.evaluationDependsOn(':app') 30 | } 31 | 32 | tasks.register("clean", Delete) { 33 | delete rootProject.buildDir 34 | } 35 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | } 9 | settings.ext.flutterSdkPath = flutterSdkPath() 10 | 11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") 12 | 13 | plugins { 14 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false 15 | } 16 | } 17 | 18 | include ":app" 19 | 20 | apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" 21 | -------------------------------------------------------------------------------- /assets/icons/lakasir.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/icons/lakasir.jpg -------------------------------------------------------------------------------- /assets/icons/lakasir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/icons/lakasir.png -------------------------------------------------------------------------------- /assets/no-image-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/no-image-100.png -------------------------------------------------------------------------------- /assets/no-image-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/no-image-50.png -------------------------------------------------------------------------------- /assets/onboards/onboarding-image-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/onboards/onboarding-image-1.png -------------------------------------------------------------------------------- /assets/onboards/onboarding-image-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/onboards/onboarding-image-2.png -------------------------------------------------------------------------------- /assets/onboards/onboarding-image-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/onboards/onboarding-image-3.png -------------------------------------------------------------------------------- /assets/onboards/onboarding-image-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/onboards/onboarding-image-4.png -------------------------------------------------------------------------------- /assets/onboards/onboarding-image-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/onboards/onboarding-image-5.png -------------------------------------------------------------------------------- /assets/onboards/onboarding-image-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/assets/onboards/onboarding-image-6.png -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | {"flutter":{"platforms":{"android":{"default":{"projectId":"lakasir-pos","appId":"1:98840745074:android:16d26e821ce5c512dddeeb","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"lakasir-pos","configurations":{"android":"1:98840745074:android:16d26e821ce5c512dddeeb"}}}}}} -------------------------------------------------------------------------------- /fonts/Poppins-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-Black.ttf -------------------------------------------------------------------------------- /fonts/Poppins-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-BlackItalic.ttf -------------------------------------------------------------------------------- /fonts/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-Bold.ttf -------------------------------------------------------------------------------- /fonts/Poppins-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-BoldItalic.ttf -------------------------------------------------------------------------------- /fonts/Poppins-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-ExtraBold.ttf -------------------------------------------------------------------------------- /fonts/Poppins-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /fonts/Poppins-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-ExtraLight.ttf -------------------------------------------------------------------------------- /fonts/Poppins-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /fonts/Poppins-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-Italic.ttf -------------------------------------------------------------------------------- /fonts/Poppins-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-Light.ttf -------------------------------------------------------------------------------- /fonts/Poppins-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-LightItalic.ttf -------------------------------------------------------------------------------- /fonts/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-Medium.ttf -------------------------------------------------------------------------------- /fonts/Poppins-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-MediumItalic.ttf -------------------------------------------------------------------------------- /fonts/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-Regular.ttf -------------------------------------------------------------------------------- /fonts/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /fonts/Poppins-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /fonts/Poppins-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-Thin.ttf -------------------------------------------------------------------------------- /fonts/Poppins-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/Poppins-ThinItalic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-Black.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-BlackItalic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-Bold.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-BoldItalic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-ExtraBold.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-ExtraLight.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-Italic-VariableFont_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-Italic-VariableFont_wght.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-Italic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-Light.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-LightItalic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-Medium.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-MediumItalic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-Regular.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-SemiBold.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /fonts/SourceSans3-VariableFont_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/fonts/SourceSans3-VariableFont_wght.ttf -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - image_cropper (0.0.4): 4 | - Flutter 5 | - TOCropViewController (~> 2.6.1) 6 | - image_picker_ios (0.0.1): 7 | - Flutter 8 | - shared_preferences_foundation (0.0.1): 9 | - Flutter 10 | - FlutterMacOS 11 | - TOCropViewController (2.6.1) 12 | 13 | DEPENDENCIES: 14 | - Flutter (from `Flutter`) 15 | - image_cropper (from `.symlinks/plugins/image_cropper/ios`) 16 | - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) 17 | - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) 18 | 19 | SPEC REPOS: 20 | trunk: 21 | - TOCropViewController 22 | 23 | EXTERNAL SOURCES: 24 | Flutter: 25 | :path: Flutter 26 | image_cropper: 27 | :path: ".symlinks/plugins/image_cropper/ios" 28 | image_picker_ios: 29 | :path: ".symlinks/plugins/image_picker_ios/ios" 30 | shared_preferences_foundation: 31 | :path: ".symlinks/plugins/shared_preferences_foundation/darwin" 32 | 33 | SPEC CHECKSUMS: 34 | Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 35 | image_cropper: a3291c624a953049bc6a02e1f8c8ceb162a24b25 36 | image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 37 | shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 38 | TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 39 | 40 | PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189 41 | 42 | COCOAPODS: 1.12.1 43 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | API_KEY 6 | AIzaSyAEkX_T1BspCmVuriKNGtigYUWe0kHIaqU 7 | GCM_SENDER_ID 8 | 98840745074 9 | PLIST_VERSION 10 | 1 11 | BUNDLE_ID 12 | com.example.lakasir 13 | PROJECT_ID 14 | lakasir-pos 15 | STORAGE_BUCKET 16 | lakasir-pos.appspot.com 17 | IS_ADS_ENABLED 18 | 19 | IS_ANALYTICS_ENABLED 20 | 21 | IS_APPINVITE_ENABLED 22 | 23 | IS_GCM_ENABLED 24 | 25 | IS_SIGNIN_ENABLED 26 | 27 | GOOGLE_APP_ID 28 | 1:98840745074:ios:d13c376d0b34997adddeeb 29 | 30 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Lakasir 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | lakasir 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lib/Exceptions/unauthenticated.dart: -------------------------------------------------------------------------------- 1 | class UnauthorizedException implements Exception { 2 | final String message; 3 | 4 | UnauthorizedException(this.message); 5 | 6 | @override 7 | String toString() { 8 | return message; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/Exceptions/validation.dart: -------------------------------------------------------------------------------- 1 | class ValidationException implements Exception { 2 | final String message; 3 | 4 | ValidationException(this.message); 5 | 6 | @override 7 | String toString() { 8 | return message; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/api/requests/about_request.dart: -------------------------------------------------------------------------------- 1 | class AboutRequest { 2 | final String? shopName; 3 | final String? shopLocation; 4 | final String? businessType; 5 | final String? otherBusinessType; 6 | final String? photoUrl; 7 | final String? ownerName; 8 | 9 | AboutRequest({ 10 | this.shopName, 11 | this.shopLocation, 12 | this.businessType, 13 | this.otherBusinessType, 14 | this.photoUrl, 15 | this.ownerName, 16 | }); 17 | 18 | Map toJson() { 19 | return { 20 | 'shop_name': shopName, 21 | 'shop_location': shopLocation, 22 | 'business_type': businessType, 23 | 'other_business_type': otherBusinessType, 24 | 'photo_url': photoUrl ?? '', 25 | 'owner_name': ownerName, 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/api/requests/cash_drawer_request.dart: -------------------------------------------------------------------------------- 1 | class CashDrawerRequest { 2 | double? cash; 3 | 4 | CashDrawerRequest({ 5 | this.cash, 6 | }); 7 | 8 | Map toJson() { 9 | return { 10 | 'cash': cash, 11 | }; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/api/requests/cashier_report_request.dart: -------------------------------------------------------------------------------- 1 | class CashierReportRequest { 2 | final String? startDate; 3 | final String? endDate; 4 | 5 | CashierReportRequest({ 6 | this.startDate, 7 | this.endDate, 8 | }); 9 | 10 | Map toJson() { 11 | return { 12 | 'start_date': startDate, 13 | 'end_date': endDate, 14 | }; 15 | } 16 | 17 | String toQuery() { 18 | return 'start_date=$startDate&end_date=$endDate'; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/api/requests/login_request.dart: -------------------------------------------------------------------------------- 1 | class LoginRequest { 2 | final String? password; 3 | final String? email; 4 | final bool remember; 5 | 6 | LoginRequest({ 7 | this.password, 8 | this.email, 9 | this.remember = false, 10 | }); 11 | 12 | Map toJson() { 13 | return { 14 | 'password': password, 15 | 'email': email, 16 | 'remember': remember, 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/api/requests/member_request.dart: -------------------------------------------------------------------------------- 1 | class MemberRequest { 2 | final String? name; 3 | final String? address; 4 | final String? code; 5 | final String? email; 6 | 7 | MemberRequest({ 8 | this.name, 9 | this.address, 10 | this.code, 11 | this.email, 12 | }); 13 | 14 | Map toJson() { 15 | return { 16 | 'name': name, 17 | 'address': address, 18 | 'code': code, 19 | 'email': email, 20 | }; 21 | } 22 | 23 | String? toQuery() { 24 | final query = []; 25 | if (name != null) { 26 | query.add('filter[name]=$name'); 27 | } 28 | if (address != null) { 29 | query.add('filter[address]=$address'); 30 | } 31 | if (code != null) { 32 | query.add('filter[code]=$code'); 33 | } 34 | if (email != null) { 35 | query.add('filter[email]=$email'); 36 | } 37 | 38 | return query.join('&'); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /lib/api/requests/pagination_request.dart: -------------------------------------------------------------------------------- 1 | class PaginationRequest { 2 | final int page; 3 | final int perPage; 4 | 5 | PaginationRequest({ 6 | required this.page, 7 | required this.perPage, 8 | }); 9 | 10 | Map toJson() => { 11 | 'page': page, 12 | 'per_page': perPage, 13 | }; 14 | 15 | String toQuery() { 16 | final query = []; 17 | query.add('page=$page'); 18 | query.add('per_page=$perPage'); 19 | 20 | return "?${query.join('&')}"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/api/requests/payment_request.dart: -------------------------------------------------------------------------------- 1 | class PaymentRequest { 2 | double? payedMoney; 3 | double discountPrice; 4 | bool? friendPrice; 5 | int? memberId; 6 | double? tax; 7 | List? products; 8 | String? note; 9 | 10 | PaymentRequest({ 11 | this.payedMoney, 12 | this.friendPrice, 13 | this.products, 14 | this.memberId, 15 | this.tax, 16 | this.note, 17 | this.discountPrice = 0, 18 | }); 19 | 20 | Map toJson() { 21 | final data = {}; 22 | data['payed_money'] = payedMoney; 23 | data['friend_price'] = friendPrice; 24 | data['note'] = note; 25 | data['discount_price'] = discountPrice; 26 | if (memberId != null) data['member_id'] = memberId; 27 | if (tax != null) data['tax'] = tax; 28 | if (products != null) { 29 | data['products'] = products!.map((v) => v.toJson()).toList(); 30 | } 31 | return data; 32 | } 33 | } 34 | 35 | class PaymentRequestItem { 36 | int? productId; 37 | int? qty; 38 | double discountPrice; 39 | 40 | PaymentRequestItem({ 41 | this.productId, 42 | this.qty, 43 | this.discountPrice = 0, 44 | }); 45 | 46 | Map toJson() { 47 | final data = {}; 48 | data['product_id'] = productId; 49 | data['discount_price'] = discountPrice; 50 | data['qty'] = qty; 51 | return data; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/api/requests/product_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/utils/utils.dart'; 2 | 3 | class ProductRequest { 4 | String? name; 5 | String? categoryId; 6 | double? stock; 7 | double? initialPrice; 8 | double? sellingPrice; 9 | String? type; 10 | String? unit; 11 | String? photoUrl; 12 | bool isNonStock; 13 | String? sku; 14 | String? barcode; 15 | String? expired; 16 | 17 | ProductRequest({ 18 | this.name, 19 | this.categoryId, 20 | this.stock, 21 | this.initialPrice, 22 | this.sellingPrice, 23 | this.type, 24 | this.unit, 25 | this.photoUrl, 26 | this.isNonStock = false, 27 | this.sku, 28 | this.barcode, 29 | this.expired, 30 | }); 31 | 32 | Map toJson() { 33 | final data = { 34 | 'name': name, 35 | 'category': categoryId, 36 | 'stock': stock, 37 | 'initial_price': initialPrice, 38 | 'selling_price': sellingPrice, 39 | 'type': type ?? '', 40 | 'unit': unit ?? '', 41 | 'is_non_stock': isNonStock, 42 | 'sku': sku, 43 | 'barcode': barcode ?? '', 44 | 'expired': expired ?? '' 45 | }; 46 | if (photoUrl != '') { 47 | data['hero_images_url'] = photoUrl; 48 | } 49 | 50 | return data; 51 | } 52 | 53 | String? toQuery() { 54 | final query = []; 55 | if (name != null) { 56 | query.add('filter[global]=$name'); 57 | } 58 | if (categoryId != null) { 59 | query.add('filter[category_id]=$categoryId'); 60 | } 61 | if (type != null) { 62 | query.add('filter[type]=$type'); 63 | } 64 | if (unit != null) { 65 | query.add('filter[unit]=$unit'); 66 | } 67 | if (stock != null) { 68 | query.add('filter[stock-gt]=$stock'); 69 | } 70 | return query.join('&'); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/api/requests/product_stock_request.dart: -------------------------------------------------------------------------------- 1 | class ProductStockRequest { 2 | final int stock; 3 | final String? type; 4 | final String? date; 5 | final double? initialPrice; 6 | final double? sellingPrice; 7 | 8 | ProductStockRequest({ 9 | required this.stock, 10 | this.type, 11 | this.date, 12 | this.initialPrice, 13 | this.sellingPrice, 14 | }); 15 | 16 | Map toJson() { 17 | return { 18 | 'stock': stock, 19 | 'type': type, 20 | 'date': date, 21 | 'initial_price': initialPrice, 22 | 'selling_price': sellingPrice, 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/api/requests/profile_request.dart: -------------------------------------------------------------------------------- 1 | class ProfileRequest { 2 | String? name; 3 | String? email; 4 | String? phone; 5 | String? photoUrl; 6 | String? address; 7 | String? locale; 8 | 9 | ProfileRequest({ 10 | this.name, 11 | this.email, 12 | this.phone, 13 | this.photoUrl, 14 | this.address, 15 | this.locale, 16 | }); 17 | 18 | Map toJson() { 19 | return { 20 | 'name': name, 21 | 'email': email, 22 | 'phone': phone, 23 | 'photo_url': photoUrl, 24 | 'address': address, 25 | 'locale': locale, 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/api/responses/abouts/about_error_response.dart: -------------------------------------------------------------------------------- 1 | class AboutErrorResponse { 2 | final String? businessType; 3 | final String? otherBusinesType; 4 | 5 | AboutErrorResponse({ 6 | this.businessType, 7 | this.otherBusinesType, 8 | }); 9 | 10 | factory AboutErrorResponse.fromJson(Map json) { 11 | return AboutErrorResponse( 12 | businessType: 13 | json['business_type'] == null ? '' : json['business_type'][0], 14 | otherBusinesType: json['other_business_type'] == null 15 | ? '' 16 | : json['other_business_type'][0], 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/api/responses/abouts/about_response.dart: -------------------------------------------------------------------------------- 1 | class AboutResponse { 2 | String? shopeName; 3 | String? businessType; 4 | String? ownerName; 5 | String? location; 6 | String? currency; 7 | String? photo; 8 | String? otherBusinessType; 9 | 10 | AboutResponse({ 11 | this.shopeName, 12 | this.businessType, 13 | this.otherBusinessType, 14 | this.ownerName, 15 | this.location, 16 | this.currency, 17 | this.photo, 18 | }); 19 | 20 | factory AboutResponse.fromJson(Map json) { 21 | return AboutResponse( 22 | shopeName: json['shop_name'], 23 | businessType: json['business_type'], 24 | otherBusinessType: json['other_business_type'], 25 | ownerName: json['owner_name'], 26 | location: json['shop_location'], 27 | currency: json['currency'], 28 | photo: json['photo_url'], 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/api/responses/api_response.dart: -------------------------------------------------------------------------------- 1 | class DataWrapper { 2 | final T value; 3 | 4 | DataWrapper(this.value); 5 | } 6 | 7 | class ApiResponse { 8 | bool success; 9 | String? message; 10 | DataWrapper? data; 11 | 12 | ApiResponse({ 13 | required this.success, 14 | this.message, 15 | this.data, 16 | }); 17 | 18 | factory ApiResponse.fromJson( 19 | Map json, 20 | T Function(Map) fromJson, 21 | ) { 22 | return ApiResponse( 23 | success: json['success'], 24 | message: json['message'], 25 | data: DataWrapper(fromJson(json['data'])), 26 | ); 27 | } 28 | 29 | factory ApiResponse.fromJsonList( 30 | Map json, 31 | T Function(List) fromJson, 32 | ) { 33 | return ApiResponse( 34 | success: json['success'], 35 | message: json['message'], 36 | data: DataWrapper(fromJson(json['data'])), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/api/responses/auths/forgot_password_error_response.dart: -------------------------------------------------------------------------------- 1 | class ForgotPasswordErrorResponse { 2 | ForgotPasswordErrorResponse({ 3 | required this.email, 4 | }); 5 | 6 | String email; 7 | 8 | factory ForgotPasswordErrorResponse.fromJson(Map json) { 9 | return ForgotPasswordErrorResponse( 10 | email: json['email'] == null ? '' : json['email'][0], 11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/api/responses/auths/login_error_response.dart: -------------------------------------------------------------------------------- 1 | class LoginErrorResponse { 2 | String? email; 3 | String? password; 4 | LoginErrorResponse({this.email, this.password}); 5 | 6 | factory LoginErrorResponse.fromJson(Map json) { 7 | return LoginErrorResponse( 8 | email: json['email'] == null ? '' : json['email'][0], 9 | password: json['password'] == null ? '' : json['password'][0], 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/api/responses/auths/login_response.dart: -------------------------------------------------------------------------------- 1 | class LoginResponse { 2 | final String token; 3 | final List permissions; 4 | 5 | LoginResponse({required this.token, required this.permissions}); 6 | 7 | factory LoginResponse.fromJson(Map json) { 8 | return LoginResponse( 9 | token: json['token'], 10 | permissions: 11 | (json['permissions'] as List).map((item) => item as String).toList(), 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/api/responses/auths/profile_error_response.dart: -------------------------------------------------------------------------------- 1 | class ProfileErrorResponse { 2 | String name; 3 | String phone; 4 | String email; 5 | String address; 6 | String locale; 7 | String photoUrl; 8 | 9 | ProfileErrorResponse({ 10 | this.name = '', 11 | this.phone = '', 12 | this.email = '', 13 | this.address = '', 14 | this.locale = '', 15 | this.photoUrl = '', 16 | }); 17 | 18 | factory ProfileErrorResponse.fromJson(Map json) { 19 | return ProfileErrorResponse( 20 | phone: json["phone"] == null ? '' : json["phone"][0], 21 | name: json["name"] == null ? '' : json["name"][0], 22 | email: json['email'] == null ? '' : json['email'][0], 23 | address: json["address"] == null ? '' : json["address"][0], 24 | locale: json["locale"] == null ? '' : json["locale"][0], 25 | photoUrl: json["photo_url"] == null ? '' : json["photo_url"][0], 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/api/responses/auths/profile_response.dart: -------------------------------------------------------------------------------- 1 | class ProfileResponse { 2 | final String? name; 3 | final String? roles; 4 | final String? email; 5 | final String? phone; 6 | final String? address; 7 | String? photoUrl; 8 | final String? locale; 9 | final String? createdAt; 10 | final String? updatedAt; 11 | final List? permissions; 12 | final Map? features; 13 | 14 | ProfileResponse({ 15 | this.name, 16 | this.roles, 17 | this.permissions, 18 | this.email, 19 | this.phone, 20 | this.address, 21 | this.photoUrl, 22 | this.locale, 23 | this.createdAt, 24 | this.updatedAt, 25 | this.features, 26 | }); 27 | 28 | factory ProfileResponse.fromJson(Map json) { 29 | return ProfileResponse( 30 | name: json['name'], 31 | email: json['email'], 32 | phone: json['phone'], 33 | photoUrl: json['photo'], 34 | address: json['address'], 35 | roles: json['roles'], 36 | permissions: json['permissions'] != null 37 | ? List.from(json['permissions']) 38 | : [], 39 | features: json['features'], 40 | locale: json['locale'] ?? 'en', 41 | createdAt: json['created_at'], 42 | updatedAt: json['updated_at'], 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/api/responses/carts/cart_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/responses/products/product_response.dart'; 2 | 3 | class CartResponse { 4 | int id; 5 | int quantity; 6 | int productId; 7 | ProductResponse product; 8 | final String createdAt; 9 | final String updatedAt; 10 | 11 | CartResponse({ 12 | required this.id, 13 | required this.quantity, 14 | required this.productId, 15 | required this.product, 16 | required this.createdAt, 17 | required this.updatedAt, 18 | }); 19 | 20 | factory CartResponse.fromJson(Map json) { 21 | return CartResponse( 22 | id: json['id'], 23 | quantity: json['quantity'], 24 | productId: json['product_id'], 25 | product: ProductResponse.fromJson(json['product']), 26 | createdAt: json['created_at'], 27 | updatedAt: json['updated_at'], 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/api/responses/cash_drawers/cash_drawer_response.dart: -------------------------------------------------------------------------------- 1 | class CashDrawerResponse { 2 | int? id; 3 | int? openedBy; 4 | int? closedBy; 5 | double? cash; 6 | 7 | CashDrawerResponse({ 8 | this.id, 9 | this.openedBy, 10 | this.closedBy, 11 | this.cash, 12 | }); 13 | 14 | factory CashDrawerResponse.fromJson(Map json) { 15 | return CashDrawerResponse( 16 | id: json['id'], 17 | openedBy: json['opened_by'], 18 | closedBy: json['closed_by'], 19 | cash: json['cash'].toDouble(), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/api/responses/categories/category_error_response.dart: -------------------------------------------------------------------------------- 1 | class CategoryErrorResponse { 2 | String name; 3 | 4 | CategoryErrorResponse({required this.name}); 5 | 6 | factory CategoryErrorResponse.fromJson(Map json) { 7 | return CategoryErrorResponse( 8 | name: json['name'] == null ? '' : json['name'][0], 9 | ); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/api/responses/categories/category_response.dart: -------------------------------------------------------------------------------- 1 | class CategoryResponse { 2 | int id; 3 | String name; 4 | final String createdAt; 5 | final String updatedAt; 6 | 7 | CategoryResponse({ 8 | required this.id, 9 | required this.name, 10 | required this.createdAt, 11 | required this.updatedAt, 12 | }); 13 | 14 | factory CategoryResponse.fromJson(Map json) { 15 | return CategoryResponse( 16 | id: json['id'], 17 | name: json['name'], 18 | createdAt: json['created_at'], 19 | updatedAt: json['updated_at'], 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/api/responses/domain/register_error_response.dart: -------------------------------------------------------------------------------- 1 | class RegisterErrorResponse { 2 | String shopName; 3 | String fullName; 4 | String domainName; 5 | String emailOrPhone; 6 | String password; 7 | String? businessType; 8 | String? otherBusinessType; 9 | 10 | RegisterErrorResponse({ 11 | required this.shopName, 12 | required this.fullName, 13 | required this.domainName, 14 | required this.emailOrPhone, 15 | required this.password, 16 | required this.businessType, 17 | required this.otherBusinessType, 18 | }); 19 | 20 | factory RegisterErrorResponse.fromJson(Map json) { 21 | return RegisterErrorResponse( 22 | shopName: json['shop_name'] == null ? '' : json['shop_name'][0], 23 | fullName: json['full_name'] == null ? '' : json['full_name'][0], 24 | domainName: json['domain_name'] == null ? '' : json['domain_name'][0], 25 | emailOrPhone: 26 | json['email_or_phone'] == null ? '' : json['email_or_phone'][0], 27 | password: json['password'] == null ? '' : json['password'][0], 28 | businessType: 29 | json['business_type'] == null ? '' : json['business_type'][0], 30 | otherBusinessType: json['other_business_type'] == null 31 | ? '' 32 | : json['other_business_type'][0], 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/api/responses/domain/setup_error_response.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/lib/api/responses/domain/setup_error_response.dart -------------------------------------------------------------------------------- /lib/api/responses/error_response.dart: -------------------------------------------------------------------------------- 1 | class ErrorResponse { 2 | final String message; 3 | final T? errors; 4 | 5 | ErrorResponse({required this.message, this.errors}); 6 | 7 | factory ErrorResponse.fromJson( 8 | Map json, T Function(Map)? fromJson) { 9 | return ErrorResponse( 10 | message: json['message'], 11 | errors: fromJson != null ? fromJson(json['errors']) : null, 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/api/responses/members/member_error_response.dart: -------------------------------------------------------------------------------- 1 | class MemberErrorResponse { 2 | String name; 3 | String? email; 4 | 5 | MemberErrorResponse({ 6 | required this.name, 7 | this.email, 8 | }); 9 | 10 | factory MemberErrorResponse.fromJson(Map json) { 11 | return MemberErrorResponse( 12 | name: json['name'] == null ? '' : json['name'][0], 13 | email: json['email'] == null ? '' : json['email'][0], 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/api/responses/members/member_response.dart: -------------------------------------------------------------------------------- 1 | class MemberResponse { 2 | int id; 3 | String name; 4 | String? code; 5 | String? address; 6 | String? email; 7 | final String createdAt; 8 | final String updatedAt; 9 | 10 | MemberResponse({ 11 | required this.id, 12 | this.name = '', 13 | this.code = '', 14 | this.address = '', 15 | this.email = '', 16 | this.createdAt = '', 17 | this.updatedAt = '', 18 | }); 19 | 20 | factory MemberResponse.fromJson(Map json) { 21 | return MemberResponse( 22 | id: json['id'], 23 | name: json['name'], 24 | code: json['code'], 25 | address: json['address'], 26 | createdAt: json['created_at'], 27 | updatedAt: json['updated_at'], 28 | email: json['email'], 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/api/responses/notifications/notification_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/responses/notifications/stock_runs_out_response.dart'; 2 | 3 | class NotificationResponse { 4 | String? uuid; 5 | String? type; 6 | List? data; 7 | String? createdAt; 8 | 9 | NotificationResponse({ 10 | this.uuid, 11 | this.type, 12 | this.data, 13 | this.createdAt, 14 | }); 15 | 16 | factory NotificationResponse.fromJson(Map json) { 17 | dynamic data; 18 | if (json['type'] == 'App\\Notifications\\StockRunsOut') { 19 | data = json['data'] != null 20 | ? (json['data'] as List).map((e) => StockRunsOut.fromJson(e)).toList() 21 | : []; 22 | } 23 | return NotificationResponse( 24 | uuid: json['id'], 25 | type: json['type'], 26 | data: data, 27 | createdAt: json['created_at'], 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/api/responses/notifications/stock_runs_out_response.dart: -------------------------------------------------------------------------------- 1 | class StockRunsOut { 2 | int? id; 3 | String? name; 4 | String? stock; 5 | String? route; 6 | 7 | StockRunsOut({ 8 | this.id, 9 | this.name, 10 | this.stock, 11 | this.route, 12 | }); 13 | 14 | factory StockRunsOut.fromJson(Map json) { 15 | return StockRunsOut( 16 | id: json['id'], 17 | name: json['name'], 18 | stock: json['stock'], 19 | route: json['route'], 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/api/responses/pagination_response.dart: -------------------------------------------------------------------------------- 1 | class PaginationResponse { 2 | ListPaginationResponse? links; 3 | MetaPaginationResponse? meta; 4 | List? data; 5 | 6 | PaginationResponse({ 7 | this.links, 8 | this.meta, 9 | this.data, 10 | }); 11 | 12 | factory PaginationResponse.fromJson(Map json, 13 | [T Function(Map)? fromJson]) { 14 | return PaginationResponse( 15 | links: ListPaginationResponse.fromJson(json['links']), 16 | meta: MetaPaginationResponse.fromJson(json['meta']), 17 | data: fromJson != null 18 | ? (json['data'] as List).map((e) { 19 | return fromJson(e); 20 | }).toList() 21 | : null, 22 | ); 23 | } 24 | } 25 | 26 | class ListPaginationResponse { 27 | final String? first; 28 | final String? prev; 29 | final String? next; 30 | 31 | ListPaginationResponse({ 32 | this.first, 33 | this.prev, 34 | this.next, 35 | }); 36 | 37 | factory ListPaginationResponse.fromJson(Map json) { 38 | return ListPaginationResponse( 39 | first: json['first'], 40 | prev: json['prev'], 41 | next: json['next'], 42 | ); 43 | } 44 | } 45 | 46 | class MetaPaginationResponse { 47 | int? currentPage; 48 | int? from; 49 | String? path; 50 | String? perPage; 51 | int? to; 52 | MetaPaginationResponse({ 53 | this.currentPage, 54 | this.from, 55 | this.path, 56 | this.perPage, 57 | this.to, 58 | }); 59 | 60 | factory MetaPaginationResponse.fromJson(Map json) { 61 | return MetaPaginationResponse( 62 | currentPage: json['current_page'], 63 | from: json['from'], 64 | path: json['path'], 65 | perPage: json['per_page'].toString(), 66 | to: json['to'], 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/api/responses/payment_methods/payment_method_response.dart: -------------------------------------------------------------------------------- 1 | class PaymentMethodRespone { 2 | int id; 3 | String name; 4 | String? icon; 5 | bool isCash; 6 | bool isDebit; 7 | bool isCredit; 8 | bool isWallet; 9 | 10 | PaymentMethodRespone({ 11 | required this.id, 12 | required this.name, 13 | this.icon, 14 | this.isCash = false, 15 | this.isDebit = false, 16 | this.isCredit = false, 17 | this.isWallet = false, 18 | }); 19 | 20 | factory PaymentMethodRespone.fromJson(Map json) { 21 | return PaymentMethodRespone( 22 | id: json['id'], 23 | name: json['name'], 24 | icon: json['icon'], 25 | isCash: json['is_cash'] == 0 ? false : true, 26 | isDebit: json['is_debit'] == 0 ? false : true, 27 | isCredit: json['is_credit'] == 0 ? false : true, 28 | isWallet: json['is_wallet'] == 0 ? false : true, 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/api/responses/products/product_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/responses/categories/category_response.dart'; 2 | import 'package:lakasir/api/responses/products/stocks/stock_response.dart'; 3 | 4 | class ProductResponse { 5 | final int id; 6 | final String name; 7 | final String type; 8 | final String unit; 9 | final String? image; 10 | final double? initialPrice; 11 | final double? sellingPrice; 12 | final double? discount; 13 | final double? discountPrice; 14 | final int? stock; 15 | final int? categoryId; 16 | final String? createdAt; 17 | final String? updatedAt; 18 | final bool isNonStock; 19 | final String sku; 20 | final String? barcode; 21 | final CategoryResponse? category; 22 | final List? stocks; 23 | 24 | ProductResponse({ 25 | this.id = 0, 26 | this.name = '', 27 | this.type = 'product', 28 | this.unit = '', 29 | this.isNonStock = false, 30 | this.sku = '', 31 | this.barcode, 32 | this.image, 33 | this.initialPrice, 34 | this.sellingPrice, 35 | this.discount, 36 | this.discountPrice, 37 | this.stock, 38 | this.categoryId, 39 | this.createdAt, 40 | this.updatedAt, 41 | this.category, 42 | this.stocks, 43 | }); 44 | 45 | factory ProductResponse.fromJson(Map json) { 46 | final heroImages = json['hero_images'] as List; 47 | 48 | return ProductResponse( 49 | id: json['id'], 50 | name: json['name'], 51 | sku: json['sku'] ?? '', 52 | barcode: json['barcode'], 53 | isNonStock: json['is_non_stock'] ?? false, 54 | type: json['type'], 55 | unit: json['unit'], 56 | image: heroImages.firstOrNull, 57 | initialPrice: json['initial_price'].toDouble(), 58 | sellingPrice: json['selling_price'].toDouble(), 59 | // initialPrice: json['initial_price'].toDouble(), 60 | // sellingPrice: json['selling_price'].toDouble(), 61 | stock: json['stock'], 62 | categoryId: json['category_id'], 63 | category: json['category'] != null 64 | ? CategoryResponse.fromJson(json['category']) 65 | : null, 66 | stocks: json['stocks'] != null 67 | ? (json['stocks'] as List) 68 | .map((e) => StockResponse.fromJson(e)) 69 | .toList() 70 | : [], 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/api/responses/products/produect_error_response.dart: -------------------------------------------------------------------------------- 1 | class ProductErrorResponse { 2 | String? name; 3 | String? category; 4 | String? stock; 5 | String? initialPrice; 6 | String? sellingPrice; 7 | String? type; 8 | String? unit; 9 | String? photoUrl; 10 | String? isNotStock; 11 | String? sku; 12 | String? barcode; 13 | String? expired; 14 | 15 | ProductErrorResponse({ 16 | this.name, 17 | this.category, 18 | this.stock, 19 | this.initialPrice, 20 | this.sellingPrice, 21 | this.type, 22 | this.unit, 23 | this.photoUrl, 24 | this.isNotStock, 25 | this.sku, 26 | this.barcode, 27 | this.expired, 28 | }); 29 | 30 | factory ProductErrorResponse.fromJson(Map json) { 31 | return ProductErrorResponse( 32 | name: json['name'] == null ? '' : json['name'][0], 33 | category: json['category'] == null ? '' : json['category'][0], 34 | stock: json['stock'] == null ? '' : json['stock'][0], 35 | initialPrice: 36 | json['initial_price'] == null ? '' : json['initial_price'][0], 37 | sellingPrice: 38 | json['selling_price'] == null ? '' : json['selling_price'][0], 39 | type: json['type'] == null ? '' : json['type'][0], 40 | unit: json['unit'] == null ? '' : json['unit'][0], 41 | photoUrl: 42 | json['hero_images_url'] == null ? '' : json['hero_images_url'][0], 43 | isNotStock: json['is_not_stock'] == null ? '' : json['is_not_stock'][0], 44 | sku: json['sku'] == null ? '' : json['sku'][0], 45 | barcode: json['barcode'] == null ? '' : json['barcode'][0], 46 | expired: json['expired'] == null ? '' : json['expired'][0], 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/api/responses/products/stocks/stock_error_response.dart: -------------------------------------------------------------------------------- 1 | class StockErrorResponse { 2 | String? stock; 3 | String? initialPrice; 4 | String? sellingPrice; 5 | 6 | StockErrorResponse({ 7 | this.stock, 8 | this.initialPrice, 9 | this.sellingPrice, 10 | }); 11 | 12 | StockErrorResponse.fromJson(Map json) { 13 | stock = json['stock'] == null ? '' : json['stock'][0]; 14 | initialPrice = json['initial_price'] == null ? '' : json['initial_price'][0]; 15 | sellingPrice = json['selling_price'] == null ? '' : json['selling_price'][0]; 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /lib/api/responses/products/stocks/stock_response.dart: -------------------------------------------------------------------------------- 1 | class StockResponse { 2 | final int id; 3 | final int? stock; 4 | final int? initStock; 5 | final String type; 6 | final double? initialPrice; 7 | final double? sellingPrice; 8 | final String date; 9 | 10 | 11 | StockResponse({ 12 | required this.id, 13 | required this.stock, 14 | required this.initStock, 15 | required this.type, 16 | this.initialPrice, 17 | this.sellingPrice, 18 | required this.date, 19 | }); 20 | 21 | factory StockResponse.fromJson(Map json) { 22 | return StockResponse( 23 | id: json['id'], 24 | stock: json['stock'], 25 | initStock: json['init_stock'], 26 | type: json['type'], 27 | initialPrice: double.parse(json['initial_price'].toString()), 28 | sellingPrice: double.parse(json['selling_price'].toString()), 29 | date: json['date'], 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/api/responses/setting_response.dart: -------------------------------------------------------------------------------- 1 | class SettingResponse { 2 | String? key; 3 | String? value; 4 | 5 | SettingResponse({this.key, this.value}); 6 | 7 | factory SettingResponse.fromJson(Map json) { 8 | return SettingResponse( 9 | key: json['key'], 10 | value: json['value'], 11 | ); 12 | } 13 | } 14 | 15 | class Setting { 16 | String? currency; 17 | String? locale; 18 | String? sellingMethod; 19 | bool cashDrawerEnabled; 20 | bool? hideInitialPrice; 21 | bool? hideInitialPriceUsingPin; 22 | double? defaultTax; 23 | int? minimumStock; 24 | 25 | Setting({ 26 | this.currency, 27 | this.locale, 28 | this.sellingMethod, 29 | this.cashDrawerEnabled = false, 30 | this.hideInitialPrice = false, 31 | this.hideInitialPriceUsingPin = false, 32 | this.defaultTax = 0, 33 | this.minimumStock, 34 | }); 35 | 36 | factory Setting.fromJson(Map json) { 37 | return Setting( 38 | currency: json["currency"], 39 | sellingMethod: json["selling_method"], 40 | cashDrawerEnabled: json["cash_drawer_enabled"], 41 | hideInitialPrice: json["secure_initial_price_enabled"], 42 | hideInitialPriceUsingPin: json["secure_initial_price_using_pin"], 43 | minimumStock: int.parse(json["minimum_stock_nofication"].toString()), 44 | defaultTax: 45 | json["default_tax"] == null ? 0 : json["default_tax"].toDouble(), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/api/responses/transactions/analytics/total_gross_profit_response.dart: -------------------------------------------------------------------------------- 1 | class TotalGrossProfitRespnose { 2 | double totalGrossProfit; 3 | double totalPreviousGrossProfit; 4 | int percentageChange; 5 | 6 | TotalGrossProfitRespnose({ 7 | this.totalGrossProfit = 0, 8 | this.totalPreviousGrossProfit = 0, 9 | this.percentageChange = 0, 10 | }); 11 | 12 | factory TotalGrossProfitRespnose.fromJson(Map json) { 13 | return TotalGrossProfitRespnose( 14 | totalGrossProfit: json['total_gross_profit'].toDouble(), 15 | totalPreviousGrossProfit: json['total_prevous_gross_profit'].toDouble(), 16 | percentageChange: json['percentage_change'], 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/api/responses/transactions/analytics/total_revenue_response.dart: -------------------------------------------------------------------------------- 1 | class TotalRevenueResponse { 2 | double totalRevenue; 3 | double totalPreviousRevenue; 4 | int percentageChange; 5 | 6 | TotalRevenueResponse({ 7 | this.totalRevenue = 0, 8 | this.totalPreviousRevenue = 0, 9 | this.percentageChange = 0, 10 | }); 11 | 12 | factory TotalRevenueResponse.fromJson(Map json) { 13 | // {total_revenue: 50000, total_prevous_revenue: 24500, percentage_change: 104} 14 | // print(json); 15 | return TotalRevenueResponse( 16 | totalRevenue: json["total_revenue"].toDouble(), 17 | totalPreviousRevenue: json["total_prevous_revenue"].toDouble(), 18 | percentageChange: json["percentage_change"], 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/api/responses/transactions/analytics/total_sales_response.dart: -------------------------------------------------------------------------------- 1 | class TotalSalesResponse { 2 | double totalSales; 3 | double totalPreviousSales; 4 | int percentageChange; 5 | 6 | TotalSalesResponse({ 7 | this.totalSales = 0, 8 | this.totalPreviousSales = 0, 9 | this.percentageChange = 0, 10 | }); 11 | 12 | factory TotalSalesResponse.fromJson(Map json) { 13 | print(json); 14 | return TotalSalesResponse( 15 | totalSales: json["total_sales"].toDouble(), 16 | totalPreviousSales: json["total_prevous_sales"].toDouble(), 17 | percentageChange: json["percentage_change"], 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/api/responses/transactions/selling_detail.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/responses/products/product_response.dart'; 2 | import 'package:lakasir/utils/utils.dart'; 3 | 4 | class SellingDetail { 5 | int id; 6 | int sellingId; 7 | int productId; 8 | double price; 9 | double discountPrice; 10 | double discount; 11 | int quantity; 12 | ProductResponse? product; 13 | 14 | SellingDetail({ 15 | required this.id, 16 | required this.sellingId, 17 | required this.productId, 18 | required this.price, 19 | required this.quantity, 20 | this.discountPrice = 0, 21 | this.product, 22 | this.discount = 0, 23 | }); 24 | 25 | factory SellingDetail.fromJson(Map json) { 26 | return SellingDetail( 27 | id: json['id'], 28 | sellingId: json['selling_id'], 29 | productId: json['product_id'], 30 | price: double.parse(json['price'].toString()), 31 | discount: double.parse(json['discount'].toString()), 32 | discountPrice: double.parse(json['discount_price'].toString()), 33 | quantity: json['qty'], 34 | product: json['product'] != null 35 | ? ProductResponse.fromJson(json['product']) 36 | : null, 37 | ); 38 | } 39 | 40 | String buildRowPrice() { 41 | var priceText = "${formatPrice(price, isSymbol: false)} x $quantity"; 42 | 43 | if (discountPrice != 0) { 44 | priceText = 45 | "($priceText) -\n${formatPrice(discountPrice, isSymbol: false)} "; 46 | } 47 | 48 | return priceText; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/config/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 2 | 3 | String baseUrl = dotenv.get('BASE_URL'); 4 | String environment = dotenv.get('APP_ENV'); 5 | -------------------------------------------------------------------------------- /lib/controllers/abouts/about_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/responses/abouts/about_response.dart'; 3 | import 'package:lakasir/services/about_service.dart'; 4 | 5 | class AboutController extends GetxController { 6 | Rx shop = AboutResponse( 7 | shopeName: '', 8 | businessType: '', 9 | ownerName: '', 10 | location: '', 11 | currency: '', 12 | photo: '', 13 | ).obs; 14 | RxBool isLoading = false.obs; 15 | 16 | AboutService aboutService = AboutService(); 17 | 18 | Future getShop() async { 19 | isLoading(true); 20 | final response = await aboutService.get(); 21 | shop.value = response; 22 | isLoading(false); 23 | } 24 | 25 | @override 26 | void onInit() { 27 | super.onInit(); 28 | getShop(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/controllers/auths/auth_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/controllers/profiles/profile_controller.dart'; 3 | import 'package:lakasir/utils/utils.dart'; 4 | 5 | class AuthController extends GetxController { 6 | RxList permissions = List.empty().obs; 7 | RxMap features = {}.obs; 8 | RxBool loading = false.obs; 9 | final ProfileController _profileController = Get.put(ProfileController()); 10 | 11 | bool can({String? ability, String? feature}) { 12 | if (feature!.isEmpty) { 13 | return permissions.contains(ability); 14 | } 15 | 16 | return features[feature]! && permissions.contains(ability); 17 | } 18 | 19 | bool feature({String? feature}) { 20 | return features[feature]!; 21 | } 22 | 23 | void fetchPermissions() async { 24 | loading(true); 25 | await _profileController.getProfile(); 26 | if (_profileController.profile.value.permissions != null) { 27 | permissions(_profileController.profile.value.permissions!); 28 | } 29 | if (_profileController.profile.value.features!.isNotEmpty) { 30 | Map validFeatures = _profileController 31 | .profile.value.features! 32 | .map((key, value) => MapEntry(key, value as bool)); 33 | features.assignAll(validFeatures); 34 | 35 | // features(_profileController.profile.value.features); 36 | } 37 | loading(false); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/controllers/auths/login_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:lakasir/Exceptions/validation.dart'; 6 | import 'package:lakasir/api/requests/login_request.dart'; 7 | import 'package:lakasir/api/responses/auths/login_error_response.dart'; 8 | import 'package:lakasir/api/responses/error_response.dart'; 9 | import 'package:lakasir/services/login_service.dart'; 10 | 11 | class LoginController extends GetxController { 12 | final emailController = TextEditingController(); 13 | final passwordController = TextEditingController(); 14 | final remember = false.obs; 15 | final isLoading = false.obs; 16 | final GlobalKey formKey = GlobalKey(); 17 | Rx loginErrorResponse = LoginErrorResponse( 18 | password: "", 19 | email: "", 20 | ).obs; 21 | final LoginService _loginService = LoginService(); 22 | 23 | Future login() async { 24 | try { 25 | isLoading(true); 26 | if (!formKey.currentState!.validate()) { 27 | isLoading(false); 28 | return; 29 | } 30 | 31 | await _loginService.login( 32 | LoginRequest( 33 | email: emailController.text, 34 | password: passwordController.text, 35 | remember: remember.value, 36 | ), 37 | ); 38 | isLoading(false); 39 | clearError(); 40 | clearInput(); 41 | Get.offAllNamed('/auth'); 42 | } catch (e) { 43 | if (e is ValidationException) { 44 | ErrorResponse errorResponse = 45 | ErrorResponse.fromJson(jsonDecode(e.toString()), 46 | (json) => LoginErrorResponse.fromJson(json)); 47 | 48 | loginErrorResponse.value = errorResponse.errors!; 49 | } 50 | isLoading(false); 51 | } 52 | } 53 | 54 | void clearError() { 55 | loginErrorResponse.value = LoginErrorResponse(); 56 | } 57 | 58 | void clearInput() { 59 | emailController.clear(); 60 | passwordController.clear(); 61 | remember.value = false; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/controllers/members/member_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/api/requests/member_request.dart'; 4 | import 'package:lakasir/api/responses/members/member_response.dart'; 5 | import 'package:lakasir/services/member_service.dart'; 6 | import 'package:lakasir/widgets/dialog.dart'; 7 | import 'package:lakasir/widgets/text_field.dart'; 8 | 9 | class MemberController extends GetxController { 10 | final MemberService _memberService = MemberService(); 11 | RxList members = [].obs; 12 | final isFetching = false.obs; 13 | final searchByNameController = TextEditingController(); 14 | 15 | Future fetchMembers() async { 16 | isFetching(true); 17 | final response = await _memberService.get(MemberRequest()); 18 | members.assignAll(response); 19 | isFetching(false); 20 | } 21 | 22 | Future searchMember() async { 23 | isFetching(true); 24 | final response = await _memberService.get( 25 | MemberRequest( 26 | name: searchByNameController.text, 27 | ), 28 | ); 29 | members.assignAll(response); 30 | isFetching(false); 31 | } 32 | 33 | void showDialogSearch() { 34 | showDialog( 35 | context: Get.context!, 36 | builder: (context) { 37 | return MyDialog( 38 | noPadding: true, 39 | content: Column( 40 | children: [ 41 | MyTextField( 42 | hintText: 'field_name'.tr, 43 | controller: searchByNameController, 44 | textInputAction: TextInputAction.search, 45 | onSubmitted: (value) { 46 | searchMember(); 47 | }, 48 | rightIcon: IconButton( 49 | onPressed: searchMember, 50 | icon: const Icon(Icons.search), 51 | ), 52 | ), 53 | ], 54 | ), 55 | ); 56 | }, 57 | ); 58 | } 59 | 60 | @override 61 | void onInit() { 62 | super.onInit(); 63 | fetchMembers(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/controllers/notification_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/responses/notifications/notification_response.dart'; 3 | import 'package:lakasir/services/notification_service.dart'; 4 | import 'package:lakasir/utils/utils.dart'; 5 | 6 | class NotificationController extends GetxController { 7 | RxList notifications = [].obs; 8 | final NotificationService _notificationService = NotificationService(); 9 | 10 | void fetch() async { 11 | var response = await _notificationService.get(); 12 | 13 | notifications.value = response; 14 | } 15 | 16 | void create(NotificationRequest request) async { 17 | fetch(); 18 | } 19 | 20 | void clear() async { 21 | await _notificationService.clear(); 22 | fetch(); 23 | show('notification_cleared'.tr); 24 | } 25 | 26 | void delete(NotificationResponse notification, int id) async { 27 | await _notificationService.delete(notification, id); 28 | fetch(); 29 | } 30 | 31 | void createMany(List request) { 32 | fetch(); 33 | } 34 | } 35 | 36 | class NotificationRequest { 37 | final String? title; 38 | final String? body; 39 | final String? data; 40 | 41 | NotificationRequest({ 42 | this.title, 43 | this.body, 44 | this.data, 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /lib/controllers/payment_method_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/responses/payment_methods/payment_method_response.dart'; 3 | import 'package:lakasir/services/payment_method_service.dart'; 4 | 5 | class PaymentMethodController extends GetxController { 6 | RxList paymentMethods = [].obs; 7 | final _paymentMethodService = PaymentMethodService(); 8 | RxBool isFetching = false.obs; 9 | 10 | Future fetchPaymentMethods() async { 11 | isFetching(true); 12 | final response = await _paymentMethodService.get(); 13 | paymentMethods.assignAll(response); 14 | isFetching(false); 15 | } 16 | 17 | @override 18 | void onInit() { 19 | fetchPaymentMethods(); 20 | super.onInit(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/controllers/products/unit_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/models/lakasir_database.dart'; 3 | import 'package:lakasir/models/unit.dart'; 4 | 5 | class UnitController extends GetxController { 6 | RxList units = [].obs; 7 | 8 | void fetchUnits() async { 9 | var results = await LakasirDatabase().unit.fetch(); 10 | 11 | units.assignAll(results); 12 | } 13 | 14 | void createOrUpdateUnit(String name) async { 15 | var unit = Unit() 16 | ..name = name 17 | ..updatedAt = DateTime.now(); 18 | await LakasirDatabase().unit.create(unit); 19 | fetchUnits(); 20 | } 21 | 22 | void clearUnit() async { 23 | await LakasirDatabase().unit.clear(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/controllers/profiles/profile_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/responses/auths/profile_response.dart'; 3 | import 'package:lakasir/services/profile_service.dart'; 4 | 5 | class ProfileController extends GetxController { 6 | Rx profile = ProfileResponse().obs; 7 | final ProfileService _profileService = ProfileService(); 8 | Rx isLoading = false.obs; 9 | 10 | Future getProfile() async { 11 | isLoading(true); 12 | final response = await _profileService.get(); 13 | profile(response); 14 | update(); 15 | isLoading(false); 16 | } 17 | 18 | @override 19 | void onInit() { 20 | super.onInit(); 21 | getProfile(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/controllers/setting_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/responses/setting_response.dart'; 3 | import 'package:lakasir/controllers/transactions/cash_drawer_controller.dart'; 4 | import 'package:lakasir/services/setting_service.dart'; 5 | 6 | class SettingController extends GetxController { 7 | Rx settingResponse = SettingResponse().obs; 8 | final SettingService _settingService = SettingService(); 9 | final _cashDrawerController = Get.put(CashDrawerController()); 10 | Rx setting = Setting().obs; 11 | 12 | void getSetting(String key) async { 13 | final response = await _settingService.get(key); 14 | settingResponse(response); 15 | } 16 | 17 | void getAllSetting() async { 18 | final response = await _settingService.getAll(); 19 | setting(response); 20 | } 21 | 22 | void updateSetting(String key, dynamic value) async { 23 | await _settingService.set(SettingRequest(key: key, value: value)); 24 | getAllSetting(); 25 | getSetting(key); 26 | } 27 | 28 | @override 29 | void onInit() { 30 | getAllSetting(); 31 | super.onInit(); 32 | } 33 | 34 | @override 35 | void onReady() { 36 | if (setting.value.cashDrawerEnabled) { 37 | _cashDrawerController.showCashDrawerDialog(); 38 | } 39 | super.onReady(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/controllers/transactions/analytics/analytics_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/responses/transactions/analytics/total_gross_profit_response.dart'; 3 | import 'package:lakasir/api/responses/transactions/analytics/total_revenue_response.dart'; 4 | import 'package:lakasir/api/responses/transactions/analytics/total_sales_response.dart'; 5 | import 'package:lakasir/services/analytics_service.dart'; 6 | 7 | class AnalyticsController extends GetxController { 8 | final _analyticsService = AnalyticsService(); 9 | final Rx totalRevenue = TotalRevenueResponse().obs; 10 | RxBool isTotalRevenueLoading = false.obs; 11 | final Rx totalSales = TotalSalesResponse().obs; 12 | RxBool isTotalSalesLoading = false.obs; 13 | final Rx totalGrossProfit = 14 | TotalGrossProfitRespnose().obs; 15 | RxBool isTotalGrossProfitLoading = false.obs; 16 | 17 | void fetchTotalRevenue({String filterType = "today"}) async { 18 | isTotalRevenueLoading.value = true; 19 | totalRevenue.value = await _analyticsService.fetchTotalRevenue(filterType); 20 | isTotalRevenueLoading.value = false; 21 | } 22 | 23 | void fetchTotalSales({String filterType = "today"}) async { 24 | isTotalSalesLoading.value = true; 25 | totalSales.value = await _analyticsService.fetchTotalSales(filterType); 26 | isTotalSalesLoading.value = false; 27 | } 28 | 29 | void fetchTotalGrossProfit({String filterType = "today"}) async { 30 | isTotalGrossProfitLoading.value = true; 31 | totalGrossProfit.value = await _analyticsService.fetchTotalGrossProfit(filterType); 32 | isTotalGrossProfitLoading.value = false; 33 | } 34 | 35 | @override 36 | void onInit() { 37 | fetchTotalRevenue(); 38 | fetchTotalSales(); 39 | fetchTotalGrossProfit(); 40 | super.onInit(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/controllers/transactions/history_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/requests/pagination_request.dart'; 3 | import 'package:lakasir/api/responses/payment_methods/payment_method_response.dart'; 4 | import 'package:lakasir/api/responses/transactions/history_response.dart'; 5 | import 'package:lakasir/services/history_service.dart'; 6 | 7 | class HistoryController extends GetxController { 8 | RxBool isLoading = false.obs; 9 | final _historyService = HistoryService(); 10 | RxList histories = 11 | [].obs; 12 | Rx transaction = TransactionHistoryResponse( 13 | id: 0, 14 | friendPrice: false, 15 | paymentMethodId: 0, 16 | ).obs; 17 | int perPage = 20; 18 | 19 | Future fetchTransaction(PaginationRequest request) async { 20 | isLoading.value = true; 21 | final response = await _historyService.get(request); 22 | histories.value = response.data!; 23 | isLoading.value = false; 24 | } 25 | 26 | // @override 27 | // void onInit() { 28 | // fetchTransaction(PaginationRequest(page: 1, perPage: perPage)); 29 | // super.onInit(); 30 | // } 31 | } 32 | -------------------------------------------------------------------------------- /lib/controllers/transactions/reports/cashier_report_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class CashierReportController extends GetxController {} 4 | -------------------------------------------------------------------------------- /lib/firebase_options.dart: -------------------------------------------------------------------------------- 1 | // File generated by FlutterFire CLI. 2 | // ignore_for_file: type=lint 3 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; 4 | import 'package:flutter/foundation.dart' 5 | show defaultTargetPlatform, kIsWeb, TargetPlatform; 6 | 7 | /// Default [FirebaseOptions] for use with your Firebase apps. 8 | /// 9 | /// Example: 10 | /// ```dart 11 | /// import 'firebase_options.dart'; 12 | /// // ... 13 | /// await Firebase.initializeApp( 14 | /// options: DefaultFirebaseOptions.currentPlatform, 15 | /// ); 16 | /// ``` 17 | class DefaultFirebaseOptions { 18 | static FirebaseOptions get currentPlatform { 19 | if (kIsWeb) { 20 | throw UnsupportedError( 21 | 'DefaultFirebaseOptions have not been configured for web - ' 22 | 'you can reconfigure this by running the FlutterFire CLI again.', 23 | ); 24 | } 25 | switch (defaultTargetPlatform) { 26 | case TargetPlatform.android: 27 | return android; 28 | case TargetPlatform.iOS: 29 | throw UnsupportedError( 30 | 'DefaultFirebaseOptions have not been configured for ios - ' 31 | 'you can reconfigure this by running the FlutterFire CLI again.', 32 | ); 33 | case TargetPlatform.macOS: 34 | throw UnsupportedError( 35 | 'DefaultFirebaseOptions have not been configured for macos - ' 36 | 'you can reconfigure this by running the FlutterFire CLI again.', 37 | ); 38 | case TargetPlatform.windows: 39 | throw UnsupportedError( 40 | 'DefaultFirebaseOptions have not been configured for windows - ' 41 | 'you can reconfigure this by running the FlutterFire CLI again.', 42 | ); 43 | case TargetPlatform.linux: 44 | throw UnsupportedError( 45 | 'DefaultFirebaseOptions have not been configured for linux - ' 46 | 'you can reconfigure this by running the FlutterFire CLI again.', 47 | ); 48 | default: 49 | throw UnsupportedError( 50 | 'DefaultFirebaseOptions are not supported for this platform.', 51 | ); 52 | } 53 | } 54 | 55 | static const FirebaseOptions android = FirebaseOptions( 56 | apiKey: 'AIzaSyCEeawbXxkbIRYGvnkalmYhn2zybp6mD-Y', 57 | appId: '1:98840745074:android:16d26e821ce5c512dddeeb', 58 | messagingSenderId: '98840745074', 59 | projectId: 'lakasir-pos', 60 | storageBucket: 'lakasir-pos.appspot.com', 61 | ); 62 | 63 | } -------------------------------------------------------------------------------- /lib/models/lakasir_database.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:isar/isar.dart'; 3 | import 'package:lakasir/models/printer.dart'; 4 | import 'package:lakasir/models/unit.dart'; 5 | import 'package:path_provider/path_provider.dart'; 6 | 7 | class LakasirDatabase extends ChangeNotifier { 8 | static late Isar isar; 9 | 10 | static Future initialize() async { 11 | final dir = await getApplicationDocumentsDirectory(); 12 | var instance = Isar.getInstance("isar"); 13 | 14 | if (instance == null) { 15 | isar = await Isar.open( 16 | [PrinterSchema, UnitSchema], 17 | directory: dir.path, 18 | name: 'isar', 19 | ); 20 | } 21 | } 22 | 23 | Unit get unit { 24 | return Unit(isar: isar); 25 | } 26 | 27 | Printer get printer { 28 | return Printer(isar: isar); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/models/printer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:isar/isar.dart'; 4 | 5 | part 'printer.g.dart'; 6 | 7 | @collection 8 | class Printer { 9 | Id id = Isar.autoIncrement; 10 | 11 | String? name; 12 | String? logopath; 13 | String? address; 14 | String? footer; 15 | 16 | @ignore 17 | final Isar? isar; 18 | 19 | Printer({this.isar}); 20 | 21 | Future> fetch() async { 22 | final results = await isar!.printers.where().findAll(); 23 | 24 | return results; 25 | } 26 | 27 | Future create(Printer printer) async { 28 | await isar!.writeTxn(() => isar!.printers.put(printer)); 29 | 30 | fetch(); 31 | } 32 | 33 | Future delete(Printer printer) async { 34 | // how to delete the logo path from local path 35 | 36 | if (printer.logopath != null) File(printer.logopath!).delete(); 37 | await isar!.writeTxn(() => isar!.printers.delete(printer.id)); 38 | fetch(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/models/unit.dart: -------------------------------------------------------------------------------- 1 | import 'package:isar/isar.dart'; 2 | 3 | part 'unit.g.dart'; 4 | 5 | @collection 6 | class Unit { 7 | Id id = Isar.autoIncrement; 8 | 9 | String? name; 10 | DateTime? updatedAt; 11 | 12 | @ignore 13 | final Isar? isar; 14 | 15 | Unit({this.isar}); 16 | 17 | Future> fetch() async { 18 | final results = 19 | await isar!.units.where().sortByUpdatedAtDesc().limit(3).findAll(); 20 | return results; 21 | } 22 | 23 | Future create(Unit unit) async { 24 | await isar!.writeTxn(() async { 25 | var existingUnit = 26 | (await isar!.units.where().filter().nameEqualTo(unit.name).findAll()) 27 | .firstOrNull; 28 | existingUnit?.updatedAt = unit.updatedAt; 29 | await isar!.units.put(existingUnit ?? unit); 30 | }); 31 | } 32 | 33 | Future clear() async { 34 | await isar!.writeTxn(() async { 35 | final results = await isar!.units.where().findAll(); 36 | await isar!.units.deleteAll(results.map((e) => e.id).toList()); 37 | }); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/screens/auth_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lakasir/screens/domain/setup_screen.dart'; 3 | import 'package:lakasir/screens/login_screen.dart'; 4 | import 'package:lakasir/screens/menu_screen.dart'; 5 | import 'package:lakasir/screens/onboard_screen.dart'; 6 | import 'package:lakasir/utils/auth.dart'; 7 | 8 | class AuthScreen extends StatefulWidget { 9 | const AuthScreen({super.key}); 10 | 11 | @override 12 | State createState() => _AuthScreenState(); 13 | } 14 | 15 | class _AuthScreenState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return FutureBuilder( 19 | future: checkAuthentication(), 20 | builder: (context, snapshot) { 21 | if (snapshot.connectionState == ConnectionState.waiting) { 22 | return const CircularProgressIndicator(); 23 | } else if (snapshot.hasError) { 24 | return Text('Error: ${snapshot.error}'); 25 | } else if (snapshot.data == "setup") { 26 | return const OnboardingScreen(); 27 | } else if (snapshot.data == "login") { 28 | return const LoginScreen(); 29 | } else { 30 | return const MenuScreen(); 31 | } 32 | }, 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/screens/members/add_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/controllers/members/member_add_controller.dart'; 4 | import 'package:lakasir/screens/members/member_form.dart'; 5 | import 'package:lakasir/widgets/layout.dart'; 6 | 7 | class AddMemberScreen extends StatefulWidget { 8 | const AddMemberScreen({super.key}); 9 | 10 | @override 11 | State createState() => _AddMemberScreenState(); 12 | } 13 | 14 | class _AddMemberScreenState extends State { 15 | final MemberAddController _memberAddController = Get.put( 16 | MemberAddController(), 17 | ); 18 | 19 | @override 20 | void didChangeDependencies() { 21 | super.didChangeDependencies(); 22 | } 23 | 24 | @override 25 | void dispose() { 26 | _memberAddController.clear(); 27 | super.dispose(); 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return Layout( 33 | resizeToAvoidBottomInset: true, 34 | title: 'global_add_item'.trParams({ 35 | 'item': 'menu_member'.tr, 36 | }), 37 | child: MemberForm( 38 | controller: _memberAddController, 39 | onPressed: _memberAddController.addMember, 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/screens/members/edit_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/controllers/members/member_update_controller.dart'; 4 | import 'package:lakasir/screens/members/member_form.dart'; 5 | import 'package:lakasir/widgets/layout.dart'; 6 | 7 | class EditMemberScreen extends StatefulWidget { 8 | const EditMemberScreen({super.key}); 9 | 10 | @override 11 | State createState() => _EditMemberScreenState(); 12 | } 13 | 14 | class _EditMemberScreenState extends State { 15 | final MemberUpdateController _memberUpdateController = Get.put( 16 | MemberUpdateController(), 17 | ); 18 | 19 | @override 20 | void didChangeDependencies() { 21 | super.didChangeDependencies(); 22 | _memberUpdateController.setData(); 23 | } 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Layout( 28 | title: 'Edit Member', 29 | resizeToAvoidBottomInset: true, 30 | child: MemberForm( 31 | controller: _memberUpdateController, 32 | onPressed: _memberUpdateController.updateMember, 33 | isUpdate: true, 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/screens/products/add_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/controllers/products/product_add_controller.dart'; 4 | import 'package:lakasir/screens/products/product_form.dart'; 5 | import 'package:lakasir/widgets/layout.dart'; 6 | 7 | class AddProductScreen extends StatefulWidget { 8 | const AddProductScreen({super.key}); 9 | 10 | @override 11 | State createState() => _AddProductScreenState(); 12 | } 13 | 14 | class _AddProductScreenState extends State { 15 | final ProductAddEditController _productAddController = 16 | Get.put(ProductAddEditController()); 17 | 18 | @override 19 | void dispose() { 20 | _productAddController.clearInput(); 21 | super.dispose(); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Layout( 27 | resizeToAvoidBottomInset: true, 28 | title: 'product_add'.tr, 29 | child: Form( 30 | key: _productAddController.formKey, 31 | child: ProductForm( 32 | onSubmit: () => _productAddController.create(), 33 | controller: _productAddController, 34 | ), 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/screens/products/edit_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/controllers/products/product_add_controller.dart'; 4 | import 'package:lakasir/screens/products/product_form.dart'; 5 | import 'package:lakasir/widgets/layout.dart'; 6 | 7 | class EditProductScreen extends StatefulWidget { 8 | const EditProductScreen({super.key}); 9 | 10 | @override 11 | State createState() => _EditProductScreenState(); 12 | } 13 | 14 | class _EditProductScreenState extends State { 15 | final ProductAddEditController _productAddEditController = 16 | Get.put(ProductAddEditController()); 17 | 18 | @override 19 | void initState() { 20 | _productAddEditController.setData(); 21 | super.initState(); 22 | } 23 | 24 | @override 25 | void dispose() { 26 | super.dispose(); 27 | _productAddEditController.clearInput(); 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return Layout( 33 | title: 'product_edit'.tr, 34 | resizeToAvoidBottomInset: true, 35 | child: Form( 36 | key: _productAddEditController.formKey, 37 | child: ProductForm(onSubmit: () => _productAddEditController.edit(), controller: _productAddEditController), 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/screens/setting/layout_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/widgets/layout.dart'; 4 | 5 | class LayoutScreen extends StatelessWidget { 6 | const LayoutScreen({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Layout(title: 'setting_system_layout'.tr, child: Container()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/screens/setting/menus/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:heroicons/heroicons.dart'; 4 | import 'package:lakasir/utils/colors.dart'; 5 | import 'package:lakasir/widgets/my_card_list.dart'; 6 | 7 | class ProductSetting extends StatelessWidget { 8 | const ProductSetting({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Column( 13 | crossAxisAlignment: CrossAxisAlignment.start, 14 | children: [ 15 | Container( 16 | margin: const EdgeInsets.only(top: 10), 17 | child: Text("menu_product".tr, style: const TextStyle(fontSize: 20)), 18 | ), 19 | Container( 20 | margin: const EdgeInsets.only(top: 15), 21 | child: MyCardList( 22 | onTap: () { 23 | Get.toNamed("/menu/setting/hide_initial_price"); 24 | }, 25 | imagebox: Container( 26 | width: 52, 27 | height: 52, 28 | decoration: const BoxDecoration( 29 | color: primary, 30 | borderRadius: BorderRadius.all( 31 | Radius.circular(10), 32 | ), 33 | ), 34 | child: const HeroIcon( 35 | HeroIcons.eyeSlash, 36 | color: Colors.white, 37 | size: 32, 38 | ), 39 | ), 40 | list: [ 41 | Row( 42 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 43 | children: [ 44 | Text( 45 | "setting_secure_initial_price".tr, 46 | style: const TextStyle(fontSize: 20), 47 | ), 48 | const Icon( 49 | Icons.arrow_forward_ios_rounded, 50 | ), 51 | ], 52 | ), 53 | ], 54 | ), 55 | ), 56 | ], 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/screens/setting/selling_methods/fifo_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/widgets/my_card_list.dart'; 4 | 5 | class FifoScreen extends StatelessWidget { 6 | const FifoScreen({super.key, this.isEnable = false, this.onChanged}); 7 | 8 | final bool isEnable; 9 | final Function(bool)? onChanged; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Column( 14 | crossAxisAlignment: CrossAxisAlignment.start, 15 | children: [ 16 | const SizedBox(height: 10), 17 | Text( 18 | "fifo_info".tr, 19 | ), 20 | const SizedBox(height: 10), 21 | Text( 22 | "fifo_price_info".tr, 23 | ), 24 | MyCardList(list: [ 25 | Row( 26 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 27 | children: [ 28 | Text("global_enable_it".tr), 29 | Switch( 30 | value: isEnable, 31 | onChanged: onChanged, 32 | ), 33 | ], 34 | ), 35 | ]) 36 | ], 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/screens/setting/selling_methods/lifo_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/widgets/my_card_list.dart'; 4 | 5 | class LifoScreen extends StatelessWidget { 6 | const LifoScreen({super.key, this.isEnable = false, this.onChanged}); 7 | 8 | final bool isEnable; 9 | final Function(bool)? onChanged; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Column( 14 | crossAxisAlignment: CrossAxisAlignment.start, 15 | children: [ 16 | const SizedBox(height: 10), 17 | Text( 18 | "lifo_info".tr, 19 | ), 20 | const SizedBox(height: 10), 21 | Text( 22 | "lifo_price_info".tr, 23 | ), 24 | MyCardList(list: [ 25 | Row( 26 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 27 | children: [ 28 | Text("global_enable_it".tr), 29 | Switch( 30 | value: isEnable, 31 | onChanged: onChanged, 32 | ), 33 | ], 34 | ), 35 | ]) 36 | ], 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/screens/setting/selling_methods/normal_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/widgets/my_card_list.dart'; 4 | 5 | class NormalScreen extends StatelessWidget { 6 | const NormalScreen({super.key, this.isEnable = false, this.onChanged}); 7 | 8 | final bool isEnable; 9 | final Function(bool)? onChanged; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Column( 14 | crossAxisAlignment: CrossAxisAlignment.start, 15 | children: [ 16 | const SizedBox(height: 10), 17 | Text( 18 | "normal_info".tr, 19 | ), 20 | const SizedBox(height: 10), 21 | Text( 22 | "normal_price_info".tr, 23 | ), 24 | MyCardList(list: [ 25 | Row( 26 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 27 | children: [ 28 | Text("global_enable_it".tr), 29 | Switch( 30 | value: isEnable, 31 | onChanged: onChanged, 32 | ), 33 | ], 34 | ), 35 | ]) 36 | ], 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/screens/setting/setting_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/controllers/auths/auth_controller.dart'; 4 | import 'package:lakasir/controllers/setting_controller.dart'; 5 | import 'package:lakasir/screens/setting/menus/auth.dart'; 6 | import 'package:lakasir/screens/setting/menus/general.dart'; 7 | import 'package:lakasir/screens/setting/menus/product.dart'; 8 | import 'package:lakasir/screens/setting/menus/system.dart'; 9 | import 'package:lakasir/screens/setting/menus/transaction.dart'; 10 | import 'package:lakasir/utils/auth.dart'; 11 | import 'package:lakasir/widgets/layout.dart'; 12 | 13 | class SettingScreen extends StatefulWidget { 14 | const SettingScreen({super.key}); 15 | 16 | @override 17 | State createState() => _SettingScreenState(); 18 | } 19 | 20 | class _SettingScreenState extends State { 21 | final SettingController settingController = Get.put(SettingController()); 22 | final AuthController _authController = Get.put(AuthController()); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Layout( 27 | title: 'setting'.tr, 28 | child: ListView.separated( 29 | itemCount: 1, 30 | itemBuilder: (context, index) { 31 | return Column( 32 | crossAxisAlignment: CrossAxisAlignment.start, 33 | children: [ 34 | if (can(_authController.permissions, ability: 'read category') || 35 | can(_authController.permissions, ability: 'update currency')) 36 | GeneralSetting(authController: _authController), 37 | const SystemSetting(), 38 | if (can(_authController.permissions, 39 | ability: 'enable cash drawer') || 40 | can(_authController.permissions, 41 | ability: 'set default tax') || 42 | can(_authController.permissions, 43 | ability: 'set selling method')) 44 | if (_authController.feature(feature: 'product-initial-price')) 45 | const TransactionSetting(), 46 | if (_authController.can( 47 | ability: 'enable secure initial price', 48 | feature: 'product-initial-price', 49 | )) 50 | const ProductSetting(), 51 | const AuthSetting(), 52 | ], 53 | ); 54 | }, 55 | separatorBuilder: (context, index) { 56 | return const Divider(); 57 | }, 58 | ), 59 | ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/screens/transactions/carts/cart_menu_scren/cart_control_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/controllers/transactions/cart_controller.dart'; 4 | import 'package:lakasir/screens/transactions/carts/cart_menu_scren/cart_list.dart'; 5 | import 'package:lakasir/screens/transactions/carts/cart_menu_scren/detail_field.dart'; 6 | import 'package:lakasir/screens/transactions/carts/cart_menu_scren/sub_total_field.dart'; 7 | 8 | class CartControlWidget extends StatefulWidget { 9 | const CartControlWidget({ 10 | super.key, 11 | }); 12 | 13 | @override 14 | State createState() => _CartControlWidgetState(); 15 | } 16 | 17 | class _CartControlWidgetState extends State { 18 | final _cartController = Get.put(CartController()); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Obx( 23 | () { 24 | final cartItems = _cartController.cartSessions.value.cartItems; 25 | 26 | return SingleChildScrollView( 27 | child: Column( 28 | children: [ 29 | for (var i = 0; i < cartItems.length; i++) 30 | CartList( 31 | cartItem: cartItems[i], 32 | ), 33 | SubTotalField(cartController: _cartController), 34 | DetailField(), 35 | const SizedBox( 36 | height: 70, 37 | ), 38 | ], 39 | ), 40 | ); 41 | }, 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/screens/transactions/carts/cart_menu_scren/payment_calculator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/controllers/transactions/cart_controller.dart'; 4 | import 'package:lakasir/utils/utils.dart'; 5 | import 'package:lakasir/widgets/calculator_payment_button.dart'; 6 | 7 | class PaymentCalculator extends StatefulWidget { 8 | const PaymentCalculator({ 9 | super.key, 10 | }); 11 | 12 | @override 13 | State createState() => _PaymentCalculatorState(); 14 | } 15 | 16 | class _PaymentCalculatorState extends State { 17 | final _cartController = Get.put(CartController()); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return SingleChildScrollView( 22 | child: Column( 23 | children: [ 24 | Obx( 25 | () => Text( 26 | formatPrice( 27 | _cartController.cartSessions.value.payedMoney!, 28 | isSymbol: false, 29 | ), 30 | style: const TextStyle( 31 | fontSize: 47, 32 | fontWeight: FontWeight.bold, 33 | ), 34 | ), 35 | ), 36 | const SizedBox( 37 | height: 40, 38 | ), 39 | Center( 40 | child: SizedBox( 41 | width: Get.width * (!context.isPhone ? 30 : 100) / 100, 42 | child: CalculatorPaymentButton( 43 | onUpdated: (String value) { 44 | _cartController.cartSessions.update((val) { 45 | val!.payedMoney = double.parse(value); 46 | }); 47 | }, 48 | ), 49 | ), 50 | ), 51 | ], 52 | ), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/screens/transactions/carts/payment_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:lakasir/controllers/transactions/cart_controller.dart'; 4 | import 'package:lakasir/screens/transactions/carts/cart_menu_scren/payment_calculator.dart'; 5 | import 'package:lakasir/screens/transactions/carts/dialog/confirm_alert_dialog.dart'; 6 | import 'package:lakasir/utils/colors.dart'; 7 | import 'package:lakasir/utils/utils.dart'; 8 | import 'package:lakasir/widgets/layout.dart'; 9 | import 'package:lakasir/widgets/my_bottom_bar.dart'; 10 | 11 | class PaymentScreen extends StatefulWidget { 12 | const PaymentScreen({super.key}); 13 | 14 | @override 15 | State createState() => _PaymentScreenState(); 16 | } 17 | 18 | class _PaymentScreenState extends State { 19 | final _cartController = Get.put(CartController()); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | var cartSession = _cartController.cartSessions.value; 24 | var subTotalPrice = cartSession.getTotalPrice; 25 | 26 | return Layout( 27 | title: "Total: ${formatPrice(subTotalPrice)}", 28 | bottomNavigationBar: MyBottomBar( 29 | onPressed: () { 30 | if (cartSession.payedMoney! < subTotalPrice) { 31 | Get.rawSnackbar( 32 | message: 'Payed money is not enough', 33 | backgroundColor: error, 34 | duration: const Duration(seconds: 2), 35 | ); 36 | return; 37 | } 38 | openSunmiCashDrawer(); 39 | Get.dialog(ConfirmAlertDialog()); 40 | }, 41 | label: Text( 42 | "Pay it".tr, 43 | ), 44 | icon: Icons.check, 45 | ), 46 | child: const PaymentCalculator(), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/services/about_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/requests/about_request.dart'; 3 | import 'package:lakasir/api/responses/abouts/about_response.dart'; 4 | import 'package:lakasir/api/responses/api_response.dart'; 5 | import 'package:lakasir/utils/auth.dart'; 6 | 7 | class AboutService { 8 | Future get() async { 9 | final response = await ApiService(await getDomain()).fetchData('about'); 10 | final apiResponse = ApiResponse.fromJson( 11 | response, 12 | (json) { 13 | return AboutResponse.fromJson(json); 14 | }, 15 | ); 16 | 17 | return apiResponse.data!.value; 18 | } 19 | 20 | Future update(AboutRequest data) async { 21 | await ApiService(await getDomain()).putData('about', data.toJson()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/services/analytics_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/responses/api_response.dart'; 3 | import 'package:lakasir/api/responses/transactions/analytics/total_gross_profit_response.dart'; 4 | import 'package:lakasir/api/responses/transactions/analytics/total_revenue_response.dart'; 5 | import 'package:lakasir/api/responses/transactions/analytics/total_sales_response.dart'; 6 | import 'package:lakasir/utils/auth.dart'; 7 | 8 | class AnalyticsService { 9 | Future fetchTotalRevenue(String filterType) async { 10 | String tzName = DateTime.now().timeZoneName; 11 | final response = await ApiService(await getDomain()).fetchData( 12 | 'transaction/dashboard/total-revenue?filter_type=$filterType&timezone=$tzName'); 13 | 14 | final apiResponse = ApiResponse.fromJson(response, (json) { 15 | return TotalRevenueResponse.fromJson(json); 16 | }); 17 | 18 | return apiResponse.data!.value; 19 | } 20 | 21 | Future fetchTotalGrossProfit( 22 | String filterType) async { 23 | String tzName = DateTime.now().timeZoneName; 24 | final response = await ApiService(await getDomain()).fetchData( 25 | 'transaction/dashboard/total-gross-profit?filter_type=$filterType&timezone=$tzName'); 26 | 27 | final apiResponse = ApiResponse.fromJson(response, (json) { 28 | return TotalGrossProfitRespnose.fromJson(json); 29 | }); 30 | 31 | return apiResponse.data!.value; 32 | } 33 | 34 | Future fetchTotalSales(String filterType) async { 35 | String tzName = DateTime.now().timeZoneName; 36 | final response = await ApiService(await getDomain()).fetchData( 37 | 'transaction/dashboard/total-sales?filter_type=$filterType&timezone=$tzName'); 38 | 39 | final apiResponse = ApiResponse.fromJson(response, (json) { 40 | return TotalSalesResponse.fromJson(json); 41 | }); 42 | 43 | return apiResponse.data!.value; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/services/cash_drawer_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/requests/cash_drawer_request.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/cash_drawers/cash_drawer_response.dart'; 5 | import 'package:lakasir/utils/auth.dart'; 6 | 7 | class CashDrawerService { 8 | Future get() async { 9 | final response = await ApiService(await getDomain()).fetchData('transaction/cash-drawer'); 10 | ApiResponse profileResponse = ApiResponse.fromJson( 11 | response, 12 | (json) { 13 | if (json['id'] == null) { 14 | return CashDrawerResponse(); 15 | } 16 | return CashDrawerResponse.fromJson(json); 17 | }, 18 | ); 19 | 20 | if (!profileResponse.success) { 21 | throw Exception('Failed to load data'); 22 | } 23 | 24 | return profileResponse.data!.value; 25 | } 26 | 27 | Future store(CashDrawerRequest cashDrawerRequest) async { 28 | await ApiService(await getDomain()).postData( 29 | 'transaction/cash-drawer', 30 | cashDrawerRequest.toJson(), 31 | ); 32 | } 33 | 34 | Future close() async { 35 | await ApiService(await getDomain()).postData( 36 | 'transaction/cash-drawer/close', {} 37 | ); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /lib/services/category_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/api_service.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/categories/category_response.dart'; 5 | import 'package:lakasir/utils/auth.dart'; 6 | 7 | class CategoryService { 8 | CategoryService(); 9 | 10 | Future> getCategories() async { 11 | final response = 12 | await ApiService(await getDomain()).fetchData('master/category'); 13 | final apiResponse = ApiResponse.fromJsonList(response, (json) { 14 | return RxList.from( 15 | json.map((x) => CategoryResponse.fromJson(x))); 16 | }); 17 | 18 | return apiResponse.data!.value; 19 | } 20 | 21 | Future addCategory(String name) async { 22 | await ApiService(await getDomain()).postData('master/category', { 23 | 'name': name, 24 | }); 25 | } 26 | 27 | Future deleteCategory(int id) async { 28 | await ApiService(await getDomain()).deleteData('master/category/$id'); 29 | } 30 | 31 | Future updateCategory(int id, String name) async { 32 | await ApiService(await getDomain()).putData('master/category/$id', { 33 | 'name': name, 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/services/history_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/requests/pagination_request.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/pagination_response.dart'; 5 | import 'package:lakasir/api/responses/transactions/history_response.dart'; 6 | import 'package:lakasir/utils/auth.dart'; 7 | 8 | class HistoryService { 9 | Future> get( 10 | PaginationRequest request) async { 11 | String tzName = DateTime.now().timeZoneName; 12 | final response = await ApiService(await getDomain()).fetchData( 13 | 'transaction/selling${request.toQuery()}&timezone=$tzName', 14 | ); 15 | 16 | final apiResponse = ApiResponse.fromJson(response, (contentJson) { 17 | return PaginationResponse.fromJson( 18 | contentJson, 19 | (dataJson) { 20 | return TransactionHistoryResponse.fromJson(dataJson); 21 | }, 22 | ); 23 | }); 24 | 25 | return apiResponse.data?.value ?? PaginationResponse(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/services/login_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/requests/login_request.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/auths/login_response.dart'; 5 | import 'package:lakasir/utils/auth.dart'; 6 | 7 | class LoginService { 8 | Future login(LoginRequest loginRequest) async { 9 | final response = await ApiService(await getDomain()).postData( 10 | 'auth/login', 11 | loginRequest.toJson(), 12 | ); 13 | 14 | ApiResponse apiResponse = ApiResponse.fromJson( 15 | response, 16 | (json) => LoginResponse.fromJson(json), 17 | ); 18 | 19 | storeToken(apiResponse.data!.value.token); 20 | } 21 | 22 | void setFcmToken(String fcmToken) async { 23 | ApiService(await getDomain()).postData('register-fcm-token', { 24 | 'fcm_token': fcmToken, 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/services/member_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/api_service.dart'; 3 | import 'package:lakasir/api/requests/member_request.dart'; 4 | import 'package:lakasir/api/responses/api_response.dart'; 5 | import 'package:lakasir/api/responses/members/member_response.dart'; 6 | import 'package:lakasir/utils/auth.dart'; 7 | 8 | class MemberService { 9 | Future> get(MemberRequest? memberRequest) async { 10 | final query = memberRequest?.toQuery(); 11 | final response = 12 | await ApiService(await getDomain()).fetchData('master/member?$query'); 13 | final apiResponse = ApiResponse.fromJsonList(response, (json) { 14 | return RxList.from( 15 | json.map((x) => MemberResponse.fromJson(x))); 16 | }); 17 | 18 | return apiResponse.data!.value; 19 | } 20 | 21 | Future add(MemberRequest request) async { 22 | await ApiService(await getDomain()) 23 | .postData('master/member', request.toJson()); 24 | } 25 | 26 | Future delete(int id) async { 27 | await ApiService(await getDomain()).deleteData('master/member/$id'); 28 | } 29 | 30 | Future update(int id, MemberRequest request) async { 31 | await ApiService(await getDomain()) 32 | .putData('master/member/$id', request.toJson()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/services/notification_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/responses/api_response.dart'; 3 | import 'package:lakasir/api/responses/notifications/notification_response.dart'; 4 | import 'package:lakasir/utils/auth.dart'; 5 | 6 | class NotificationService { 7 | Future> get() async { 8 | final response = await ApiService(await getDomain()).fetchData( 9 | 'notification', 10 | ); 11 | 12 | final apiResponse = ApiResponse.fromJsonList(response, (contentJson) { 13 | return List.from( 14 | contentJson.map((x) => NotificationResponse.fromJson(x))); 15 | }); 16 | 17 | return apiResponse.data?.value ?? []; 18 | } 19 | 20 | Future clear() async { 21 | await ApiService(await getDomain()).deleteData( 22 | 'notification/clear', 23 | ); 24 | } 25 | 26 | Future delete(NotificationResponse notification, int id) async { 27 | await ApiService(await getDomain()).putData( 28 | 'notification/${notification.uuid}/$id', 29 | {}, 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/services/payment_method_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:lakasir/api/api_service.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/payment_methods/payment_method_response.dart'; 5 | import 'package:lakasir/utils/auth.dart'; 6 | 7 | class PaymentMethodService { 8 | Future> get() async { 9 | final response = await await ApiService(await getDomain()) 10 | .fetchData("master/payment-method"); 11 | 12 | final apiResponse = ApiResponse.fromJsonList(response, (json) { 13 | return RxList.from( 14 | json.map((x) => PaymentMethodRespone.fromJson(x))); 15 | }); 16 | 17 | return apiResponse.data!.value; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/services/payment_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/requests/payment_request.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/transactions/history_response.dart'; 5 | import 'package:lakasir/utils/auth.dart'; 6 | 7 | class PaymentSerivce { 8 | Future store( 9 | PaymentRequest paymentRequest) async { 10 | final response = await ApiService(await getDomain()) 11 | .postData("transaction/selling", paymentRequest.toJson()); 12 | 13 | final apiResponse = ApiResponse.fromJson(response, (json) { 14 | return TransactionHistoryResponse.fromJson(json); 15 | }); 16 | 17 | return apiResponse.data!.value; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/services/product_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/requests/product_request.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/pagination_response.dart'; 5 | import 'package:lakasir/api/responses/products/product_response.dart'; 6 | import 'package:lakasir/utils/auth.dart'; 7 | 8 | class ProductService { 9 | Future> get(ProductRequest? productRequest) async { 10 | final response = await ApiService(await getDomain()).fetchData( 11 | 'master/product?${productRequest?.toQuery()}', 12 | ); 13 | 14 | final apiResponse = ApiResponse.fromJson(response, (contentJson) { 15 | return PaginationResponse.fromJson( 16 | contentJson, 17 | (dataJson) { 18 | return ProductResponse.fromJson(dataJson); 19 | }, 20 | ); 21 | }); 22 | 23 | return apiResponse.data?.value ?? PaginationResponse(); 24 | } 25 | 26 | Future create(ProductRequest productRequest) async { 27 | await ApiService(await getDomain()).postData( 28 | 'master/product', 29 | productRequest.toJson(), 30 | ); 31 | } 32 | 33 | Future update(int id, ProductRequest productRequest) async { 34 | await ApiService(await getDomain()).putData( 35 | 'master/product/$id', 36 | productRequest.toJson(), 37 | ); 38 | } 39 | 40 | Future delete(int id) async { 41 | await ApiService(await getDomain()).deleteData( 42 | 'master/product/$id', 43 | ); 44 | } 45 | 46 | Future getById(int id) async { 47 | final response = await ApiService(await getDomain()).fetchData( 48 | 'master/product/$id', 49 | ); 50 | 51 | final apiResponse = ApiResponse.fromJson(response, (contentJson) { 52 | return ProductResponse.fromJson(contentJson); 53 | }); 54 | 55 | return Future.value(apiResponse.data?.value); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/services/product_stock_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/requests/product_stock_request.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/pagination_response.dart'; 5 | import 'package:lakasir/api/responses/products/stocks/stock_response.dart'; 6 | import 'package:lakasir/utils/auth.dart'; 7 | 8 | class ProductStockService { 9 | Future> get(int id) async { 10 | final response = await ApiService(await getDomain()).fetchData( 11 | 'master/product/$id/stock', 12 | ); 13 | 14 | final apiResponse = ApiResponse.fromJson(response, (contentJson) { 15 | return PaginationResponse.fromJson( 16 | contentJson, 17 | (dataJson) { 18 | return StockResponse.fromJson(dataJson); 19 | }, 20 | ); 21 | }); 22 | 23 | return apiResponse.data?.value ?? PaginationResponse(); 24 | } 25 | 26 | Future create(int id, ProductStockRequest? productStockRequest) async { 27 | await ApiService(await getDomain()).postData( 28 | 'master/product/$id/stock', 29 | productStockRequest?.toJson(), 30 | ); 31 | } 32 | 33 | Future delete(int id, int stockId) async { 34 | await ApiService(await getDomain()).deleteData( 35 | 'master/product/$id/stock/$stockId', 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/services/profile_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/requests/profile_request.dart'; 3 | import 'package:lakasir/api/responses/api_response.dart'; 4 | import 'package:lakasir/api/responses/auths/profile_response.dart'; 5 | import 'package:lakasir/utils/auth.dart'; 6 | 7 | class ProfileService { 8 | Future get() async { 9 | final response = await ApiService(await getDomain()).fetchData('auth/me'); 10 | ApiResponse profileResponse = ApiResponse.fromJson( 11 | response, 12 | (json) => ProfileResponse.fromJson(json), 13 | ); 14 | 15 | return profileResponse.data!.value; 16 | } 17 | 18 | Future update(ProfileRequest profileRequest) async { 19 | await ApiService(await getDomain()).putData( 20 | 'auth/me', 21 | profileRequest.toJson(), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/services/secure_initial_price_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/utils/auth.dart'; 3 | 4 | class SecureInitialPriceService { 5 | Future verifyPassword(String text) async{ 6 | await ApiService(await getDomain()).postData( 7 | 'setting/secure-initial-price/verify', 8 | {'password': text}, 9 | ); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/services/setting_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/api/api_service.dart'; 2 | import 'package:lakasir/api/responses/api_response.dart'; 3 | import 'package:lakasir/api/responses/setting_response.dart'; 4 | import 'package:lakasir/utils/auth.dart'; 5 | 6 | class SettingService { 7 | Future get(String key) async { 8 | final response = await ApiService(await getDomain()).fetchData('setting/$key'); 9 | ApiResponse profileResponse = ApiResponse.fromJson( 10 | response, 11 | (json) => SettingResponse.fromJson(json), 12 | ); 13 | 14 | return profileResponse.data!.value; 15 | } 16 | 17 | Future getAll() async { 18 | final response = await ApiService(await getDomain()).fetchData('setting/all'); 19 | ApiResponse profileResponse = ApiResponse.fromJson( 20 | response, 21 | (json) => Setting.fromJson(json), 22 | ); 23 | 24 | return profileResponse.data!.value; 25 | } 26 | 27 | Future set(SettingRequest settingRequest) async { 28 | await ApiService(await getDomain()).postData( 29 | 'setting', 30 | settingRequest.toJson(), 31 | ); 32 | } 33 | } 34 | 35 | class SettingRequest { 36 | final String key; 37 | final dynamic value; 38 | 39 | SettingRequest({ 40 | required this.key, 41 | required this.value, 42 | }); 43 | 44 | Map toJson() => { 45 | 'key': key, 46 | 'value': value, 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /lib/utils/auth.dart: -------------------------------------------------------------------------------- 1 | import 'package:lakasir/config/app.dart'; 2 | import 'package:shared_preferences/shared_preferences.dart'; 3 | 4 | Future checkAuthentication() async { 5 | final setup = await isSetup(); 6 | final token = await getToken(); // Retrieve the user's token 7 | if (!setup) { 8 | return "setup"; 9 | } 10 | 11 | if (token == null) { 12 | return "login"; 13 | } 14 | 15 | return "menu"; 16 | } 17 | 18 | Future logout() async { 19 | final prefs = await SharedPreferences.getInstance(); 20 | await prefs.remove('token'); 21 | await prefs.remove('permissions'); 22 | } 23 | 24 | Future storeToken(String token) async { 25 | final prefs = await SharedPreferences.getInstance(); 26 | await prefs.setString('token', token); 27 | } 28 | 29 | Future getToken() async { 30 | final prefs = await SharedPreferences.getInstance(); 31 | return prefs.getString('token'); 32 | } 33 | 34 | Future getDomain() async { 35 | final prefs = await SharedPreferences.getInstance(); 36 | if (prefs.getString('domain') == null) { 37 | return ""; 38 | } 39 | String certificated = "https://"; 40 | if (environment == "local") { 41 | certificated = "http://"; 42 | } 43 | return "$certificated${prefs.getString('domain')!}/api"; 44 | } 45 | 46 | Future isSetup() async { 47 | final prefs = await SharedPreferences.getInstance(); 48 | return prefs.getBool('setup') ?? false; 49 | } 50 | 51 | Future storeSetup(String domain) async { 52 | final prefs = await SharedPreferences.getInstance(); 53 | await logout(); 54 | await prefs.setBool('setup', true); 55 | await prefs.setString('domain', domain); 56 | } 57 | 58 | bool can(List permissions, {String? ability, String? feature}) { 59 | return permissions.contains(ability); 60 | } 61 | 62 | void destroySetup() async { 63 | final prefs = await SharedPreferences.getInstance(); 64 | await prefs.remove('setup'); 65 | await prefs.remove('domain'); 66 | } 67 | -------------------------------------------------------------------------------- /lib/utils/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const Color primary = Color(0xffff6600); 4 | const Color backgroudWhite = Colors.white; 5 | const Color secondary = Color.fromRGBO(86, 97, 111, 1); 6 | const Color error = Colors.red; 7 | const Color whiteGrey = Color.fromRGBO(235, 235, 235, 1); 8 | const Color grey = Color.fromRGBO(217, 217, 217, 1); 9 | const Color success = Colors.green; 10 | const Color warning = Colors.yellow; 11 | -------------------------------------------------------------------------------- /lib/widgets/build_list_image.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class BuildListImage extends StatelessWidget { 4 | final String? url; 5 | const BuildListImage({super.key, required this.url}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return SizedBox( 10 | height: 90, 11 | width: 90, 12 | child: ClipRRect( 13 | borderRadius: BorderRadius.circular(10), 14 | child: Image.network( 15 | url ?? '', 16 | fit: BoxFit.cover, 17 | frameBuilder: (BuildContext context, Widget child, int? frame, 18 | bool wasSynchronouslyLoaded) { 19 | if (wasSynchronouslyLoaded) { 20 | return child; 21 | } 22 | return AnimatedOpacity( 23 | opacity: frame == null ? 0 : 1, 24 | duration: const Duration(seconds: 1), 25 | curve: Curves.easeOut, 26 | child: child, 27 | ); 28 | }, 29 | errorBuilder: 30 | (BuildContext context, Object exception, StackTrace? stackTrace) { 31 | return Image.asset( 32 | 'assets/no-image-100.png', 33 | fit: BoxFit.cover, 34 | ); 35 | }, 36 | ), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/widgets/card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MyCard extends StatelessWidget { 4 | const MyCard({ 5 | super.key, 6 | required this.child, 7 | }); 8 | final Widget child; 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | padding: const EdgeInsets.all(10), 14 | decoration: BoxDecoration( 15 | borderRadius: BorderRadius.circular(10), 16 | color: Colors.white, 17 | boxShadow: [ 18 | BoxShadow( 19 | color: Colors.grey.withOpacity(0.1), 20 | spreadRadius: 1, 21 | blurRadius: 5, 22 | offset: const Offset(0, 3), 23 | ), 24 | ], 25 | ), 26 | margin: const EdgeInsets.only(bottom: 10), 27 | child: child, 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/widgets/checkbox.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lakasir/utils/colors.dart'; 3 | 4 | typedef MyCallback = void Function(bool); 5 | 6 | class MyCheckbox extends StatefulWidget { 7 | const MyCheckbox({ 8 | super.key, 9 | this.label = "", 10 | required this.onChange, 11 | this.isChecked = false, 12 | }); 13 | final String label; 14 | final MyCallback onChange; 15 | final bool isChecked; 16 | 17 | @override 18 | State createState() => _MyCheckboxState(); 19 | } 20 | 21 | class _MyCheckboxState extends State { 22 | bool isChecked = false; 23 | 24 | @override 25 | void initState() { 26 | super.initState(); 27 | isChecked = widget.isChecked; 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | double widthScreen = MediaQuery.of(context).size.width * 80 / 100; 33 | return InkWell( 34 | highlightColor: Colors.transparent, 35 | splashColor: Colors.transparent, 36 | onTap: () { 37 | setState(() { 38 | isChecked = !isChecked; 39 | }); 40 | widget.onChange(isChecked); 41 | }, 42 | child: Container( 43 | padding: EdgeInsets.zero, 44 | child: Row( 45 | mainAxisSize: MainAxisSize.min, 46 | mainAxisAlignment: MainAxisAlignment.start, 47 | crossAxisAlignment: CrossAxisAlignment.center, 48 | children: [ 49 | Container( 50 | padding: EdgeInsets.zero, 51 | decoration: BoxDecoration( 52 | border: Border.all(color: primary), 53 | borderRadius: BorderRadius.circular(4.0), 54 | color: isChecked ? primary : Colors.white, 55 | ), 56 | child: Icon( 57 | isChecked ? Icons.check : null, 58 | size: 16.0, 59 | color: Colors.white, 60 | ), 61 | ), 62 | const SizedBox(width: 8.0), 63 | if (widget.label.isNotEmpty) 64 | SizedBox( 65 | width: widthScreen.ceil().toDouble(), 66 | child: Text(widget.label), 67 | ), 68 | ], 69 | ), 70 | ), 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/widgets/confirm_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class MyConfirmDialog extends StatelessWidget { 5 | const MyConfirmDialog({ 6 | super.key, 7 | required this.title, 8 | required this.content, 9 | required this.onConfirm, 10 | this.onCancel, 11 | this.confirmText, 12 | this.cancelText, 13 | }); 14 | 15 | final String title; 16 | final Widget content; 17 | final VoidCallback onConfirm; 18 | final VoidCallback? onCancel; 19 | final String? confirmText; 20 | final String? cancelText; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return AlertDialog( 25 | title: Text(title), 26 | content: content, 27 | actions: [ 28 | TextButton( 29 | onPressed: () { 30 | if (onCancel != null) { 31 | onCancel!(); 32 | } else { 33 | Navigator.of(context).pop(); 34 | } 35 | }, 36 | child: Text(cancelText ?? "global_cancel".tr), 37 | ), 38 | TextButton( 39 | onPressed: onConfirm, 40 | child: Text(confirmText ?? "global_confirm".tr), 41 | ), 42 | ], 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/widgets/filled_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lakasir/utils/colors.dart'; 3 | 4 | class MyFilledButton extends StatefulWidget { 5 | final bool? isLoading; 6 | final VoidCallback onPressed; 7 | final Widget child; 8 | final Color? color; 9 | 10 | const MyFilledButton({ 11 | super.key, 12 | this.isLoading = false, 13 | required this.onPressed, 14 | required this.child, 15 | this.color = primary, 16 | }); 17 | 18 | @override 19 | State createState() => _MyFilledButton(); 20 | } 21 | 22 | class _MyFilledButton extends State { 23 | @override 24 | Widget build(BuildContext context) { 25 | return SizedBox( 26 | // margin: const EdgeInsets.only(bottom: 40.0), 27 | width: double.infinity, 28 | child: FilledButton( 29 | onPressed: widget.onPressed, 30 | style: ButtonStyle( 31 | backgroundColor: MaterialStateProperty.all(widget.color!), 32 | shape: MaterialStateProperty.all( 33 | const RoundedRectangleBorder( 34 | borderRadius: BorderRadius.all(Radius.circular(12)), 35 | ), 36 | ), 37 | ), 38 | child: Container( 39 | padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), 40 | height: 50, 41 | child: Row( 42 | mainAxisAlignment: MainAxisAlignment.center, 43 | children: [ 44 | widget.child, 45 | Visibility( 46 | visible: widget.isLoading!, 47 | child: const SizedBox(width: 10), 48 | ), 49 | Visibility( 50 | visible: widget.isLoading!, 51 | child: const SizedBox( 52 | width: 20, 53 | height: 20, 54 | child: CircularProgressIndicator( 55 | backgroundColor: Colors.grey, 56 | valueColor: AlwaysStoppedAnimation(primary), 57 | strokeWidth: 2, 58 | ), 59 | ), 60 | ), 61 | ], 62 | ), 63 | ), 64 | ), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/widgets/my_card_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | 4 | class MyCardList extends StatefulWidget { 5 | const MyCardList({ 6 | super.key, 7 | required this.list, 8 | this.imagebox, 9 | this.route, 10 | this.onTap, 11 | this.trailing, 12 | this.enableFeedback = true, 13 | }); 14 | final String? route; 15 | final List list; 16 | final Widget? imagebox; 17 | final Widget? trailing; 18 | final Function? onTap; 19 | final bool enableFeedback; 20 | 21 | @override 22 | State createState() => _MyCardListState(); 23 | } 24 | 25 | class _MyCardListState extends State { 26 | @override 27 | Widget build(BuildContext context) { 28 | double marginLeft = MediaQuery.of(context).size.width * 4 / 100; 29 | if (widget.imagebox == null) { 30 | marginLeft = 0; 31 | } 32 | return InkWell( 33 | splashColor: widget.enableFeedback 34 | ? Get.theme.primaryColor.withOpacity(0.12) 35 | : Colors.transparent, 36 | splashFactory: widget.enableFeedback 37 | ? InkRipple.splashFactory 38 | : NoSplash.splashFactory, 39 | onLongPress: () {}, 40 | enableFeedback: widget.enableFeedback, 41 | onTap: () { 42 | if (widget.route != null) { 43 | Get.toNamed(widget.route as String); 44 | } 45 | if (widget.onTap != null) { 46 | widget.onTap!(); 47 | } 48 | }, 49 | child: SizedBox( 50 | width: double.infinity, 51 | child: Row( 52 | children: [ 53 | if (widget.imagebox != null) widget.imagebox!, 54 | Flexible( 55 | child: Container( 56 | margin: EdgeInsets.only( 57 | left: marginLeft, 58 | ), 59 | child: Column( 60 | crossAxisAlignment: CrossAxisAlignment.start, 61 | children: widget.list, 62 | ), 63 | ), 64 | ), 65 | if (widget.trailing != null) widget.trailing!, 66 | ], 67 | ), 68 | ), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/widgets/radio_group_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lakasir/utils/colors.dart'; 3 | 4 | class MyRadioGroup extends StatefulWidget { 5 | const MyRadioGroup({ 6 | super.key, 7 | required this.options, 8 | required this.onSelected, 9 | this.defaultSelectedValue = '', 10 | }); 11 | final List options; 12 | final Function(String) onSelected; 13 | final String defaultSelectedValue; 14 | 15 | @override 16 | State createState() => _MyRadioGroupState(); 17 | } 18 | 19 | class _MyRadioGroupState extends State { 20 | String selectedValue = ''; 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | if (widget.defaultSelectedValue != '') { 26 | selectedValue = widget.defaultSelectedValue; 27 | } 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return Row( 33 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 34 | children: [ 35 | for (final option in widget.options) 36 | Row( 37 | children: [ 38 | Container( 39 | width: 20, 40 | margin: const EdgeInsets.only(right: 10), 41 | child: Radio( 42 | toggleable: true, 43 | fillColor: MaterialStateProperty.all(primary), 44 | value: option.value, 45 | groupValue: selectedValue, 46 | onChanged: (value) { 47 | setState(() { 48 | selectedValue = value ?? ""; 49 | }); 50 | widget.onSelected(value!); 51 | }, 52 | ), 53 | ), 54 | GestureDetector( 55 | onTap: () { 56 | setState(() { 57 | selectedValue = option.value; 58 | }); 59 | widget.onSelected(option.value); 60 | }, 61 | child: Text(option.label), 62 | ), 63 | ], 64 | ), 65 | ], 66 | ); 67 | } 68 | } 69 | 70 | class RadioOption { 71 | final String label; 72 | final String value; 73 | 74 | RadioOption({required this.label, required this.value}); 75 | } 76 | 77 | class MyRadioGroupController { 78 | String selectedValue = ''; 79 | void setSelectedValue(String value) { 80 | selectedValue = value; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/widgets/read_more.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | typedef GestureTapCallback = void Function(); 4 | 5 | class ReadMoreText extends StatefulWidget { 6 | final String text; 7 | final int maxLength; 8 | final String readMoreText; 9 | final TextStyle? textStyle; 10 | 11 | final GestureTapCallback? onTap; 12 | 13 | const ReadMoreText({ 14 | super.key, 15 | required this.text, 16 | required this.maxLength, 17 | this.readMoreText = '... Read more', 18 | this.textStyle, 19 | this.onTap, 20 | }); 21 | 22 | @override 23 | State createState() => _ReadMoreTextState(); 24 | } 25 | 26 | class _ReadMoreTextState extends State { 27 | @override 28 | Widget build(BuildContext context) { 29 | String displayText = 30 | '${widget.text.substring(0, widget.maxLength)} \n\n${widget.readMoreText}'; 31 | 32 | return GestureDetector( 33 | onTap: widget.onTap, 34 | child: Text( 35 | displayText, 36 | style: widget.textStyle, 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/widgets/shimmer_loading.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lakasir/utils/utils.dart'; 3 | 4 | class ShimmerLoading extends StatefulWidget { 5 | const ShimmerLoading({ 6 | super.key, 7 | required this.isLoading, 8 | required this.child, 9 | }); 10 | 11 | final bool isLoading; 12 | final Widget child; 13 | 14 | @override 15 | State createState() => _ShimmerLoadingState(); 16 | } 17 | 18 | class _ShimmerLoadingState extends State { 19 | @override 20 | Widget build(BuildContext context) { 21 | if (!widget.isLoading) { 22 | return widget.child; 23 | } 24 | 25 | return ShaderMask( 26 | blendMode: BlendMode.srcATop, 27 | shaderCallback: (bounds) { 28 | return shimmerGradient.createShader(bounds); 29 | }, 30 | child: widget.child, 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/widgets/simple_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SimpleButton extends StatelessWidget { 4 | const SimpleButton({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | // TODO: implement build 9 | throw UnimplementedError(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/widgets/upgrade_popup.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class UpgradePopup extends StatelessWidget { 4 | final String currentVersion; 5 | final String latestVersion; 6 | 7 | const UpgradePopup({ 8 | super.key, 9 | required this.currentVersion, 10 | required this.latestVersion, 11 | }); 12 | 13 | Future checkForUpgrade(BuildContext context) async { 14 | if (currentVersion != latestVersion) { 15 | showDialog( 16 | context: context, 17 | builder: (BuildContext context) { 18 | return AlertDialog( 19 | title: const Text('New Version Available'), 20 | content: const Text( 21 | 'A new version of the app is available. Please upgrade to the latest version.'), 22 | actions: [ 23 | TextButton( 24 | onPressed: () { 25 | Navigator.of(context).pop(); // Close the dialog 26 | }, 27 | child: const Text('Upgrade'), 28 | ), 29 | ], 30 | ); 31 | }, 32 | ); 33 | } 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | checkForUpgrade(context); 39 | return Container(); // Return your actual widget here 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void fl_register_plugins(FlPluginRegistry* registry) { 14 | g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = 15 | fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); 16 | file_selector_plugin_register_with_registrar(file_selector_linux_registrar); 17 | g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar = 18 | fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin"); 19 | isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar); 20 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 21 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 22 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 23 | } 24 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | file_selector_linux 7 | isar_flutter_libs 8 | url_launcher_linux 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import blue_thermal_printer 9 | import file_selector_macos 10 | import firebase_core 11 | import firebase_messaging 12 | import isar_flutter_libs 13 | import package_info_plus 14 | import path_provider_foundation 15 | import share_plus 16 | import shared_preferences_foundation 17 | import url_launcher_macos 18 | 19 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 20 | BlueThermalPrinterPlugin.register(with: registry.registrar(forPlugin: "BlueThermalPrinterPlugin")) 21 | FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) 22 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 23 | FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) 24 | IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) 25 | FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) 26 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 27 | SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) 28 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 29 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 30 | } 31 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /macos/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - file_selector_macos (0.0.1): 3 | - FlutterMacOS 4 | - FlutterMacOS (1.0.0) 5 | - shared_preferences_foundation (0.0.1): 6 | - Flutter 7 | - FlutterMacOS 8 | 9 | DEPENDENCIES: 10 | - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) 11 | - FlutterMacOS (from `Flutter/ephemeral`) 12 | - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) 13 | 14 | EXTERNAL SOURCES: 15 | file_selector_macos: 16 | :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos 17 | FlutterMacOS: 18 | :path: Flutter/ephemeral 19 | shared_preferences_foundation: 20 | :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin 21 | 22 | SPEC CHECKSUMS: 23 | file_selector_macos: 468fb6b81fac7c0e88d71317f3eec34c3b008ff9 24 | FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 25 | shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 26 | 27 | PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 28 | 29 | COCOAPODS: 1.12.1 30 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = lakasir 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.lakasir 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: lakasir 2 | description: A new Flutter project. 3 | publish_to: 'none' 4 | version: 0.0.21 5 | 6 | environment: 7 | sdk: '>=3.1.2 <4.0.0' 8 | 9 | dependencies: 10 | http: ^1.1.0 11 | infinite_scroll_pagination: ^4.0.0 12 | flutter: 13 | sdk: flutter 14 | 15 | cupertino_icons: ^1.0.2 16 | shared_preferences: ^2.2.1 17 | image_picker: ^1.0.4 18 | intl: ^0.19.0 19 | flutter_launcher_icons: ^0.13.1 20 | flutter_dotenv: ^5.0.2 21 | get: ^4.6.6 22 | image_cropper: ^5.0.1 23 | http_parser: ^4.0.2 24 | flutter_masked_text2: ^0.9.1 25 | heroicons: ^0.10.0 26 | pdf: ^3.10.7 27 | google_fonts: ^6.1.0 28 | flutter_pdfview: ^1.3.2 29 | blue_thermal_printer: ^1.2.3 30 | isar: ^3.1.0+1 31 | isar_flutter_libs: ^3.1.0+1 32 | path_provider: ^2.1.2 33 | image: ^4.1.7 34 | firebase_core: ^2.30.0 35 | firebase_messaging: ^14.8.2 36 | rxdart: ^0.27.7 37 | share_plus: ^9.0.0 38 | screenshot: ^2.3.0 39 | package_info_plus: ^8.0.0 40 | url_launcher: ^6.2.6 41 | sunmi_printer_plus: ^2.1.3 42 | flutter_speed_dial: ^7.0.0 43 | flutter_slidable: ^3.1.0 44 | 45 | 46 | flutter_icons: 47 | android: "launcher_icon" 48 | ios: true 49 | image_path: "assets/icons/lakasir.png" 50 | 51 | dev_dependencies: 52 | flutter_test: 53 | sdk: flutter 54 | 55 | flutter_lints: ^3.0.1 56 | isar_generator: ^3.1.0+1 57 | build_runner: ^2.4.8 58 | flutter: 59 | uses-material-design: true 60 | assets: 61 | - .env 62 | - assets/ 63 | - assets/onboards/ 64 | 65 | fonts: 66 | - family: SourceSans 67 | fonts: 68 | - asset: fonts/SourceSans3-BlackItalic.ttf 69 | - asset: fonts/SourceSans3-BoldItalic.ttf 70 | - asset: fonts/SourceSans3-ExtraBoldItalic.ttf 71 | - asset: fonts/SourceSans3-ExtraLightItalic.ttf 72 | - asset: fonts/SourceSans3-Italic.ttf 73 | - asset: fonts/SourceSans3-LightItalic.ttf 74 | - asset: fonts/SourceSans3-MediumItalic.ttf 75 | - asset: fonts/SourceSans3-SemiBoldItalic.ttf 76 | style: italic 77 | - asset: fonts/SourceSans3-Black.ttf 78 | - asset: fonts/SourceSans3-Bold.ttf 79 | - asset: fonts/SourceSans3-ExtraBold.ttf 80 | - asset: fonts/SourceSans3-ExtraLight.ttf 81 | - asset: fonts/SourceSans3-Regular.ttf 82 | - asset: fonts/SourceSans3-Light.ttf 83 | - asset: fonts/SourceSans3-Medium.ttf 84 | - asset: fonts/SourceSans3-SemiBold.ttf 85 | style: normal 86 | - family: Poppins 87 | fonts: 88 | - asset: fonts/Poppins-Regular.ttf 89 | style: normal 90 | 91 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | testWidgets('it shouldbe true', (WidgetTester tester) async { 5 | expect(true, true); 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | lakasir 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lakasir", 3 | "short_name": "lakasir", 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 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | void RegisterPlugins(flutter::PluginRegistry* registry) { 16 | FileSelectorWindowsRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("FileSelectorWindows")); 18 | FirebaseCorePluginCApiRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); 20 | IsarFlutterLibsPluginRegisterWithRegistrar( 21 | registry->GetRegistrarForPlugin("IsarFlutterLibsPlugin")); 22 | SharePlusWindowsPluginCApiRegisterWithRegistrar( 23 | registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); 24 | UrlLauncherWindowsRegisterWithRegistrar( 25 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 26 | } 27 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | file_selector_windows 7 | firebase_core 8 | isar_flutter_libs 9 | share_plus 10 | url_launcher_windows 11 | ) 12 | 13 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 14 | ) 15 | 16 | set(PLUGIN_BUNDLED_LIBRARIES) 17 | 18 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 19 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 20 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 21 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 23 | endforeach(plugin) 24 | 25 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 26 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 27 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 28 | endforeach(ffi_plugin) 29 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"lakasir", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is2024/lakasir_flutter/65c0a99d54e8dcbb36815c4be02ed197ded53b52/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length <= 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | --------------------------------------------------------------------------------