├── linux
├── .gitignore
├── main.cc
├── flutter
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ ├── generated_plugins.cmake
│ └── CMakeLists.txt
├── my_application.h
├── my_application.cc
└── CMakeLists.txt
├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner
│ ├── Runner-Bridging-Header.h
│ ├── Assets.xcassets
│ │ ├── LaunchImage.imageset
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ ├── README.md
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
├── RunnerTests
│ └── RunnerTests.swift
└── .gitignore
├── macos
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Runner
│ ├── Configs
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ ├── Warnings.xcconfig
│ │ └── AppInfo.xcconfig
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_64.png
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_512.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Release.entitlements
│ ├── DebugProfile.entitlements
│ ├── MainFlutterWindow.swift
│ ├── Info.plist
│ └── Base.lproj
│ │ └── MainMenu.xib
├── .gitignore
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
└── RunnerTests
│ └── RunnerTests.swift
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── manifest.json
└── index.html
├── android
├── gradle.properties
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable-v21
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── values-night
│ │ │ │ │ └── styles.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── flutter_quick_template
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── .gitignore
├── build.gradle
└── settings.gradle
├── lib
├── events
│ └── text_event.dart
├── base
│ ├── page_life_state.dart
│ ├── network
│ │ ├── api_client.dart
│ │ ├── error_interceptor.dart
│ │ ├── mock_interceptor.dart
│ │ ├── test_info.g.dart
│ │ ├── api_result_interceptor.dart
│ │ ├── result.dart
│ │ ├── result.g.dart
│ │ ├── test_info.dart
│ │ ├── http.dart
│ │ ├── api_client.g.dart
│ │ └── api_exception.dart
│ ├── base_scaffold_page.dart
│ ├── base_controller.dart
│ ├── base_page.dart
│ ├── widgets
│ │ └── net_image.dart
│ └── LightStorage
│ │ ├── mmkv_light_storage.dart
│ │ ├── shared_preference_light_storage.dart
│ │ └── light_storage.dart
├── utils
│ ├── toast_util.dart
│ ├── loading_util.dart
│ ├── log_util.dart
│ ├── global_extension.dart
│ └── event_bus.dart
├── generated
│ ├── route_table.dart
│ └── locales.g.dart
├── Initializer.dart
├── page
│ ├── event_test_page.dart
│ ├── http_page.dart
│ ├── light_storage_page.dart
│ └── home_page.dart
└── main.dart
├── windows
├── runner
│ ├── resources
│ │ └── app_icon.ico
│ ├── resource.h
│ ├── utils.h
│ ├── runner.exe.manifest
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── CMakeLists.txt
│ ├── utils.cpp
│ ├── flutter_window.cpp
│ ├── Runner.rc
│ ├── win32_window.h
│ └── win32_window.cpp
├── flutter
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ ├── generated_plugins.cmake
│ └── CMakeLists.txt
├── .gitignore
└── CMakeLists.txt
├── translations
├── zh_CN.json
└── en_US.json
├── test
└── widget_test.dart
├── .gitignore
├── analysis_options.yaml
├── .metadata
├── pubspec.yaml
├── README_CN.md
└── README.md
/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/lib/events/text_event.dart:
--------------------------------------------------------------------------------
1 | class CustomTextEvent {
2 | CustomTextEvent({required this.text});
3 | String text = "";
4 | }
5 |
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/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/panyiho/flutter_quick_template/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/panyiho/flutter_quick_template/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/lib/base/page_life_state.dart:
--------------------------------------------------------------------------------
1 | mixin PageLifeState {
2 | void onPageVisible() {}
3 |
4 | void onPageActive() {}
5 |
6 | void onPageInActive() {}
7 |
8 | void onPageInVisible() {}
9 | }
10 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/translations/zh_CN.json:
--------------------------------------------------------------------------------
1 | {
2 | "network":{
3 | "network_error": "网络异常,请检网络连接状态",
4 | "system_error": "系统繁忙,请稍后再试!",
5 | "net_disconnect": "网络未连接,请检查后重试",
6 | "request_cancel":"请求取消"
7 | }
8 | }
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/flutter_quick_template/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.flutter_quick_template
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/lib/utils/toast_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
2 |
3 | class Toast {
4 | static show(String msg, {Duration? displayTime}) {
5 | SmartDialog.showToast(msg, displayTime: displayTime);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/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 |
10 | void fl_register_plugins(FlPluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/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-8.5-all.zip
6 |
--------------------------------------------------------------------------------
/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 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/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/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/translations/en_US.json:
--------------------------------------------------------------------------------
1 | {
2 | "network":{
3 | "network_error": "Network abnormality, please check the network connection status.",
4 | "system_error": "The system is busy, please try again later!",
5 | "net_disconnect": "Network not connected, please check and try again.",
6 | "request_cancel":"request canceled"
7 | }
8 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/base/network/api_client.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:retrofit/http.dart';
3 |
4 | import 'result.dart';
5 | import 'test_info.dart';
6 | part 'api_client.g.dart';
7 |
8 | @RestApi()
9 | abstract class ApiClient {
10 | factory ApiClient(Dio dio, {String baseUrl}) = _ApiClient;
11 |
12 | @GET("/info")
13 | Future> getInfo();
14 | }
15 |
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | rootProject.buildDir = "../build"
9 | subprojects {
10 | project.buildDir = "${rootProject.buildDir}/${project.name}"
11 | }
12 | subprojects {
13 | project.evaluationDependsOn(":app")
14 | }
15 |
16 | tasks.register("clean", Delete) {
17 | delete rootProject.buildDir
18 | }
19 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility in the flutter_test package. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 |
9 | void main() {
10 | }
11 |
--------------------------------------------------------------------------------
/lib/base/network/error_interceptor.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'api_exception.dart';
3 |
4 | class ErrorInterceptor extends Interceptor {
5 | @override
6 | void onError(DioException err, ErrorInterceptorHandler handler) {
7 | var apiException = err;
8 |
9 | if (err is! ApiException) {
10 | apiException = ApiException.create(err);
11 | }
12 |
13 | super.onError(apiException, handler);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/base/network/mock_interceptor.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:dio/dio.dart';
4 |
5 | class MockInterceptor extends Interceptor {
6 | String jsonString =
7 | '''
8 | {
9 | "code": 10000,
10 | "msg": "success",
11 | "data": {"age":22}
12 | }
13 | ''';
14 |
15 | @override
16 | void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
17 | handler.resolve(
18 | Response(requestOptions: options, data: jsonDecode(jsonString)), true);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/utils/loading_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
2 |
3 | class Loading {
4 | static void show(
5 | {String msg = 'loading...',
6 | bool clickMaskDismiss = false,
7 | Duration? displayTime}) async {
8 | await SmartDialog.showLoading(
9 | msg: msg,
10 | clickMaskDismiss: clickMaskDismiss,
11 | displayTime: displayTime,
12 | usePenetrate: false);
13 | }
14 |
15 | static void dismiss() async {
16 | await SmartDialog.dismiss(status: SmartStatus.loading);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import path_provider_foundation
9 | import shared_preferences_foundation
10 | import sqflite_darwin
11 |
12 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
13 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
14 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
15 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
16 | }
17 |
--------------------------------------------------------------------------------
/lib/base/base_scaffold_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'base_controller.dart';
4 | import 'base_page.dart';
5 |
6 | abstract class BaseScaffoldPage extends BasePage {
7 | @override
8 | Widget buildWidget(BaseController controller) {
9 | return Scaffold(
10 | appBar: getAppBar(),
11 | body: getBody(),
12 | bottomNavigationBar: getBottomNavigationBar(),
13 | );
14 | }
15 |
16 | PreferredSizeWidget? getAppBar();
17 |
18 | Widget? getBody();
19 |
20 | Widget? getBottomNavigationBar() {
21 | return null;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/base/network/test_info.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'test_info.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | TestInfo _$TestInfoFromJson(Map json) => TestInfo(
10 | age: json['age'] as int? ?? 0,
11 | name: json['name'] as String? ?? '',
12 | );
13 |
14 | Map _$TestInfoToJson(TestInfo instance) => {
15 | 'age': instance.age,
16 | 'name': instance.name,
17 | };
18 |
--------------------------------------------------------------------------------
/lib/base/network/api_result_interceptor.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 |
3 | import 'api_exception.dart';
4 |
5 | class ApiResultInterceptor extends Interceptor {
6 | @override
7 | Future onResponse(
8 | Response resp, ResponseInterceptorHandler handler) async {
9 | final result = resp.data as Map;
10 | if (result["code"] == 10000) {
11 | handler.next(resp);
12 | return;
13 | } else {
14 | handler.reject(
15 | ApiException(code: result["code"], message: result["msg"])
16 | ..requestOptions = resp.requestOptions,
17 | true);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/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/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 = flutter_quick_template
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterTestCode
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21 | id "com.android.application" version "8.2.1" apply false
22 | id "org.jetbrains.kotlin.android" version "1.9.20" apply false
23 | }
24 |
25 | include ":app"
26 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/lib/utils/log_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:logger/logger.dart';
2 | import 'dart:developer';
3 |
4 | bool isDebug = const bool.fromEnvironment('dart.vm.product') != true;
5 | Logger _logger = Logger(
6 | printer: PrettyPrinter(
7 | stackTraceBeginIndex: 1, printTime: true, noBoxingByDefault: false),
8 | );
9 |
10 | logV(dynamic msg) {
11 | if (isDebug) {
12 | _logger.t("$msg");
13 | }
14 | }
15 |
16 | logD(dynamic msg) {
17 | if (isDebug) {
18 | _logger.d("$msg");
19 | }
20 | }
21 |
22 | logI(dynamic msg) {
23 | if (isDebug) {
24 | _logger.i("$msg");
25 | }
26 | }
27 |
28 | logW(dynamic msg) {
29 | if (isDebug) {
30 | _logger.w("$msg");
31 | }
32 | }
33 |
34 | logE(dynamic msg) {
35 | if (isDebug) {
36 | _logger.e("$msg");
37 | }
38 | }
39 |
40 | logWTF(dynamic msg) {
41 | if (isDebug) {
42 | log(msg);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/generated/route_table.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: constant_identifier_names
2 | import 'package:get/get.dart';
3 | import 'package:flutter_quick_template/page/event_test_page.dart';
4 | import 'package:flutter_quick_template/page/home_page.dart';
5 | import 'package:flutter_quick_template/page/http_page.dart';
6 | import 'package:flutter_quick_template/page/light_storage_page.dart';
7 |
8 | class RouteTable {
9 | static const String event = '/event';
10 | static const String home = '/home';
11 | static const String http = '/http';
12 | static const String lightStorage = '/lightStorage';
13 |
14 | static final List pages = [
15 | GetPage(name: '/event', page: () => EventTestPage()),
16 | GetPage(name: '/home', page: () => HomePage()),
17 | GetPage(name: '/http', page: () => HttpPage()),
18 | GetPage(name: '/lightStorage', page: () => LightStoragePage()),
19 | ];
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/lib/base/network/result.dart:
--------------------------------------------------------------------------------
1 | import 'package:json_annotation/json_annotation.dart';
2 | import 'api_exception.dart';
3 | part 'result.g.dart';
4 |
5 | @JsonSerializable(genericArgumentFactories: true)
6 | class Result {
7 | int code;
8 | T? data;
9 | String? msg;
10 |
11 | Result({required this.code, this.data, this.msg});
12 |
13 | factory Result.fromJson(
14 | Map json,
15 | T Function(dynamic json) fromJsonT,
16 | ) =>
17 | _$ResultFromJson(json, fromJsonT);
18 |
19 | Map toJson(Object? Function(T value) toJsonT) =>
20 | _$ResultToJson(this, toJsonT);
21 |
22 | factory Result.fromMapJson(Map json) {
23 | return Result(
24 | code: json['code'] as int,
25 | data: json['data'] as T?,
26 | msg: json['msg'] as String?,
27 | );
28 | }
29 |
30 | ApiException toException({dynamic cause}) =>
31 | ApiException(code: code, message: msg, cause: cause);
32 | }
33 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 | /.history
46 | /.vscode
47 | /.idea
48 | /.dart_tool
49 | .history
50 | pubspec.lock
51 |
52 | # FVM Version Cache
53 | .fvm/
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "flutter_quick_template",
3 | "short_name": "flutter_quick_template",
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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/lib/Initializer.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 | import 'package:get/get_utils/src/platform/platform.dart';
4 | import 'base/LightStorage/light_storage.dart';
5 |
6 | /// 全局初始化器
7 | class Initializer {
8 | /// 初始化
9 | static Future init() async {
10 | WidgetsFlutterBinding.ensureInitialized();
11 | await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
12 | await LightStorage.getInstance().init();
13 | setSystemUi();
14 | }
15 |
16 | static void setSystemUi() {
17 | if (GetPlatform.isAndroid) {
18 | SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle(
19 | statusBarColor: Colors.transparent,
20 | statusBarBrightness: Brightness.light,
21 | statusBarIconBrightness: Brightness.dark,
22 | systemNavigationBarDividerColor: Colors.transparent,
23 | systemNavigationBarColor: Colors.white,
24 | systemNavigationBarIconBrightness: Brightness.dark,
25 | );
26 | SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/base/base_controller.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:get/get.dart';
5 |
6 | import '../utils/event_bus.dart';
7 | import 'page_life_state.dart';
8 |
9 | class BaseController extends SuperController with PageLifeState {
10 | StreamSubscription? streamSubscription;
11 | @mustCallSuper
12 | @override
13 | void onReady() {
14 | super.onReady();
15 | var listenerEventList = getListenEvent();
16 | if (listenerEventList.isNotEmpty) {
17 | streamSubscription =
18 | EventBus().onTypes(listenerEventList).listen(onReceiveEvent);
19 | }
20 | }
21 |
22 | void onReceiveEvent(event) {}
23 |
24 | List getListenEvent() {
25 | return [];
26 | }
27 |
28 | @mustCallSuper
29 | @override
30 | void onClose() {
31 | super.onClose();
32 | streamSubscription?.cancel();
33 | }
34 |
35 | @override
36 | void onDetached() {}
37 |
38 | @override
39 | void onHidden() {}
40 |
41 | @override
42 | void onInactive() {}
43 |
44 | @override
45 | void onPaused() {}
46 |
47 | @override
48 | void onResumed() {}
49 | }
50 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/base/network/result.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'result.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | Result _$ResultFromJson(
10 | Map json,
11 | T Function(Object? json) fromJsonT,
12 | ) =>
13 | Result(
14 | code: json['code'] as int,
15 | data: _$nullableGenericFromJson(json['data'], fromJsonT),
16 | msg: json['msg'] as String?,
17 | );
18 |
19 | Map _$ResultToJson(
20 | Result instance,
21 | Object? Function(T value) toJsonT,
22 | ) =>
23 | {
24 | 'code': instance.code,
25 | 'data': _$nullableGenericToJson(instance.data, toJsonT),
26 | 'msg': instance.msg,
27 | };
28 |
29 | T? _$nullableGenericFromJson(
30 | Object? input,
31 | T Function(Object? json) fromJson,
32 | ) =>
33 | input == null ? null : fromJson(input);
34 |
35 | Object? _$nullableGenericToJson(
36 | T? input,
37 | Object? Function(T value) toJson,
38 | ) =>
39 | input == null ? null : toJson(input);
40 |
--------------------------------------------------------------------------------
/lib/base/network/test_info.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: public_member_api_docs, sort_constructors_first
2 | import 'package:json_annotation/json_annotation.dart';
3 |
4 | part 'test_info.g.dart';
5 |
6 | @JsonSerializable()
7 | class TestInfo {
8 | int age;
9 | String name;
10 | TestInfo({
11 | this.age = 0,
12 | this.name = '',
13 | });
14 |
15 | factory TestInfo.fromJson(Map json) =>
16 | _$TestInfoFromJson(json);
17 | Map toJson() => _$TestInfoToJson(this);
18 |
19 | TestInfo copyWith({
20 | int? age,
21 | String? name,
22 | }) {
23 | return TestInfo(
24 | age: age ?? this.age,
25 | name: name ?? this.name,
26 | );
27 | }
28 |
29 | Map toMap() {
30 | return {
31 | 'age': age,
32 | 'name': name,
33 | };
34 | }
35 |
36 | @override
37 | String toString() => 'TestInfo(age: $age, name: $name)';
38 |
39 | @override
40 | bool operator ==(covariant TestInfo other) {
41 | if (identical(this, other)) return true;
42 |
43 | return
44 | other.age == age &&
45 | other.name == name;
46 | }
47 |
48 | @override
49 | int get hashCode => age.hashCode ^ name.hashCode;
50 | }
51 |
--------------------------------------------------------------------------------
/lib/page/event_test_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:getx_route_annotations/getx_route_annotations.dart';
3 | import '../utils/global_extension.dart';
4 | import 'package:get/get.dart';
5 |
6 | import '../base/base_controller.dart';
7 | import '../base/base_scaffold_page.dart';
8 | import '../events/text_event.dart';
9 |
10 | @GetXRoutePage("/event")
11 | class EventTestPage extends BaseScaffoldPage {
12 | @override
13 | EventTestController generateController() {
14 | return EventTestController();
15 | }
16 |
17 | @override
18 | PreferredSizeWidget? getAppBar() {
19 | return AppBar(
20 | leading: const Icon(Icons.arrow_back).onTab(() {
21 | Get.back();
22 | }),
23 | title: const Text("EventTestPage"),
24 | );
25 | }
26 |
27 | @override
28 | Widget? getBody() {
29 | return ElevatedButton(
30 | onPressed: () {
31 | CustomTextEvent(text: "msg from EventTestPage").sendEvent();
32 | },
33 | child: const Text("send Event to HomePage"))
34 | .align(Alignment.center);
35 | }
36 | }
37 |
38 | class EventTestController extends BaseController {
39 | @override
40 | void onReady() {
41 | super.onReady();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/generated/locales.g.dart:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT. This is code generated via package:get_cli/get_cli.dart
2 |
3 | // ignore_for_file: lines_longer_than_80_chars
4 | // ignore: avoid_classes_with_only_static_members
5 | class AppTranslation {
6 | static Map> translations = {
7 | 'en_US': Locales.en_US,
8 | 'zh_CN': Locales.zh_CN,
9 | };
10 | }
11 |
12 | class LocaleKeys {
13 | LocaleKeys._();
14 | static const network_network_error = 'network_network_error';
15 | static const network_system_error = 'network_system_error';
16 | static const network_net_disconnect = 'network_net_disconnect';
17 | static const network_request_cancel = 'network_request_cancel';
18 | }
19 |
20 | class Locales {
21 | static const en_US = {
22 | 'network_network_error':
23 | 'Network abnormality, please check the network connection status.',
24 | 'network_system_error': 'The system is busy, please try again later!',
25 | 'network_net_disconnect':
26 | 'Network not connected, please check and try again.',
27 | 'network_request_cancel': 'request canceled',
28 | };
29 | static const zh_CN = {
30 | 'network_network_error': '网络异常,请检网络连接状态',
31 | 'network_system_error': '系统繁忙,请稍后再试!',
32 | 'network_net_disconnect': '网络未连接,请检查后重试',
33 | 'network_request_cancel': '请求取消',
34 | };
35 | }
36 |
--------------------------------------------------------------------------------
/lib/page/http_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_quick_template/utils/global_extension.dart';
3 | import 'package:get/get.dart';
4 | import 'package:getx_route_annotations/getx_route_annotations.dart';
5 | import '../base/base_controller.dart';
6 | import '../base/base_scaffold_page.dart';
7 | import '../base/network/http.dart';
8 | import '../base/network/result.dart';
9 | import '../base/network/test_info.dart';
10 | import '../utils/toast_util.dart';
11 |
12 | @GetXRoutePage("/http")
13 | class HttpPage extends BaseScaffoldPage {
14 | @override
15 | BaseController generateController() {
16 | return HttpPageController();
17 | }
18 |
19 | @override
20 | PreferredSizeWidget? getAppBar() {
21 | return AppBar(
22 | leading: const Icon(Icons.arrow_back).onTab(() {
23 | Get.back();
24 | }),
25 | title: const Text("HttpMockPage"),
26 | );
27 | }
28 |
29 | @override
30 | Widget? getBody() {
31 | return ElevatedButton(
32 | onPressed: () async {
33 | Result result = await Http.client().getInfo();
34 | Toast.show("${result.data}");
35 | },
36 | child: const Text("click to get Http result"))
37 | .align(Alignment.center);
38 | }
39 | }
40 |
41 | class HttpPageController extends BaseController {}
42 |
--------------------------------------------------------------------------------
/lib/base/base_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:get/get.dart';
3 | import 'package:lifecycle/lifecycle.dart';
4 |
5 | import '../utils/log_util.dart';
6 | import 'base_controller.dart';
7 |
8 | abstract class BasePage extends GetView {
9 | BuildContext? context;
10 |
11 | T generateController();
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | this.context = context;
16 | Get.put(generateController());
17 | return LifecycleWrapper(
18 | onLifecycleEvent: (LifecycleEvent lifecycleEvent) {
19 | logI("$runtimeType $lifecycleEvent");
20 | switch (lifecycleEvent) {
21 | case LifecycleEvent.visible:
22 | controller.onPageVisible();
23 | break;
24 | case LifecycleEvent.inactive:
25 | controller.onPageInActive();
26 | break;
27 | case LifecycleEvent.active:
28 | controller.onPageActive();
29 | break;
30 | case LifecycleEvent.invisible:
31 | controller.onPageInVisible();
32 | break;
33 | default:
34 | }
35 | },
36 | child: GetBuilder(
37 | builder: buildWidget,
38 | assignId: true,
39 | ));
40 | }
41 |
42 | Widget buildWidget(T controller);
43 | }
44 |
--------------------------------------------------------------------------------
/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"flutter_quick_template", 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 |
--------------------------------------------------------------------------------
/lib/base/network/http.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:pretty_dio_logger/pretty_dio_logger.dart';
3 | import 'api_client.dart';
4 | import 'api_result_interceptor.dart';
5 | import 'error_interceptor.dart';
6 | import 'mock_interceptor.dart';
7 |
8 | class Http {
9 | static const Duration connectTimeout = Duration(milliseconds: 20 * 1000);
10 | static const Duration receiveTimeout = Duration(milliseconds: 20 * 1000);
11 | //change to the real url
12 | static const BASE_URL = "https://xxx.com";
13 | static final Http _instance = Http._internal();
14 |
15 | factory Http() => _instance;
16 |
17 | late Dio dio;
18 | late ApiClient _client;
19 |
20 | static ApiClient client() {
21 | return Http()._client;
22 | }
23 |
24 | Http._internal() {
25 | BaseOptions options = BaseOptions(
26 | connectTimeout: connectTimeout,
27 | persistentConnection: true,
28 | receiveTimeout: receiveTimeout,
29 | baseUrl: BASE_URL,
30 | contentType: Headers.jsonContentType,
31 | responseType: ResponseType.json,
32 | receiveDataWhenStatusError: false,
33 | );
34 |
35 | dio = Dio(options);
36 | //mock request ,if you want to requet you own service.must be remove
37 | dio.interceptors.add(MockInterceptor());
38 | dio.interceptors.add(ApiResultInterceptor());
39 | dio.interceptors.add(PrettyDioLogger(requestHeader: true));
40 | dio.interceptors.add(ErrorInterceptor());
41 | _client = ApiClient(dio, baseUrl: BASE_URL);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/utils/global_extension.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/gestures.dart';
2 | import 'package:flutter/material.dart';
3 | import 'event_bus.dart';
4 |
5 | extension ObjectExtension on Object {
6 | void sendEvent({T? event}) {
7 | if (event == null) {
8 | EventBus().fire(this);
9 | return;
10 | }
11 | EventBus().fire(event);
12 | }
13 | }
14 |
15 | extension GestureExtension on Widget {
16 | GestureDetector onTab(GestureTapCallback tapCallback) {
17 | return GestureDetector(onTap: tapCallback, child: this);
18 | }
19 |
20 | GestureDetector onDoubleTab(GestureDoubleTapCallback tapCallback) {
21 | return GestureDetector(onDoubleTap: tapCallback, child: this);
22 | }
23 |
24 | GestureDetector onLongPress(GestureLongPressCallback tapCallback) {
25 | return GestureDetector(onLongPress: tapCallback, child: this);
26 | }
27 | }
28 |
29 | extension WidgetsExtension on Widget {
30 | Flexible flexible() {
31 | return Flexible(child: this);
32 | }
33 |
34 | Expanded expanded() {
35 | return Expanded(child: this);
36 | }
37 |
38 | SizedBox sizedBox({double? width, double? height}) {
39 | return SizedBox(
40 | width: width,
41 | height: height,
42 | child: this,
43 | );
44 | }
45 |
46 | Align align(Alignment alignment,
47 | {double? widthFactor, double? heightFactor}) {
48 | return Align(
49 | alignment: alignment,
50 | widthFactor: widthFactor,
51 | heightFactor: heightFactor,
52 | child: this,
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/base/widgets/net_image.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 |
5 | class NetImage extends StatelessWidget {
6 | final String imageUrl;
7 |
8 | final Widget? placeholder;
9 |
10 | final Widget? errorWidget;
11 |
12 | final BoxFit? fit;
13 |
14 | final double? width;
15 |
16 | final double? height;
17 |
18 | final double? placeHolderHeight;
19 |
20 | const NetImage(
21 | {Key? key,
22 | required this.imageUrl,
23 | this.placeholder,
24 | this.errorWidget,
25 | this.fit,
26 | this.width,
27 | this.height,
28 | this.placeHolderHeight})
29 | : super(key: key);
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return CachedNetworkImage(
34 | imageUrl: imageUrl,
35 | placeholder: (context, url) => placeholder ?? _defaultPlaceholder(),
36 | errorWidget: (context, url, error) =>
37 | errorWidget ?? _defaultPlaceholder(),
38 | fit: fit ?? BoxFit.cover,
39 | width: width,
40 | height: height,
41 | fadeInDuration: const Duration(milliseconds: 1),
42 | fadeOutDuration: const Duration(milliseconds: 1),
43 | );
44 | }
45 |
46 | Widget _defaultPlaceholder() {
47 | return Container(
48 | width: placeHolderHeight,
49 | height: height ?? 300.h,
50 | decoration: BoxDecoration(
51 | color: const Color.fromRGBO(231, 234, 236, 1),
52 | borderRadius: BorderRadius.all(
53 | Radius.circular(5.h),
54 | ),
55 | ));
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/base/LightStorage/mmkv_light_storage.dart:
--------------------------------------------------------------------------------
1 | import 'package:mmkv/mmkv.dart';
2 | import 'light_storage.dart';
3 |
4 | class MMKVStorage extends AbsLightStorage {
5 | late MMKV _mmkv;
6 | @override
7 | Future clear() async {
8 | _mmkv.clearAll();
9 | }
10 |
11 | @override
12 | bool getBoolean(String key, {bool defaultValue = false}) {
13 | return _mmkv.decodeBool(key, defaultValue: defaultValue);
14 | }
15 |
16 | @override
17 | double getDouble(String key, {double defaultValue = 0}) {
18 | return _mmkv.decodeDouble(key, defaultValue: defaultValue);
19 | }
20 |
21 | @override
22 | int getInt(String key, {int defaultValue = 0}) {
23 | return _mmkv.decodeInt(key, defaultValue: defaultValue);
24 | }
25 |
26 | @override
27 | String getString(String key, {String defaultValue = ""}) {
28 | return _mmkv.decodeString(key) ?? defaultValue;
29 | }
30 |
31 | @override
32 | Future init() async {
33 | await MMKV.initialize();
34 | _mmkv = MMKV.defaultMMKV();
35 | }
36 |
37 | @override
38 | Future putBoolean(String key, bool value) async {
39 | _mmkv.encodeBool(key, value);
40 | }
41 |
42 | @override
43 | Future putDouble(String key, double value) async {
44 | _mmkv.encodeDouble(key, value);
45 | }
46 |
47 | @override
48 | Future putInt(String key, int value) async {
49 | _mmkv.encodeInt(key, value);
50 | }
51 |
52 | @override
53 | Future putString(String key, String value) async {
54 | _mmkv.encodeString(key, value);
55 | }
56 |
57 | @override
58 | Future remove(String key) async {
59 | _mmkv.removeValue(key);
60 | }
61 |
62 | @override
63 | bool containsKey(String key) {
64 | return _mmkv.containsKey(key);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/lib/base/LightStorage/shared_preference_light_storage.dart:
--------------------------------------------------------------------------------
1 | import 'package:shared_preferences/shared_preferences.dart';
2 | import 'light_storage.dart';
3 |
4 | class SharePreferenceStorage extends AbsLightStorage {
5 | late SharedPreferences _preferences;
6 | @override
7 | Future init() async {
8 | _preferences = await SharedPreferences.getInstance();
9 | }
10 |
11 | @override
12 | bool getBoolean(String key, {bool defaultValue = false}) {
13 | return _preferences.getBool(key) ?? defaultValue;
14 | }
15 |
16 | @override
17 | double getDouble(String key, {double defaultValue = 0}) {
18 | return _preferences.getDouble(key) ?? defaultValue;
19 | }
20 |
21 | @override
22 | int getInt(String key, {int defaultValue = 0}) {
23 | return _preferences.getInt(key) ?? defaultValue;
24 | }
25 |
26 | @override
27 | String getString(String key, {String defaultValue = ""}) {
28 | return _preferences.getString(key) ?? defaultValue;
29 | }
30 |
31 | @override
32 | Future putBoolean(String key, bool value) {
33 | return _preferences.setBool(key, value);
34 | }
35 |
36 | @override
37 | Future putDouble(String key, double value) {
38 | return _preferences.setDouble(key, value);
39 | }
40 |
41 | @override
42 | Future putInt(String key, int value) {
43 | return _preferences.setInt(key, value);
44 | }
45 |
46 | @override
47 | Future putString(String key, String value) {
48 | return _preferences.setString(key, value);
49 | }
50 |
51 | @override
52 | Future remove(String key) {
53 | return _preferences.remove(key);
54 | }
55 |
56 | @override
57 | Future clear() {
58 | return _preferences.clear();
59 | }
60 |
61 | @override
62 | bool containsKey(String key) {
63 | return _preferences.containsKey(key);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | flutter_quick_template
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_quick_template
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 |
--------------------------------------------------------------------------------
/.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: "e1e47221e86272429674bec4f1bd36acc4fc7b77"
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: e1e47221e86272429674bec4f1bd36acc4fc7b77
17 | base_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
18 | - platform: android
19 | create_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
20 | base_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
21 | - platform: ios
22 | create_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
23 | base_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
24 | - platform: linux
25 | create_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
26 | base_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
27 | - platform: macos
28 | create_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
29 | base_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
30 | - platform: web
31 | create_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
32 | base_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
33 | - platform: windows
34 | create_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
35 | base_revision: e1e47221e86272429674bec4f1bd36acc4fc7b77
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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | flutter_quick_template
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/lib/page/light_storage_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_quick_template/utils/global_extension.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:get/get.dart';
5 | import 'package:getx_route_annotations/getx_route_annotations.dart';
6 |
7 | import '../base/LightStorage/light_storage.dart';
8 | import '../base/base_controller.dart';
9 | import '../base/base_scaffold_page.dart';
10 | import '../utils/toast_util.dart';
11 |
12 | @GetXRoutePage("/lightStorage")
13 | class LightStoragePage extends BaseScaffoldPage {
14 | String KEY = "key_save";
15 | TextEditingController textController = TextEditingController();
16 |
17 | @override
18 | BaseController generateController() {
19 | return LIghtStoragePageController();
20 | }
21 |
22 | @override
23 | PreferredSizeWidget? getAppBar() {
24 | return AppBar(
25 | leading: const Icon(Icons.arrow_back).onTab(() {
26 | Get.back();
27 | }),
28 | title: const Text("LightStorage"),
29 | );
30 | }
31 |
32 | @override
33 | Widget? getBody() {
34 | return Column(
35 | mainAxisAlignment: MainAxisAlignment.center,
36 | crossAxisAlignment: CrossAxisAlignment.center,
37 | children: [
38 | Row(
39 | mainAxisAlignment: MainAxisAlignment.center,
40 | children: [
41 | TextField(
42 | controller: textController,
43 | ).sizedBox(width: 100.w),
44 | ElevatedButton(
45 | onPressed: () {
46 | LightStorage.getInstance()
47 | .putString(KEY, textController.text);
48 | },
49 | child: const Text("save"))
50 | ],
51 | ).marginOnly(bottom: 10.h),
52 | ElevatedButton(
53 | onPressed: () {
54 | Toast.show(LightStorage.getInstance().getString(KEY));
55 | },
56 | child: const Text("getSaveContent"))
57 | ]).align(Alignment.center);
58 | }
59 | }
60 |
61 | class LIghtStoragePageController extends BaseController {}
62 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "com.android.application"
3 | id "kotlin-android"
4 | id "dev.flutter.flutter-gradle-plugin"
5 | }
6 |
7 | def localProperties = new Properties()
8 | def localPropertiesFile = rootProject.file('local.properties')
9 | if (localPropertiesFile.exists()) {
10 | localPropertiesFile.withReader('UTF-8') { reader ->
11 | localProperties.load(reader)
12 | }
13 | }
14 |
15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16 | if (flutterVersionCode == null) {
17 | flutterVersionCode = '1'
18 | }
19 |
20 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
21 | if (flutterVersionName == null) {
22 | flutterVersionName = '1.0'
23 | }
24 |
25 | android {
26 | namespace "com.example.flutter_quick_template"
27 | compileSdkVersion flutter.compileSdkVersion
28 | ndkVersion flutter.ndkVersion
29 |
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 |
35 | kotlinOptions {
36 | jvmTarget = '1.8'
37 | }
38 |
39 | sourceSets {
40 | main.java.srcDirs += 'src/main/kotlin'
41 | }
42 |
43 | defaultConfig {
44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45 | applicationId "com.example.flutter_quick_template"
46 | // You can update the following values to match your application needs.
47 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48 | minSdkVersion flutter.minSdkVersion
49 | targetSdkVersion flutter.targetSdkVersion
50 | versionCode flutterVersionCode.toInteger()
51 | versionName flutterVersionName
52 | }
53 |
54 | buildTypes {
55 | release {
56 | // TODO: Add your own signing config for the release build.
57 | // Signing with the debug keys for now, so `flutter run --release` works.
58 | signingConfig signingConfigs.debug
59 | }
60 | }
61 | }
62 |
63 | flutter {
64 | source '../..'
65 | }
66 |
67 | dependencies {}
68 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/base/network/api_client.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'api_client.dart';
4 |
5 | // **************************************************************************
6 | // RetrofitGenerator
7 | // **************************************************************************
8 |
9 | // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers
10 |
11 | class _ApiClient implements ApiClient {
12 | _ApiClient(
13 | this._dio, {
14 | this.baseUrl,
15 | });
16 |
17 | final Dio _dio;
18 |
19 | String? baseUrl;
20 |
21 | @override
22 | Future> getInfo() async {
23 | const _extra = {};
24 | final queryParameters = {};
25 | final _headers = {};
26 | final Map? _data = null;
27 | final _result = await _dio
28 | .fetch