├── 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
├── 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
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.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
├── Podfile.lock
├── .gitignore
└── Podfile
├── lib
├── models
│ ├── api_response
│ │ ├── raw_data.dart
│ │ ├── api_response_entity.dart
│ │ ├── paging_data.dart
│ │ ├── api_response_entity.g.dart
│ │ └── paging_data.g.dart
│ ├── school_entity.dart
│ ├── login_params.dart
│ ├── user_entity.dart
│ ├── article.dart
│ └── paging_request.dart
├── res
│ └── string_res
│ │ ├── str_res_keys.dart
│ │ ├── str_res_zh.dart
│ │ ├── str_res_en.dart
│ │ └── str_res.dart
├── request
│ ├── apis.dart
│ ├── config.dart
│ ├── exception_handler.dart
│ ├── request.dart
│ ├── token_interceptor.dart
│ ├── exception.dart
│ └── request_client.dart
├── utils
│ ├── type_utils.dart
│ ├── loading.dart
│ └── func_utils.dart
├── pages
│ ├── article_lists
│ │ ├── article_lists_state.dart
│ │ ├── article_lists_binding.dart
│ │ ├── article_lists_controller.dart
│ │ └── article_lists_view.dart
│ ├── article_details
│ │ ├── article_details_state.dart
│ │ ├── article_details_binding.dart
│ │ ├── article_details_controller.dart
│ │ └── article_details_view.dart
│ └── counter
│ │ ├── state.dart
│ │ ├── binding.dart
│ │ ├── view.dart
│ │ └── controller.dart
├── base
│ ├── page_state.dart
│ └── page_controller.dart
├── generated
│ └── json
│ │ ├── school_entity.g.dart
│ │ ├── base
│ │ ├── json_field.dart
│ │ └── json_convert_content.dart
│ │ ├── login_params.g.dart
│ │ ├── user_entity.g.dart
│ │ ├── article.g.dart
│ │ └── paging_request.g.dart
├── main.dart
├── service
│ └── api_service.dart
├── components
│ ├── click_widget.dart
│ └── refresh.dart
└── routers
│ └── routers.dart
├── 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
│ │ │ │ │ └── loongwind
│ │ │ │ │ └── core
│ │ │ │ │ └── flutter_app_core
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
└── build.gradle
├── macos
├── 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
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
└── Podfile
├── windows
├── runner
│ ├── resources
│ │ └── app_icon.ico
│ ├── resource.h
│ ├── CMakeLists.txt
│ ├── utils.h
│ ├── runner.exe.manifest
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── 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
├── .metadata
├── README.md
├── .gitignore
├── analysis_options.yaml
├── pubspec.yaml
├── test
└── widget_test.dart
├── pubspec.lock
└── LICENSE
/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/models/api_response/raw_data.dart:
--------------------------------------------------------------------------------
1 | class RawData{
2 | dynamic value;
3 | }
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/HEAD/web/favicon.png
--------------------------------------------------------------------------------
/lib/res/string_res/str_res_keys.dart:
--------------------------------------------------------------------------------
1 |
2 | class SR{
3 | static const hello = 'hello';
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/HEAD/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/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/loongwind/flutter_app_core/HEAD/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/HEAD/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/lib/request/apis.dart:
--------------------------------------------------------------------------------
1 |
2 | class APIS{
3 | static const login = "/login";
4 | static const test = "/test";
5 |
6 |
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/HEAD/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/lib/utils/type_utils.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | isBaseType(dynamic data){
4 | return data is String || data is double || data is bool || data is int;
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/lib/res/string_res/str_res_zh.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter_app_core/res/string_res/str_res_keys.dart';
3 |
4 | const zh_CN_res = {
5 | SR.hello: '你好 世界',
6 | };
7 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/lib/res/string_res/str_res_en.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter_app_core/res/string_res/str_res_keys.dart';
3 |
4 | const en_US_res = {
5 | SR.hello: 'Hello World',
6 | };
7 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/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/loongwind/flutter_app_core/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/loongwind/flutter_app_core/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/loongwind/flutter_app_core/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/loongwind/core/flutter_app_core/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.loongwind.core.flutter_app_core
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/lib/pages/article_lists/article_lists_state.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/base/page_state.dart';
2 | import 'package:flutter_app_core/models/article.dart';
3 |
4 | class ArticleListsState extends PagingState{
5 |
6 | }
7 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 |
9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10 | }
11 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/base/page_state.dart:
--------------------------------------------------------------------------------
1 |
2 | class PagingState{
3 | /// 分页的页数
4 | int pageIndex = 1;
5 | ///是否还有更多数据
6 | bool hasMore = true;
7 |
8 | /// 用于列表刷新的id
9 | Object refreshId = Object();
10 |
11 | /// 列表数据
12 | List data = [];
13 |
14 | }
--------------------------------------------------------------------------------
/lib/pages/article_details/article_details_state.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/models/article.dart';
2 |
3 | class ArticleDetailsState {
4 |
5 | Article? article;
6 |
7 | ArticleDetailsState() {
8 | ///Initialize variables
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/lib/request/config.dart:
--------------------------------------------------------------------------------
1 |
2 | ///request config
3 | class RequestConfig{
4 | static String baseUrl = "https://www.fastmock.site/mock/6d5084df89b4c7a49b28052a0f51c29a/test";
5 | static const connectTimeout = 15000;
6 | static const successCode = 200;
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/lib/pages/counter/state.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/models/user_entity.dart';
2 |
3 | class CounterState {
4 | late int count;
5 |
6 | UserEntity? user;
7 | String? errorMessage;
8 |
9 | CounterState() {
10 | count = 0;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
7 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/pages/article_details/article_details_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 |
3 | import 'article_details_controller.dart';
4 |
5 | class ArticleDetailsBinding extends Bindings {
6 | @override
7 | void dependencies() {
8 | Get.lazyPut(() => ArticleDetailsController());
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/.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: 18116933e77adc82f80866c928266a5b4f1ed645
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/lib/pages/counter/binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/service/api_service.dart';
2 | import 'package:get/get.dart';
3 |
4 | import 'controller.dart';
5 |
6 | class CounterBinding extends Bindings {
7 | @override
8 | void dependencies() {
9 | Get.lazyPut(() => CounterController());
10 | Get.lazyPut(() => ApiService());
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 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lib/pages/article_details/article_details_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 |
3 | import 'article_details_state.dart';
4 |
5 | class ArticleDetailsController extends GetxController {
6 | final ArticleDetailsState state = ArticleDetailsState();
7 |
8 | @override
9 | void onInit() {
10 | super.onInit();
11 | state.article = Get.arguments["article"];
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/lib/pages/article_lists/article_lists_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/service/api_service.dart';
2 | import 'package:get/get.dart';
3 |
4 | import 'article_lists_controller.dart';
5 |
6 | class ArticleListsBinding extends Bindings {
7 | @override
8 | void dependencies() {
9 | Get.lazyPut(() => ArticleListsController());
10 | Get.lazyPut(() => ApiService());
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/res/string_res/str_res.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter_app_core/res/string_res/str_res_en.dart';
3 | import 'package:flutter_app_core/res/string_res/str_res_zh.dart';
4 | import 'package:get/get.dart';
5 |
6 | class StringRes extends Translations{
7 |
8 | @override
9 | Map> get keys => {
10 | 'zh_CN': zh_CN_res,
11 | 'en_US':en_US_res
12 | };
13 |
14 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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.init()
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | > Flutter 应用框架搭建系列文章:
3 | >
4 | > - [Flutter应用框架搭建(一)GetX集成及使用详解](https://juejin.cn/post/7039637076962181157)
5 | > - [Flutter应用框架搭建(二)屏幕适配](https://juejin.cn/post/7041021257562718239)
6 | > - [Flutter应用框架搭建(三)Json数据解析](https://juejin.cn/post/7043721908801503269)
7 | > - [Flutter应用框架搭建(四) 网络请求封装](https://juejin.cn/post/7061806192980410382)
8 | > - [Flutter快速开发——列表分页加载封装](https://juejin.cn/post/7067455179506860069)
9 | > - [Flutter之事件节流、防抖封装](https://juejin.cn/post/7071074352837443614)
10 |
--------------------------------------------------------------------------------
/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/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/lib/utils/loading.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:flutter_easyloading/flutter_easyloading.dart';
4 |
5 | Future loading( Function block, {bool isShowLoading = true}) async{
6 | if (isShowLoading) {
7 | showLoading();
8 | }
9 | try {
10 | await block();
11 | } catch (e) {
12 | rethrow;
13 | } finally {
14 | dismissLoading();
15 | }
16 | return;
17 | }
18 |
19 |
20 | void showLoading(){
21 | EasyLoading.show(status: "加载中...");
22 | }
23 |
24 | void dismissLoading(){
25 | EasyLoading.dismiss();
26 | }
--------------------------------------------------------------------------------
/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/models/school_entity.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:flutter_app_core/generated/json/base/json_field.dart';
3 | import 'package:flutter_app_core/generated/json/school_entity.g.dart';
4 |
5 | @JsonSerializable()
6 | class SchoolEntity {
7 |
8 | String? name;
9 |
10 | SchoolEntity();
11 |
12 | factory SchoolEntity.fromJson(Map json) => $SchoolEntityFromJson(json);
13 |
14 | Map toJson() => $SchoolEntityToJson(this);
15 |
16 | @override
17 | String toString() {
18 | return jsonEncode(this);
19 | }
20 | }
--------------------------------------------------------------------------------
/lib/models/login_params.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_app_core/generated/json/base/json_field.dart';
4 | import 'package:flutter_app_core/generated/json/login_params.g.dart';
5 |
6 | @JsonSerializable()
7 | class LoginParams {
8 |
9 | String? username;
10 | String? password;
11 |
12 | LoginParams();
13 |
14 | factory LoginParams.fromJson(Map json) => $LoginParamsFromJson(json);
15 |
16 | Map toJson() => $LoginParamsToJson(this);
17 |
18 | @override
19 | String toString() {
20 | return jsonEncode(this);
21 | }
22 | }
--------------------------------------------------------------------------------
/lib/models/api_response/api_response_entity.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:flutter_app_core/generated/json/base/json_field.dart';
3 | import 'package:flutter_app_core/models/api_response/api_response_entity.g.dart';
4 |
5 | class ApiResponse {
6 |
7 | int? code;
8 | String? message;
9 | T? data;
10 |
11 | ApiResponse();
12 |
13 | factory ApiResponse.fromJson(Map json) => $ApiResponseFromJson(json);
14 |
15 | Map toJson() => $ApiResponseToJson(this);
16 |
17 | @override
18 | String toString() {
19 | return jsonEncode(this);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/models/api_response/paging_data.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_app_core/models/api_response/paging_data.g.dart';
4 |
5 | class PagingData {
6 |
7 | int? current;
8 | bool? hitCount;
9 | int? pages;
10 | List? data;
11 | bool? searchCount;
12 | int? size;
13 | int? total;
14 |
15 | PagingData();
16 |
17 | factory PagingData.fromJson(Map json) => $PagingDataFromJson(json);
18 |
19 | Map toJson() => $PagingDataToJson(this);
20 |
21 | @override
22 | String toString() {
23 | return jsonEncode(this);
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/lib/models/user_entity.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:flutter_app_core/generated/json/base/json_field.dart';
3 | import 'package:flutter_app_core/generated/json/user_entity.g.dart';
4 |
5 | @JsonSerializable()
6 | class UserEntity {
7 | String? userId;
8 | String? username;
9 | int? age;
10 |
11 | UserEntity();
12 |
13 | factory UserEntity.fromJson(Map json) =>
14 | $UserEntityFromJson(json);
15 |
16 | Map toJson() => $UserEntityToJson(this);
17 |
18 | @override
19 | String toString() {
20 | return jsonEncode(this);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/request/exception_handler.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:flutter_app_core/request/config.dart';
4 | import 'package:flutter_app_core/request/exception.dart';
5 | import 'package:flutter_easyloading/flutter_easyloading.dart';
6 | import 'package:get/get.dart';
7 |
8 | bool handleException(ApiException exception, {bool Function(ApiException)? onError}){
9 |
10 | if(onError?.call(exception) == true){
11 | return true;
12 | }
13 |
14 | if(exception.code == 401 ){
15 | ///todo to login
16 | return true;
17 | }
18 | EasyLoading.showError(exception.message ?? ApiException.unknownException);
19 |
20 | return false;
21 | }
--------------------------------------------------------------------------------
/lib/request/request.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:flutter_app_core/request/config.dart';
4 | import 'package:flutter_app_core/request/exception.dart';
5 | import 'package:flutter_app_core/request/exception_handler.dart';
6 | import 'package:flutter_app_core/utils/loading.dart';
7 | import 'package:flutter_easyloading/flutter_easyloading.dart';
8 |
9 | Future request(Function() block, {bool showLoading = true, bool Function(ApiException)? onError, }) async{
10 | try {
11 | await loading(block, isShowLoading: showLoading);
12 | } catch (e) {
13 | handleException(ApiException.from(e), onError: onError);
14 | }
15 | return;
16 | }
--------------------------------------------------------------------------------
/lib/generated/json/school_entity.g.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/generated/json/base/json_convert_content.dart';
2 | import 'package:flutter_app_core/models/school_entity.dart';
3 |
4 | SchoolEntity $SchoolEntityFromJson(Map json) {
5 | final SchoolEntity schoolEntity = SchoolEntity();
6 | final String? name = jsonConvert.convert(json['name']);
7 | if (name != null) {
8 | schoolEntity.name = name;
9 | }
10 | return schoolEntity;
11 | }
12 |
13 | Map $SchoolEntityToJson(SchoolEntity entity) {
14 | final Map data = {};
15 | data['name'] = entity.name;
16 | return data;
17 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(runner LANGUAGES CXX)
3 |
4 | add_executable(${BINARY_NAME} WIN32
5 | "flutter_window.cpp"
6 | "main.cpp"
7 | "utils.cpp"
8 | "win32_window.cpp"
9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
10 | "Runner.rc"
11 | "runner.exe.manifest"
12 | )
13 | apply_standard_settings(${BINARY_NAME})
14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
17 | add_dependencies(${BINARY_NAME} flutter_assemble)
18 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - webview_flutter_wkwebview (0.0.1):
4 | - Flutter
5 |
6 | DEPENDENCIES:
7 | - Flutter (from `Flutter`)
8 | - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
9 |
10 | EXTERNAL SOURCES:
11 | Flutter:
12 | :path: Flutter
13 | webview_flutter_wkwebview:
14 | :path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
15 |
16 | SPEC CHECKSUMS:
17 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
18 | webview_flutter_wkwebview: 005fbd90c888a42c5690919a1527ecc6649e1162
19 |
20 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
21 |
22 | COCOAPODS: 1.11.2
23 |
--------------------------------------------------------------------------------
/lib/generated/json/base/json_field.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: non_constant_identifier_names
2 | // ignore_for_file: camel_case_types
3 | // ignore_for_file: prefer_single_quotes
4 |
5 | // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
6 |
7 | class JsonSerializable{
8 | const JsonSerializable();
9 | }
10 |
11 | class JSONField {
12 | //Specify the parse field name
13 | final String? name;
14 |
15 | //Whether to participate in toJson
16 | final bool? serialize;
17 |
18 | //Whether to participate in fromMap
19 | final bool? deserialize;
20 |
21 | const JSONField({this.name, this.serialize, this.deserialize});
22 | }
23 |
--------------------------------------------------------------------------------
/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_app_core
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.loongwind.core.flutterAppCore
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2021 com.loongwind.core. All rights reserved.
15 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.8.0'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.1.3'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/request/token_interceptor.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'dart:io';
4 |
5 | import 'package:dio/dio.dart' as dio;
6 | import 'package:dio/dio.dart';
7 | import 'package:get/get.dart';
8 |
9 | class TokenInterceptor extends Interceptor{
10 |
11 | @override
12 | void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
13 | ///todo get token from cache
14 | options.headers["Authorization"] = "Basic ZHhtaF93ZWI6ZHhtaF93ZWJfc2VjcmV0";
15 | options.headers["token"] = "Bearer ";
16 | // options.headers["response-status"] = 401;
17 | super.onRequest(options, handler);
18 | }
19 |
20 | @override
21 | void onResponse(dio.Response response, ResponseInterceptorHandler handler) {
22 | super.onResponse(response, handler);
23 | }
24 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/pages/article_details/article_details_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:webview_flutter/webview_flutter.dart';
4 |
5 | import 'article_details_controller.dart';
6 |
7 | class ArticleDetailsPage extends StatelessWidget {
8 | final controller = Get.find();
9 | final state = Get.find().state;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Scaffold(
14 | appBar: AppBar(
15 | title: Text(state.article?.title ?? ""),
16 | ),
17 | body: WebView(
18 | initialUrl: state.article?.url,
19 | javascriptMode: JavascriptMode.unrestricted,
20 | ),
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/models/article.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_app_core/generated/json/article.g.dart';
4 | import 'package:flutter_app_core/generated/json/base/json_field.dart';
5 | import 'package:flutter_app_core/generated/json/paging_request.g.dart';
6 |
7 | @JsonSerializable()
8 | class Article {
9 |
10 | String? title;
11 | String? des;
12 | String? createTime;
13 | String? author;
14 | String? cover;
15 | String? url;
16 |
17 | @JSONField(serialize: false)
18 | int? total;
19 |
20 | Article();
21 |
22 | factory Article.fromJson(Map json) => $ArticleFromJson(json);
23 |
24 | Map toJson() => $ArticleToJson(this);
25 |
26 | @override
27 | String toString() {
28 | return jsonEncode(this);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/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/generated/json/login_params.g.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/generated/json/base/json_convert_content.dart';
2 | import 'package:flutter_app_core/models/login_params.dart';
3 |
4 | LoginParams $LoginParamsFromJson(Map json) {
5 | final LoginParams loginParams = LoginParams();
6 | final String? username = jsonConvert.convert(json['username']);
7 | if (username != null) {
8 | loginParams.username = username;
9 | }
10 | final String? password = jsonConvert.convert(json['password']);
11 | if (password != null) {
12 | loginParams.password = password;
13 | }
14 | return loginParams;
15 | }
16 |
17 | Map $LoginParamsToJson(LoginParams entity) {
18 | final Map data = {};
19 | data['username'] = entity.username;
20 | data['password'] = entity.password;
21 | return data;
22 | }
--------------------------------------------------------------------------------
/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 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/pages/article_lists/article_lists_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/base/page_controller.dart';
2 | import 'package:flutter_app_core/models/api_response/paging_data.dart';
3 | import 'package:flutter_app_core/models/article.dart';
4 | import 'package:flutter_app_core/models/paging_request.dart';
5 | import 'package:flutter_app_core/service/api_service.dart';
6 | import 'package:get/get.dart';
7 |
8 | import 'article_lists_state.dart';
9 |
10 | class ArticleListsController extends PagingController {
11 | final ArticleListsState state = ArticleListsState();
12 | final ApiService apiService = Get.find();
13 |
14 |
15 | @override
16 | ArticleListsState getState() => ArticleListsState();
17 |
18 | @override
19 | Future?> loadData(PagingParams pagingParams) async{
20 | PagingData? articleList = await apiService.getArticleList(pagingParams);
21 | return articleList;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_app_core/res/string_res/str_res.dart';
3 | import 'package:flutter_app_core/routers/routers.dart';
4 | import 'package:flutter_easyloading/flutter_easyloading.dart';
5 | import 'package:get/get.dart';
6 |
7 | void main() {
8 | runApp(const MyApp());
9 | }
10 |
11 | class MyApp extends StatelessWidget {
12 | const MyApp({Key? key}) : super(key: key);
13 |
14 | // This widget is the root of your application.
15 | @override
16 | Widget build(BuildContext context) {
17 | return GetMaterialApp(
18 | title: 'Flutter Demo',
19 | debugShowCheckedModeBanner: false,
20 | initialRoute: RouteGet.main,
21 | getPages: RouteGet.getPages,
22 | translations: StringRes(),
23 | locale: const Locale('zh', 'CN'),
24 | theme: ThemeData(
25 | primarySwatch: Colors.blue,
26 | ),
27 | builder: EasyLoading.init(),
28 | );
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/lib/generated/json/user_entity.g.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/generated/json/base/json_convert_content.dart';
2 | import 'package:flutter_app_core/models/user_entity.dart';
3 |
4 | UserEntity $UserEntityFromJson(Map json) {
5 | final UserEntity userEntity = UserEntity();
6 | final String? userId = jsonConvert.convert(json['userId']);
7 | if (userId != null) {
8 | userEntity.userId = userId;
9 | }
10 | final String? username = jsonConvert.convert(json['username']);
11 | if (username != null) {
12 | userEntity.username = username;
13 | }
14 | final int? age = jsonConvert.convert(json['age']);
15 | if (age != null) {
16 | userEntity.age = age;
17 | }
18 | return userEntity;
19 | }
20 |
21 | Map $UserEntityToJson(UserEntity entity) {
22 | final Map data = {};
23 | data['userId'] = entity.userId;
24 | data['username'] = entity.username;
25 | data['age'] = entity.age;
26 | return data;
27 | }
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "flutter_app_core",
3 | "short_name": "flutter_app_core",
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/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/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-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/lib/models/paging_request.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_app_core/generated/json/base/json_field.dart';
4 | import 'package:flutter_app_core/generated/json/paging_request.g.dart';
5 |
6 | @JsonSerializable()
7 | class PagingParams {
8 |
9 | int current = 1;
10 | Map? extra = {};
11 | Map model = {};
12 | String? order = 'descending';
13 | int size = 10;
14 | String? sort = "id";
15 |
16 | @JSONField(serialize: false)
17 | int? total;
18 |
19 | PagingParams();
20 |
21 | factory PagingParams.fromJson(Map json) => $PagingParamsFromJson(json);
22 |
23 | Map toJson() => $PagingParamsToJson(this);
24 |
25 | @override
26 | String toString() {
27 | return jsonEncode(this);
28 | }
29 |
30 | factory PagingParams.create({required int pageIndex, int pageSize = 10,Map? model}){
31 | var request = PagingParams();
32 | request.current = pageIndex;
33 | request.size = pageSize;
34 | request.model = model ?? {};
35 | return request;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/service/api_service.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:flutter_app_core/models/api_response/paging_data.dart';
4 | import 'package:flutter_app_core/models/article.dart';
5 | import 'package:flutter_app_core/models/login_params.dart';
6 | import 'package:flutter_app_core/models/paging_request.dart';
7 | import 'package:flutter_app_core/models/user_entity.dart';
8 | import 'package:flutter_app_core/request/apis.dart';
9 | import 'package:flutter_app_core/request/request_client.dart';
10 | import 'package:get/get.dart';
11 |
12 | class ApiService extends GetxService{
13 |
14 |
15 | Future login(LoginParams params, {onError}){
16 | return requestClient.post(APIS.login, data: params, onError: onError);
17 | }
18 | Future test(){
19 | return requestClient.post(APIS.test);
20 | }
21 |
22 | Future?> getArticleList(PagingParams pagingRequest) async{
23 | return await requestClient.post>("https://www.fastmock.site/mock/6d5084df89b4c7a49b28052a0f51c29a/test/api/article/list", data: pagingRequest);
24 | }
25 | }
--------------------------------------------------------------------------------
/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/components/click_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_app_core/utils/func_utils.dart';
3 |
4 | enum ClickType {
5 | none,
6 | throttle,
7 | throttleWithTimeout,
8 | debounce
9 | }
10 |
11 | class ClickWidget extends StatelessWidget {
12 | final Widget child;
13 | final Function? onTap;
14 | final ClickType type;
15 | final int? timeout;
16 |
17 | const ClickWidget(
18 | {Key? key,
19 | required this.child,
20 | this.onTap,
21 | this.type = ClickType.throttle,
22 | this.timeout})
23 | : super(key: key);
24 |
25 | @override
26 | Widget build(BuildContext context) {
27 | return GestureDetector(
28 | behavior: HitTestBehavior.opaque,
29 | child: child,
30 | onTap: _getOnTap(),
31 | );
32 | }
33 |
34 | VoidCallback? _getOnTap() {
35 | if (type == ClickType.throttle) {
36 | return onTap?.throttle();
37 | } else if (type == ClickType.throttleWithTimeout) {
38 | return onTap?.throttleWithTimeout(timeout: timeout);
39 | }else if (type == ClickType.debounce) {
40 | return onTap?.debounce(timeout: timeout);
41 | }
42 | return () => onTap?.call();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/lib/routers/routers.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/pages/article_details/article_details_binding.dart';
2 | import 'package:flutter_app_core/pages/article_details/article_details_view.dart';
3 | import 'package:flutter_app_core/pages/article_lists/article_lists_binding.dart';
4 | import 'package:flutter_app_core/pages/article_lists/article_lists_view.dart';
5 | import 'package:flutter_app_core/pages/counter/binding.dart';
6 | import 'package:flutter_app_core/pages/counter/view.dart';
7 | import 'package:get/get.dart';
8 |
9 | class RouteGet {
10 | ///root page
11 | static const String main = "/";
12 | static const String article = "/article";
13 | static const String articleDetails = "/articleDetails";
14 |
15 | ///pages map
16 | static final List getPages = [
17 | GetPage(
18 | name: main,
19 | page: () => CounterPage(),
20 | binding: CounterBinding()
21 | ),
22 | GetPage(
23 | name: article,
24 | page: () => ArticleListsPage(),
25 | binding: ArticleListsBinding()
26 | ),
27 | GetPage(
28 | name: articleDetails,
29 | page: () => ArticleDetailsPage(),
30 | binding: ArticleDetailsBinding()
31 | ),
32 | ];
33 | }
--------------------------------------------------------------------------------
/lib/models/api_response/api_response_entity.g.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/generated/json/base/json_convert_content.dart';
2 | import 'package:flutter_app_core/models/api_response/api_response_entity.dart';
3 | import 'package:flutter_app_core/models/api_response/paging_data.g.dart';
4 |
5 | ApiResponse $ApiResponseFromJson(Map json) {
6 | final ApiResponse apiResponseEntity = ApiResponse();
7 | final int? code = jsonConvert.convert(json['code']);
8 | if (code != null) {
9 | apiResponseEntity.code = code;
10 | }
11 | final String? message = jsonConvert.convert(json['message']);
12 | if (message != null) {
13 | apiResponseEntity.message = message;
14 | }
15 | String type = T.toString();
16 | T? data;
17 | print("type:$type");
18 | if(json['data'] != null){
19 | if(type.startsWith("PagingData<")){
20 | data = pagingDataFromJsonSingle(json['data']);
21 | }else{
22 | data = jsonConvert.convert(json['data']);
23 | }
24 | }
25 | if (data != null) {
26 | apiResponseEntity.data = data;
27 | }
28 | return apiResponseEntity;
29 | }
30 |
31 | Map $ApiResponseToJson(ApiResponse entity) {
32 | final Map data = {};
33 | data['code'] = entity.code;
34 | data['message'] = entity.message;
35 | data['data'] = entity.data;
36 | return data;
37 | }
--------------------------------------------------------------------------------
/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.CreateAndShow(L"flutter_app_core", 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 |
--------------------------------------------------------------------------------
/macos/Podfile:
--------------------------------------------------------------------------------
1 | platform :osx, '10.11'
2 |
3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5 |
6 | project 'Runner', {
7 | 'Debug' => :debug,
8 | 'Profile' => :release,
9 | 'Release' => :release,
10 | }
11 |
12 | def flutter_root
13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14 | unless File.exist?(generated_xcode_build_settings_path)
15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16 | end
17 |
18 | File.foreach(generated_xcode_build_settings_path) do |line|
19 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
20 | return matches[1].strip if matches
21 | end
22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23 | end
24 |
25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26 |
27 | flutter_macos_podfile_setup
28 |
29 | target 'Runner' do
30 | use_frameworks!
31 | use_modular_headers!
32 |
33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34 | end
35 |
36 | post_install do |installer|
37 | installer.pods_project.targets.each do |target|
38 | flutter_additional_macos_build_settings(target)
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/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
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/lib/generated/json/article.g.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/generated/json/base/json_convert_content.dart';
2 | import 'package:flutter_app_core/models/article.dart';
3 |
4 | Article $ArticleFromJson(Map json) {
5 | final Article article = Article();
6 | final String? title = jsonConvert.convert(json['title']);
7 | if (title != null) {
8 | article.title = title;
9 | }
10 | final String? des = jsonConvert.convert(json['des']);
11 | if (des != null) {
12 | article.des = des;
13 | }
14 | final String? createTime = jsonConvert.convert(json['createTime']);
15 | if (createTime != null) {
16 | article.createTime = createTime;
17 | }
18 | final String? author = jsonConvert.convert(json['author']);
19 | if (author != null) {
20 | article.author = author;
21 | }
22 | final String? cover = jsonConvert.convert(json['cover']);
23 | if (cover != null) {
24 | article.cover = cover;
25 | }
26 | final String? url = jsonConvert.convert(json['url']);
27 | if (url != null) {
28 | article.url = url;
29 | }
30 | final int? total = jsonConvert.convert(json['total']);
31 | if (total != null) {
32 | article.total = total;
33 | }
34 | return article;
35 | }
36 |
37 | Map $ArticleToJson(Article entity) {
38 | final Map data = {};
39 | data['title'] = entity.title;
40 | data['des'] = entity.des;
41 | data['createTime'] = entity.createTime;
42 | data['author'] = entity.author;
43 | data['cover'] = entity.cover;
44 | data['url'] = entity.url;
45 | return data;
46 | }
--------------------------------------------------------------------------------
/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/generated/json/paging_request.g.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_app_core/generated/json/base/json_convert_content.dart';
2 | import 'package:flutter_app_core/models/paging_request.dart';
3 |
4 | PagingParams $PagingParamsFromJson(Map json) {
5 | final PagingParams pagingParams = PagingParams();
6 | final int? current = jsonConvert.convert(json['current']);
7 | if (current != null) {
8 | pagingParams.current = current;
9 | }
10 | final Map? extra = jsonConvert.convert