├── .gitignore
├── .metadata
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── arch
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── app
│ ├── app_controller.dart
│ ├── app_widget.dart
│ ├── blocs
│ │ └── change_theme_bloc.dart
│ ├── interfaces
│ │ └── local_storage_interface.dart
│ ├── models
│ │ ├── appconfig_model.dart
│ │ └── user_model.dart
│ ├── pages
│ │ ├── home
│ │ │ ├── components
│ │ │ │ └── custom_switch_widget.dart
│ │ │ ├── home_controller.dart
│ │ │ └── home_page.dart
│ │ └── login
│ │ │ ├── login_controller.dart
│ │ │ └── login_page.dart
│ ├── services
│ │ ├── client_http_service.dart
│ │ └── shared_local_storage_service.dart
│ ├── stores
│ │ └── change_theme_store.dart
│ └── viewmodels
│ │ └── change_theme_viewmodel.dart
└── main.dart
├── pubspec.lock
├── pubspec.yaml
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ └── Icon-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── AppConfiguration.props
├── FlutterBuild.vcxproj
├── Runner.sln
├── Runner.vcxproj
├── Runner.vcxproj.filters
├── flutter
├── .template_version
├── GeneratedPlugins.props
├── generated_plugin_registrant.cc
└── generated_plugin_registrant.h
├── runner
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
│ └── app_icon.ico
├── run_loop.cpp
├── run_loop.h
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
├── win32_window.h
├── window_configuration.cpp
└── window_configuration.h
└── scripts
├── bundle_assets_and_deps.bat
└── prepare_dependencies.bat
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Exceptions to above rules.
44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
45 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 2f993d70c178f4a927da5d7d76bd527115920695
8 | channel: master
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # arch
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.arch"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/arch/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.arch
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | include ':app'
6 |
7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8 | def properties = new Properties()
9 |
10 | assert localPropertiesFile.exists()
11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12 |
13 | def flutterSdkPath = properties.getProperty("flutter.sdk")
14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
16 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 97C146F11CF9000F007C117D /* Supporting Files */,
94 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
95 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
96 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
97 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
98 | );
99 | path = Runner;
100 | sourceTree = "";
101 | };
102 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | );
106 | name = "Supporting Files";
107 | sourceTree = "";
108 | };
109 | /* End PBXGroup section */
110 |
111 | /* Begin PBXNativeTarget section */
112 | 97C146ED1CF9000F007C117D /* Runner */ = {
113 | isa = PBXNativeTarget;
114 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
115 | buildPhases = (
116 | 9740EEB61CF901F6004384FC /* Run Script */,
117 | 97C146EA1CF9000F007C117D /* Sources */,
118 | 97C146EB1CF9000F007C117D /* Frameworks */,
119 | 97C146EC1CF9000F007C117D /* Resources */,
120 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
121 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
122 | );
123 | buildRules = (
124 | );
125 | dependencies = (
126 | );
127 | name = Runner;
128 | productName = Runner;
129 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
130 | productType = "com.apple.product-type.application";
131 | };
132 | /* End PBXNativeTarget section */
133 |
134 | /* Begin PBXProject section */
135 | 97C146E61CF9000F007C117D /* Project object */ = {
136 | isa = PBXProject;
137 | attributes = {
138 | LastUpgradeCheck = 1020;
139 | ORGANIZATIONNAME = "";
140 | TargetAttributes = {
141 | 97C146ED1CF9000F007C117D = {
142 | CreatedOnToolsVersion = 7.3.1;
143 | LastSwiftMigration = 1100;
144 | };
145 | };
146 | };
147 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
148 | compatibilityVersion = "Xcode 9.3";
149 | developmentRegion = en;
150 | hasScannedForEncodings = 0;
151 | knownRegions = (
152 | en,
153 | Base,
154 | );
155 | mainGroup = 97C146E51CF9000F007C117D;
156 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
157 | projectDirPath = "";
158 | projectRoot = "";
159 | targets = (
160 | 97C146ED1CF9000F007C117D /* Runner */,
161 | );
162 | };
163 | /* End PBXProject section */
164 |
165 | /* Begin PBXResourcesBuildPhase section */
166 | 97C146EC1CF9000F007C117D /* Resources */ = {
167 | isa = PBXResourcesBuildPhase;
168 | buildActionMask = 2147483647;
169 | files = (
170 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
171 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
172 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
173 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
174 | );
175 | runOnlyForDeploymentPostprocessing = 0;
176 | };
177 | /* End PBXResourcesBuildPhase section */
178 |
179 | /* Begin PBXShellScriptBuildPhase section */
180 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
181 | isa = PBXShellScriptBuildPhase;
182 | buildActionMask = 2147483647;
183 | files = (
184 | );
185 | inputPaths = (
186 | );
187 | name = "Thin Binary";
188 | outputPaths = (
189 | );
190 | runOnlyForDeploymentPostprocessing = 0;
191 | shellPath = /bin/sh;
192 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
193 | };
194 | 9740EEB61CF901F6004384FC /* Run Script */ = {
195 | isa = PBXShellScriptBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | );
199 | inputPaths = (
200 | );
201 | name = "Run Script";
202 | outputPaths = (
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | shellPath = /bin/sh;
206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
207 | };
208 | /* End PBXShellScriptBuildPhase section */
209 |
210 | /* Begin PBXSourcesBuildPhase section */
211 | 97C146EA1CF9000F007C117D /* Sources */ = {
212 | isa = PBXSourcesBuildPhase;
213 | buildActionMask = 2147483647;
214 | files = (
215 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
216 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | };
220 | /* End PBXSourcesBuildPhase section */
221 |
222 | /* Begin PBXVariantGroup section */
223 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C146FB1CF9000F007C117D /* Base */,
227 | );
228 | name = Main.storyboard;
229 | sourceTree = "";
230 | };
231 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
232 | isa = PBXVariantGroup;
233 | children = (
234 | 97C147001CF9000F007C117D /* Base */,
235 | );
236 | name = LaunchScreen.storyboard;
237 | sourceTree = "";
238 | };
239 | /* End PBXVariantGroup section */
240 |
241 | /* Begin XCBuildConfiguration section */
242 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
243 | isa = XCBuildConfiguration;
244 | buildSettings = {
245 | ALWAYS_SEARCH_USER_PATHS = NO;
246 | CLANG_ANALYZER_NONNULL = YES;
247 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
248 | CLANG_CXX_LIBRARY = "libc++";
249 | CLANG_ENABLE_MODULES = YES;
250 | CLANG_ENABLE_OBJC_ARC = YES;
251 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
252 | CLANG_WARN_BOOL_CONVERSION = YES;
253 | CLANG_WARN_COMMA = YES;
254 | CLANG_WARN_CONSTANT_CONVERSION = YES;
255 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
257 | CLANG_WARN_EMPTY_BODY = YES;
258 | CLANG_WARN_ENUM_CONVERSION = YES;
259 | CLANG_WARN_INFINITE_RECURSION = YES;
260 | CLANG_WARN_INT_CONVERSION = YES;
261 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
262 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
263 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
265 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
266 | CLANG_WARN_STRICT_PROTOTYPES = YES;
267 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
268 | CLANG_WARN_UNREACHABLE_CODE = YES;
269 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
270 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
271 | COPY_PHASE_STRIP = NO;
272 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
273 | ENABLE_NS_ASSERTIONS = NO;
274 | ENABLE_STRICT_OBJC_MSGSEND = YES;
275 | GCC_C_LANGUAGE_STANDARD = gnu99;
276 | GCC_NO_COMMON_BLOCKS = YES;
277 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
278 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
279 | GCC_WARN_UNDECLARED_SELECTOR = YES;
280 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
281 | GCC_WARN_UNUSED_FUNCTION = YES;
282 | GCC_WARN_UNUSED_VARIABLE = YES;
283 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
284 | MTL_ENABLE_DEBUG_INFO = NO;
285 | SDKROOT = iphoneos;
286 | SUPPORTED_PLATFORMS = iphoneos;
287 | TARGETED_DEVICE_FAMILY = "1,2";
288 | VALIDATE_PRODUCT = YES;
289 | };
290 | name = Profile;
291 | };
292 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
293 | isa = XCBuildConfiguration;
294 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
295 | buildSettings = {
296 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
297 | CLANG_ENABLE_MODULES = YES;
298 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
299 | ENABLE_BITCODE = NO;
300 | FRAMEWORK_SEARCH_PATHS = (
301 | "$(inherited)",
302 | "$(PROJECT_DIR)/Flutter",
303 | );
304 | INFOPLIST_FILE = Runner/Info.plist;
305 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
306 | LIBRARY_SEARCH_PATHS = (
307 | "$(inherited)",
308 | "$(PROJECT_DIR)/Flutter",
309 | );
310 | PRODUCT_BUNDLE_IDENTIFIER = com.example.arch;
311 | PRODUCT_NAME = "$(TARGET_NAME)";
312 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
313 | SWIFT_VERSION = 5.0;
314 | VERSIONING_SYSTEM = "apple-generic";
315 | };
316 | name = Profile;
317 | };
318 | 97C147031CF9000F007C117D /* Debug */ = {
319 | isa = XCBuildConfiguration;
320 | buildSettings = {
321 | ALWAYS_SEARCH_USER_PATHS = NO;
322 | CLANG_ANALYZER_NONNULL = YES;
323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
324 | CLANG_CXX_LIBRARY = "libc++";
325 | CLANG_ENABLE_MODULES = YES;
326 | CLANG_ENABLE_OBJC_ARC = YES;
327 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
328 | CLANG_WARN_BOOL_CONVERSION = YES;
329 | CLANG_WARN_COMMA = YES;
330 | CLANG_WARN_CONSTANT_CONVERSION = YES;
331 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
332 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
333 | CLANG_WARN_EMPTY_BODY = YES;
334 | CLANG_WARN_ENUM_CONVERSION = YES;
335 | CLANG_WARN_INFINITE_RECURSION = YES;
336 | CLANG_WARN_INT_CONVERSION = YES;
337 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
338 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
339 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
341 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
342 | CLANG_WARN_STRICT_PROTOTYPES = YES;
343 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
344 | CLANG_WARN_UNREACHABLE_CODE = YES;
345 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
346 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
347 | COPY_PHASE_STRIP = NO;
348 | DEBUG_INFORMATION_FORMAT = dwarf;
349 | ENABLE_STRICT_OBJC_MSGSEND = YES;
350 | ENABLE_TESTABILITY = YES;
351 | GCC_C_LANGUAGE_STANDARD = gnu99;
352 | GCC_DYNAMIC_NO_PIC = NO;
353 | GCC_NO_COMMON_BLOCKS = YES;
354 | GCC_OPTIMIZATION_LEVEL = 0;
355 | GCC_PREPROCESSOR_DEFINITIONS = (
356 | "DEBUG=1",
357 | "$(inherited)",
358 | );
359 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
360 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
361 | GCC_WARN_UNDECLARED_SELECTOR = YES;
362 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
363 | GCC_WARN_UNUSED_FUNCTION = YES;
364 | GCC_WARN_UNUSED_VARIABLE = YES;
365 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
366 | MTL_ENABLE_DEBUG_INFO = YES;
367 | ONLY_ACTIVE_ARCH = YES;
368 | SDKROOT = iphoneos;
369 | TARGETED_DEVICE_FAMILY = "1,2";
370 | };
371 | name = Debug;
372 | };
373 | 97C147041CF9000F007C117D /* Release */ = {
374 | isa = XCBuildConfiguration;
375 | buildSettings = {
376 | ALWAYS_SEARCH_USER_PATHS = NO;
377 | CLANG_ANALYZER_NONNULL = YES;
378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
379 | CLANG_CXX_LIBRARY = "libc++";
380 | CLANG_ENABLE_MODULES = YES;
381 | CLANG_ENABLE_OBJC_ARC = YES;
382 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
383 | CLANG_WARN_BOOL_CONVERSION = YES;
384 | CLANG_WARN_COMMA = YES;
385 | CLANG_WARN_CONSTANT_CONVERSION = YES;
386 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
388 | CLANG_WARN_EMPTY_BODY = YES;
389 | CLANG_WARN_ENUM_CONVERSION = YES;
390 | CLANG_WARN_INFINITE_RECURSION = YES;
391 | CLANG_WARN_INT_CONVERSION = YES;
392 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
393 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
394 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
396 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
397 | CLANG_WARN_STRICT_PROTOTYPES = YES;
398 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
399 | CLANG_WARN_UNREACHABLE_CODE = YES;
400 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
402 | COPY_PHASE_STRIP = NO;
403 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
404 | ENABLE_NS_ASSERTIONS = NO;
405 | ENABLE_STRICT_OBJC_MSGSEND = YES;
406 | GCC_C_LANGUAGE_STANDARD = gnu99;
407 | GCC_NO_COMMON_BLOCKS = YES;
408 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
409 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
410 | GCC_WARN_UNDECLARED_SELECTOR = YES;
411 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
412 | GCC_WARN_UNUSED_FUNCTION = YES;
413 | GCC_WARN_UNUSED_VARIABLE = YES;
414 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
415 | MTL_ENABLE_DEBUG_INFO = NO;
416 | SDKROOT = iphoneos;
417 | SUPPORTED_PLATFORMS = iphoneos;
418 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
419 | TARGETED_DEVICE_FAMILY = "1,2";
420 | VALIDATE_PRODUCT = YES;
421 | };
422 | name = Release;
423 | };
424 | 97C147061CF9000F007C117D /* Debug */ = {
425 | isa = XCBuildConfiguration;
426 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
427 | buildSettings = {
428 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
429 | CLANG_ENABLE_MODULES = YES;
430 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
431 | ENABLE_BITCODE = NO;
432 | FRAMEWORK_SEARCH_PATHS = (
433 | "$(inherited)",
434 | "$(PROJECT_DIR)/Flutter",
435 | );
436 | INFOPLIST_FILE = Runner/Info.plist;
437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
438 | LIBRARY_SEARCH_PATHS = (
439 | "$(inherited)",
440 | "$(PROJECT_DIR)/Flutter",
441 | );
442 | PRODUCT_BUNDLE_IDENTIFIER = com.example.arch;
443 | PRODUCT_NAME = "$(TARGET_NAME)";
444 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
445 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
446 | SWIFT_VERSION = 5.0;
447 | VERSIONING_SYSTEM = "apple-generic";
448 | };
449 | name = Debug;
450 | };
451 | 97C147071CF9000F007C117D /* Release */ = {
452 | isa = XCBuildConfiguration;
453 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
454 | buildSettings = {
455 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
456 | CLANG_ENABLE_MODULES = YES;
457 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
458 | ENABLE_BITCODE = NO;
459 | FRAMEWORK_SEARCH_PATHS = (
460 | "$(inherited)",
461 | "$(PROJECT_DIR)/Flutter",
462 | );
463 | INFOPLIST_FILE = Runner/Info.plist;
464 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
465 | LIBRARY_SEARCH_PATHS = (
466 | "$(inherited)",
467 | "$(PROJECT_DIR)/Flutter",
468 | );
469 | PRODUCT_BUNDLE_IDENTIFIER = com.example.arch;
470 | PRODUCT_NAME = "$(TARGET_NAME)";
471 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
472 | SWIFT_VERSION = 5.0;
473 | VERSIONING_SYSTEM = "apple-generic";
474 | };
475 | name = Release;
476 | };
477 | /* End XCBuildConfiguration section */
478 |
479 | /* Begin XCConfigurationList section */
480 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
481 | isa = XCConfigurationList;
482 | buildConfigurations = (
483 | 97C147031CF9000F007C117D /* Debug */,
484 | 97C147041CF9000F007C117D /* Release */,
485 | 249021D3217E4FDB00AE95B9 /* Profile */,
486 | );
487 | defaultConfigurationIsVisible = 0;
488 | defaultConfigurationName = Release;
489 | };
490 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
491 | isa = XCConfigurationList;
492 | buildConfigurations = (
493 | 97C147061CF9000F007C117D /* Debug */,
494 | 97C147071CF9000F007C117D /* Release */,
495 | 249021D4217E4FDB00AE95B9 /* Profile */,
496 | );
497 | defaultConfigurationIsVisible = 0;
498 | defaultConfigurationName = Release;
499 | };
500 | /* End XCConfigurationList section */
501 | };
502 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
503 | }
504 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | arch
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/app/app_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:arch/app/services/shared_local_storage_service.dart';
2 | import 'package:arch/app/viewmodels/change_theme_viewmodel.dart';
3 | import 'package:flutter/foundation.dart';
4 |
5 | class AppController {
6 | static final AppController instance = AppController._();
7 | AppController._() {
8 | changeThemeViewModel.init();
9 | }
10 |
11 | final ChangeThemeViewModel changeThemeViewModel =
12 | ChangeThemeViewModel(storage: SharedLocalStorageService());
13 |
14 | bool get isDark => changeThemeViewModel.config.themeSwitch.value;
15 | ValueNotifier get themeSwitch =>
16 | changeThemeViewModel.config.themeSwitch;
17 | }
18 |
--------------------------------------------------------------------------------
/lib/app/app_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:arch/app/pages/home/home_page.dart';
2 | import 'package:arch/app/pages/login/login_page.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | import 'app_controller.dart';
6 |
7 | class AppWidget extends StatelessWidget {
8 | @override
9 | Widget build(BuildContext context) {
10 | return ValueListenableBuilder(
11 | valueListenable: AppController.instance.themeSwitch,
12 | builder: (context, isDart, child) {
13 | return MaterialApp(
14 | title: 'Flutter Demo',
15 | theme: ThemeData(
16 | primarySwatch: Colors.blue,
17 | visualDensity: VisualDensity.adaptivePlatformDensity,
18 | brightness: isDart ? Brightness.dark : Brightness.light,
19 | ),
20 | initialRoute: "/",
21 | routes: {
22 | "/": (_) => LoginPage(),
23 | "/home": (_) => HomePage(),
24 | },
25 | );
26 | },
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/app/blocs/change_theme_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | class ChangeThemeBloc {
4 | final streamTheme = StreamController();
5 |
6 | dispose() {
7 | streamTheme.close();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/app/interfaces/local_storage_interface.dart:
--------------------------------------------------------------------------------
1 | abstract class ILocalStorage {
2 | Future get(String key);
3 | Future delete(String key);
4 | Future put(String key, dynamic value);
5 | }
6 |
--------------------------------------------------------------------------------
/lib/app/models/appconfig_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 |
3 | class AppConfigModel {
4 | final themeSwitch = ValueNotifier(false);
5 | }
6 |
--------------------------------------------------------------------------------
/lib/app/models/user_model.dart:
--------------------------------------------------------------------------------
1 | class UserModel {
2 | final String name;
3 | final String email;
4 | final String nickname;
5 | final String picture;
6 |
7 | UserModel({this.name, this.email, this.nickname, this.picture});
8 |
9 | factory UserModel.fromJson(Map json) {
10 | return UserModel(
11 | name: json['name'],
12 | picture: json['picture'],
13 | email: json['email'],
14 | nickname: json['nickname'],
15 | );
16 | }
17 |
18 | Map toJson() {
19 | final Map data = Map();
20 | data['name'] = this.name;
21 | data['picture'] = this.picture;
22 | data['email'] = this.email;
23 | data['nickname'] = this.nickname;
24 | return data;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lib/app/pages/home/components/custom_switch_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../../../app_controller.dart';
4 |
5 | class CustomSwitchWidget extends StatelessWidget {
6 | @override
7 | Widget build(BuildContext context) {
8 | return Switch(
9 | value: AppController.instance.isDark,
10 | onChanged: (value) {
11 | AppController.instance.changeThemeViewModel.changeTheme(value);
12 | },
13 | );
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/app/pages/home/home_controller.dart:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/lib/app/pages/home/home_controller.dart
--------------------------------------------------------------------------------
/lib/app/pages/home/home_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'components/custom_switch_widget.dart';
4 |
5 | class HomePage extends StatefulWidget {
6 | @override
7 | _HomePageState createState() => _HomePageState();
8 | }
9 |
10 | class _HomePageState extends State {
11 | @override
12 | Widget build(BuildContext context) {
13 | return Scaffold(
14 | appBar: AppBar(
15 | title: Text('Home Page'),
16 | ),
17 | body: Center(
18 | child: CustomSwitchWidget(),
19 | ),
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/app/pages/login/login_controller.dart:
--------------------------------------------------------------------------------
1 | class LoginController {}
2 |
--------------------------------------------------------------------------------
/lib/app/pages/login/login_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'login_controller.dart';
4 |
5 | class LoginPage extends StatefulWidget {
6 | @override
7 | _LoginPageState createState() => _LoginPageState();
8 | }
9 |
10 | class _LoginPageState extends State {
11 | final LoginController controller = LoginController();
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return Scaffold(
16 | appBar: AppBar(
17 | title: Text('Login Page'),
18 | ),
19 | body: Padding(
20 | padding: const EdgeInsets.all(8.0),
21 | child: Column(
22 | mainAxisAlignment: MainAxisAlignment.center,
23 | children: [
24 | TextField(
25 | decoration: InputDecoration(
26 | border: OutlineInputBorder(),
27 | labelText: "email",
28 | ),
29 | keyboardType: TextInputType.emailAddress,
30 | ),
31 | SizedBox(height: 10),
32 | TextField(
33 | decoration: InputDecoration(
34 | border: OutlineInputBorder(),
35 | labelText: "password",
36 | ),
37 | keyboardType: TextInputType.visiblePassword,
38 | obscureText: true,
39 | ),
40 | SizedBox(height: 30),
41 | RaisedButton(
42 | onPressed: () {
43 | Navigator.of(context).pushReplacementNamed('/home');
44 | },
45 | child: Text('Login'),
46 | ),
47 | ],
48 | ),
49 | ),
50 | );
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/lib/app/services/client_http_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/native_imp.dart';
2 |
3 | class ClientHttp extends DioForNative {
4 | ClientHttp() {
5 | options.baseUrl = "https://5ecafaf138df960016511b4c.mockapi.io/api/v1";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/lib/app/services/shared_local_storage_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:arch/app/interfaces/local_storage_interface.dart';
2 | import 'package:shared_preferences/shared_preferences.dart';
3 |
4 | class SharedLocalStorageService implements ILocalStorage {
5 | @override
6 | Future delete(String key) async {
7 | var shared = await SharedPreferences.getInstance();
8 | shared.remove(key);
9 | }
10 |
11 | @override
12 | Future get(String key) async {
13 | var shared = await SharedPreferences.getInstance();
14 | return shared.get(key);
15 | }
16 |
17 | @override
18 | Future put(String key, dynamic value) async {
19 | var shared = await SharedPreferences.getInstance();
20 | if (value is bool) {
21 | shared.setBool(key, value);
22 | } else if (value is String) {
23 | shared.setString(key, value);
24 | } else if (value is int) {
25 | shared.setInt(key, value);
26 | } else if (value is double) {
27 | shared.setDouble(key, value);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/app/stores/change_theme_store.dart:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/lib/app/viewmodels/change_theme_viewmodel.dart:
--------------------------------------------------------------------------------
1 | import 'package:arch/app/interfaces/local_storage_interface.dart';
2 | import 'package:arch/app/models/appconfig_model.dart';
3 |
4 | class ChangeThemeViewModel {
5 | final ILocalStorage storage;
6 |
7 | final AppConfigModel config = AppConfigModel();
8 |
9 | ChangeThemeViewModel({this.storage});
10 |
11 | Future init() async {
12 | await storage.get('isDark').then((value) {
13 | if (value != null) config.themeSwitch.value = value;
14 | });
15 | }
16 |
17 | changeTheme(bool value) {
18 | config.themeSwitch.value = value;
19 | storage.put('isDark', value);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'app/app_widget.dart';
4 |
5 | void main() {
6 | runApp(AppWidget());
7 | }
8 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.4.1"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.0.0"
18 | charcode:
19 | dependency: transitive
20 | description:
21 | name: charcode
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.1.3"
25 | clock:
26 | dependency: transitive
27 | description:
28 | name: clock
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.0.1"
32 | collection:
33 | dependency: transitive
34 | description:
35 | name: collection
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.14.12"
39 | cupertino_icons:
40 | dependency: "direct main"
41 | description:
42 | name: cupertino_icons
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "0.1.3"
46 | dio:
47 | dependency: "direct main"
48 | description:
49 | name: dio
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "3.0.9"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.1.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | flutter_web_plugins:
71 | dependency: transitive
72 | description: flutter
73 | source: sdk
74 | version: "0.0.0"
75 | http_parser:
76 | dependency: transitive
77 | description:
78 | name: http_parser
79 | url: "https://pub.dartlang.org"
80 | source: hosted
81 | version: "3.1.4"
82 | matcher:
83 | dependency: transitive
84 | description:
85 | name: matcher
86 | url: "https://pub.dartlang.org"
87 | source: hosted
88 | version: "0.12.6"
89 | meta:
90 | dependency: transitive
91 | description:
92 | name: meta
93 | url: "https://pub.dartlang.org"
94 | source: hosted
95 | version: "1.1.8"
96 | path:
97 | dependency: transitive
98 | description:
99 | name: path
100 | url: "https://pub.dartlang.org"
101 | source: hosted
102 | version: "1.7.0"
103 | shared_preferences:
104 | dependency: "direct main"
105 | description:
106 | name: shared_preferences
107 | url: "https://pub.dartlang.org"
108 | source: hosted
109 | version: "0.5.7+3"
110 | shared_preferences_macos:
111 | dependency: transitive
112 | description:
113 | name: shared_preferences_macos
114 | url: "https://pub.dartlang.org"
115 | source: hosted
116 | version: "0.0.1+9"
117 | shared_preferences_platform_interface:
118 | dependency: transitive
119 | description:
120 | name: shared_preferences_platform_interface
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.0.4"
124 | shared_preferences_web:
125 | dependency: transitive
126 | description:
127 | name: shared_preferences_web
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "0.1.2+7"
131 | sky_engine:
132 | dependency: transitive
133 | description: flutter
134 | source: sdk
135 | version: "0.0.99"
136 | source_span:
137 | dependency: transitive
138 | description:
139 | name: source_span
140 | url: "https://pub.dartlang.org"
141 | source: hosted
142 | version: "1.7.0"
143 | stack_trace:
144 | dependency: transitive
145 | description:
146 | name: stack_trace
147 | url: "https://pub.dartlang.org"
148 | source: hosted
149 | version: "1.9.3"
150 | stream_channel:
151 | dependency: transitive
152 | description:
153 | name: stream_channel
154 | url: "https://pub.dartlang.org"
155 | source: hosted
156 | version: "2.0.0"
157 | string_scanner:
158 | dependency: transitive
159 | description:
160 | name: string_scanner
161 | url: "https://pub.dartlang.org"
162 | source: hosted
163 | version: "1.0.5"
164 | term_glyph:
165 | dependency: transitive
166 | description:
167 | name: term_glyph
168 | url: "https://pub.dartlang.org"
169 | source: hosted
170 | version: "1.1.0"
171 | test_api:
172 | dependency: transitive
173 | description:
174 | name: test_api
175 | url: "https://pub.dartlang.org"
176 | source: hosted
177 | version: "0.2.15"
178 | typed_data:
179 | dependency: transitive
180 | description:
181 | name: typed_data
182 | url: "https://pub.dartlang.org"
183 | source: hosted
184 | version: "1.1.6"
185 | vector_math:
186 | dependency: transitive
187 | description:
188 | name: vector_math
189 | url: "https://pub.dartlang.org"
190 | source: hosted
191 | version: "2.0.8"
192 | sdks:
193 | dart: ">=2.7.0 <3.0.0"
194 | flutter: ">=1.12.13+hotfix.5 <2.0.0"
195 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: arch
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.7.0 <3.0.0"
22 |
23 | dependencies:
24 | dio: ^3.0.9
25 | shared_preferences: ^0.5.7+3
26 | flutter:
27 | sdk: flutter
28 |
29 |
30 | # The following adds the Cupertino Icons font to your application.
31 | # Use with the CupertinoIcons class for iOS style icons.
32 | cupertino_icons: ^0.1.3
33 |
34 | dev_dependencies:
35 | flutter_test:
36 | sdk: flutter
37 |
38 | # For information on the generic Dart part of this file, see the
39 | # following page: https://dart.dev/tools/pub/pubspec
40 |
41 | # The following section is specific to Flutter.
42 | flutter:
43 |
44 | # The following line ensures that the Material Icons font is
45 | # included with your application, so that you can use the icons in
46 | # the material Icons class.
47 | uses-material-design: true
48 |
49 | # To add assets to your application, add an assets section, like this:
50 | # assets:
51 | # - images/a_dot_burr.jpeg
52 | # - images/a_dot_ham.jpeg
53 |
54 | # An image asset can refer to one or more resolution-specific "variants", see
55 | # https://flutter.dev/assets-and-images/#resolution-aware.
56 |
57 | # For details regarding adding assets from package dependencies, see
58 | # https://flutter.dev/assets-and-images/#from-packages
59 |
60 | # To add custom fonts to your application, add a fonts section here,
61 | # in this "flutter" section. Each entry in this list should have a
62 | # "family" key with the font family name, and a "fonts" key with a
63 | # list giving the asset and other descriptors for the font. For
64 | # example:
65 | # fonts:
66 | # - family: Schyler
67 | # fonts:
68 | # - asset: fonts/Schyler-Regular.ttf
69 | # - asset: fonts/Schyler-Italic.ttf
70 | # style: italic
71 | # - family: Trajan Pro
72 | # fonts:
73 | # - asset: fonts/TrajanPro.ttf
74 | # - asset: fonts/TrajanPro_Bold.ttf
75 | # weight: 700
76 | #
77 | # For details regarding fonts from package dependencies,
78 | # see https://flutter.dev/custom-fonts/#from-packages
79 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | arch
18 |
19 |
20 |
21 |
24 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "arch",
3 | "short_name": "arch",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/AppConfiguration.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | arch
5 |
6 |
7 |
--------------------------------------------------------------------------------
/windows/FlutterBuild.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Profile
10 | x64
11 |
12 |
13 | Release
14 | x64
15 |
16 |
17 |
18 | 15.0
19 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}
20 | Flutter Build
21 | 10.0
22 |
23 |
24 |
25 | v141
26 | v142
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | "$(ProjectDir)scripts\prepare_dependencies" $(Configuration)
41 | Running Flutter backend build
42 | force_to_run_every_time
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/windows/Runner.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29709.97
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Runner", "Runner.vcxproj", "{5A827760-CF8B-408A-99A3-B6C0AD2271E7}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F} = {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}
9 | EndProjectSection
10 | EndProject
11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flutter Build", "FlutterBuild.vcxproj", "{6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}"
12 | EndProject
13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Flutter Plugins", "Flutter Plugins", "{5C2E738A-1DD3-445A-AAC8-EEB9648DD07C}"
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|x64 = Debug|x64
18 | Profile|x64 = Profile|x64
19 | Release|x64 = Release|x64
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.ActiveCfg = Debug|x64
23 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.Build.0 = Debug|x64
24 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Profile|x64.ActiveCfg = Profile|x64
25 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Profile|x64.Build.0 = Profile|x64
26 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.ActiveCfg = Release|x64
27 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.Build.0 = Release|x64
28 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Debug|x64.ActiveCfg = Debug|x64
29 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Debug|x64.Build.0 = Debug|x64
30 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Profile|x64.ActiveCfg = Profile|x64
31 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Profile|x64.Build.0 = Profile|x64
32 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Release|x64.ActiveCfg = Release|x64
33 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Release|x64.Build.0 = Release|x64
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | GlobalSection(ExtensibilityGlobals) = postSolution
39 | SolutionGuid = {B8A69CB0-A974-4774-9EBD-1E5EECACD186}
40 | EndGlobalSection
41 | GlobalSection(NestedProjects) = preSolution
42 | EndGlobalSection
43 | EndGlobal
--------------------------------------------------------------------------------
/windows/Runner.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Profile
10 | x64
11 |
12 |
13 | Release
14 | x64
15 |
16 |
17 |
18 | 15.0
19 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}
20 | arch
21 | 10.0
22 |
23 |
24 |
25 | Application
26 | true
27 | v141
28 | v142
29 | Unicode
30 |
31 |
32 | Application
33 | false
34 | v141
35 | v142
36 | true
37 | Unicode
38 |
39 |
40 | Application
41 | false
42 | v141
43 | v142
44 | true
45 | Unicode
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\
73 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\
74 |
75 |
76 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\
77 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\
78 |
79 |
80 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\
81 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\
82 |
83 |
84 |
85 | Level4
86 | Disabled
87 | true
88 | true
89 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories)
90 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)
91 | true
92 | 4100
93 |
94 |
95 | flutter_windows.dll.lib;%(AdditionalDependencies)
96 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories)
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)"
120 |
121 |
122 | Bundling dependencies
123 | Dummy_Run_Always
124 |
125 |
126 |
127 |
128 |
129 |
130 | Level4
131 | MaxSpeed
132 | true
133 | true
134 | true
135 | true
136 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories)
137 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)
138 | true
139 | 4100
140 |
141 |
142 | true
143 | true
144 | flutter_windows.dll.lib;%(AdditionalDependencies)
145 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories)
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)"
169 |
170 |
171 | Bundling dependencies
172 | Dummy_Run_Always
173 |
174 |
175 |
176 |
177 |
178 |
179 | Level4
180 | MaxSpeed
181 | true
182 | true
183 | true
184 | true
185 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories)
186 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)
187 | true
188 | 4100
189 |
190 |
191 | true
192 | true
193 | flutter_windows.dll.lib;%(AdditionalDependencies)
194 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories)
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)"
218 |
219 |
220 | Bundling dependencies
221 | Dummy_Run_Always
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 | $(SolutionDir)
261 |
262 |
263 |
--------------------------------------------------------------------------------
/windows/Runner.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 | {2761a4b5-57b2-4d50-a677-d20ddc17a7f1}
18 |
19 |
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 | Source Files
35 |
36 |
37 | Source Files
38 |
39 |
40 | Source Files
41 |
42 |
43 | Source Files\Client Wrapper
44 |
45 |
46 | Source Files\Client Wrapper
47 |
48 |
49 | Source Files\Client Wrapper
50 |
51 |
52 |
53 |
54 | Header Files
55 |
56 |
57 | Header Files
58 |
59 |
60 | Header Files
61 |
62 |
63 | Header Files
64 |
65 |
66 | Header Files
67 |
68 |
69 | Header Files
70 |
71 |
72 | Header Files
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | Resource Files
81 |
82 |
83 |
84 |
85 | Resource Files
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/windows/flutter/.template_version:
--------------------------------------------------------------------------------
1 | 2
2 |
--------------------------------------------------------------------------------
/windows/flutter/GeneratedPlugins.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | #include "generated_plugin_registrant.h"
6 |
7 |
8 | void RegisterPlugins(flutter::PluginRegistry* registry) {
9 | }
10 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | #ifndef GENERATED_PLUGIN_REGISTRANT_
6 | #define GENERATED_PLUGIN_REGISTRANT_
7 |
8 | #include
9 |
10 | // Registers Flutter plugins.
11 | void RegisterPlugins(flutter::PluginRegistry* registry);
12 |
13 | #endif // GENERATED_PLUGIN_REGISTRANT_
14 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 | #endif // English (United States) resources
58 | /////////////////////////////////////////////////////////////////////////////
59 |
60 |
61 |
62 | #ifndef APSTUDIO_INVOKED
63 | /////////////////////////////////////////////////////////////////////////////
64 | //
65 | // Generated from the TEXTINCLUDE 3 resource.
66 | //
67 |
68 |
69 | /////////////////////////////////////////////////////////////////////////////
70 | #endif // not APSTUDIO_INVOKED
71 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include "flutter/generated_plugin_registrant.h"
4 |
5 | FlutterWindow::FlutterWindow(RunLoop* run_loop,
6 | const flutter::DartProject& project)
7 | : run_loop_(run_loop), project_(project) {}
8 |
9 | FlutterWindow::~FlutterWindow() {}
10 |
11 | void FlutterWindow::OnCreate() {
12 | Win32Window::OnCreate();
13 |
14 | // The size here is arbitrary since SetChildContent will resize it.
15 | flutter_controller_ =
16 | std::make_unique(100, 100, project_);
17 | RegisterPlugins(flutter_controller_.get());
18 | run_loop_->RegisterFlutterInstance(flutter_controller_.get());
19 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
20 | }
21 |
22 | void FlutterWindow::OnDestroy() {
23 | if (flutter_controller_) {
24 | run_loop_->UnregisterFlutterInstance(flutter_controller_.get());
25 | flutter_controller_ = nullptr;
26 | }
27 |
28 | Win32Window::OnDestroy();
29 | }
30 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_WINDOW_H_
2 | #define FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include "run_loop.h"
8 | #include "win32_window.h"
9 |
10 | #include
11 |
12 | // A window that does nothing but host a Flutter view.
13 | class FlutterWindow : public Win32Window {
14 | public:
15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a
16 | // Flutter view running |project|.
17 | explicit FlutterWindow(RunLoop* run_loop,
18 | const flutter::DartProject& project);
19 | virtual ~FlutterWindow();
20 |
21 | protected:
22 | // Win32Window:
23 | void OnCreate() override;
24 | void OnDestroy() override;
25 |
26 | private:
27 | // The run loop driving events for this window.
28 | RunLoop* run_loop_;
29 |
30 | // The project to run.
31 | flutter::DartProject project_;
32 |
33 | // The Flutter instance hosted by this window.
34 | std::unique_ptr flutter_controller_;
35 | };
36 |
37 | #endif // FLUTTER_WINDOW_H_
38 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "run_loop.h"
7 | #include "utils.h"
8 | #include "window_configuration.h"
9 |
10 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
11 | _In_ wchar_t *command_line, _In_ int show_command) {
12 | // Attach to console when present (e.g., 'flutter run') or create a
13 | // new console when running with a debugger.
14 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
15 | CreateAndAttachConsole();
16 | }
17 |
18 | // Initialize COM, so that it is available for use in the library and/or
19 | // plugins.
20 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
21 |
22 | RunLoop run_loop;
23 |
24 | flutter::DartProject project(L"data");
25 | FlutterWindow window(&run_loop, project);
26 | Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY);
27 | Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight);
28 | if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) {
29 | return EXIT_FAILURE;
30 | }
31 | window.SetQuitOnClose(true);
32 |
33 | run_loop.Run();
34 |
35 | ::CoUninitialize();
36 | return EXIT_SUCCESS;
37 | }
38 |
--------------------------------------------------------------------------------
/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Flutterando/semana-do-flutter-arc/bc5fc93fa9708e1b7541c34d2c2fae5f799ad6ca/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/windows/runner/run_loop.cpp:
--------------------------------------------------------------------------------
1 | #include "run_loop.h"
2 |
3 | #include
4 | // Don't stomp std::min/std::max
5 | #undef max
6 | #undef min
7 |
8 | #include
9 |
10 | RunLoop::RunLoop() {}
11 |
12 | RunLoop::~RunLoop() {}
13 |
14 | void RunLoop::Run() {
15 | bool keep_running = true;
16 | TimePoint next_flutter_event_time = TimePoint::clock::now();
17 | while (keep_running) {
18 | std::chrono::nanoseconds wait_duration =
19 | std::max(std::chrono::nanoseconds(0),
20 | next_flutter_event_time - TimePoint::clock::now());
21 | ::MsgWaitForMultipleObjects(
22 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000),
23 | QS_ALLINPUT);
24 | bool processed_events = false;
25 | MSG message;
26 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects
27 | // won't return again for items left in the queue after PeekMessage.
28 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) {
29 | processed_events = true;
30 | if (message.message == WM_QUIT) {
31 | keep_running = false;
32 | break;
33 | }
34 | ::TranslateMessage(&message);
35 | ::DispatchMessage(&message);
36 | // Allow Flutter to process messages each time a Windows message is
37 | // processed, to prevent starvation.
38 | next_flutter_event_time =
39 | std::min(next_flutter_event_time, ProcessFlutterMessages());
40 | }
41 | // If the PeekMessage loop didn't run, process Flutter messages.
42 | if (!processed_events) {
43 | next_flutter_event_time =
44 | std::min(next_flutter_event_time, ProcessFlutterMessages());
45 | }
46 | }
47 | }
48 |
49 | void RunLoop::RegisterFlutterInstance(
50 | flutter::FlutterViewController* flutter_instance) {
51 | flutter_instances_.insert(flutter_instance);
52 | }
53 |
54 | void RunLoop::UnregisterFlutterInstance(
55 | flutter::FlutterViewController* flutter_instance) {
56 | flutter_instances_.erase(flutter_instance);
57 | }
58 |
59 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() {
60 | TimePoint next_event_time = TimePoint::max();
61 | for (auto flutter_controller : flutter_instances_) {
62 | std::chrono::nanoseconds wait_duration =
63 | flutter_controller->ProcessMessages();
64 | if (wait_duration != std::chrono::nanoseconds::max()) {
65 | next_event_time =
66 | std::min(next_event_time, TimePoint::clock::now() + wait_duration);
67 | }
68 | }
69 | return next_event_time;
70 | }
71 |
--------------------------------------------------------------------------------
/windows/runner/run_loop.h:
--------------------------------------------------------------------------------
1 | #ifndef RUN_LOOP_H_
2 | #define RUN_LOOP_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 |
9 | // A runloop that will service events for Flutter instances as well
10 | // as native messages.
11 | class RunLoop {
12 | public:
13 | RunLoop();
14 | ~RunLoop();
15 |
16 | // Prevent copying
17 | RunLoop(RunLoop const&) = delete;
18 | RunLoop& operator=(RunLoop const&) = delete;
19 |
20 | // Runs the run loop until the application quits.
21 | void Run();
22 |
23 | // Registers the given Flutter instance for event servicing.
24 | void RegisterFlutterInstance(
25 | flutter::FlutterViewController* flutter_instance);
26 |
27 | // Unregisters the given Flutter instance from event servicing.
28 | void UnregisterFlutterInstance(
29 | flutter::FlutterViewController* flutter_instance);
30 |
31 | private:
32 | using TimePoint = std::chrono::steady_clock::time_point;
33 |
34 | // Processes all currently pending messages for registered Flutter instances.
35 | TimePoint ProcessFlutterMessages();
36 |
37 | std::set flutter_instances_;
38 | };
39 |
40 | #endif // RUN_LOOP_H_
41 |
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef CONSOLE_UTILS_H_
2 | #define CONSOLE_UTILS_H_
3 |
4 | // Creates a console for the process, and redirects stdout and stderr to
5 | // it for both the runner and the Flutter library.
6 | void CreateAndAttachConsole();
7 |
8 | #endif // CONSOLE_UTILS_H_
9 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.cpp:
--------------------------------------------------------------------------------
1 | #include "win32_window.h"
2 |
3 | #include
4 |
5 | #include "resource.h"
6 |
7 | namespace {
8 |
9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
10 |
11 | // The number of Win32Window objects that currently exist.
12 | static int g_active_window_count = 0;
13 |
14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);
15 |
16 | // Scale helper to convert logical scaler values to physical using passed in
17 | // scale factor
18 | int Scale(int source, double scale_factor) {
19 | return static_cast(source * scale_factor);
20 | }
21 |
22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.
23 | // This API is only needed for PerMonitor V1 awareness mode.
24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) {
25 | HMODULE user32_module = LoadLibraryA("User32.dll");
26 | if (!user32_module) {
27 | return;
28 | }
29 | auto enable_non_client_dpi_scaling =
30 | reinterpret_cast(
31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
32 | if (enable_non_client_dpi_scaling != nullptr) {
33 | enable_non_client_dpi_scaling(hwnd);
34 | FreeLibrary(user32_module);
35 | }
36 | }
37 |
38 | } // namespace
39 |
40 | // Manages the Win32Window's window class registration.
41 | class WindowClassRegistrar {
42 | public:
43 | ~WindowClassRegistrar() = default;
44 |
45 | // Returns the singleton registar instance.
46 | static WindowClassRegistrar* GetInstance() {
47 | if (!instance_) {
48 | instance_ = new WindowClassRegistrar();
49 | }
50 | return instance_;
51 | }
52 |
53 | // Returns the name of the window class, registering the class if it hasn't
54 | // previously been registered.
55 | const wchar_t* GetWindowClass();
56 |
57 | // Unregisters the window class. Should only be called if there are no
58 | // instances of the window.
59 | void UnregisterWindowClass();
60 |
61 | private:
62 | WindowClassRegistrar() = default;
63 |
64 | static WindowClassRegistrar* instance_;
65 |
66 | bool class_registered_ = false;
67 | };
68 |
69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;
70 |
71 | const wchar_t* WindowClassRegistrar::GetWindowClass() {
72 | if (!class_registered_) {
73 | WNDCLASS window_class{};
74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);
75 | window_class.lpszClassName = kWindowClassName;
76 | window_class.style = CS_HREDRAW | CS_VREDRAW;
77 | window_class.cbClsExtra = 0;
78 | window_class.cbWndExtra = 0;
79 | window_class.hInstance = GetModuleHandle(nullptr);
80 | window_class.hIcon =
81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));
82 | window_class.hbrBackground = 0;
83 | window_class.lpszMenuName = nullptr;
84 | window_class.lpfnWndProc = Win32Window::WndProc;
85 | RegisterClass(&window_class);
86 | class_registered_ = true;
87 | }
88 | return kWindowClassName;
89 | }
90 |
91 | void WindowClassRegistrar::UnregisterWindowClass() {
92 | UnregisterClass(kWindowClassName, nullptr);
93 | class_registered_ = false;
94 | }
95 |
96 | Win32Window::Win32Window() {
97 | ++g_active_window_count;
98 | }
99 |
100 | Win32Window::~Win32Window() {
101 | --g_active_window_count;
102 | Destroy();
103 | }
104 |
105 | bool Win32Window::CreateAndShow(const std::wstring& title,
106 | const Point& origin,
107 | const Size& size) {
108 | Destroy();
109 |
110 | const wchar_t* window_class =
111 | WindowClassRegistrar::GetInstance()->GetWindowClass();
112 |
113 | const POINT target_point = {static_cast(origin.x),
114 | static_cast(origin.y)};
115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);
116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
117 | double scale_factor = dpi / 96.0;
118 |
119 | HWND window = CreateWindow(
120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor),
123 | nullptr, nullptr, GetModuleHandle(nullptr), this);
124 |
125 | OnCreate();
126 |
127 | return window != nullptr;
128 | }
129 |
130 | // static
131 | LRESULT CALLBACK Win32Window::WndProc(HWND const window,
132 | UINT const message,
133 | WPARAM const wparam,
134 | LPARAM const lparam) noexcept {
135 | if (message == WM_NCCREATE) {
136 | auto window_struct = reinterpret_cast(lparam);
137 | SetWindowLongPtr(window, GWLP_USERDATA,
138 | reinterpret_cast(window_struct->lpCreateParams));
139 |
140 | auto that = static_cast(window_struct->lpCreateParams);
141 | EnableFullDpiSupportIfAvailable(window);
142 | that->window_handle_ = window;
143 | } else if (Win32Window* that = GetThisFromHandle(window)) {
144 | return that->MessageHandler(window, message, wparam, lparam);
145 | }
146 |
147 | return DefWindowProc(window, message, wparam, lparam);
148 | }
149 |
150 | LRESULT
151 | Win32Window::MessageHandler(HWND hwnd,
152 | UINT const message,
153 | WPARAM const wparam,
154 | LPARAM const lparam) noexcept {
155 | auto window =
156 | reinterpret_cast(GetWindowLongPtr(hwnd, GWLP_USERDATA));
157 |
158 | if (window == nullptr) {
159 | return 0;
160 | }
161 |
162 | switch (message) {
163 | case WM_DESTROY:
164 | window_handle_ = nullptr;
165 | Destroy();
166 | if (quit_on_close_) {
167 | PostQuitMessage(0);
168 | }
169 | return 0;
170 |
171 | case WM_DPICHANGED: {
172 | auto newRectSize = reinterpret_cast(lparam);
173 | LONG newWidth = newRectSize->right - newRectSize->left;
174 | LONG newHeight = newRectSize->bottom - newRectSize->top;
175 |
176 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,
177 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
178 |
179 | return 0;
180 | }
181 | case WM_SIZE:
182 | RECT rect;
183 | GetClientRect(hwnd, &rect);
184 | if (child_content_ != nullptr) {
185 | // Size and position the child window.
186 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
187 | rect.bottom - rect.top, TRUE);
188 | }
189 | return 0;
190 |
191 | case WM_ACTIVATE:
192 | if (child_content_ != nullptr) {
193 | SetFocus(child_content_);
194 | }
195 | return 0;
196 |
197 | // Messages that are directly forwarded to embedding.
198 | case WM_FONTCHANGE:
199 | SendMessage(child_content_, WM_FONTCHANGE, NULL, NULL);
200 | return 0;
201 | }
202 |
203 | return DefWindowProc(window_handle_, message, wparam, lparam);
204 | }
205 |
206 | void Win32Window::Destroy() {
207 | OnDestroy();
208 |
209 | if (window_handle_) {
210 | DestroyWindow(window_handle_);
211 | window_handle_ = nullptr;
212 | }
213 | if (g_active_window_count == 0) {
214 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass();
215 | }
216 | }
217 |
218 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
219 | return reinterpret_cast(
220 | GetWindowLongPtr(window, GWLP_USERDATA));
221 | }
222 |
223 | void Win32Window::SetChildContent(HWND content) {
224 | child_content_ = content;
225 | SetParent(content, window_handle_);
226 | RECT frame;
227 | GetClientRect(window_handle_, &frame);
228 |
229 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
230 | frame.bottom - frame.top, true);
231 |
232 | SetFocus(child_content_);
233 | }
234 |
235 | HWND Win32Window::GetHandle() {
236 | return window_handle_;
237 | }
238 |
239 | void Win32Window::SetQuitOnClose(bool quit_on_close) {
240 | quit_on_close_ = quit_on_close;
241 | }
242 |
243 | void Win32Window::OnCreate() {
244 | // No-op; provided for subclasses.
245 | }
246 |
247 | void Win32Window::OnDestroy() {
248 | // No-op; provided for subclasses.
249 | }
250 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef WIN32_WINDOW_H_
2 | #define WIN32_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
12 | // inherited from by classes that wish to specialize with custom
13 | // rendering and input handling
14 | class Win32Window {
15 | public:
16 | struct Point {
17 | unsigned int x;
18 | unsigned int y;
19 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
20 | };
21 |
22 | struct Size {
23 | unsigned int width;
24 | unsigned int height;
25 | Size(unsigned int width, unsigned int height)
26 | : width(width), height(height) {}
27 | };
28 |
29 | Win32Window();
30 | virtual ~Win32Window();
31 |
32 | // Creates and shows a win32 window with |title| and position and size using
33 | // |origin| and |size|. New windows are created on the default monitor. Window
34 | // sizes are specified to the OS in physical pixels, hence to ensure a
35 | // consistent size to will treat the width height passed in to this function
36 | // as logical pixels and scale to appropriate for the default monitor. Returns
37 | // true if the window was created successfully.
38 | bool CreateAndShow(const std::wstring& title,
39 | const Point& origin,
40 | const Size& size);
41 |
42 | // Release OS resources associated with window.
43 | void Destroy();
44 |
45 | // Inserts |content| into the window tree.
46 | void SetChildContent(HWND content);
47 |
48 | // Returns the backing Window handle to enable clients to set icon and other
49 | // window properties. Returns nullptr if the window has been destroyed.
50 | HWND GetHandle();
51 |
52 | // If true, closing this window will quit the application.
53 | void SetQuitOnClose(bool quit_on_close);
54 |
55 | protected:
56 | // Processes and route salient window messages for mouse handling,
57 | // size change and DPI. Delegates handling of these to member overloads that
58 | // inheriting classes can handle.
59 | virtual LRESULT MessageHandler(HWND window,
60 | UINT const message,
61 | WPARAM const wparam,
62 | LPARAM const lparam) noexcept;
63 |
64 | // Called when CreateAndShow is called, allowing subclass window-related
65 | // setup.
66 | virtual void OnCreate();
67 |
68 | // Called when Destroy is called.
69 | virtual void OnDestroy();
70 |
71 | private:
72 | friend class WindowClassRegistrar;
73 |
74 | // OS callback called by message pump. Handles the WM_NCCREATE message which
75 | // is passed when the non-client area is being created and enables automatic
76 | // non-client DPI scaling so that the non-client area automatically
77 | // responsponds to changes in DPI. All other messages are handled by
78 | // MessageHandler.
79 | static LRESULT CALLBACK WndProc(HWND const window,
80 | UINT const message,
81 | WPARAM const wparam,
82 | LPARAM const lparam) noexcept;
83 |
84 | // Retrieves a class instance pointer for |window|
85 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
86 |
87 | bool quit_on_close_ = false;
88 |
89 | // window handle for top level window.
90 | HWND window_handle_ = nullptr;
91 |
92 | // window handle for hosted content.
93 | HWND child_content_ = nullptr;
94 | };
95 |
96 | #endif // WIN32_WINDOW_H_
97 |
--------------------------------------------------------------------------------
/windows/runner/window_configuration.cpp:
--------------------------------------------------------------------------------
1 | #include "window_configuration.h"
2 |
3 | const wchar_t* kFlutterWindowTitle = L"arch";
4 | const unsigned int kFlutterWindowOriginX = 10;
5 | const unsigned int kFlutterWindowOriginY = 10;
6 | const unsigned int kFlutterWindowWidth = 800;
7 | const unsigned int kFlutterWindowHeight = 600;
8 |
--------------------------------------------------------------------------------
/windows/runner/window_configuration.h:
--------------------------------------------------------------------------------
1 | #ifndef WINDOW_CONFIGURATION_
2 | #define WINDOW_CONFIGURATION_
3 |
4 | // This is a temporary approach to isolate changes that people are likely to
5 | // make to main.cpp, where the APIs are still in flux. This will reduce the
6 | // need to resolve conflicts or re-create changes slightly differently every
7 | // time the Windows Flutter API surface changes.
8 | //
9 | // Longer term there should be simpler configuration options for common
10 | // customizations like this, without requiring native code changes.
11 |
12 | extern const wchar_t* kFlutterWindowTitle;
13 | extern const unsigned int kFlutterWindowOriginX;
14 | extern const unsigned int kFlutterWindowOriginY;
15 | extern const unsigned int kFlutterWindowWidth;
16 | extern const unsigned int kFlutterWindowHeight;
17 |
18 | #endif // WINDOW_CONFIGURATION_
19 |
--------------------------------------------------------------------------------
/windows/scripts/bundle_assets_and_deps.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | set FLUTTER_CACHE_DIR=%~1
4 | set BUNDLE_DIR=%~2
5 | set PLUGIN_DIR=%~3
6 | set EXE_NAME=%~4
7 |
8 | set DATA_DIR=%BUNDLE_DIR%data
9 |
10 | if not exist "%DATA_DIR%" call mkdir "%DATA_DIR%"
11 | if %errorlevel% neq 0 exit /b %errorlevel%
12 |
13 | :: Write the executable name to the location expected by the Flutter tool.
14 | echo %EXE_NAME%>"%FLUTTER_CACHE_DIR%exe_filename"
15 |
16 | :: Copy the Flutter assets to the data directory.
17 | set FLUTTER_APP_DIR=%~dp0..\..
18 | set ASSET_DIR_NAME=flutter_assets
19 | set TARGET_ASSET_DIR=%DATA_DIR%\%ASSET_DIR_NAME%
20 | if exist "%TARGET_ASSET_DIR%" call rmdir /s /q "%TARGET_ASSET_DIR%"
21 | if %errorlevel% neq 0 exit /b %errorlevel%
22 | call xcopy /s /e /i /q "%FLUTTER_APP_DIR%\build\%ASSET_DIR_NAME%" "%TARGET_ASSET_DIR%"
23 | if %errorlevel% neq 0 exit /b %errorlevel%
24 |
25 | :: Copy the icudtl.dat file from the Flutter tree to the data directory.
26 | call xcopy /y /d /q "%FLUTTER_CACHE_DIR%icudtl.dat" "%DATA_DIR%"
27 | if %errorlevel% neq 0 exit /b %errorlevel%
28 |
29 | :: Copy the Flutter DLL to the target location.
30 | call xcopy /y /d /q "%FLUTTER_CACHE_DIR%flutter_windows.dll" "%BUNDLE_DIR%"
31 | if %errorlevel% neq 0 exit /b %errorlevel%
32 |
33 | :: Copy any Plugin DLLs to the target location.
34 | if exist "%PLUGIN_DIR%" (
35 | call xcopy /y /d /q "%PLUGIN_DIR%"*.dll "%BUNDLE_DIR%"
36 | if %errorlevel% neq 0 exit /b %errorlevel%
37 | )
38 |
--------------------------------------------------------------------------------
/windows/scripts/prepare_dependencies.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | :: Run flutter tool backend.
4 | set BUILD_MODE=%~1
5 | "%FLUTTER_ROOT%\packages\flutter_tools\bin\tool_backend" windows-x64 %BUILD_MODE%
6 |
--------------------------------------------------------------------------------