首次提交

This commit is contained in:
machuanyu 2024-04-01 10:49:41 +08:00
parent fb2f2f8d46
commit 5aaa4a0d64
114 changed files with 4833 additions and 29 deletions

1
.fvm/flutter_sdk Submodule

@ -0,0 +1 @@
Subproject commit d3d8effc686d73e0114d71abdcccef63fa1f25d2

4
.fvm/fvm_config.json Normal file
View File

@ -0,0 +1,4 @@
{
"flutterSdkVersion": "3.10.1",
"flavors": {}
}

63
.gitignore vendored
View File

@ -1,35 +1,44 @@
# ---> Android
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json
# IntelliJ
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Keystore files
*.jks
*.keystore
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Google Services (e.g. APIs or Firebase)
google-services.json
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Android Profiling
*.hprof
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

33
.metadata Normal file
View File

@ -0,0 +1,33 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
version:
revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
channel: stable
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
- platform: android
create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
- platform: ios
create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'

View File

@ -1,3 +1,16 @@
# Making.School.Asignment.app
# school_asignment_app
阅卷App第二版
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

29
analysis_options.yaml Normal file
View File

@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

13
android/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks

73
android/app/build.gradle Normal file
View File

@ -0,0 +1,73 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.school_asignment_app"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.school_asignment_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
// minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

View File

@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@ -0,0 +1,33 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="school_asignment_app"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

View File

@ -0,0 +1,6 @@
package com.example.school_asignment_app
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

View File

@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

31
android/build.gradle Normal file
View File

@ -0,0 +1,31 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

View File

@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

11
android/settings.gradle Normal file
View File

@ -0,0 +1,11 @@
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

BIN
assets/images/login_bgi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
assets/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

34
ios/.gitignore vendored Normal file
View File

@ -0,0 +1,34 @@
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
</dict>
</plist>

View File

@ -0,0 +1 @@
#include "Generated.xcconfig"

View File

@ -0,0 +1 @@
#include "Generated.xcconfig"

View File

@ -0,0 +1,613 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
proxyType = 1;
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
remoteInfo = Runner;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
331C8082294A63A400263BE5 /* RunnerTests */ = {
isa = PBXGroup;
children = (
331C807B294A618700263BE5 /* RunnerTests.swift */,
);
path = RunnerTests;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
331C8082294A63A400263BE5 /* RunnerTests */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
331C8080294A63A400263BE5 /* RunnerTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
331C807D294A63A400263BE5 /* Sources */,
331C807E294A63A400263BE5 /* Frameworks */,
331C807F294A63A400263BE5 /* Resources */,
);
buildRules = (
);
dependencies = (
331C8086294A63A400263BE5 /* PBXTargetDependency */,
);
name = RunnerTests;
productName = RunnerTests;
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
331C8080294A63A400263BE5 = {
CreatedOnToolsVersion = 14.0;
TestTargetID = 97C146ED1CF9000F007C117D;
};
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
331C8080294A63A400263BE5 /* RunnerTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
331C807F294A63A400263BE5 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
331C807D294A63A400263BE5 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 97C146ED1CF9000F007C117D /* Runner */;
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
331C8088294A63A400263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Debug;
};
331C8089294A63A400263BE5 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Release;
};
331C808A294A63A400263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.schoolAsignmentApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
331C8088294A63A400263BE5 /* Debug */,
331C8089294A63A400263BE5 /* Release */,
331C808A294A63A400263BE5 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "331C8080294A63A400263BE5"
BuildableName = "RunnerTests.xctest"
BlueprintName = "RunnerTests"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>

View File

@ -0,0 +1,13 @@
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}

View File

@ -0,0 +1,122 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

View File

@ -0,0 +1,5 @@
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
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.

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

51
ios/Runner/Info.plist Normal file
View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>School Asignment App</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>school_asignment_app</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1 @@
#import "GeneratedPluginRegistrant.h"

View File

@ -0,0 +1,12 @@
import Flutter
import UIKit
import XCTest
class RunnerTests: XCTestCase {
func testExample() {
// If you add code to the Runner application, consider adding tests here.
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
}
}

View File

@ -0,0 +1,19 @@
import 'package:school_asignment_app/common/job/user_info.dart';
import 'package:school_asignment_app/common/request/rest_dio.dart';
import '../job/common/base_structure_result.dart';
class UserApi{
static Future<BaseStructureResult<dynamic>> toLogin({required String loginName, required String password}) async {
var response = await RestDio.instance.post('/auth/login/exam-marking/user', data: {'loginName': loginName,'password': password});
return BaseStructureResult.fromJson(response, (response) => response);
}
//
static Future<BaseStructureResult<UserInfo>> getUserInfo() async {
var response = await RestDio.instance.get('/auth/info/cur-user');
return BaseStructureResult.fromJson(response, (response) => UserInfo.fromJson(response));
}
}

View File

@ -0,0 +1,18 @@
// ignore_for_file: constant_identifier_names
library values;
///
///
///
class AppConfig {
static const bool DEBUG_MODE = false;
/// ui width
static const UI_WIDTH = 375.0;
/// ui width
static const UI_HEIGHT = 812.0;
}

View File

@ -0,0 +1,53 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-06 14:52:21
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-06 14:57:33
* @FilePath: \marking_app\lib\utils\colorUtils.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'dart:ui';
import 'dart:ui';
import 'package:flutter/material.dart';
//hex改一下#223344 needs change to 0xFF223344
//#0xFF
MaterialColor createMaterialColor(Color color) {
List strengths = <double>[.05];
Map<int, Color> swatch = {};
final int r = color.red, g = color.green, b = color.blue;
for (int i = 1; i < 10; i++) {
strengths.add(0.1 * i);
}
for (var strength in strengths) {
final double ds = 0.5 - strength;
swatch[(strength * 1000).round()] = Color.fromRGBO(
r + ((ds < 0 ? r : (255 - r)) * ds).round(),
g + ((ds < 0 ? g : (255 - g)) * ds).round(),
b + ((ds < 0 ? b : (255 - b)) * ds).round(),
1,
);
}
return MaterialColor(color.value, swatch);
}
class CommonColors {
static const Color defaultColor = Color.fromRGBO(45, 56, 76, 1);
static Map<String, ColorItem> map = Map.from({
'text_black': ColorItem(
title: 'text_black', color: const Color.fromRGBO(45, 56, 76, 1)),
});
ColorItem getColorItem(String key, {Color color = defaultColor}) {
return map[key] ?? ColorItem(color: color,title: 'default_color');
}
}
class ColorItem {
String title;
Color color;
ColorItem({required this.color, required this.title});
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,31 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-19 16:17:38
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-19 16:22:41
* @FilePath: \marking_app\lib\common\model\common\base_page.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'package:json_annotation/json_annotation.dart';
part 'base_page.g.dart';
@JsonSerializable()
class BasePage extends Object {
@JsonKey(name: 'Page')
int page;
@JsonKey(name: 'Limit')
int limit;
BasePage(this.page,this.limit,);
factory BasePage.fromJson(Map<String, dynamic> srcJson) => _$BasePageFromJson(srcJson);
Map<String, dynamic> toJson() => _$BasePageToJson(this);
}

View File

@ -0,0 +1,17 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_page.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BasePage _$BasePageFromJson(Map<String, dynamic> json) => BasePage(
json['Page'] as int,
json['Limit'] as int,
);
Map<String, dynamic> _$BasePageToJson(BasePage instance) => <String, dynamic>{
'Page': instance.page,
'Limit': instance.limit,
};

View File

@ -0,0 +1,29 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-18 17:44:15
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-19 16:19:15
* @FilePath: \marking_app\lib\common\model\common\base_page.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'package:json_annotation/json_annotation.dart';
part 'base_page_data.g.dart';
@JsonSerializable(genericArgumentFactories: true, fieldRename: FieldRename.snake)
class BasePageData<T> extends Object {
@JsonKey(name: 'items')
List<T> items;
@JsonKey(name: 'total')
int total;
BasePageData(this.items,this.total,);
factory BasePageData.fromJson( Map<String, dynamic> json, T Function(dynamic json) fromJsonT) => _$BasePageDataFromJson(json, fromJsonT);
Map<String, dynamic> toJson(Object Function(T value) toJsonT) => _$BasePageDataToJson(this, toJsonT);
}

View File

@ -0,0 +1,25 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_page_data.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BasePageData<T> _$BasePageDataFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
BasePageData<T>(
(json['items'] as List<dynamic>).map(fromJsonT).toList(),
json['total'] as int,
);
Map<String, dynamic> _$BasePageDataToJson<T>(
BasePageData<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'items': instance.items.map(toJsonT).toList(),
'total': instance.total,
};

View File

@ -0,0 +1,19 @@
import 'package:json_annotation/json_annotation.dart';
part 'base_page_data_report.g.dart';
@JsonSerializable(genericArgumentFactories: true, fieldRename: FieldRename.snake)
class BasePageDataReport<T> extends Object {
@JsonKey(name: 'Data')
List<T> items;
@JsonKey(name: 'Total')
int total;
BasePageDataReport(this.items,this.total,);
factory BasePageDataReport.fromJson( Map<String, dynamic> json, T Function(dynamic json) fromJsonT) => _$BasePageDataReportFromJson(json, fromJsonT);
Map<String, dynamic> toJson(Object Function(T value) toJsonT) => _$BasePageDataReportToJson(this, toJsonT);
}

View File

@ -0,0 +1,25 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_page_data_report.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BasePageDataReport<T> _$BasePageDataReportFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
BasePageDataReport<T>(
(json['Data'] as List<dynamic>).map(fromJsonT).toList(),
json['Total'] as int,
);
Map<String, dynamic> _$BasePageDataReportToJson<T>(
BasePageDataReport<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'Data': instance.items.map(toJsonT).toList(),
'Total': instance.total,
};

View File

@ -0,0 +1,31 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-19 16:17:38
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-19 16:22:41
* @FilePath: \marking_app\lib\common\model\common\base_page.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'package:json_annotation/json_annotation.dart';
part 'base_page_report.g.dart';
@JsonSerializable()
class BasePageReport extends Object {
@JsonKey(name: 'PageIndex')
int page;
@JsonKey(name: 'PageSize')
int limit;
BasePageReport(this.page,this.limit,);
factory BasePageReport.fromJson(Map<String, dynamic> srcJson) => _$BasePageReportFromJson(srcJson);
Map<String, dynamic> toJson() => _$BasePageReportToJson(this);
}

View File

@ -0,0 +1,19 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_page_report.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BasePageReport _$BasePageReportFromJson(Map<String, dynamic> json) =>
BasePageReport(
json['PageIndex'] as int,
json['PageSize'] as int,
);
Map<String, dynamic> _$BasePageReportToJson(BasePageReport instance) =>
<String, dynamic>{
'PageIndex': instance.page,
'PageSize': instance.limit,
};

View File

@ -0,0 +1,38 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-13 18:30:11
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-14 10:20:21
* @FilePath: \marking_app\lib\common\model\common\base_structure_result.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'package:json_annotation/json_annotation.dart';
import 'package:school_asignment_app/common/request/request_config.dart';
part 'base_structure_result.g.dart';
@JsonSerializable(genericArgumentFactories: true, fieldRename: FieldRename.snake)
class BaseStructureResult<T> extends Object {
@JsonKey(name: 'success')
bool success;
@JsonKey(name: 'code')
int code;
@JsonKey(name: 'message')
String? message;
@JsonKey(name: 'data')
T? data;
BaseStructureResult(
this.code,
this.message,
this.data, {
this.success = false,
}) {
success = (code == RequestConfig.successCode);
}
factory BaseStructureResult.fromJson(Map<String, dynamic> json, T Function(dynamic json) fromJsonT) => _$BaseStructureResultFromJson(json, fromJsonT);
Map<String, dynamic> toJson(Object Function(T value) toJsonT) => _$BaseStructureResultToJson(this, toJsonT);
}

View File

@ -0,0 +1,41 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_structure_result.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BaseStructureResult<T> _$BaseStructureResultFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
BaseStructureResult<T>(
json['code'] as int,
json['message'] as String?,
_$nullableGenericFromJson(json['data'], fromJsonT),
success: json['success'] as bool? ?? false,
);
Map<String, dynamic> _$BaseStructureResultToJson<T>(
BaseStructureResult<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'success': instance.success,
'code': instance.code,
'message': instance.message,
'data': _$nullableGenericToJson(instance.data, toJsonT),
};
T? _$nullableGenericFromJson<T>(
Object? input,
T Function(Object? json) fromJson,
) =>
input == null ? null : fromJson(input);
Object? _$nullableGenericToJson<T>(
T? input,
Object? Function(T value) toJson,
) =>
input == null ? null : toJson(input);

View File

@ -0,0 +1,38 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-13 18:30:11
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-14 10:20:21
* @FilePath: \marking_app\lib\common\model\common\base_structure_result.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'package:json_annotation/json_annotation.dart';
import 'package:school_asignment_app/common/request/request_config.dart';
part 'base_structure_result_report.g.dart';
@JsonSerializable(genericArgumentFactories: true, fieldRename: FieldRename.snake)
class BaseStructureResultReport<T> extends Object {
@JsonKey(name: 'success')
bool success;
@JsonKey(name: 'Code')
int code;
@JsonKey(name: 'Message')
String? message;
@JsonKey(name: 'Data')
T? data;
BaseStructureResultReport(
this.code,
this.message,
this.data, {
this.success = false,
}) {
success = (code == RequestConfig.successCode);
}
factory BaseStructureResultReport.fromJson(Map<String, dynamic> json, T Function(dynamic json) fromJsonT) => _$BaseStructureResultReportFromJson(json, fromJsonT);
Map<String, dynamic> toJson(Object Function(T value) toJsonT) => _$BaseStructureResultReportToJson(this, toJsonT);
}

View File

@ -0,0 +1,41 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_structure_result_report.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BaseStructureResultReport<T> _$BaseStructureResultReportFromJson<T>(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) =>
BaseStructureResultReport<T>(
json['Code'] as int,
json['Message'] as String?,
_$nullableGenericFromJson(json['Data'], fromJsonT),
success: json['success'] as bool? ?? false,
);
Map<String, dynamic> _$BaseStructureResultReportToJson<T>(
BaseStructureResultReport<T> instance,
Object? Function(T value) toJsonT,
) =>
<String, dynamic>{
'success': instance.success,
'Code': instance.code,
'Message': instance.message,
'Data': _$nullableGenericToJson(instance.data, toJsonT),
};
T? _$nullableGenericFromJson<T>(
Object? input,
T Function(Object? json) fromJson,
) =>
input == null ? null : fromJson(input);
Object? _$nullableGenericToJson<T>(
T? input,
Object? Function(T value) toJson,
) =>
input == null ? null : toJson(input);

View File

@ -0,0 +1,57 @@
import 'package:json_annotation/json_annotation.dart';
part 'upload_img_secret_key.g.dart';
@JsonSerializable()
class UploadImgSecretKey extends Object {
@JsonKey(name: 'account')
String? account;
@JsonKey(name: 'bucketName')
String? bucketName;
@JsonKey(name: 'endPoint')
int? endPoint;
@JsonKey(name: 'ip')
String? ip;
@JsonKey(name: 'password')
String? password;
@JsonKey(name: 'imgSecretKey')
bool? imgSecretKey;
//
bool annotationSwitch;
UploadImgSecretKey({this.account,this.bucketName,this.endPoint,this.ip,this.password,this.imgSecretKey,this.annotationSwitch = false});
factory UploadImgSecretKey.fromJson(Map<String, dynamic> srcJson) => _$UploadImgSecretKeyFromJson(srcJson);
Map<String, dynamic> toJson() => _$UploadImgSecretKeyToJson(this);
}
///
@JsonSerializable()
class FileResult extends Object{
String? path; //
String? url; // url地址
dynamic? otherParam;
String myObject; //
bool success; //
FileResult({required this.myObject, this.url, this.success = false,this.otherParam});
factory FileResult.fromJson(Map<String, dynamic> srcJson) => _$FileResultFromJson(srcJson);
Map<String, dynamic> toJson() => _$FileResultToJson(this);
}

View File

@ -0,0 +1,45 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'upload_img_secret_key.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
UploadImgSecretKey _$UploadImgSecretKeyFromJson(Map<String, dynamic> json) =>
UploadImgSecretKey(
account: json['account'] as String?,
bucketName: json['bucketName'] as String?,
endPoint: json['endPoint'] as int?,
ip: json['ip'] as String?,
password: json['password'] as String?,
imgSecretKey: json['imgSecretKey'] as bool?,
annotationSwitch: json['annotationSwitch'] as bool? ?? false,
);
Map<String, dynamic> _$UploadImgSecretKeyToJson(UploadImgSecretKey instance) =>
<String, dynamic>{
'account': instance.account,
'bucketName': instance.bucketName,
'endPoint': instance.endPoint,
'ip': instance.ip,
'password': instance.password,
'imgSecretKey': instance.imgSecretKey,
'annotationSwitch': instance.annotationSwitch,
};
FileResult _$FileResultFromJson(Map<String, dynamic> json) => FileResult(
myObject: json['myObject'] as String,
url: json['url'] as String?,
success: json['success'] as bool? ?? false,
otherParam: json['otherParam'],
)..path = json['path'] as String?;
Map<String, dynamic> _$FileResultToJson(FileResult instance) =>
<String, dynamic>{
'path': instance.path,
'url': instance.url,
'otherParam': instance.otherParam,
'myObject': instance.myObject,
'success': instance.success,
};

View File

@ -0,0 +1,53 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-14 10:44:46
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-19 20:17:48
* @FilePath: \marking_app\lib\common\model\user\user_info.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'dart:convert';
import 'package:json_annotation/json_annotation.dart';
part 'user_info.g.dart';
@JsonSerializable(checked: true)
class UserInfo extends Object {
@JsonKey(name: 'id')
String id ='';
@JsonKey(name: 'userName')
String userName = '';
@JsonKey(name: 'loginName')
String loginName = '';
@JsonKey(name: 'subjectIds')
List<int> subjectIds = [];
@JsonKey(name: 'schoolId')
int schoolId = 0;
@JsonKey(name: 'schoolName')
String schoolName = '';
@JsonKey(name: 'avatar')
String avatar ='';
@JsonKey(name: 'positionNames')
List<String> positionNames=[];
UserInfo();
factory UserInfo.fromJson(Map<String, dynamic> srcJson) => _$UserInfoFromJson(srcJson);
Map<String, dynamic> toJson() => _$UserInfoToJson(this);
}

View File

@ -0,0 +1,41 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_info.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
UserInfo _$UserInfoFromJson(Map<String, dynamic> json) => $checkedCreate(
'UserInfo',
json,
($checkedConvert) {
final val = UserInfo();
$checkedConvert('id', (v) => val.id = v as String);
$checkedConvert('userName', (v) => val.userName = v as String);
$checkedConvert('loginName', (v) => val.loginName = v as String);
$checkedConvert(
'subjectIds',
(v) => val.subjectIds =
(v as List<dynamic>).map((e) => e as int).toList());
$checkedConvert('schoolId', (v) => val.schoolId = v as int);
$checkedConvert('schoolName', (v) => val.schoolName = v as String);
$checkedConvert('avatar', (v) => val.avatar = v as String);
$checkedConvert(
'positionNames',
(v) => val.positionNames =
(v as List<dynamic>).map((e) => e as String).toList());
return val;
},
);
Map<String, dynamic> _$UserInfoToJson(UserInfo instance) => <String, dynamic>{
'id': instance.id,
'userName': instance.userName,
'loginName': instance.loginName,
'subjectIds': instance.subjectIds,
'schoolId': instance.schoolId,
'schoolName': instance.schoolName,
'avatar': instance.avatar,
'positionNames': instance.positionNames,
};

View File

@ -0,0 +1,32 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-13 14:50:51
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-13 17:22:16
* @FilePath: \marking_app\lib\common\model\UserLogin.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'package:json_annotation/json_annotation.dart';
part 'user_login.g.dart';
@JsonSerializable(checked: true)
class UserLogin extends Object {
@JsonKey(name: 'access_token')
String accessToken;
@JsonKey(name: 'expires_in')
int expiresIn;
@JsonKey(name: 'token_type')
String tokenType;
UserLogin(this.accessToken,this.expiresIn,this.tokenType,);
factory UserLogin.fromJson(Map<String, dynamic> srcJson) => _$UserLoginFromJson(srcJson);
Map<String, dynamic> toJson() => _$UserLoginToJson(this);
}

View File

@ -0,0 +1,31 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_login.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
UserLogin _$UserLoginFromJson(Map<String, dynamic> json) => $checkedCreate(
'UserLogin',
json,
($checkedConvert) {
final val = UserLogin(
$checkedConvert('access_token', (v) => v as String),
$checkedConvert('expires_in', (v) => v as int),
$checkedConvert('token_type', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'accessToken': 'access_token',
'expiresIn': 'expires_in',
'tokenType': 'token_type'
},
);
Map<String, dynamic> _$UserLoginToJson(UserLogin instance) => <String, dynamic>{
'access_token': instance.accessToken,
'expires_in': instance.expiresIn,
'token_type': instance.tokenType,
};

View File

@ -0,0 +1,80 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-13 11:28:23
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-09-14 11:17:20
* @FilePath: \marking_app\lib\config\RequestConfig.dart
* @Description:
*/
import 'package:school_asignment_app/common/job/common/base_page.dart';
class RequestConfig {
/*
static const devBaseUrl = "http://192.168.2.9:6600"; // ==>
// static const devBaseUrl = "http://192.168.2.8:6700"; // ==>
static const devLoginBaseUrl = "http://192.168.2.9:6400"; //
static const devBaseUrlOfReport = "http://192.168.2.9:4000"; // */
static const devBaseUrl = "https://mk-hw.23544.com"; //
static const devLoginBaseUrl = "https://mk-hw.23544.com"; //
static const devBaseUrlOfReport = "https://mhw.qwit.top"; //
static const proBaseUrlOfHomework = "https://mk-hw.23544.com/hw"; //
/* 正式地址 */
static const proBaseUrl = "https://mk-hw.23544.com"; //
static const proLoginBaseUrl = "https://mk-hw.23544.com"; //
static const proBaseUrlOfReport = "https://dc-api.23544.com"; //
// static const proBaseUrlOfHomework = "https://mk-hw.23544.com/hw"; //
static const hwProxyKeywords = "/hw"; //
// https://mk-api.23544.com/hw/hw/api/Task/answer
// http://192.168.2.9:6400/hw/api/Task/answer
static RequestConfig? _instance;
String baseUrl;
String loginBaseUrl;
String baseUrlOfReport;
static const connectTimeout = 8000; //
static const receiveTimeout = 8000; //
static const bool requestDataPrinting = true; //
static const bool printSwitch = true; //
static const successCode = 200; // code
static final BasePage basePage = BasePage(1, 10); //
//
//
RequestConfig._(
{required this.baseUrl,
required this.baseUrlOfReport,
required this.loginBaseUrl});
factory RequestConfig() {
if (_instance == null) {
late String newBaseUrl;
late String newBaseUrlOfReport;
late String newLoginBaseUrl;
if (bool.fromEnvironment('dart.vm.product')) {
//
newLoginBaseUrl = proLoginBaseUrl;
newBaseUrl = proBaseUrl;
newBaseUrlOfReport = proBaseUrlOfReport;
} else {
//
newBaseUrl = devBaseUrl;
newBaseUrlOfReport = devBaseUrlOfReport;
newLoginBaseUrl = devLoginBaseUrl;
}
_instance = RequestConfig._(
baseUrl: newBaseUrl,
baseUrlOfReport: newBaseUrlOfReport,
loginBaseUrl: newLoginBaseUrl);
}
return _instance!;
}
}

View File

@ -0,0 +1,427 @@
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dio/dio.dart';
import 'package:dio/adapter.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:package_info/package_info.dart';
import 'package:school_asignment_app/common/request/request_config.dart';
import 'package:school_asignment_app/common/store/app_storage_key.dart';
import 'package:school_asignment_app/common/the_global.dart';
import 'package:school_asignment_app/common/utils/storage.dart';
import 'package:school_asignment_app/common/utils/toast_utils.dart';
class RestDio {
late Dio _dio;
//
static final RestDio instance = RestDio._internal();
factory RestDio() => instance;
RestDio._internal() {
init();
}
//
init() {
BaseOptions options = BaseOptions(
baseUrl: RequestConfig().baseUrl,
connectTimeout: RequestConfig.connectTimeout,
receiveTimeout: RequestConfig.receiveTimeout,
);
_dio = Dio(options);
_dio.interceptors.add(AuthInterceptor()); // token
_dio.interceptors.add(ResponseHandle()); //
_dio.interceptors.add(TheError()); //
const isProd = bool.fromEnvironment('dart.vm.product');
if (!isProd && RequestConfig.requestDataPrinting) {
_dio.interceptors.add(LogInterceptor(responseBody: true, requestBody: true)); //
}
// https证书
setHttpsPEM();
// setHttpsPKCS12();
// 使
// setFindProxy();
}
/// restful post
Future get(String path, {Map<String, dynamic>? queryParameters, Options? options}) async {
Options requestOptions = options ?? Options();
var response = await _dio.get(
path,
queryParameters: queryParameters,
options: requestOptions,
cancelToken: CancelToken(),
);
return response.data;
}
/// restful post
Future post(String path, {Map<String, dynamic>? data, Options? options}) async {
Options requestOptions = options ?? Options();
var response = await _dio.post(
path,
data: data,
options: requestOptions,
cancelToken: CancelToken(),
);
return response.data;
}
String PEM = "XXXXX"; // certificate content
String PKCS12File = "XXXXX"; // certificate content
//dio
Future<Dio> getDio() async {
return _dio;
}
//
setHttpsPEM() async {
(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
client.badCertificateCallback = (X509Certificate cert, String host, int port) {
// if (cert.pem == PEM) {
// // Verify the certificate
// return true;
// }
// return false;
return true;
};
};
}
setHttpsPKCS12() async {
(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
SecurityContext sc = new SecurityContext();
//file is the path of certificate
sc.setTrustedCertificates(PKCS12File);
HttpClient httpClient = new HttpClient(context: sc);
return httpClient;
};
}
//
setFindProxy() async {
//
_dio.interceptors.add(InterceptorsWrapper(onRequest: (options, handler) {
// URI
if (options.uri.path.contains(RequestConfig.hwProxyKeywords)) {
//
_dio.httpClientAdapter = DefaultHttpClientAdapter();
(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
client.findProxy = (uri) {
print('进入开始代理...............');
return RequestConfig.proBaseUrlOfHomework;
};
};
}
return handler.next(options); //
}));
}
}
/*
*
*AuthInterceptor
*header认证
* */
class AuthInterceptor extends Interceptor {
String PLATFORM = "android"; //
@override
onRequest(RequestOptions options, RequestInterceptorHandler handler) async {
//app版本
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;
if (Platform.isIOS) {
PLATFORM = "ios";
} else if (Platform.isAndroid) {
PLATFORM = "android";
} else if (Platform.isWindows) {
PLATFORM = "Windows";
} else if (Platform.isMacOS) {
PLATFORM = "macos";
} else if (Platform.isLinux) {
PLATFORM = "Linux";
}
Map<String, String> headers = {};
headers["Accept-Charset"] = "utf-8";
headers["Connection"] = "keep-alive";
headers["Accept"] = "*/*";
headers["x-version"] = version; //
headers["x-platform"] = PLATFORM;
// header token
String? token = StorageService.to.read(AppStorageKey.STORAGE_USER_TOKEN);
if (null != token && token.isNotEmpty) {
headers["Authorization"] = 'Bearer $token'; //
}
options.headers = headers;
Uri uri = options.uri;
print(uri.toString());
// URL
if (uri.toString().contains(RequestConfig.hwProxyKeywords)) {
String newPath = options.path.replaceFirst(RegExp('^${RequestConfig.hwProxyKeywords}'), '');
options.path = newPath;
// URL
options.baseUrl = RequestConfig.proBaseUrlOfHomework;
}
// print('请求参数query' + jsonEncode(options.queryParameters));
// print('请求参数data' + jsonEncode(options.data));
return super.onRequest(options, handler);
}
}
/*
* ResponseHandle
*
**/
class ResponseHandle extends Interceptor {
@override
void onResponse(Response response, ResponseInterceptorHandler handler) {
const isProd = bool.fromEnvironment('dart.vm.product');
if (!isProd && RequestConfig.requestDataPrinting) {
// printJson(response.data);
}
super.onResponse(response, handler);
}
}
/*
* ResponseHandle
*
**/
class TheError extends Interceptor {
//
Future<bool> isConnected() async {
var connectivityResult = await (Connectivity().checkConnectivity());
return connectivityResult != ConnectivityResult.none;
}
@override
Future<void> onError(DioError err, ErrorInterceptorHandler handler) async {
// socket实例dio原生的实例message属于是只读的
// dio err实例
if (err.error is SocketException) {
err.error = MyDioSocketException(
err.message.contains('111') ? "服务器拒绝连接,请重试" : err.message,
osError: err.error?.osError,
address: err.error?.address,
port: err.error?.port,
);
}
// dio默认的错误实例
if (err.type == DioErrorType.other) {
bool isConnectNetWork = await isConnected();
if (!isConnectNetWork && err.error is MyDioSocketException) {
err.error.message = "当前网络不可用,请检查您的网络";
}
}
// error统一处理
AppException appException = AppException.create(err);
//
// debugPrint('DioError===: ${appException.toString()}');
err = appException;
return super.onError(err, handler);
}
}
String getDioErrorTypeStr(DioError err) {
DioErrorType errorType = err.type;
String str;
switch (errorType) {
case DioErrorType.connectTimeout:
str = '连接超时,请检查网络再重试';
break;
case DioErrorType.sendTimeout:
str = '发送时间超时,请重试';
break;
case DioErrorType.receiveTimeout:
str = '接收数据超时,请重试';
break;
case DioErrorType.response:
str = '请求返回失败';
break;
case DioErrorType.cancel:
str = '请求取消';
break;
case DioErrorType.other:
str = '请求其他错误';
break;
}
return str;
}
///
class AppException extends DioError {
final String _message;
final int _code;
AppException(this._code, this._message, StackTrace? theStackTrace,
{required super.requestOptions, super.type, super.error}) {
super.stackTrace = theStackTrace;
}
@override
String toString() {
return "$_code$_message" + super.toString();
}
String getMessage() {
return _message;
}
factory AppException.create(DioError error) {
switch (error.type) {
case DioErrorType.cancel:
{
return AppException(-1, "请求取消", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case DioErrorType.connectTimeout:
{
return AppException(-1, "连接超时", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case DioErrorType.sendTimeout:
{
return AppException(-1, "请求超时", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case DioErrorType.receiveTimeout:
{
return AppException(-1, "响应超时", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case DioErrorType.response:
{
try {
int? errCode = error.response!.statusCode;
// String errMsg = error.response.statusMessage;
// return ErrorEntity(code: errCode, message: errMsg);
switch (errCode) {
case 400:
{
return AppException(errCode!, "请求语法错误", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case 401:
{
var currentContext = TheGlobal.navigatorKey.currentState?.overlay?.context;
if (currentContext != null) {
var routePath = ModalRoute.of(currentContext)?.settings;
if (routePath != null) {
} else {
if (TheGlobal.navigatorKey.currentContext != null) {
ExceptionHandle.toLogin(TheGlobal.navigatorKey.currentContext);
}
}
}
return AppException(errCode!, "登录信息过期,请重新登录", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case 403:
{
return AppException(errCode!, "服务器拒绝执行", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case 404:
{
return AppException(errCode!, "无法连接服务器", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case 405:
{
return AppException(errCode!, "请求方法被禁止", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case 500:
{
return AppException(errCode!, "服务器内部错误", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case 502:
{
return AppException(errCode!, "无效的请求", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case 503:
{
return AppException(errCode!, "服务器挂了", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
case 505:
{
return AppException(errCode!, "不支持HTTP协议请求", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
default:
{
// return ErrorEntity(code: errCode, message: "未知错误");
return AppException(errCode!, error.response!.statusMessage!, error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
}
} on Exception catch (_) {
return AppException(-1, "未知错误", error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
}
default:
{
return AppException(-1, error.error.message, error.stackTrace,
requestOptions: error.requestOptions, type: error.type, error: error.error);
}
}
}
}
class ExceptionHandle {
//
static void exceptionPrompt(BuildContext context, AppException err, {bool logicHandle = true}) {
ToastUtils.getFluttertoast(
context: context,
msg: err._message,
backgroundColor: Colors.grey[350],
toastLength: Toast.LENGTH_LONG,
);
if (!logicHandle) return;
switch (err._code) {
case 401:
toLogin(context); //
break;
default:
}
}
static void toLogin(context, {int timeer = 800}) {
/* setTimeOut(
timeer,
() => RouterManager.router.navigateTo(context, RouterManager.loginPath, clearStack: true),
);*/
}
}
// soket错误实例dio默认生成的是不允许修改message内容的使
class MyDioSocketException extends SocketException {
String message;
MyDioSocketException(
this.message, {
osError,
address,
port,
}) : super(
message,
osError: osError,
address: address,
port: port,
);
}

View File

@ -0,0 +1,15 @@
/// -
// ignore_for_file: constant_identifier_names
class AppStorageKey {
///
static const String STORAGE_USER_INFO = 'user_info';
/// token
static const String STORAGE_USER_TOKEN = 'APP:TOKEN';
///
static const String STORAGE_USER_MOBILE = 'user_mobile';
}

View File

@ -0,0 +1,48 @@
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/user_info.dart';
import 'package:school_asignment_app/common/store/app_storage_key.dart';
import 'package:school_asignment_app/common/utils/storage.dart';
import 'package:school_asignment_app/routes/app_pages.dart';
class UserStore extends GetxController {
static UserStore get to => Get.find();
///
final isLogin = false.obs;
String token = '';
///
Rx<UserInfo> userInfo = Rx(UserInfo());
void init() {
/*token = StorageService.to.read(AppStorageKey.STORAGE_USER_TOKEN) ?? '';
try {
var userInfoJson = StorageService.to.read(AppStorageKey.STORAGE_USER_INFO);
if (userInfoJson != null) {
userInfo.value = UserInfo.fromJson(userInfoJson);
} else {
userInfo.value = UserInfo();
}
} catch (err, t) {
userInfo.value = UserInfo();
StorageService.to.remove(AppStorageKey.STORAGE_USER_INFO);
}
if (token.isNotEmpty && userInfo.value.loginName.isNotEmpty) {
isLogin.value = true;
}else{
isLogin.value = false;
Get.toNamed(Routes.login);
}*/
}
/// token
void setToken(String token) {
token = token;
StorageService.to.write(AppStorageKey.STORAGE_USER_TOKEN, token);
}
/// token
void setUserInfo(UserInfo info) {
userInfo.value = info;
StorageService.to.write(AppStorageKey.STORAGE_USER_INFO, info);
}
}

View File

@ -0,0 +1,6 @@
import 'package:flutter/material.dart';
// GlobalKey
class TheGlobal {
static GlobalKey<NavigatorState> navigatorKey = GlobalKey();
}

View File

@ -0,0 +1,21 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-13 16:59:53
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-13 17:00:56
* @FilePath: \marking_app\lib\utils\common_utils.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'dart:convert';
import 'package:convert/convert.dart';
import 'package:crypto/crypto.dart';
class CommonUtils {
// md5
static String generateMD5(String data) {
var content = new Utf8Encoder().convert(data);
var digest = md5.convert(content);
// digest.toString()
return hex.encode(digest.bytes);
}
}

View File

@ -0,0 +1,30 @@
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
class StorageService extends GetxService {
static StorageService get to => Get.find();
late final GetStorage _getStorage;
get storage => _getStorage;
Future<void> init() async {
await GetStorage.init();
_getStorage = GetStorage();
}
T? read<T>(String key) {
return _getStorage.read(key);
}
Future<void> write(String key, dynamic value) async {
return await _getStorage.write(key, value);
}
Future<void> remove(String key) async {
return await _getStorage.remove(key);
}
bool hasData(String key) {
return _getStorage.hasData(key);
}
}

View File

@ -0,0 +1,82 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-07-13 16:31:05
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-07-28 11:56:13
* @FilePath: \marking_app\lib\utils\toast_utils.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
class ToastUtils {
static void getFluttertoast({
required BuildContext context,
required String msg,
Toast? toastLength,
int timeInSecForIosWeb = 1,
double? fontSize,
ToastGravity? gravity,
Color? backgroundColor,
Color? textColor,
}) {
Fluttertoast.showToast(
msg: msg,
toastLength: toastLength ?? Toast.LENGTH_SHORT,
gravity: gravity ?? ToastGravity.CENTER,
timeInSecForIosWeb: timeInSecForIosWeb,
backgroundColor: backgroundColor ?? Theme.of(context).primaryColor,
textColor: textColor ?? Colors.white,
fontSize: fontSize ?? 16.sp,
);
}
static void getErrFluttertoast({
required BuildContext context,
required String msg,
ToastGravity gravity = ToastGravity.BOTTOM,
Color backgroundColor = Colors.grey,
Toast? toastLength,
int timeInSecForIosWeb = 1,
double? fontSize,
Color? textColor,
}) {
ToastUtils.getFluttertoast(
context: context,
msg: msg,
toastLength: toastLength ?? Toast.LENGTH_SHORT,
gravity: gravity,
timeInSecForIosWeb: timeInSecForIosWeb,
backgroundColor: backgroundColor,
textColor: textColor ?? Colors.white,
fontSize: fontSize ?? 16.sp,
);
}
static showError(String showMsg) {
EasyLoading.showError(showMsg);
}
static showLoading() {
EasyLoading.show(status: 'loading...');
}
static showInfo(String showMsg, {Duration? duration}) {
EasyLoading.showInfo(showMsg, duration: duration);
}
static showInfoSimple(String showMsg, int microseconds) {
EasyLoading.showInfo(showMsg, duration: Duration(microseconds: microseconds));
}
static showSuccess(String showMsg, {Duration? duration}) {
EasyLoading.showSuccess(showMsg, duration: duration);
}
static dismiss() {
EasyLoading.dismiss();
}
}

View File

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class Utils{
Utils._internal();
///
static void hideKeyboard() {
FocusScopeNode? currentFocus = Get.focusScope?.nearestScope;
if (currentFocus == null) {
return;
}
if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
FocusManager.instance.primaryFocus?.unfocus();
}
}
}

164
lib/main.dart Normal file
View File

@ -0,0 +1,164 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/common/config/app_config.dart';
import 'package:school_asignment_app/common/config/colorUtils.dart';
import 'package:school_asignment_app/common/store/user_store.dart';
import 'package:school_asignment_app/common/utils/storage.dart';
import 'package:school_asignment_app/common/utils/utils.dart';
import 'package:school_asignment_app/routes/app_pages.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
void main() async{
// Get
Get.testMode = true;
///
StorageService storageService = StorageService();
await storageService.init();
Get.put(storageService);
/// UserStore
UserStore userStore = UserStore();
userStore.init();
Get.put<UserStore>(userStore);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return ScreenUtilInit(
designSize: const Size(AppConfig.UI_WIDTH, AppConfig.UI_HEIGHT),
builder: (BuildContext context, Widget? child) => GetMaterialApp(
title: '作业',
theme: ThemeData(
brightness: Brightness.light,
primarySwatch: createMaterialColor(const Color.fromRGBO(46, 91, 255, 1)),
// textTheme: Typography.englishLike2018.apply(fontSizeFactor: 1.sp,),
primaryTextTheme: TextTheme(
bodyLarge: TextStyle(fontSize: 14.sp, color: Colors.black87),
),
useMaterial3: true,
),
enableLog: true,
logWriterCallback: (text, {bool isError = false}) {
// isError ? LoggerUtils.e(text) : LoggerUtils.i(text);
},
//
defaultTransition: Transition.fade,
//
initialRoute: Routes.startPage,
///
getPages: AppPages.pages,
builder: EasyLoading.init(
builder: (context, child) {
return MediaQuery(
//Setting font does not change with system font size
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: Scaffold(
body: GestureDetector(
onTap: () => Utils.hideKeyboard(),
child: child,
),
),
);
},
),
// home: const MyHomePage(title: 'Flutter Demo Home Page'),
),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// TRY THIS: Try changing the color here to a specific color (to
// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
// change color while the other colors stay the same.
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
//
// TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
// action in the IDE, or press "p" in the console), to see the
// wireframe for each widget.
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}

View File

@ -0,0 +1,33 @@
/*
* @Author: wangyang 1147192855@qq.com
* @Date: 2022-08-01 14:11:37
* @LastEditors: wangyang 1147192855@qq.com
* @LastEditTime: 2022-08-02 15:34:34
* @FilePath: \marking_app\lib\utils\my_text.dart
* @Description: ,`customMade`, koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import 'package:flutter/cupertino.dart';
import 'package:school_asignment_app/common/config/colorUtils.dart';
// Text使用
Text quickText(text,
{double? size,
Color color = CommonColors.defaultColor,
TextAlign? align,
FontWeight? fontWeight,
TextOverflow overflow = TextOverflow.ellipsis,
int maxLines = 1,
TextDecoration decoration = TextDecoration.none}) {
return Text(
text.toString(),
textAlign: align,
maxLines: maxLines,
overflow: overflow,
style: TextStyle(
decoration: decoration,
fontSize: size,
color: color,
fontWeight: fontWeight,
),
);
}

View File

@ -0,0 +1,58 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/user_info.dart';
import 'package:school_asignment_app/common/store/app_storage_key.dart';
import 'package:school_asignment_app/common/utils/storage.dart';
import 'package:school_asignment_app/routes/app_pages.dart';
class StartPage extends StatefulWidget {
const StartPage({Key? key}) : super(key: key);
@override
State<StartPage> createState() => _StartPageState();
}
class _StartPageState extends State<StartPage> {
@override
void initState(){
super.initState();
var token = StorageService.to.read(AppStorageKey.STORAGE_USER_TOKEN) ?? '';
UserInfo userInfo = UserInfo();
try {
var userInfoJson = StorageService.to.read(AppStorageKey.STORAGE_USER_INFO);
if (userInfoJson != null) {
userInfo = UserInfo.fromJson(userInfoJson);
} else {
userInfo = UserInfo();
}
} catch (err, t) {
userInfo = UserInfo();
StorageService.to.remove(AppStorageKey.STORAGE_USER_INFO);
}
if (token.isNotEmpty && userInfo.loginName.isNotEmpty) {
Future.delayed(const Duration(milliseconds: 200)).then((e) {
Get.toNamed(Routes.home);
});
}else{
Future.delayed(const Duration(milliseconds: 200)).then((e) {
Get.toNamed(Routes.login);
});
}
}
@override
Widget build(BuildContext context) {
return Stack(
children: [
Positioned(
bottom: 40.r,
child: Text('启动中...',style: TextStyle(fontSize: 16.r,color: const Color(0xFF6888FD)),))
]
);
}
}

Some files were not shown because too many files have changed in this diff Show More