WIP
+ added new example for nav 2 + made changes to router delegate
Showing
107 changed files
with
2873 additions
and
208 deletions
example_nav2/.gitignore
0 → 100644
| 1 | +# Miscellaneous | ||
| 2 | +*.class | ||
| 3 | +*.log | ||
| 4 | +*.pyc | ||
| 5 | +*.swp | ||
| 6 | +.DS_Store | ||
| 7 | +.atom/ | ||
| 8 | +.buildlog/ | ||
| 9 | +.history | ||
| 10 | +.svn/ | ||
| 11 | + | ||
| 12 | +# IntelliJ related | ||
| 13 | +*.iml | ||
| 14 | +*.ipr | ||
| 15 | +*.iws | ||
| 16 | +.idea/ | ||
| 17 | + | ||
| 18 | +# The .vscode folder contains launch configuration and tasks you configure in | ||
| 19 | +# VS Code which you may wish to be included in version control, so this line | ||
| 20 | +# is commented out by default. | ||
| 21 | +#.vscode/ | ||
| 22 | + | ||
| 23 | +# Flutter/Dart/Pub related | ||
| 24 | +**/doc/api/ | ||
| 25 | +**/ios/Flutter/.last_build_id | ||
| 26 | +.dart_tool/ | ||
| 27 | +.flutter-plugins | ||
| 28 | +.flutter-plugins-dependencies | ||
| 29 | +.packages | ||
| 30 | +.pub-cache/ | ||
| 31 | +.pub/ | ||
| 32 | +/build/ | ||
| 33 | + | ||
| 34 | +# Web related | ||
| 35 | +lib/generated_plugin_registrant.dart | ||
| 36 | + | ||
| 37 | +# Symbolication related | ||
| 38 | +app.*.symbols | ||
| 39 | + | ||
| 40 | +# Obfuscation related | ||
| 41 | +app.*.map.json | ||
| 42 | + | ||
| 43 | +# Android Studio will place build artifacts here | ||
| 44 | +/android/app/debug | ||
| 45 | +/android/app/profile | ||
| 46 | +/android/app/release |
example_nav2/.metadata
0 → 100644
| 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: b22742018b3edf16c6cadd7b76d9db5e7f9064b5 | ||
| 8 | + channel: stable | ||
| 9 | + | ||
| 10 | +project_type: app |
example_nav2/README.md
0 → 100644
| 1 | +# example_nav2 | ||
| 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. |
example_nav2/android/.gitignore
0 → 100644
example_nav2/android/app/build.gradle
0 → 100644
| 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 30 | ||
| 30 | + | ||
| 31 | + sourceSets { | ||
| 32 | + main.java.srcDirs += 'src/main/kotlin' | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + defaultConfig { | ||
| 36 | + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | ||
| 37 | + applicationId "com.get.example_nav2" | ||
| 38 | + minSdkVersion 16 | ||
| 39 | + targetSdkVersion 30 | ||
| 40 | + versionCode flutterVersionCode.toInteger() | ||
| 41 | + versionName flutterVersionName | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + buildTypes { | ||
| 45 | + release { | ||
| 46 | + // TODO: Add your own signing config for the release build. | ||
| 47 | + // Signing with the debug keys for now, so `flutter run --release` works. | ||
| 48 | + signingConfig signingConfigs.debug | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +flutter { | ||
| 54 | + source '../..' | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +dependencies { | ||
| 58 | + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
| 59 | +} |
| 1 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | + package="com.get.example_nav2"> | ||
| 3 | + <!-- Flutter needs it to communicate with the running application | ||
| 4 | + to allow setting breakpoints, to provide hot reload, etc. | ||
| 5 | + --> | ||
| 6 | + <uses-permission android:name="android.permission.INTERNET"/> | ||
| 7 | +</manifest> |
| 1 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | + package="com.get.example_nav2"> | ||
| 3 | + <application | ||
| 4 | + android:label="example_nav2" | ||
| 5 | + android:icon="@mipmap/ic_launcher"> | ||
| 6 | + <activity | ||
| 7 | + android:name=".MainActivity" | ||
| 8 | + android:launchMode="singleTop" | ||
| 9 | + android:theme="@style/LaunchTheme" | ||
| 10 | + android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
| 11 | + android:hardwareAccelerated="true" | ||
| 12 | + android:windowSoftInputMode="adjustResize"> | ||
| 13 | + <!-- Specifies an Android theme to apply to this Activity as soon as | ||
| 14 | + the Android process has started. This theme is visible to the user | ||
| 15 | + while the Flutter UI initializes. After that, this theme continues | ||
| 16 | + to determine the Window background behind the Flutter UI. --> | ||
| 17 | + <meta-data | ||
| 18 | + android:name="io.flutter.embedding.android.NormalTheme" | ||
| 19 | + android:resource="@style/NormalTheme" | ||
| 20 | + /> | ||
| 21 | + <!-- Displays an Android View that continues showing the launch screen | ||
| 22 | + Drawable until Flutter paints its first frame, then this splash | ||
| 23 | + screen fades out. A splash screen is useful to avoid any visual | ||
| 24 | + gap between the end of Android's launch screen and the painting of | ||
| 25 | + Flutter's first frame. --> | ||
| 26 | + <meta-data | ||
| 27 | + android:name="io.flutter.embedding.android.SplashScreenDrawable" | ||
| 28 | + android:resource="@drawable/launch_background" | ||
| 29 | + /> | ||
| 30 | + <intent-filter> | ||
| 31 | + <action android:name="android.intent.action.MAIN"/> | ||
| 32 | + <category android:name="android.intent.category.LAUNCHER"/> | ||
| 33 | + </intent-filter> | ||
| 34 | + </activity> | ||
| 35 | + <!-- Don't delete the meta-data below. | ||
| 36 | + This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> | ||
| 37 | + <meta-data | ||
| 38 | + android:name="flutterEmbedding" | ||
| 39 | + android:value="2" /> | ||
| 40 | + </application> | ||
| 41 | +</manifest> |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<!-- Modify this file to customize your launch splash screen --> | ||
| 3 | +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 4 | + <item android:drawable="?android:colorBackground" /> | ||
| 5 | + | ||
| 6 | + <!-- You can insert your own image assets here --> | ||
| 7 | + <!-- <item> | ||
| 8 | + <bitmap | ||
| 9 | + android:gravity="center" | ||
| 10 | + android:src="@mipmap/launch_image" /> | ||
| 11 | + </item> --> | ||
| 12 | +</layer-list> |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<!-- Modify this file to customize your launch splash screen --> | ||
| 3 | +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 4 | + <item android:drawable="@android:color/white" /> | ||
| 5 | + | ||
| 6 | + <!-- You can insert your own image assets here --> | ||
| 7 | + <!-- <item> | ||
| 8 | + <bitmap | ||
| 9 | + android:gravity="center" | ||
| 10 | + android:src="@mipmap/launch_image" /> | ||
| 11 | + </item> --> | ||
| 12 | +</layer-list> |
544 Bytes
442 Bytes
721 Bytes
1.01 KB
1.41 KB
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<resources> | ||
| 3 | + <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on --> | ||
| 4 | + <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
| 5 | + <!-- Show a splash screen on the activity. Automatically removed when | ||
| 6 | + Flutter draws its first frame --> | ||
| 7 | + <item name="android:windowBackground">@drawable/launch_background</item> | ||
| 8 | + </style> | ||
| 9 | + <!-- Theme applied to the Android Window as soon as the process has started. | ||
| 10 | + This theme determines the color of the Android Window while your | ||
| 11 | + Flutter UI initializes, as well as behind your Flutter UI while its | ||
| 12 | + running. | ||
| 13 | + | ||
| 14 | + This Theme is only used starting with V2 of Flutter's Android embedding. --> | ||
| 15 | + <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
| 16 | + <item name="android:windowBackground">?android:colorBackground</item> | ||
| 17 | + </style> | ||
| 18 | +</resources> |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<resources> | ||
| 3 | + <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off --> | ||
| 4 | + <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar"> | ||
| 5 | + <!-- Show a splash screen on the activity. Automatically removed when | ||
| 6 | + Flutter draws its first frame --> | ||
| 7 | + <item name="android:windowBackground">@drawable/launch_background</item> | ||
| 8 | + </style> | ||
| 9 | + <!-- Theme applied to the Android Window as soon as the process has started. | ||
| 10 | + This theme determines the color of the Android Window while your | ||
| 11 | + Flutter UI initializes, as well as behind your Flutter UI while its | ||
| 12 | + running. | ||
| 13 | + | ||
| 14 | + This Theme is only used starting with V2 of Flutter's Android embedding. --> | ||
| 15 | + <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar"> | ||
| 16 | + <item name="android:windowBackground">?android:colorBackground</item> | ||
| 17 | + </style> | ||
| 18 | +</resources> |
| 1 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | + package="com.get.example_nav2"> | ||
| 3 | + <!-- Flutter needs it to communicate with the running application | ||
| 4 | + to allow setting breakpoints, to provide hot reload, etc. | ||
| 5 | + --> | ||
| 6 | + <uses-permission android:name="android.permission.INTERNET"/> | ||
| 7 | +</manifest> |
example_nav2/android/build.gradle
0 → 100644
| 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:4.1.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 | + project.evaluationDependsOn(':app') | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +task clean(type: Delete) { | ||
| 28 | + delete rootProject.buildDir | ||
| 29 | +} |
example_nav2/android/gradle.properties
0 → 100644
example_nav2/android/settings.gradle
0 → 100644
| 1 | +include ':app' | ||
| 2 | + | ||
| 3 | +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") | ||
| 4 | +def properties = new Properties() | ||
| 5 | + | ||
| 6 | +assert localPropertiesFile.exists() | ||
| 7 | +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } | ||
| 8 | + | ||
| 9 | +def flutterSdkPath = properties.getProperty("flutter.sdk") | ||
| 10 | +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" | ||
| 11 | +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" |
example_nav2/ios/.gitignore
0 → 100644
| 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/ephemeral/ | ||
| 22 | +Flutter/app.flx | ||
| 23 | +Flutter/app.zip | ||
| 24 | +Flutter/flutter_assets/ | ||
| 25 | +Flutter/flutter_export_environment.sh | ||
| 26 | +ServiceDefinitions.json | ||
| 27 | +Runner/GeneratedPluginRegistrant.* | ||
| 28 | + | ||
| 29 | +# Exceptions to above rules. | ||
| 30 | +!default.mode1v3 | ||
| 31 | +!default.mode2v3 | ||
| 32 | +!default.pbxuser | ||
| 33 | +!default.perspectivev3 |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | +<plist version="1.0"> | ||
| 4 | +<dict> | ||
| 5 | + <key>CFBundleDevelopmentRegion</key> | ||
| 6 | + <string>en</string> | ||
| 7 | + <key>CFBundleExecutable</key> | ||
| 8 | + <string>App</string> | ||
| 9 | + <key>CFBundleIdentifier</key> | ||
| 10 | + <string>io.flutter.flutter.app</string> | ||
| 11 | + <key>CFBundleInfoDictionaryVersion</key> | ||
| 12 | + <string>6.0</string> | ||
| 13 | + <key>CFBundleName</key> | ||
| 14 | + <string>App</string> | ||
| 15 | + <key>CFBundlePackageType</key> | ||
| 16 | + <string>FMWK</string> | ||
| 17 | + <key>CFBundleShortVersionString</key> | ||
| 18 | + <string>1.0</string> | ||
| 19 | + <key>CFBundleSignature</key> | ||
| 20 | + <string>????</string> | ||
| 21 | + <key>CFBundleVersion</key> | ||
| 22 | + <string>1.0</string> | ||
| 23 | + <key>MinimumOSVersion</key> | ||
| 24 | + <string>8.0</string> | ||
| 25 | +</dict> | ||
| 26 | +</plist> |
example_nav2/ios/Flutter/Debug.xcconfig
0 → 100644
| 1 | +#include "Generated.xcconfig" |
example_nav2/ios/Flutter/Release.xcconfig
0 → 100644
| 1 | +#include "Generated.xcconfig" |
| 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 = "<group>"; }; | ||
| 33 | + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; | ||
| 34 | + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; | ||
| 35 | + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; | ||
| 36 | + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; | ||
| 37 | + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; | ||
| 38 | + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; | ||
| 39 | + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; | ||
| 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 = "<group>"; }; | ||
| 42 | + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; | ||
| 43 | + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; | ||
| 44 | + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; | ||
| 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 = "<group>"; | ||
| 68 | + }; | ||
| 69 | + 97C146E51CF9000F007C117D = { | ||
| 70 | + isa = PBXGroup; | ||
| 71 | + children = ( | ||
| 72 | + 9740EEB11CF90186004384FC /* Flutter */, | ||
| 73 | + 97C146F01CF9000F007C117D /* Runner */, | ||
| 74 | + 97C146EF1CF9000F007C117D /* Products */, | ||
| 75 | + ); | ||
| 76 | + sourceTree = "<group>"; | ||
| 77 | + }; | ||
| 78 | + 97C146EF1CF9000F007C117D /* Products */ = { | ||
| 79 | + isa = PBXGroup; | ||
| 80 | + children = ( | ||
| 81 | + 97C146EE1CF9000F007C117D /* Runner.app */, | ||
| 82 | + ); | ||
| 83 | + name = Products; | ||
| 84 | + sourceTree = "<group>"; | ||
| 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 | + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, | ||
| 94 | + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, | ||
| 95 | + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, | ||
| 96 | + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, | ||
| 97 | + ); | ||
| 98 | + path = Runner; | ||
| 99 | + sourceTree = "<group>"; | ||
| 100 | + }; | ||
| 101 | +/* End PBXGroup section */ | ||
| 102 | + | ||
| 103 | +/* Begin PBXNativeTarget section */ | ||
| 104 | + 97C146ED1CF9000F007C117D /* Runner */ = { | ||
| 105 | + isa = PBXNativeTarget; | ||
| 106 | + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; | ||
| 107 | + buildPhases = ( | ||
| 108 | + 9740EEB61CF901F6004384FC /* Run Script */, | ||
| 109 | + 97C146EA1CF9000F007C117D /* Sources */, | ||
| 110 | + 97C146EB1CF9000F007C117D /* Frameworks */, | ||
| 111 | + 97C146EC1CF9000F007C117D /* Resources */, | ||
| 112 | + 9705A1C41CF9048500538489 /* Embed Frameworks */, | ||
| 113 | + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, | ||
| 114 | + ); | ||
| 115 | + buildRules = ( | ||
| 116 | + ); | ||
| 117 | + dependencies = ( | ||
| 118 | + ); | ||
| 119 | + name = Runner; | ||
| 120 | + productName = Runner; | ||
| 121 | + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; | ||
| 122 | + productType = "com.apple.product-type.application"; | ||
| 123 | + }; | ||
| 124 | +/* End PBXNativeTarget section */ | ||
| 125 | + | ||
| 126 | +/* Begin PBXProject section */ | ||
| 127 | + 97C146E61CF9000F007C117D /* Project object */ = { | ||
| 128 | + isa = PBXProject; | ||
| 129 | + attributes = { | ||
| 130 | + LastUpgradeCheck = 1020; | ||
| 131 | + ORGANIZATIONNAME = ""; | ||
| 132 | + TargetAttributes = { | ||
| 133 | + 97C146ED1CF9000F007C117D = { | ||
| 134 | + CreatedOnToolsVersion = 7.3.1; | ||
| 135 | + LastSwiftMigration = 1100; | ||
| 136 | + }; | ||
| 137 | + }; | ||
| 138 | + }; | ||
| 139 | + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; | ||
| 140 | + compatibilityVersion = "Xcode 9.3"; | ||
| 141 | + developmentRegion = en; | ||
| 142 | + hasScannedForEncodings = 0; | ||
| 143 | + knownRegions = ( | ||
| 144 | + en, | ||
| 145 | + Base, | ||
| 146 | + ); | ||
| 147 | + mainGroup = 97C146E51CF9000F007C117D; | ||
| 148 | + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; | ||
| 149 | + projectDirPath = ""; | ||
| 150 | + projectRoot = ""; | ||
| 151 | + targets = ( | ||
| 152 | + 97C146ED1CF9000F007C117D /* Runner */, | ||
| 153 | + ); | ||
| 154 | + }; | ||
| 155 | +/* End PBXProject section */ | ||
| 156 | + | ||
| 157 | +/* Begin PBXResourcesBuildPhase section */ | ||
| 158 | + 97C146EC1CF9000F007C117D /* Resources */ = { | ||
| 159 | + isa = PBXResourcesBuildPhase; | ||
| 160 | + buildActionMask = 2147483647; | ||
| 161 | + files = ( | ||
| 162 | + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, | ||
| 163 | + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, | ||
| 164 | + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, | ||
| 165 | + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, | ||
| 166 | + ); | ||
| 167 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 168 | + }; | ||
| 169 | +/* End PBXResourcesBuildPhase section */ | ||
| 170 | + | ||
| 171 | +/* Begin PBXShellScriptBuildPhase section */ | ||
| 172 | + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { | ||
| 173 | + isa = PBXShellScriptBuildPhase; | ||
| 174 | + buildActionMask = 2147483647; | ||
| 175 | + files = ( | ||
| 176 | + ); | ||
| 177 | + inputPaths = ( | ||
| 178 | + ); | ||
| 179 | + name = "Thin Binary"; | ||
| 180 | + outputPaths = ( | ||
| 181 | + ); | ||
| 182 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 183 | + shellPath = /bin/sh; | ||
| 184 | + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; | ||
| 185 | + }; | ||
| 186 | + 9740EEB61CF901F6004384FC /* Run Script */ = { | ||
| 187 | + isa = PBXShellScriptBuildPhase; | ||
| 188 | + buildActionMask = 2147483647; | ||
| 189 | + files = ( | ||
| 190 | + ); | ||
| 191 | + inputPaths = ( | ||
| 192 | + ); | ||
| 193 | + name = "Run Script"; | ||
| 194 | + outputPaths = ( | ||
| 195 | + ); | ||
| 196 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 197 | + shellPath = /bin/sh; | ||
| 198 | + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; | ||
| 199 | + }; | ||
| 200 | +/* End PBXShellScriptBuildPhase section */ | ||
| 201 | + | ||
| 202 | +/* Begin PBXSourcesBuildPhase section */ | ||
| 203 | + 97C146EA1CF9000F007C117D /* Sources */ = { | ||
| 204 | + isa = PBXSourcesBuildPhase; | ||
| 205 | + buildActionMask = 2147483647; | ||
| 206 | + files = ( | ||
| 207 | + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, | ||
| 208 | + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, | ||
| 209 | + ); | ||
| 210 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 211 | + }; | ||
| 212 | +/* End PBXSourcesBuildPhase section */ | ||
| 213 | + | ||
| 214 | +/* Begin PBXVariantGroup section */ | ||
| 215 | + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { | ||
| 216 | + isa = PBXVariantGroup; | ||
| 217 | + children = ( | ||
| 218 | + 97C146FB1CF9000F007C117D /* Base */, | ||
| 219 | + ); | ||
| 220 | + name = Main.storyboard; | ||
| 221 | + sourceTree = "<group>"; | ||
| 222 | + }; | ||
| 223 | + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { | ||
| 224 | + isa = PBXVariantGroup; | ||
| 225 | + children = ( | ||
| 226 | + 97C147001CF9000F007C117D /* Base */, | ||
| 227 | + ); | ||
| 228 | + name = LaunchScreen.storyboard; | ||
| 229 | + sourceTree = "<group>"; | ||
| 230 | + }; | ||
| 231 | +/* End PBXVariantGroup section */ | ||
| 232 | + | ||
| 233 | +/* Begin XCBuildConfiguration section */ | ||
| 234 | + 249021D3217E4FDB00AE95B9 /* Profile */ = { | ||
| 235 | + isa = XCBuildConfiguration; | ||
| 236 | + buildSettings = { | ||
| 237 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 238 | + CLANG_ANALYZER_NONNULL = YES; | ||
| 239 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 240 | + CLANG_CXX_LIBRARY = "libc++"; | ||
| 241 | + CLANG_ENABLE_MODULES = YES; | ||
| 242 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
| 243 | + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
| 244 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 245 | + CLANG_WARN_COMMA = YES; | ||
| 246 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 247 | + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
| 248 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 249 | + CLANG_WARN_EMPTY_BODY = YES; | ||
| 250 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 251 | + CLANG_WARN_INFINITE_RECURSION = YES; | ||
| 252 | + CLANG_WARN_INT_CONVERSION = YES; | ||
| 253 | + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
| 254 | + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
| 255 | + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
| 256 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 257 | + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
| 258 | + CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
| 259 | + CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
| 260 | + CLANG_WARN_UNREACHABLE_CODE = YES; | ||
| 261 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 262 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 263 | + COPY_PHASE_STRIP = NO; | ||
| 264 | + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; | ||
| 265 | + ENABLE_NS_ASSERTIONS = NO; | ||
| 266 | + ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
| 267 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 268 | + GCC_NO_COMMON_BLOCKS = YES; | ||
| 269 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 270 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 271 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 272 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 273 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 274 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 275 | + IPHONEOS_DEPLOYMENT_TARGET = 9.0; | ||
| 276 | + MTL_ENABLE_DEBUG_INFO = NO; | ||
| 277 | + SDKROOT = iphoneos; | ||
| 278 | + SUPPORTED_PLATFORMS = iphoneos; | ||
| 279 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 280 | + VALIDATE_PRODUCT = YES; | ||
| 281 | + }; | ||
| 282 | + name = Profile; | ||
| 283 | + }; | ||
| 284 | + 249021D4217E4FDB00AE95B9 /* Profile */ = { | ||
| 285 | + isa = XCBuildConfiguration; | ||
| 286 | + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; | ||
| 287 | + buildSettings = { | ||
| 288 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 289 | + CLANG_ENABLE_MODULES = YES; | ||
| 290 | + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| 291 | + ENABLE_BITCODE = NO; | ||
| 292 | + INFOPLIST_FILE = Runner/Info.plist; | ||
| 293 | + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
| 294 | + PRODUCT_BUNDLE_IDENTIFIER = com.get.exampleNav2; | ||
| 295 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 296 | + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | ||
| 297 | + SWIFT_VERSION = 5.0; | ||
| 298 | + VERSIONING_SYSTEM = "apple-generic"; | ||
| 299 | + }; | ||
| 300 | + name = Profile; | ||
| 301 | + }; | ||
| 302 | + 97C147031CF9000F007C117D /* Debug */ = { | ||
| 303 | + isa = XCBuildConfiguration; | ||
| 304 | + buildSettings = { | ||
| 305 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 306 | + CLANG_ANALYZER_NONNULL = YES; | ||
| 307 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 308 | + CLANG_CXX_LIBRARY = "libc++"; | ||
| 309 | + CLANG_ENABLE_MODULES = YES; | ||
| 310 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
| 311 | + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
| 312 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 313 | + CLANG_WARN_COMMA = YES; | ||
| 314 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 315 | + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
| 316 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 317 | + CLANG_WARN_EMPTY_BODY = YES; | ||
| 318 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 319 | + CLANG_WARN_INFINITE_RECURSION = YES; | ||
| 320 | + CLANG_WARN_INT_CONVERSION = YES; | ||
| 321 | + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
| 322 | + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
| 323 | + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
| 324 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 325 | + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
| 326 | + CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
| 327 | + CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
| 328 | + CLANG_WARN_UNREACHABLE_CODE = YES; | ||
| 329 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 330 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 331 | + COPY_PHASE_STRIP = NO; | ||
| 332 | + DEBUG_INFORMATION_FORMAT = dwarf; | ||
| 333 | + ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
| 334 | + ENABLE_TESTABILITY = YES; | ||
| 335 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 336 | + GCC_DYNAMIC_NO_PIC = NO; | ||
| 337 | + GCC_NO_COMMON_BLOCKS = YES; | ||
| 338 | + GCC_OPTIMIZATION_LEVEL = 0; | ||
| 339 | + GCC_PREPROCESSOR_DEFINITIONS = ( | ||
| 340 | + "DEBUG=1", | ||
| 341 | + "$(inherited)", | ||
| 342 | + ); | ||
| 343 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 344 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 345 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 346 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 347 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 348 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 349 | + IPHONEOS_DEPLOYMENT_TARGET = 9.0; | ||
| 350 | + MTL_ENABLE_DEBUG_INFO = YES; | ||
| 351 | + ONLY_ACTIVE_ARCH = YES; | ||
| 352 | + SDKROOT = iphoneos; | ||
| 353 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 354 | + }; | ||
| 355 | + name = Debug; | ||
| 356 | + }; | ||
| 357 | + 97C147041CF9000F007C117D /* Release */ = { | ||
| 358 | + isa = XCBuildConfiguration; | ||
| 359 | + buildSettings = { | ||
| 360 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 361 | + CLANG_ANALYZER_NONNULL = YES; | ||
| 362 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 363 | + CLANG_CXX_LIBRARY = "libc++"; | ||
| 364 | + CLANG_ENABLE_MODULES = YES; | ||
| 365 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
| 366 | + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
| 367 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 368 | + CLANG_WARN_COMMA = YES; | ||
| 369 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 370 | + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
| 371 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 372 | + CLANG_WARN_EMPTY_BODY = YES; | ||
| 373 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 374 | + CLANG_WARN_INFINITE_RECURSION = YES; | ||
| 375 | + CLANG_WARN_INT_CONVERSION = YES; | ||
| 376 | + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
| 377 | + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
| 378 | + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
| 379 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 380 | + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
| 381 | + CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
| 382 | + CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
| 383 | + CLANG_WARN_UNREACHABLE_CODE = YES; | ||
| 384 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 385 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 386 | + COPY_PHASE_STRIP = NO; | ||
| 387 | + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; | ||
| 388 | + ENABLE_NS_ASSERTIONS = NO; | ||
| 389 | + ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
| 390 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 391 | + GCC_NO_COMMON_BLOCKS = YES; | ||
| 392 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 393 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 394 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 395 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 396 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 397 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 398 | + IPHONEOS_DEPLOYMENT_TARGET = 9.0; | ||
| 399 | + MTL_ENABLE_DEBUG_INFO = NO; | ||
| 400 | + SDKROOT = iphoneos; | ||
| 401 | + SUPPORTED_PLATFORMS = iphoneos; | ||
| 402 | + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; | ||
| 403 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 404 | + VALIDATE_PRODUCT = YES; | ||
| 405 | + }; | ||
| 406 | + name = Release; | ||
| 407 | + }; | ||
| 408 | + 97C147061CF9000F007C117D /* Debug */ = { | ||
| 409 | + isa = XCBuildConfiguration; | ||
| 410 | + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; | ||
| 411 | + buildSettings = { | ||
| 412 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 413 | + CLANG_ENABLE_MODULES = YES; | ||
| 414 | + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| 415 | + ENABLE_BITCODE = NO; | ||
| 416 | + INFOPLIST_FILE = Runner/Info.plist; | ||
| 417 | + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
| 418 | + PRODUCT_BUNDLE_IDENTIFIER = com.get.exampleNav2; | ||
| 419 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 420 | + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | ||
| 421 | + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; | ||
| 422 | + SWIFT_VERSION = 5.0; | ||
| 423 | + VERSIONING_SYSTEM = "apple-generic"; | ||
| 424 | + }; | ||
| 425 | + name = Debug; | ||
| 426 | + }; | ||
| 427 | + 97C147071CF9000F007C117D /* Release */ = { | ||
| 428 | + isa = XCBuildConfiguration; | ||
| 429 | + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; | ||
| 430 | + buildSettings = { | ||
| 431 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 432 | + CLANG_ENABLE_MODULES = YES; | ||
| 433 | + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| 434 | + ENABLE_BITCODE = NO; | ||
| 435 | + INFOPLIST_FILE = Runner/Info.plist; | ||
| 436 | + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
| 437 | + PRODUCT_BUNDLE_IDENTIFIER = com.get.exampleNav2; | ||
| 438 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 439 | + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | ||
| 440 | + SWIFT_VERSION = 5.0; | ||
| 441 | + VERSIONING_SYSTEM = "apple-generic"; | ||
| 442 | + }; | ||
| 443 | + name = Release; | ||
| 444 | + }; | ||
| 445 | +/* End XCBuildConfiguration section */ | ||
| 446 | + | ||
| 447 | +/* Begin XCConfigurationList section */ | ||
| 448 | + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { | ||
| 449 | + isa = XCConfigurationList; | ||
| 450 | + buildConfigurations = ( | ||
| 451 | + 97C147031CF9000F007C117D /* Debug */, | ||
| 452 | + 97C147041CF9000F007C117D /* Release */, | ||
| 453 | + 249021D3217E4FDB00AE95B9 /* Profile */, | ||
| 454 | + ); | ||
| 455 | + defaultConfigurationIsVisible = 0; | ||
| 456 | + defaultConfigurationName = Release; | ||
| 457 | + }; | ||
| 458 | + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { | ||
| 459 | + isa = XCConfigurationList; | ||
| 460 | + buildConfigurations = ( | ||
| 461 | + 97C147061CF9000F007C117D /* Debug */, | ||
| 462 | + 97C147071CF9000F007C117D /* Release */, | ||
| 463 | + 249021D4217E4FDB00AE95B9 /* Profile */, | ||
| 464 | + ); | ||
| 465 | + defaultConfigurationIsVisible = 0; | ||
| 466 | + defaultConfigurationName = Release; | ||
| 467 | + }; | ||
| 468 | +/* End XCConfigurationList section */ | ||
| 469 | + }; | ||
| 470 | + rootObject = 97C146E61CF9000F007C117D /* Project object */; | ||
| 471 | +} |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<Scheme | ||
| 3 | + LastUpgradeVersion = "1020" | ||
| 4 | + version = "1.3"> | ||
| 5 | + <BuildAction | ||
| 6 | + parallelizeBuildables = "YES" | ||
| 7 | + buildImplicitDependencies = "YES"> | ||
| 8 | + <BuildActionEntries> | ||
| 9 | + <BuildActionEntry | ||
| 10 | + buildForTesting = "YES" | ||
| 11 | + buildForRunning = "YES" | ||
| 12 | + buildForProfiling = "YES" | ||
| 13 | + buildForArchiving = "YES" | ||
| 14 | + buildForAnalyzing = "YES"> | ||
| 15 | + <BuildableReference | ||
| 16 | + BuildableIdentifier = "primary" | ||
| 17 | + BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
| 18 | + BuildableName = "Runner.app" | ||
| 19 | + BlueprintName = "Runner" | ||
| 20 | + ReferencedContainer = "container:Runner.xcodeproj"> | ||
| 21 | + </BuildableReference> | ||
| 22 | + </BuildActionEntry> | ||
| 23 | + </BuildActionEntries> | ||
| 24 | + </BuildAction> | ||
| 25 | + <TestAction | ||
| 26 | + buildConfiguration = "Debug" | ||
| 27 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| 28 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| 29 | + shouldUseLaunchSchemeArgsEnv = "YES"> | ||
| 30 | + <Testables> | ||
| 31 | + </Testables> | ||
| 32 | + <MacroExpansion> | ||
| 33 | + <BuildableReference | ||
| 34 | + BuildableIdentifier = "primary" | ||
| 35 | + BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
| 36 | + BuildableName = "Runner.app" | ||
| 37 | + BlueprintName = "Runner" | ||
| 38 | + ReferencedContainer = "container:Runner.xcodeproj"> | ||
| 39 | + </BuildableReference> | ||
| 40 | + </MacroExpansion> | ||
| 41 | + <AdditionalOptions> | ||
| 42 | + </AdditionalOptions> | ||
| 43 | + </TestAction> | ||
| 44 | + <LaunchAction | ||
| 45 | + buildConfiguration = "Debug" | ||
| 46 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| 47 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| 48 | + launchStyle = "0" | ||
| 49 | + useCustomWorkingDirectory = "NO" | ||
| 50 | + ignoresPersistentStateOnLaunch = "NO" | ||
| 51 | + debugDocumentVersioning = "YES" | ||
| 52 | + debugServiceExtension = "internal" | ||
| 53 | + allowLocationSimulation = "YES"> | ||
| 54 | + <BuildableProductRunnable | ||
| 55 | + runnableDebuggingMode = "0"> | ||
| 56 | + <BuildableReference | ||
| 57 | + BuildableIdentifier = "primary" | ||
| 58 | + BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
| 59 | + BuildableName = "Runner.app" | ||
| 60 | + BlueprintName = "Runner" | ||
| 61 | + ReferencedContainer = "container:Runner.xcodeproj"> | ||
| 62 | + </BuildableReference> | ||
| 63 | + </BuildableProductRunnable> | ||
| 64 | + <AdditionalOptions> | ||
| 65 | + </AdditionalOptions> | ||
| 66 | + </LaunchAction> | ||
| 67 | + <ProfileAction | ||
| 68 | + buildConfiguration = "Profile" | ||
| 69 | + shouldUseLaunchSchemeArgsEnv = "YES" | ||
| 70 | + savedToolIdentifier = "" | ||
| 71 | + useCustomWorkingDirectory = "NO" | ||
| 72 | + debugDocumentVersioning = "YES"> | ||
| 73 | + <BuildableProductRunnable | ||
| 74 | + runnableDebuggingMode = "0"> | ||
| 75 | + <BuildableReference | ||
| 76 | + BuildableIdentifier = "primary" | ||
| 77 | + BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
| 78 | + BuildableName = "Runner.app" | ||
| 79 | + BlueprintName = "Runner" | ||
| 80 | + ReferencedContainer = "container:Runner.xcodeproj"> | ||
| 81 | + </BuildableReference> | ||
| 82 | + </BuildableProductRunnable> | ||
| 83 | + </ProfileAction> | ||
| 84 | + <AnalyzeAction | ||
| 85 | + buildConfiguration = "Debug"> | ||
| 86 | + </AnalyzeAction> | ||
| 87 | + <ArchiveAction | ||
| 88 | + buildConfiguration = "Release" | ||
| 89 | + revealArchiveInOrganizer = "YES"> | ||
| 90 | + </ArchiveAction> | ||
| 91 | +</Scheme> |
example_nav2/ios/Runner/AppDelegate.swift
0 → 100644
| 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 | +} |
| 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 | +} |
10.7 KB
564 Bytes
3.53 KB
| 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 | +} |
68 Bytes
68 Bytes
68 Bytes
| 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. |
| 1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
| 3 | + <dependencies> | ||
| 4 | + <deployment identifier="iOS"/> | ||
| 5 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> | ||
| 6 | + </dependencies> | ||
| 7 | + <scenes> | ||
| 8 | + <!--View Controller--> | ||
| 9 | + <scene sceneID="EHf-IW-A2E"> | ||
| 10 | + <objects> | ||
| 11 | + <viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
| 12 | + <layoutGuides> | ||
| 13 | + <viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/> | ||
| 14 | + <viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/> | ||
| 15 | + </layoutGuides> | ||
| 16 | + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
| 17 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 18 | + <subviews> | ||
| 19 | + <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"> | ||
| 20 | + </imageView> | ||
| 21 | + </subviews> | ||
| 22 | + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
| 23 | + <constraints> | ||
| 24 | + <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/> | ||
| 25 | + <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/> | ||
| 26 | + </constraints> | ||
| 27 | + </view> | ||
| 28 | + </viewController> | ||
| 29 | + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
| 30 | + </objects> | ||
| 31 | + <point key="canvasLocation" x="53" y="375"/> | ||
| 32 | + </scene> | ||
| 33 | + </scenes> | ||
| 34 | + <resources> | ||
| 35 | + <image name="LaunchImage" width="168" height="185"/> | ||
| 36 | + </resources> | ||
| 37 | +</document> |
| 1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> | ||
| 3 | + <dependencies> | ||
| 4 | + <deployment identifier="iOS"/> | ||
| 5 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||
| 6 | + </dependencies> | ||
| 7 | + <scenes> | ||
| 8 | + <!--Flutter View Controller--> | ||
| 9 | + <scene sceneID="tne-QT-ifu"> | ||
| 10 | + <objects> | ||
| 11 | + <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController"> | ||
| 12 | + <layoutGuides> | ||
| 13 | + <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> | ||
| 14 | + <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> | ||
| 15 | + </layoutGuides> | ||
| 16 | + <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> | ||
| 17 | + <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
| 18 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 19 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||
| 20 | + </view> | ||
| 21 | + </viewController> | ||
| 22 | + <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> | ||
| 23 | + </objects> | ||
| 24 | + </scene> | ||
| 25 | + </scenes> | ||
| 26 | +</document> |
example_nav2/ios/Runner/Info.plist
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | +<plist version="1.0"> | ||
| 4 | +<dict> | ||
| 5 | + <key>CFBundleDevelopmentRegion</key> | ||
| 6 | + <string>$(DEVELOPMENT_LANGUAGE)</string> | ||
| 7 | + <key>CFBundleExecutable</key> | ||
| 8 | + <string>$(EXECUTABLE_NAME)</string> | ||
| 9 | + <key>CFBundleIdentifier</key> | ||
| 10 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
| 11 | + <key>CFBundleInfoDictionaryVersion</key> | ||
| 12 | + <string>6.0</string> | ||
| 13 | + <key>CFBundleName</key> | ||
| 14 | + <string>example_nav2</string> | ||
| 15 | + <key>CFBundlePackageType</key> | ||
| 16 | + <string>APPL</string> | ||
| 17 | + <key>CFBundleShortVersionString</key> | ||
| 18 | + <string>$(FLUTTER_BUILD_NAME)</string> | ||
| 19 | + <key>CFBundleSignature</key> | ||
| 20 | + <string>????</string> | ||
| 21 | + <key>CFBundleVersion</key> | ||
| 22 | + <string>$(FLUTTER_BUILD_NUMBER)</string> | ||
| 23 | + <key>LSRequiresIPhoneOS</key> | ||
| 24 | + <true/> | ||
| 25 | + <key>UILaunchStoryboardName</key> | ||
| 26 | + <string>LaunchScreen</string> | ||
| 27 | + <key>UIMainStoryboardFile</key> | ||
| 28 | + <string>Main</string> | ||
| 29 | + <key>UISupportedInterfaceOrientations</key> | ||
| 30 | + <array> | ||
| 31 | + <string>UIInterfaceOrientationPortrait</string> | ||
| 32 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| 33 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
| 34 | + </array> | ||
| 35 | + <key>UISupportedInterfaceOrientations~ipad</key> | ||
| 36 | + <array> | ||
| 37 | + <string>UIInterfaceOrientationPortrait</string> | ||
| 38 | + <string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
| 39 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| 40 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
| 41 | + </array> | ||
| 42 | + <key>UIViewControllerBasedStatusBarAppearance</key> | ||
| 43 | + <false/> | ||
| 44 | +</dict> | ||
| 45 | +</plist> |
| 1 | +#import "GeneratedPluginRegistrant.h" |
| 1 | +import 'package:get/get.dart'; | ||
| 2 | + | ||
| 3 | +class HomeController extends GetxController { | ||
| 4 | + //TODO: Implement HomeController | ||
| 5 | + | ||
| 6 | + final count = 0.obs; | ||
| 7 | + @override | ||
| 8 | + void onInit() { | ||
| 9 | + super.onInit(); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + @override | ||
| 13 | + void onReady() { | ||
| 14 | + super.onReady(); | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + @override | ||
| 18 | + void onClose() {} | ||
| 19 | + void increment() => count.value++; | ||
| 20 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | + | ||
| 3 | +import 'package:get/get.dart'; | ||
| 4 | + | ||
| 5 | +import '../controllers/home_controller.dart'; | ||
| 6 | + | ||
| 7 | +class HomeView extends GetView<HomeController> { | ||
| 8 | + @override | ||
| 9 | + Widget build(BuildContext context) { | ||
| 10 | + return Scaffold( | ||
| 11 | + appBar: AppBar( | ||
| 12 | + title: Text('HomeView'), | ||
| 13 | + centerTitle: true, | ||
| 14 | + ), | ||
| 15 | + body: Center( | ||
| 16 | + child: Text( | ||
| 17 | + 'HomeView is working', | ||
| 18 | + style: TextStyle(fontSize: 20), | ||
| 19 | + ), | ||
| 20 | + ), | ||
| 21 | + ); | ||
| 22 | + } | ||
| 23 | +} |
| 1 | +import 'package:get/get.dart'; | ||
| 2 | + | ||
| 3 | +class ProductsController extends GetxController { | ||
| 4 | + //TODO: Implement ProductsController | ||
| 5 | + | ||
| 6 | + final count = 0.obs; | ||
| 7 | + @override | ||
| 8 | + void onInit() { | ||
| 9 | + super.onInit(); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + @override | ||
| 13 | + void onReady() { | ||
| 14 | + super.onReady(); | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + @override | ||
| 18 | + void onClose() {} | ||
| 19 | + void increment() => count.value++; | ||
| 20 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | + | ||
| 3 | +import 'package:get/get.dart'; | ||
| 4 | + | ||
| 5 | +import '../controllers/products_controller.dart'; | ||
| 6 | + | ||
| 7 | +class ProductsView extends GetView<ProductsController> { | ||
| 8 | + @override | ||
| 9 | + Widget build(BuildContext context) { | ||
| 10 | + return Scaffold( | ||
| 11 | + appBar: AppBar( | ||
| 12 | + title: Text('ProductsView'), | ||
| 13 | + centerTitle: true, | ||
| 14 | + ), | ||
| 15 | + body: Center( | ||
| 16 | + child: Text( | ||
| 17 | + 'ProductsView is working', | ||
| 18 | + style: TextStyle(fontSize: 20), | ||
| 19 | + ), | ||
| 20 | + ), | ||
| 21 | + ); | ||
| 22 | + } | ||
| 23 | +} |
example_nav2/lib/app/routes/app_pages.dart
0 → 100644
| 1 | +import 'package:get/get.dart'; | ||
| 2 | + | ||
| 3 | +import 'package:example_nav2/app/modules/home/bindings/home_binding.dart'; | ||
| 4 | +import 'package:example_nav2/app/modules/home/views/home_view.dart'; | ||
| 5 | +import 'package:example_nav2/app/modules/products/bindings/products_binding.dart'; | ||
| 6 | +import 'package:example_nav2/app/modules/products/views/products_view.dart'; | ||
| 7 | + | ||
| 8 | +part 'app_routes.dart'; | ||
| 9 | + | ||
| 10 | +class AppPages { | ||
| 11 | + AppPages._(); | ||
| 12 | + | ||
| 13 | + static const INITIAL = Routes.HOME; | ||
| 14 | + | ||
| 15 | + static final routes = [ | ||
| 16 | + GetPage( | ||
| 17 | + name: _Paths.HOME, | ||
| 18 | + page: () => HomeView(), | ||
| 19 | + binding: HomeBinding(), | ||
| 20 | + ), | ||
| 21 | + GetPage( | ||
| 22 | + name: _Paths.PRODUCTS, | ||
| 23 | + page: () => ProductsView(), | ||
| 24 | + binding: ProductsBinding(), | ||
| 25 | + ), | ||
| 26 | + ]; | ||
| 27 | +} |
example_nav2/lib/app/routes/app_routes.dart
0 → 100644
| 1 | +part of 'app_pages.dart'; | ||
| 2 | +// DO NOT EDIT. This is code generated via package:get_cli/get_cli.dart | ||
| 3 | + | ||
| 4 | +abstract class Routes { | ||
| 5 | + Routes._(); | ||
| 6 | + | ||
| 7 | + static const HOME = _Paths.HOME; | ||
| 8 | + static const PRODUCTS = _Paths.PRODUCTS; | ||
| 9 | +} | ||
| 10 | + | ||
| 11 | +abstract class _Paths { | ||
| 12 | + static const HOME = '/home'; | ||
| 13 | + static const PRODUCTS = '/products'; | ||
| 14 | +} |
example_nav2/pubspec.yaml
0 → 100644
| 1 | +name: example_nav2 | ||
| 2 | +version: 1.0.0+1 | ||
| 3 | +publish_to: none | ||
| 4 | +description: A new Flutter project. | ||
| 5 | +environment: | ||
| 6 | + sdk: ">=2.12.0 <3.0.0" | ||
| 7 | + | ||
| 8 | +dependencies: | ||
| 9 | + cupertino_icons: ^1.0.2 | ||
| 10 | + effective_dart: 1.3.1 | ||
| 11 | + get: | ||
| 12 | + path: ../ | ||
| 13 | + flutter: | ||
| 14 | + sdk: flutter | ||
| 15 | + | ||
| 16 | +dev_dependencies: | ||
| 17 | + flutter_test: | ||
| 18 | + sdk: flutter | ||
| 19 | + | ||
| 20 | +flutter: | ||
| 21 | + uses-material-design: true |
example_nav2/test/widget_test.dart
0 → 100644
example_nav2/web/favicon.png
0 → 100644
917 Bytes
example_nav2/web/icons/Icon-192.png
0 → 100644
5.17 KB
example_nav2/web/icons/Icon-512.png
0 → 100644
8.06 KB
example_nav2/web/index.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html> | ||
| 3 | +<head> | ||
| 4 | + <!-- | ||
| 5 | + If you are serving your web app in a path other than the root, change the | ||
| 6 | + href value below to reflect the base path you are serving from. | ||
| 7 | + | ||
| 8 | + The path provided below has to start and end with a slash "/" in order for | ||
| 9 | + it to work correctly. | ||
| 10 | + | ||
| 11 | + For more details: | ||
| 12 | + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base | ||
| 13 | + --> | ||
| 14 | + <base href="/"> | ||
| 15 | + | ||
| 16 | + <meta charset="UTF-8"> | ||
| 17 | + <meta content="IE=Edge" http-equiv="X-UA-Compatible"> | ||
| 18 | + <meta name="description" content="A new Flutter project."> | ||
| 19 | + | ||
| 20 | + <!-- iOS meta tags & icons --> | ||
| 21 | + <meta name="apple-mobile-web-app-capable" content="yes"> | ||
| 22 | + <meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
| 23 | + <meta name="apple-mobile-web-app-title" content="example_nav2"> | ||
| 24 | + <link rel="apple-touch-icon" href="icons/Icon-192.png"> | ||
| 25 | + | ||
| 26 | + <title>example_nav2</title> | ||
| 27 | + <link rel="manifest" href="manifest.json"> | ||
| 28 | +</head> | ||
| 29 | +<body> | ||
| 30 | + <!-- This script installs service_worker.js to provide PWA functionality to | ||
| 31 | + application. For more information, see: | ||
| 32 | + https://developers.google.com/web/fundamentals/primers/service-workers --> | ||
| 33 | + <script> | ||
| 34 | + var serviceWorkerVersion = null; | ||
| 35 | + var scriptLoaded = false; | ||
| 36 | + function loadMainDartJs() { | ||
| 37 | + if (scriptLoaded) { | ||
| 38 | + return; | ||
| 39 | + } | ||
| 40 | + scriptLoaded = true; | ||
| 41 | + var scriptTag = document.createElement('script'); | ||
| 42 | + scriptTag.src = 'main.dart.js'; | ||
| 43 | + scriptTag.type = 'application/javascript'; | ||
| 44 | + document.body.append(scriptTag); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + if ('serviceWorker' in navigator) { | ||
| 48 | + // Service workers are supported. Use them. | ||
| 49 | + window.addEventListener('load', function () { | ||
| 50 | + // Wait for registration to finish before dropping the <script> tag. | ||
| 51 | + // Otherwise, the browser will load the script multiple times, | ||
| 52 | + // potentially different versions. | ||
| 53 | + var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion; | ||
| 54 | + navigator.serviceWorker.register(serviceWorkerUrl) | ||
| 55 | + .then((reg) => { | ||
| 56 | + function waitForActivation(serviceWorker) { | ||
| 57 | + serviceWorker.addEventListener('statechange', () => { | ||
| 58 | + if (serviceWorker.state == 'activated') { | ||
| 59 | + console.log('Installed new service worker.'); | ||
| 60 | + loadMainDartJs(); | ||
| 61 | + } | ||
| 62 | + }); | ||
| 63 | + } | ||
| 64 | + if (!reg.active && (reg.installing || reg.waiting)) { | ||
| 65 | + // No active web worker and we have installed or are installing | ||
| 66 | + // one for the first time. Simply wait for it to activate. | ||
| 67 | + waitForActivation(reg.installing ?? reg.waiting); | ||
| 68 | + } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) { | ||
| 69 | + // When the app updates the serviceWorkerVersion changes, so we | ||
| 70 | + // need to ask the service worker to update. | ||
| 71 | + console.log('New service worker available.'); | ||
| 72 | + reg.update(); | ||
| 73 | + waitForActivation(reg.installing); | ||
| 74 | + } else { | ||
| 75 | + // Existing service worker is still good. | ||
| 76 | + console.log('Loading app from service worker.'); | ||
| 77 | + loadMainDartJs(); | ||
| 78 | + } | ||
| 79 | + }); | ||
| 80 | + | ||
| 81 | + // If service worker doesn't succeed in a reasonable amount of time, | ||
| 82 | + // fallback to plaint <script> tag. | ||
| 83 | + setTimeout(() => { | ||
| 84 | + if (!scriptLoaded) { | ||
| 85 | + console.warn( | ||
| 86 | + 'Failed to load app from service worker. Falling back to plain <script> tag.', | ||
| 87 | + ); | ||
| 88 | + loadMainDartJs(); | ||
| 89 | + } | ||
| 90 | + }, 4000); | ||
| 91 | + }); | ||
| 92 | + } else { | ||
| 93 | + // Service workers not supported. Just drop the <script> tag. | ||
| 94 | + loadMainDartJs(); | ||
| 95 | + } | ||
| 96 | + </script> | ||
| 97 | +</body> | ||
| 98 | +</html> |
example_nav2/web/manifest.json
0 → 100644
| 1 | +{ | ||
| 2 | + "name": "example_nav2", | ||
| 3 | + "short_name": "example_nav2", | ||
| 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 | +} |
example_nav2/windows/.gitignore
0 → 100644
| 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/ |
example_nav2/windows/CMakeLists.txt
0 → 100644
| 1 | +cmake_minimum_required(VERSION 3.15) | ||
| 2 | +project(example_nav2 LANGUAGES CXX) | ||
| 3 | + | ||
| 4 | +set(BINARY_NAME "example_nav2") | ||
| 5 | + | ||
| 6 | +cmake_policy(SET CMP0063 NEW) | ||
| 7 | + | ||
| 8 | +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") | ||
| 9 | + | ||
| 10 | +# Configure build options. | ||
| 11 | +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) | ||
| 12 | +if(IS_MULTICONFIG) | ||
| 13 | + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" | ||
| 14 | + CACHE STRING "" FORCE) | ||
| 15 | +else() | ||
| 16 | + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
| 17 | + set(CMAKE_BUILD_TYPE "Debug" CACHE | ||
| 18 | + STRING "Flutter build mode" FORCE) | ||
| 19 | + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS | ||
| 20 | + "Debug" "Profile" "Release") | ||
| 21 | + endif() | ||
| 22 | +endif() | ||
| 23 | + | ||
| 24 | +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") | ||
| 25 | +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") | ||
| 26 | +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") | ||
| 27 | +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") | ||
| 28 | + | ||
| 29 | +# Use Unicode for all projects. | ||
| 30 | +add_definitions(-DUNICODE -D_UNICODE) | ||
| 31 | + | ||
| 32 | +# Compilation settings that should be applied to most targets. | ||
| 33 | +function(APPLY_STANDARD_SETTINGS TARGET) | ||
| 34 | + target_compile_features(${TARGET} PUBLIC cxx_std_17) | ||
| 35 | + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") | ||
| 36 | + target_compile_options(${TARGET} PRIVATE /EHsc) | ||
| 37 | + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") | ||
| 38 | + target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>") | ||
| 39 | +endfunction() | ||
| 40 | + | ||
| 41 | +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") | ||
| 42 | + | ||
| 43 | +# Flutter library and tool build rules. | ||
| 44 | +add_subdirectory(${FLUTTER_MANAGED_DIR}) | ||
| 45 | + | ||
| 46 | +# Application build | ||
| 47 | +add_subdirectory("runner") | ||
| 48 | + | ||
| 49 | +# Generated plugin build rules, which manage building the plugins and adding | ||
| 50 | +# them to the application. | ||
| 51 | +include(flutter/generated_plugins.cmake) | ||
| 52 | + | ||
| 53 | + | ||
| 54 | +# === Installation === | ||
| 55 | +# Support files are copied into place next to the executable, so that it can | ||
| 56 | +# run in place. This is done instead of making a separate bundle (as on Linux) | ||
| 57 | +# so that building and running from within Visual Studio will work. | ||
| 58 | +set(BUILD_BUNDLE_DIR "$<TARGET_FILE_DIR:${BINARY_NAME}>") | ||
| 59 | +# Make the "install" step default, as it's required to run. | ||
| 60 | +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) | ||
| 61 | +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
| 62 | + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) | ||
| 63 | +endif() | ||
| 64 | + | ||
| 65 | +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") | ||
| 66 | +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") | ||
| 67 | + | ||
| 68 | +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" | ||
| 69 | + COMPONENT Runtime) | ||
| 70 | + | ||
| 71 | +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" | ||
| 72 | + COMPONENT Runtime) | ||
| 73 | + | ||
| 74 | +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" | ||
| 75 | + COMPONENT Runtime) | ||
| 76 | + | ||
| 77 | +if(PLUGIN_BUNDLED_LIBRARIES) | ||
| 78 | + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" | ||
| 79 | + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" | ||
| 80 | + COMPONENT Runtime) | ||
| 81 | +endif() | ||
| 82 | + | ||
| 83 | +# Fully re-copy the assets directory on each build to avoid having stale files | ||
| 84 | +# from a previous install. | ||
| 85 | +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") | ||
| 86 | +install(CODE " | ||
| 87 | + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") | ||
| 88 | + " COMPONENT Runtime) | ||
| 89 | +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" | ||
| 90 | + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) | ||
| 91 | + | ||
| 92 | +# Install the AOT library on non-Debug builds only. | ||
| 93 | +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" | ||
| 94 | + CONFIGURATIONS Profile;Release | ||
| 95 | + COMPONENT Runtime) |
example_nav2/windows/flutter/CMakeLists.txt
0 → 100644
| 1 | +cmake_minimum_required(VERSION 3.15) | ||
| 2 | + | ||
| 3 | +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") | ||
| 4 | + | ||
| 5 | +# Configuration provided via flutter tool. | ||
| 6 | +include(${EPHEMERAL_DIR}/generated_config.cmake) | ||
| 7 | + | ||
| 8 | +# TODO: Move the rest of this into files in ephemeral. See | ||
| 9 | +# https://github.com/flutter/flutter/issues/57146. | ||
| 10 | +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") | ||
| 11 | + | ||
| 12 | +# === Flutter Library === | ||
| 13 | +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") | ||
| 14 | + | ||
| 15 | +# Published to parent scope for install step. | ||
| 16 | +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) | ||
| 17 | +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) | ||
| 18 | +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) | ||
| 19 | +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) | ||
| 20 | + | ||
| 21 | +list(APPEND FLUTTER_LIBRARY_HEADERS | ||
| 22 | + "flutter_export.h" | ||
| 23 | + "flutter_windows.h" | ||
| 24 | + "flutter_messenger.h" | ||
| 25 | + "flutter_plugin_registrar.h" | ||
| 26 | + "flutter_texture_registrar.h" | ||
| 27 | +) | ||
| 28 | +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") | ||
| 29 | +add_library(flutter INTERFACE) | ||
| 30 | +target_include_directories(flutter INTERFACE | ||
| 31 | + "${EPHEMERAL_DIR}" | ||
| 32 | +) | ||
| 33 | +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") | ||
| 34 | +add_dependencies(flutter flutter_assemble) | ||
| 35 | + | ||
| 36 | +# === Wrapper === | ||
| 37 | +list(APPEND CPP_WRAPPER_SOURCES_CORE | ||
| 38 | + "core_implementations.cc" | ||
| 39 | + "standard_codec.cc" | ||
| 40 | +) | ||
| 41 | +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") | ||
| 42 | +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN | ||
| 43 | + "plugin_registrar.cc" | ||
| 44 | +) | ||
| 45 | +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") | ||
| 46 | +list(APPEND CPP_WRAPPER_SOURCES_APP | ||
| 47 | + "flutter_engine.cc" | ||
| 48 | + "flutter_view_controller.cc" | ||
| 49 | +) | ||
| 50 | +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") | ||
| 51 | + | ||
| 52 | +# Wrapper sources needed for a plugin. | ||
| 53 | +add_library(flutter_wrapper_plugin STATIC | ||
| 54 | + ${CPP_WRAPPER_SOURCES_CORE} | ||
| 55 | + ${CPP_WRAPPER_SOURCES_PLUGIN} | ||
| 56 | +) | ||
| 57 | +apply_standard_settings(flutter_wrapper_plugin) | ||
| 58 | +set_target_properties(flutter_wrapper_plugin PROPERTIES | ||
| 59 | + POSITION_INDEPENDENT_CODE ON) | ||
| 60 | +set_target_properties(flutter_wrapper_plugin PROPERTIES | ||
| 61 | + CXX_VISIBILITY_PRESET hidden) | ||
| 62 | +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) | ||
| 63 | +target_include_directories(flutter_wrapper_plugin PUBLIC | ||
| 64 | + "${WRAPPER_ROOT}/include" | ||
| 65 | +) | ||
| 66 | +add_dependencies(flutter_wrapper_plugin flutter_assemble) | ||
| 67 | + | ||
| 68 | +# Wrapper sources needed for the runner. | ||
| 69 | +add_library(flutter_wrapper_app STATIC | ||
| 70 | + ${CPP_WRAPPER_SOURCES_CORE} | ||
| 71 | + ${CPP_WRAPPER_SOURCES_APP} | ||
| 72 | +) | ||
| 73 | +apply_standard_settings(flutter_wrapper_app) | ||
| 74 | +target_link_libraries(flutter_wrapper_app PUBLIC flutter) | ||
| 75 | +target_include_directories(flutter_wrapper_app PUBLIC | ||
| 76 | + "${WRAPPER_ROOT}/include" | ||
| 77 | +) | ||
| 78 | +add_dependencies(flutter_wrapper_app flutter_assemble) | ||
| 79 | + | ||
| 80 | +# === Flutter tool backend === | ||
| 81 | +# _phony_ is a non-existent file to force this command to run every time, | ||
| 82 | +# since currently there's no way to get a full input/output list from the | ||
| 83 | +# flutter tool. | ||
| 84 | +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") | ||
| 85 | +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) | ||
| 86 | +add_custom_command( | ||
| 87 | + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} | ||
| 88 | + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} | ||
| 89 | + ${CPP_WRAPPER_SOURCES_APP} | ||
| 90 | + ${PHONY_OUTPUT} | ||
| 91 | + COMMAND ${CMAKE_COMMAND} -E env | ||
| 92 | + ${FLUTTER_TOOL_ENVIRONMENT} | ||
| 93 | + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" | ||
| 94 | + windows-x64 $<CONFIG> | ||
| 95 | + VERBATIM | ||
| 96 | +) | ||
| 97 | +add_custom_target(flutter_assemble DEPENDS | ||
| 98 | + "${FLUTTER_LIBRARY}" | ||
| 99 | + ${FLUTTER_LIBRARY_HEADERS} | ||
| 100 | + ${CPP_WRAPPER_SOURCES_CORE} | ||
| 101 | + ${CPP_WRAPPER_SOURCES_PLUGIN} | ||
| 102 | + ${CPP_WRAPPER_SOURCES_APP} | ||
| 103 | +) |
| 1 | +// | ||
| 2 | +// Generated file. Do not edit. | ||
| 3 | +// | ||
| 4 | + | ||
| 5 | +#ifndef GENERATED_PLUGIN_REGISTRANT_ | ||
| 6 | +#define GENERATED_PLUGIN_REGISTRANT_ | ||
| 7 | + | ||
| 8 | +#include <flutter/plugin_registry.h> | ||
| 9 | + | ||
| 10 | +// Registers Flutter plugins. | ||
| 11 | +void RegisterPlugins(flutter::PluginRegistry* registry); | ||
| 12 | + | ||
| 13 | +#endif // GENERATED_PLUGIN_REGISTRANT_ |
| 1 | +# | ||
| 2 | +# Generated file, do not edit. | ||
| 3 | +# | ||
| 4 | + | ||
| 5 | +list(APPEND FLUTTER_PLUGIN_LIST | ||
| 6 | +) | ||
| 7 | + | ||
| 8 | +set(PLUGIN_BUNDLED_LIBRARIES) | ||
| 9 | + | ||
| 10 | +foreach(plugin ${FLUTTER_PLUGIN_LIST}) | ||
| 11 | + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) | ||
| 12 | + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) | ||
| 13 | + list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>) | ||
| 14 | + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) | ||
| 15 | +endforeach(plugin) |
example_nav2/windows/runner/CMakeLists.txt
0 → 100644
| 1 | +cmake_minimum_required(VERSION 3.15) | ||
| 2 | +project(runner LANGUAGES CXX) | ||
| 3 | + | ||
| 4 | +add_executable(${BINARY_NAME} WIN32 | ||
| 5 | + "flutter_window.cpp" | ||
| 6 | + "main.cpp" | ||
| 7 | + "run_loop.cpp" | ||
| 8 | + "utils.cpp" | ||
| 9 | + "win32_window.cpp" | ||
| 10 | + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" | ||
| 11 | + "Runner.rc" | ||
| 12 | + "runner.exe.manifest" | ||
| 13 | +) | ||
| 14 | +apply_standard_settings(${BINARY_NAME}) | ||
| 15 | +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") | ||
| 16 | +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) | ||
| 17 | +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") | ||
| 18 | +add_dependencies(${BINARY_NAME} flutter_assemble) |
example_nav2/windows/runner/Runner.rc
0 → 100644
| 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 | + | ||
| 58 | +///////////////////////////////////////////////////////////////////////////// | ||
| 59 | +// | ||
| 60 | +// Version | ||
| 61 | +// | ||
| 62 | + | ||
| 63 | +#ifdef FLUTTER_BUILD_NUMBER | ||
| 64 | +#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER | ||
| 65 | +#else | ||
| 66 | +#define VERSION_AS_NUMBER 1,0,0 | ||
| 67 | +#endif | ||
| 68 | + | ||
| 69 | +#ifdef FLUTTER_BUILD_NAME | ||
| 70 | +#define VERSION_AS_STRING #FLUTTER_BUILD_NAME | ||
| 71 | +#else | ||
| 72 | +#define VERSION_AS_STRING "1.0.0" | ||
| 73 | +#endif | ||
| 74 | + | ||
| 75 | +VS_VERSION_INFO VERSIONINFO | ||
| 76 | + FILEVERSION VERSION_AS_NUMBER | ||
| 77 | + PRODUCTVERSION VERSION_AS_NUMBER | ||
| 78 | + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK | ||
| 79 | +#ifdef _DEBUG | ||
| 80 | + FILEFLAGS VS_FF_DEBUG | ||
| 81 | +#else | ||
| 82 | + FILEFLAGS 0x0L | ||
| 83 | +#endif | ||
| 84 | + FILEOS VOS__WINDOWS32 | ||
| 85 | + FILETYPE VFT_APP | ||
| 86 | + FILESUBTYPE 0x0L | ||
| 87 | +BEGIN | ||
| 88 | + BLOCK "StringFileInfo" | ||
| 89 | + BEGIN | ||
| 90 | + BLOCK "040904e4" | ||
| 91 | + BEGIN | ||
| 92 | + VALUE "CompanyName", "com.get" "\0" | ||
| 93 | + VALUE "FileDescription", "A new Flutter project." "\0" | ||
| 94 | + VALUE "FileVersion", VERSION_AS_STRING "\0" | ||
| 95 | + VALUE "InternalName", "example_nav2" "\0" | ||
| 96 | + VALUE "LegalCopyright", "Copyright (C) 2021 com.get. All rights reserved." "\0" | ||
| 97 | + VALUE "OriginalFilename", "example_nav2.exe" "\0" | ||
| 98 | + VALUE "ProductName", "example_nav2" "\0" | ||
| 99 | + VALUE "ProductVersion", VERSION_AS_STRING "\0" | ||
| 100 | + END | ||
| 101 | + END | ||
| 102 | + BLOCK "VarFileInfo" | ||
| 103 | + BEGIN | ||
| 104 | + VALUE "Translation", 0x409, 1252 | ||
| 105 | + END | ||
| 106 | +END | ||
| 107 | + | ||
| 108 | +#endif // English (United States) resources | ||
| 109 | +///////////////////////////////////////////////////////////////////////////// | ||
| 110 | + | ||
| 111 | + | ||
| 112 | + | ||
| 113 | +#ifndef APSTUDIO_INVOKED | ||
| 114 | +///////////////////////////////////////////////////////////////////////////// | ||
| 115 | +// | ||
| 116 | +// Generated from the TEXTINCLUDE 3 resource. | ||
| 117 | +// | ||
| 118 | + | ||
| 119 | + | ||
| 120 | +///////////////////////////////////////////////////////////////////////////// | ||
| 121 | +#endif // not APSTUDIO_INVOKED |
| 1 | +#include "flutter_window.h" | ||
| 2 | + | ||
| 3 | +#include <optional> | ||
| 4 | + | ||
| 5 | +#include "flutter/generated_plugin_registrant.h" | ||
| 6 | + | ||
| 7 | +FlutterWindow::FlutterWindow(RunLoop* run_loop, | ||
| 8 | + const flutter::DartProject& project) | ||
| 9 | + : run_loop_(run_loop), project_(project) {} | ||
| 10 | + | ||
| 11 | +FlutterWindow::~FlutterWindow() {} | ||
| 12 | + | ||
| 13 | +bool FlutterWindow::OnCreate() { | ||
| 14 | + if (!Win32Window::OnCreate()) { | ||
| 15 | + return false; | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + RECT frame = GetClientArea(); | ||
| 19 | + | ||
| 20 | + // The size here must match the window dimensions to avoid unnecessary surface | ||
| 21 | + // creation / destruction in the startup path. | ||
| 22 | + flutter_controller_ = std::make_unique<flutter::FlutterViewController>( | ||
| 23 | + frame.right - frame.left, frame.bottom - frame.top, project_); | ||
| 24 | + // Ensure that basic setup of the controller was successful. | ||
| 25 | + if (!flutter_controller_->engine() || !flutter_controller_->view()) { | ||
| 26 | + return false; | ||
| 27 | + } | ||
| 28 | + RegisterPlugins(flutter_controller_->engine()); | ||
| 29 | + run_loop_->RegisterFlutterInstance(flutter_controller_->engine()); | ||
| 30 | + SetChildContent(flutter_controller_->view()->GetNativeWindow()); | ||
| 31 | + return true; | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +void FlutterWindow::OnDestroy() { | ||
| 35 | + if (flutter_controller_) { | ||
| 36 | + run_loop_->UnregisterFlutterInstance(flutter_controller_->engine()); | ||
| 37 | + flutter_controller_ = nullptr; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + Win32Window::OnDestroy(); | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +LRESULT | ||
| 44 | +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, | ||
| 45 | + WPARAM const wparam, | ||
| 46 | + LPARAM const lparam) noexcept { | ||
| 47 | + // Give Flutter, including plugins, an opportunity to handle window messages. | ||
| 48 | + if (flutter_controller_) { | ||
| 49 | + std::optional<LRESULT> result = | ||
| 50 | + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, | ||
| 51 | + lparam); | ||
| 52 | + if (result) { | ||
| 53 | + return *result; | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + switch (message) { | ||
| 58 | + case WM_FONTCHANGE: | ||
| 59 | + flutter_controller_->engine()->ReloadSystemFonts(); | ||
| 60 | + break; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); | ||
| 64 | +} |
example_nav2/windows/runner/flutter_window.h
0 → 100644
| 1 | +#ifndef RUNNER_FLUTTER_WINDOW_H_ | ||
| 2 | +#define RUNNER_FLUTTER_WINDOW_H_ | ||
| 3 | + | ||
| 4 | +#include <flutter/dart_project.h> | ||
| 5 | +#include <flutter/flutter_view_controller.h> | ||
| 6 | + | ||
| 7 | +#include <memory> | ||
| 8 | + | ||
| 9 | +#include "run_loop.h" | ||
| 10 | +#include "win32_window.h" | ||
| 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 | + bool OnCreate() override; | ||
| 24 | + void OnDestroy() override; | ||
| 25 | + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, | ||
| 26 | + LPARAM const lparam) noexcept override; | ||
| 27 | + | ||
| 28 | + private: | ||
| 29 | + // The run loop driving events for this window. | ||
| 30 | + RunLoop* run_loop_; | ||
| 31 | + | ||
| 32 | + // The project to run. | ||
| 33 | + flutter::DartProject project_; | ||
| 34 | + | ||
| 35 | + // The Flutter instance hosted by this window. | ||
| 36 | + std::unique_ptr<flutter::FlutterViewController> flutter_controller_; | ||
| 37 | +}; | ||
| 38 | + | ||
| 39 | +#endif // RUNNER_FLUTTER_WINDOW_H_ |
example_nav2/windows/runner/main.cpp
0 → 100644
| 1 | +#include <flutter/dart_project.h> | ||
| 2 | +#include <flutter/flutter_view_controller.h> | ||
| 3 | +#include <windows.h> | ||
| 4 | + | ||
| 5 | +#include "flutter_window.h" | ||
| 6 | +#include "run_loop.h" | ||
| 7 | +#include "utils.h" | ||
| 8 | + | ||
| 9 | +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, | ||
| 10 | + _In_ wchar_t *command_line, _In_ int show_command) { | ||
| 11 | + // Attach to console when present (e.g., 'flutter run') or create a | ||
| 12 | + // new console when running with a debugger. | ||
| 13 | + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { | ||
| 14 | + CreateAndAttachConsole(); | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + // Initialize COM, so that it is available for use in the library and/or | ||
| 18 | + // plugins. | ||
| 19 | + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); | ||
| 20 | + | ||
| 21 | + RunLoop run_loop; | ||
| 22 | + | ||
| 23 | + flutter::DartProject project(L"data"); | ||
| 24 | + | ||
| 25 | + std::vector<std::string> command_line_arguments = | ||
| 26 | + GetCommandLineArguments(); | ||
| 27 | + | ||
| 28 | + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); | ||
| 29 | + | ||
| 30 | + FlutterWindow window(&run_loop, project); | ||
| 31 | + Win32Window::Point origin(10, 10); | ||
| 32 | + Win32Window::Size size(1280, 720); | ||
| 33 | + if (!window.CreateAndShow(L"example_nav2", origin, size)) { | ||
| 34 | + return EXIT_FAILURE; | ||
| 35 | + } | ||
| 36 | + window.SetQuitOnClose(true); | ||
| 37 | + | ||
| 38 | + run_loop.Run(); | ||
| 39 | + | ||
| 40 | + ::CoUninitialize(); | ||
| 41 | + return EXIT_SUCCESS; | ||
| 42 | +} |
example_nav2/windows/runner/resource.h
0 → 100644
| 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 |
No preview for this file type
example_nav2/windows/runner/run_loop.cpp
0 → 100644
| 1 | +#include "run_loop.h" | ||
| 2 | + | ||
| 3 | +#include <windows.h> | ||
| 4 | + | ||
| 5 | +#include <algorithm> | ||
| 6 | + | ||
| 7 | +RunLoop::RunLoop() {} | ||
| 8 | + | ||
| 9 | +RunLoop::~RunLoop() {} | ||
| 10 | + | ||
| 11 | +void RunLoop::Run() { | ||
| 12 | + bool keep_running = true; | ||
| 13 | + TimePoint next_flutter_event_time = TimePoint::clock::now(); | ||
| 14 | + while (keep_running) { | ||
| 15 | + std::chrono::nanoseconds wait_duration = | ||
| 16 | + std::max(std::chrono::nanoseconds(0), | ||
| 17 | + next_flutter_event_time - TimePoint::clock::now()); | ||
| 18 | + ::MsgWaitForMultipleObjects( | ||
| 19 | + 0, nullptr, FALSE, static_cast<DWORD>(wait_duration.count() / 1000), | ||
| 20 | + QS_ALLINPUT); | ||
| 21 | + bool processed_events = false; | ||
| 22 | + MSG message; | ||
| 23 | + // All pending Windows messages must be processed; MsgWaitForMultipleObjects | ||
| 24 | + // won't return again for items left in the queue after PeekMessage. | ||
| 25 | + while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { | ||
| 26 | + processed_events = true; | ||
| 27 | + if (message.message == WM_QUIT) { | ||
| 28 | + keep_running = false; | ||
| 29 | + break; | ||
| 30 | + } | ||
| 31 | + ::TranslateMessage(&message); | ||
| 32 | + ::DispatchMessage(&message); | ||
| 33 | + // Allow Flutter to process messages each time a Windows message is | ||
| 34 | + // processed, to prevent starvation. | ||
| 35 | + next_flutter_event_time = | ||
| 36 | + std::min(next_flutter_event_time, ProcessFlutterMessages()); | ||
| 37 | + } | ||
| 38 | + // If the PeekMessage loop didn't run, process Flutter messages. | ||
| 39 | + if (!processed_events) { | ||
| 40 | + next_flutter_event_time = | ||
| 41 | + std::min(next_flutter_event_time, ProcessFlutterMessages()); | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +void RunLoop::RegisterFlutterInstance( | ||
| 47 | + flutter::FlutterEngine* flutter_instance) { | ||
| 48 | + flutter_instances_.insert(flutter_instance); | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +void RunLoop::UnregisterFlutterInstance( | ||
| 52 | + flutter::FlutterEngine* flutter_instance) { | ||
| 53 | + flutter_instances_.erase(flutter_instance); | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { | ||
| 57 | + TimePoint next_event_time = TimePoint::max(); | ||
| 58 | + for (auto instance : flutter_instances_) { | ||
| 59 | + std::chrono::nanoseconds wait_duration = instance->ProcessMessages(); | ||
| 60 | + if (wait_duration != std::chrono::nanoseconds::max()) { | ||
| 61 | + next_event_time = | ||
| 62 | + std::min(next_event_time, TimePoint::clock::now() + wait_duration); | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + return next_event_time; | ||
| 66 | +} |
example_nav2/windows/runner/run_loop.h
0 → 100644
| 1 | +#ifndef RUNNER_RUN_LOOP_H_ | ||
| 2 | +#define RUNNER_RUN_LOOP_H_ | ||
| 3 | + | ||
| 4 | +#include <flutter/flutter_engine.h> | ||
| 5 | + | ||
| 6 | +#include <chrono> | ||
| 7 | +#include <set> | ||
| 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::FlutterEngine* flutter_instance); | ||
| 26 | + | ||
| 27 | + // Unregisters the given Flutter instance from event servicing. | ||
| 28 | + void UnregisterFlutterInstance( | ||
| 29 | + flutter::FlutterEngine* 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::FlutterEngine*> flutter_instances_; | ||
| 38 | +}; | ||
| 39 | + | ||
| 40 | +#endif // RUNNER_RUN_LOOP_H_ |
| 1 | +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
| 2 | +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | ||
| 3 | + <application xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
| 4 | + <windowsSettings> | ||
| 5 | + <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> | ||
| 6 | + </windowsSettings> | ||
| 7 | + </application> | ||
| 8 | + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
| 9 | + <application> | ||
| 10 | + <!-- Windows 10 --> | ||
| 11 | + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> | ||
| 12 | + <!-- Windows 8.1 --> | ||
| 13 | + <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> | ||
| 14 | + <!-- Windows 8 --> | ||
| 15 | + <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> | ||
| 16 | + <!-- Windows 7 --> | ||
| 17 | + <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> | ||
| 18 | + </application> | ||
| 19 | + </compatibility> | ||
| 20 | +</assembly> |
example_nav2/windows/runner/utils.cpp
0 → 100644
| 1 | +#include "utils.h" | ||
| 2 | + | ||
| 3 | +#include <flutter_windows.h> | ||
| 4 | +#include <io.h> | ||
| 5 | +#include <stdio.h> | ||
| 6 | +#include <windows.h> | ||
| 7 | + | ||
| 8 | +#include <iostream> | ||
| 9 | + | ||
| 10 | +void CreateAndAttachConsole() { | ||
| 11 | + if (::AllocConsole()) { | ||
| 12 | + FILE *unused; | ||
| 13 | + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { | ||
| 14 | + _dup2(_fileno(stdout), 1); | ||
| 15 | + } | ||
| 16 | + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { | ||
| 17 | + _dup2(_fileno(stdout), 2); | ||
| 18 | + } | ||
| 19 | + std::ios::sync_with_stdio(); | ||
| 20 | + FlutterDesktopResyncOutputStreams(); | ||
| 21 | + } | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +std::vector<std::string> GetCommandLineArguments() { | ||
| 25 | + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. | ||
| 26 | + int argc; | ||
| 27 | + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); | ||
| 28 | + if (argv == nullptr) { | ||
| 29 | + return std::vector<std::string>(); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + std::vector<std::string> command_line_arguments; | ||
| 33 | + | ||
| 34 | + // Skip the first argument as it's the binary name. | ||
| 35 | + for (int i = 1; i < argc; i++) { | ||
| 36 | + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + ::LocalFree(argv); | ||
| 40 | + | ||
| 41 | + return command_line_arguments; | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +std::string Utf8FromUtf16(const wchar_t* utf16_string) { | ||
| 45 | + if (utf16_string == nullptr) { | ||
| 46 | + return std::string(); | ||
| 47 | + } | ||
| 48 | + int target_length = ::WideCharToMultiByte( | ||
| 49 | + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, | ||
| 50 | + -1, nullptr, 0, nullptr, nullptr); | ||
| 51 | + if (target_length == 0) { | ||
| 52 | + return std::string(); | ||
| 53 | + } | ||
| 54 | + std::string utf8_string; | ||
| 55 | + utf8_string.resize(target_length); | ||
| 56 | + int converted_length = ::WideCharToMultiByte( | ||
| 57 | + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, | ||
| 58 | + -1, utf8_string.data(), | ||
| 59 | + target_length, nullptr, nullptr); | ||
| 60 | + if (converted_length == 0) { | ||
| 61 | + return std::string(); | ||
| 62 | + } | ||
| 63 | + return utf8_string; | ||
| 64 | +} |
example_nav2/windows/runner/utils.h
0 → 100644
| 1 | +#ifndef RUNNER_UTILS_H_ | ||
| 2 | +#define RUNNER_UTILS_H_ | ||
| 3 | + | ||
| 4 | +#include <string> | ||
| 5 | +#include <vector> | ||
| 6 | + | ||
| 7 | +// Creates a console for the process, and redirects stdout and stderr to | ||
| 8 | +// it for both the runner and the Flutter library. | ||
| 9 | +void CreateAndAttachConsole(); | ||
| 10 | + | ||
| 11 | +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string | ||
| 12 | +// encoded in UTF-8. Returns an empty std::string on failure. | ||
| 13 | +std::string Utf8FromUtf16(const wchar_t* utf16_string); | ||
| 14 | + | ||
| 15 | +// Gets the command line arguments passed in as a std::vector<std::string>, | ||
| 16 | +// encoded in UTF-8. Returns an empty std::vector<std::string> on failure. | ||
| 17 | +std::vector<std::string> GetCommandLineArguments(); | ||
| 18 | + | ||
| 19 | +#endif // RUNNER_UTILS_H_ |
example_nav2/windows/runner/win32_window.cpp
0 → 100644
| 1 | +#include "win32_window.h" | ||
| 2 | + | ||
| 3 | +#include <flutter_windows.h> | ||
| 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<int>(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<EnableNonClientDpiScaling*>( | ||
| 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<LONG>(origin.x), | ||
| 114 | + static_cast<LONG>(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 | + if (!window) { | ||
| 126 | + return false; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + return OnCreate(); | ||
| 130 | +} | ||
| 131 | + | ||
| 132 | +// static | ||
| 133 | +LRESULT CALLBACK Win32Window::WndProc(HWND const window, | ||
| 134 | + UINT const message, | ||
| 135 | + WPARAM const wparam, | ||
| 136 | + LPARAM const lparam) noexcept { | ||
| 137 | + if (message == WM_NCCREATE) { | ||
| 138 | + auto window_struct = reinterpret_cast<CREATESTRUCT*>(lparam); | ||
| 139 | + SetWindowLongPtr(window, GWLP_USERDATA, | ||
| 140 | + reinterpret_cast<LONG_PTR>(window_struct->lpCreateParams)); | ||
| 141 | + | ||
| 142 | + auto that = static_cast<Win32Window*>(window_struct->lpCreateParams); | ||
| 143 | + EnableFullDpiSupportIfAvailable(window); | ||
| 144 | + that->window_handle_ = window; | ||
| 145 | + } else if (Win32Window* that = GetThisFromHandle(window)) { | ||
| 146 | + return that->MessageHandler(window, message, wparam, lparam); | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + return DefWindowProc(window, message, wparam, lparam); | ||
| 150 | +} | ||
| 151 | + | ||
| 152 | +LRESULT | ||
| 153 | +Win32Window::MessageHandler(HWND hwnd, | ||
| 154 | + UINT const message, | ||
| 155 | + WPARAM const wparam, | ||
| 156 | + LPARAM const lparam) noexcept { | ||
| 157 | + switch (message) { | ||
| 158 | + case WM_DESTROY: | ||
| 159 | + window_handle_ = nullptr; | ||
| 160 | + Destroy(); | ||
| 161 | + if (quit_on_close_) { | ||
| 162 | + PostQuitMessage(0); | ||
| 163 | + } | ||
| 164 | + return 0; | ||
| 165 | + | ||
| 166 | + case WM_DPICHANGED: { | ||
| 167 | + auto newRectSize = reinterpret_cast<RECT*>(lparam); | ||
| 168 | + LONG newWidth = newRectSize->right - newRectSize->left; | ||
| 169 | + LONG newHeight = newRectSize->bottom - newRectSize->top; | ||
| 170 | + | ||
| 171 | + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, | ||
| 172 | + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); | ||
| 173 | + | ||
| 174 | + return 0; | ||
| 175 | + } | ||
| 176 | + case WM_SIZE: { | ||
| 177 | + RECT rect = GetClientArea(); | ||
| 178 | + if (child_content_ != nullptr) { | ||
| 179 | + // Size and position the child window. | ||
| 180 | + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, | ||
| 181 | + rect.bottom - rect.top, TRUE); | ||
| 182 | + } | ||
| 183 | + return 0; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + case WM_ACTIVATE: | ||
| 187 | + if (child_content_ != nullptr) { | ||
| 188 | + SetFocus(child_content_); | ||
| 189 | + } | ||
| 190 | + return 0; | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + return DefWindowProc(window_handle_, message, wparam, lparam); | ||
| 194 | +} | ||
| 195 | + | ||
| 196 | +void Win32Window::Destroy() { | ||
| 197 | + OnDestroy(); | ||
| 198 | + | ||
| 199 | + if (window_handle_) { | ||
| 200 | + DestroyWindow(window_handle_); | ||
| 201 | + window_handle_ = nullptr; | ||
| 202 | + } | ||
| 203 | + if (g_active_window_count == 0) { | ||
| 204 | + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); | ||
| 205 | + } | ||
| 206 | +} | ||
| 207 | + | ||
| 208 | +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { | ||
| 209 | + return reinterpret_cast<Win32Window*>( | ||
| 210 | + GetWindowLongPtr(window, GWLP_USERDATA)); | ||
| 211 | +} | ||
| 212 | + | ||
| 213 | +void Win32Window::SetChildContent(HWND content) { | ||
| 214 | + child_content_ = content; | ||
| 215 | + SetParent(content, window_handle_); | ||
| 216 | + RECT frame = GetClientArea(); | ||
| 217 | + | ||
| 218 | + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, | ||
| 219 | + frame.bottom - frame.top, true); | ||
| 220 | + | ||
| 221 | + SetFocus(child_content_); | ||
| 222 | +} | ||
| 223 | + | ||
| 224 | +RECT Win32Window::GetClientArea() { | ||
| 225 | + RECT frame; | ||
| 226 | + GetClientRect(window_handle_, &frame); | ||
| 227 | + return frame; | ||
| 228 | +} | ||
| 229 | + | ||
| 230 | +HWND Win32Window::GetHandle() { | ||
| 231 | + return window_handle_; | ||
| 232 | +} | ||
| 233 | + | ||
| 234 | +void Win32Window::SetQuitOnClose(bool quit_on_close) { | ||
| 235 | + quit_on_close_ = quit_on_close; | ||
| 236 | +} | ||
| 237 | + | ||
| 238 | +bool Win32Window::OnCreate() { | ||
| 239 | + // No-op; provided for subclasses. | ||
| 240 | + return true; | ||
| 241 | +} | ||
| 242 | + | ||
| 243 | +void Win32Window::OnDestroy() { | ||
| 244 | + // No-op; provided for subclasses. | ||
| 245 | +} |
example_nav2/windows/runner/win32_window.h
0 → 100644
| 1 | +#ifndef RUNNER_WIN32_WINDOW_H_ | ||
| 2 | +#define RUNNER_WIN32_WINDOW_H_ | ||
| 3 | + | ||
| 4 | +#include <windows.h> | ||
| 5 | + | ||
| 6 | +#include <functional> | ||
| 7 | +#include <memory> | ||
| 8 | +#include <string> | ||
| 9 | + | ||
| 10 | +// A class abstraction for a high DPI-aware Win32 Window. Intended to be | ||
| 11 | +// inherited from by classes that wish to specialize with custom | ||
| 12 | +// rendering and input handling | ||
| 13 | +class Win32Window { | ||
| 14 | + public: | ||
| 15 | + struct Point { | ||
| 16 | + unsigned int x; | ||
| 17 | + unsigned int y; | ||
| 18 | + Point(unsigned int x, unsigned int y) : x(x), y(y) {} | ||
| 19 | + }; | ||
| 20 | + | ||
| 21 | + struct Size { | ||
| 22 | + unsigned int width; | ||
| 23 | + unsigned int height; | ||
| 24 | + Size(unsigned int width, unsigned int height) | ||
| 25 | + : width(width), height(height) {} | ||
| 26 | + }; | ||
| 27 | + | ||
| 28 | + Win32Window(); | ||
| 29 | + virtual ~Win32Window(); | ||
| 30 | + | ||
| 31 | + // Creates and shows a win32 window with |title| and position and size using | ||
| 32 | + // |origin| and |size|. New windows are created on the default monitor. Window | ||
| 33 | + // sizes are specified to the OS in physical pixels, hence to ensure a | ||
| 34 | + // consistent size to will treat the width height passed in to this function | ||
| 35 | + // as logical pixels and scale to appropriate for the default monitor. Returns | ||
| 36 | + // true if the window was created successfully. | ||
| 37 | + bool CreateAndShow(const std::wstring& title, | ||
| 38 | + const Point& origin, | ||
| 39 | + const Size& size); | ||
| 40 | + | ||
| 41 | + // Release OS resources associated with window. | ||
| 42 | + void Destroy(); | ||
| 43 | + | ||
| 44 | + // Inserts |content| into the window tree. | ||
| 45 | + void SetChildContent(HWND content); | ||
| 46 | + | ||
| 47 | + // Returns the backing Window handle to enable clients to set icon and other | ||
| 48 | + // window properties. Returns nullptr if the window has been destroyed. | ||
| 49 | + HWND GetHandle(); | ||
| 50 | + | ||
| 51 | + // If true, closing this window will quit the application. | ||
| 52 | + void SetQuitOnClose(bool quit_on_close); | ||
| 53 | + | ||
| 54 | + // Return a RECT representing the bounds of the current client area. | ||
| 55 | + RECT GetClientArea(); | ||
| 56 | + | ||
| 57 | + protected: | ||
| 58 | + // Processes and route salient window messages for mouse handling, | ||
| 59 | + // size change and DPI. Delegates handling of these to member overloads that | ||
| 60 | + // inheriting classes can handle. | ||
| 61 | + virtual LRESULT MessageHandler(HWND window, | ||
| 62 | + UINT const message, | ||
| 63 | + WPARAM const wparam, | ||
| 64 | + LPARAM const lparam) noexcept; | ||
| 65 | + | ||
| 66 | + // Called when CreateAndShow is called, allowing subclass window-related | ||
| 67 | + // setup. Subclasses should return false if setup fails. | ||
| 68 | + virtual bool OnCreate(); | ||
| 69 | + | ||
| 70 | + // Called when Destroy is called. | ||
| 71 | + virtual void OnDestroy(); | ||
| 72 | + | ||
| 73 | + private: | ||
| 74 | + friend class WindowClassRegistrar; | ||
| 75 | + | ||
| 76 | + // OS callback called by message pump. Handles the WM_NCCREATE message which | ||
| 77 | + // is passed when the non-client area is being created and enables automatic | ||
| 78 | + // non-client DPI scaling so that the non-client area automatically | ||
| 79 | + // responsponds to changes in DPI. All other messages are handled by | ||
| 80 | + // MessageHandler. | ||
| 81 | + static LRESULT CALLBACK WndProc(HWND const window, | ||
| 82 | + UINT const message, | ||
| 83 | + WPARAM const wparam, | ||
| 84 | + LPARAM const lparam) noexcept; | ||
| 85 | + | ||
| 86 | + // Retrieves a class instance pointer for |window| | ||
| 87 | + static Win32Window* GetThisFromHandle(HWND const window) noexcept; | ||
| 88 | + | ||
| 89 | + bool quit_on_close_ = false; | ||
| 90 | + | ||
| 91 | + // window handle for top level window. | ||
| 92 | + HWND window_handle_ = nullptr; | ||
| 93 | + | ||
| 94 | + // window handle for hosted content. | ||
| 95 | + HWND child_content_ = nullptr; | ||
| 96 | +}; | ||
| 97 | + | ||
| 98 | +#endif // RUNNER_WIN32_WINDOW_H_ |
| @@ -10,3 +10,4 @@ export 'get_navigation/get_navigation.dart'; | @@ -10,3 +10,4 @@ export 'get_navigation/get_navigation.dart'; | ||
| 10 | export 'get_rx/get_rx.dart'; | 10 | export 'get_rx/get_rx.dart'; |
| 11 | export 'get_state_manager/get_state_manager.dart'; | 11 | export 'get_state_manager/get_state_manager.dart'; |
| 12 | export 'get_utils/get_utils.dart'; | 12 | export 'get_utils/get_utils.dart'; |
| 13 | +export 'route_manager.dart'; |
| 1 | +import 'package:flutter/widgets.dart'; | ||
| 2 | +import 'package:get/get_navigation/src/nav2/get_router_delegate.dart'; | ||
| 3 | + | ||
| 1 | import 'log.dart'; | 4 | import 'log.dart'; |
| 2 | import 'smart_management.dart'; | 5 | import 'smart_management.dart'; |
| 3 | 6 | ||
| @@ -5,6 +8,7 @@ import 'smart_management.dart'; | @@ -5,6 +8,7 @@ import 'smart_management.dart'; | ||
| 5 | /// class through extensions | 8 | /// class through extensions |
| 6 | abstract class GetInterface { | 9 | abstract class GetInterface { |
| 7 | SmartManagement smartManagement = SmartManagement.full; | 10 | SmartManagement smartManagement = SmartManagement.full; |
| 11 | + RouterDelegate? routerDelegate; | ||
| 8 | String? reference; | 12 | String? reference; |
| 9 | bool isLogEnable = true; | 13 | bool isLogEnable = true; |
| 10 | LogWriterCallback log = defaultLogWriterCallback; | 14 | LogWriterCallback log = defaultLogWriterCallback; |
| @@ -2,6 +2,7 @@ library get_navigation; | @@ -2,6 +2,7 @@ library get_navigation; | ||
| 2 | 2 | ||
| 3 | export 'src/bottomsheet/bottomsheet.dart'; | 3 | export 'src/bottomsheet/bottomsheet.dart'; |
| 4 | export 'src/extension_navigation.dart'; | 4 | export 'src/extension_navigation.dart'; |
| 5 | +export 'src/nav2/get_information_parser.dart'; | ||
| 5 | export 'src/root/get_cupertino_app.dart'; | 6 | export 'src/root/get_cupertino_app.dart'; |
| 6 | export 'src/root/get_material_app.dart'; | 7 | export 'src/root/get_material_app.dart'; |
| 7 | export 'src/root/internacionalization.dart'; | 8 | export 'src/root/internacionalization.dart'; |
| 1 | +import 'package:flutter/foundation.dart'; | ||
| 2 | +import 'package:flutter/widgets.dart'; | ||
| 3 | +import '../../../get.dart'; | ||
| 4 | + | ||
| 5 | +class GetInformationParser extends RouteInformationParser<GetPage> { | ||
| 6 | + @override | ||
| 7 | + SynchronousFuture<GetPage> parseRouteInformation( | ||
| 8 | + RouteInformation routeInformation, | ||
| 9 | + ) { | ||
| 10 | + if (routeInformation.location == '/') { | ||
| 11 | + return SynchronousFuture(Get.routeTree.routes.first); | ||
| 12 | + } | ||
| 13 | + print('route location: ${routeInformation.location}'); | ||
| 14 | + final page = Get.routeTree.matchRoute(routeInformation.location!); | ||
| 15 | + print(page.parameters); | ||
| 16 | + final val = page.route!.copy( | ||
| 17 | + name: routeInformation.location, | ||
| 18 | + parameter: Map.from(page.parameters), | ||
| 19 | + ); | ||
| 20 | + return SynchronousFuture(val); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + @override | ||
| 24 | + RouteInformation restoreRouteInformation(GetPage uri) { | ||
| 25 | + print('restore $uri'); | ||
| 26 | + | ||
| 27 | + return RouteInformation(location: uri.name); | ||
| 28 | + } | ||
| 29 | +} |
| 1 | +import 'dart:async'; | ||
| 2 | + | ||
| 3 | +import 'package:flutter/material.dart'; | ||
| 4 | +import '../../../get.dart'; | ||
| 5 | +import '../../../get_state_manager/src/simple/list_notifier.dart'; | ||
| 6 | + | ||
| 7 | +class GetDelegate extends RouterDelegate<GetPage> | ||
| 8 | + with ListenableMixin, ListNotifierMixin { | ||
| 9 | + final List<GetPage> routes = <GetPage>[]; | ||
| 10 | + | ||
| 11 | + final GetPage? notFoundRoute; | ||
| 12 | + | ||
| 13 | + final List<NavigatorObserver>? dipNavObservers; | ||
| 14 | + final TransitionDelegate<dynamic>? transitionDelegate; | ||
| 15 | + | ||
| 16 | + GlobalKey<NavigatorState> get navigatorKey => | ||
| 17 | + GetNavigation.getxController.key; | ||
| 18 | + | ||
| 19 | + GetDelegate( | ||
| 20 | + {this.notFoundRoute, this.dipNavObservers, this.transitionDelegate}); | ||
| 21 | + | ||
| 22 | + /// Called by the [Router] at startup with the structure that the | ||
| 23 | + /// [RouteInformationParser] obtained from parsing the initial route. | ||
| 24 | + @override | ||
| 25 | + Widget build(BuildContext context) { | ||
| 26 | + return Navigator( | ||
| 27 | + key: navigatorKey, | ||
| 28 | + onPopPage: _onPopPage, | ||
| 29 | + pages: routes.toList(), | ||
| 30 | + observers: [GetObserver()], | ||
| 31 | + transitionDelegate: | ||
| 32 | + transitionDelegate ?? const DefaultTransitionDelegate<dynamic>(), | ||
| 33 | + ); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + final _resultCompleter = <Completer<Object>>[]; | ||
| 37 | + | ||
| 38 | + @override | ||
| 39 | + Future<void> setInitialRoutePath(GetPage configuration) async { | ||
| 40 | + await pushRoute(configuration); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + @override | ||
| 44 | + Future<void> setNewRoutePath(GetPage configuration) { | ||
| 45 | + routes.clear(); | ||
| 46 | + return pushRoute(configuration); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + /// Called by the [Router] when it detects a route information may have | ||
| 50 | + /// changed as a result of rebuild. | ||
| 51 | + @override | ||
| 52 | + GetPage get currentConfiguration { | ||
| 53 | + final route = routes.last; | ||
| 54 | + return route; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + Future<T?> toNamed<T>(String route) { | ||
| 58 | + final page = Get.routeTree.matchRoute(route); | ||
| 59 | + if (page.route != null) { | ||
| 60 | + return pushRoute(page.route!.copy(name: route)); | ||
| 61 | + } else { | ||
| 62 | + return pushRoute(_notFound()); | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + Future<T?> offUntil<T>(String route) { | ||
| 67 | + final page = Get.routeTree.matchRoute(route); | ||
| 68 | + if (page.route != null) { | ||
| 69 | + return pushRoute(page.route!.copy(name: route), removeUntil: true); | ||
| 70 | + } else { | ||
| 71 | + return pushRoute(_notFound()); | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + GetPage _notFound() { | ||
| 76 | + return notFoundRoute ?? | ||
| 77 | + GetPage( | ||
| 78 | + name: '/404', | ||
| 79 | + page: () => Scaffold( | ||
| 80 | + body: Text('not found'), | ||
| 81 | + ), | ||
| 82 | + ); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + Future<T?> pushRoute<T extends Object>( | ||
| 86 | + GetPage route, { | ||
| 87 | + bool removeUntil = false, | ||
| 88 | + bool replaceCurrent = false, | ||
| 89 | + bool rebuildStack = true, | ||
| 90 | + }) { | ||
| 91 | + final completer = Completer<T>(); | ||
| 92 | + _resultCompleter.add(completer); | ||
| 93 | + | ||
| 94 | + route = route.copy(unknownRoute: _notFound()); | ||
| 95 | + assert(!(removeUntil && replaceCurrent), | ||
| 96 | + 'Only removeUntil or replaceCurrent should by true!'); | ||
| 97 | + if (removeUntil) { | ||
| 98 | + routes.clear(); | ||
| 99 | + } else if (replaceCurrent && routes.isNotEmpty) { | ||
| 100 | + routes.removeLast(); | ||
| 101 | + } | ||
| 102 | + addPage(route); | ||
| 103 | + if (rebuildStack) { | ||
| 104 | + refresh(); | ||
| 105 | + } | ||
| 106 | + //emulate the old push with result | ||
| 107 | + return completer.future; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + Future<bool> handlePopupRoutes({ | ||
| 111 | + Object? result, | ||
| 112 | + }) async { | ||
| 113 | + Route? currentRoute; | ||
| 114 | + navigatorKey.currentState!.popUntil((route) { | ||
| 115 | + currentRoute = route; | ||
| 116 | + return true; | ||
| 117 | + }); | ||
| 118 | + if (currentRoute is PopupRoute) { | ||
| 119 | + return await navigatorKey.currentState!.maybePop(result); | ||
| 120 | + } | ||
| 121 | + return false; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + @override | ||
| 125 | + Future<bool> popRoute({ | ||
| 126 | + Object? result, | ||
| 127 | + }) async { | ||
| 128 | + final wasPopup = await handlePopupRoutes(result: result); | ||
| 129 | + if (wasPopup) return true; | ||
| 130 | + | ||
| 131 | + if (canPop()) { | ||
| 132 | + //emulate the old pop with result | ||
| 133 | + final lastCompleter = _resultCompleter.removeLast(); | ||
| 134 | + lastCompleter.complete(result); | ||
| 135 | + //route to be removed | ||
| 136 | + removePage(routes.last); | ||
| 137 | + return Future.value(true); | ||
| 138 | + } | ||
| 139 | + return Future.value(false); | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + bool canPop() { | ||
| 143 | + return routes.isNotEmpty; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + bool _onPopPage(Route<dynamic> route, dynamic result) { | ||
| 147 | + final didPop = route.didPop(result); | ||
| 148 | + if (!didPop) { | ||
| 149 | + return false; | ||
| 150 | + } | ||
| 151 | + routes.remove(route.settings); | ||
| 152 | + refresh(); | ||
| 153 | + return true; | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + void removePage(GetPage page) { | ||
| 157 | + routes.remove(page); | ||
| 158 | + | ||
| 159 | + refresh(); | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + void addPage(GetPage route) { | ||
| 163 | + routes.add( | ||
| 164 | + route, | ||
| 165 | + ); | ||
| 166 | + refresh(); | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + void addRoutes(List<GetPage> pages) { | ||
| 170 | + routes.addAll(pages); | ||
| 171 | + refresh(); | ||
| 172 | + } | ||
| 173 | +} |
| @@ -214,6 +214,7 @@ class GetMaterialApp extends StatelessWidget { | @@ -214,6 +214,7 @@ class GetMaterialApp extends StatelessWidget { | ||
| 214 | 214 | ||
| 215 | initialBinding?.dependencies(); | 215 | initialBinding?.dependencies(); |
| 216 | Get.addPages(getPages); | 216 | Get.addPages(getPages); |
| 217 | + Get.routerDelegate = routerDelegate; | ||
| 217 | Get.smartManagement = smartManagement; | 218 | Get.smartManagement = smartManagement; |
| 218 | onInit?.call(); | 219 | onInit?.call(); |
| 219 | 220 | ||
| @@ -314,205 +315,3 @@ class GetMaterialApp extends StatelessWidget { | @@ -314,205 +315,3 @@ class GetMaterialApp extends StatelessWidget { | ||
| 314 | // actions: actions, | 315 | // actions: actions, |
| 315 | )); | 316 | )); |
| 316 | } | 317 | } |
| 317 | - | ||
| 318 | -class GetInformationParser extends RouteInformationParser<GetPage> { | ||
| 319 | - @override | ||
| 320 | - SynchronousFuture<GetPage> parseRouteInformation( | ||
| 321 | - RouteInformation routeInformation) { | ||
| 322 | - if (routeInformation.location == '/') { | ||
| 323 | - return SynchronousFuture(Get.routeTree.routes.first); | ||
| 324 | - } | ||
| 325 | - print('route location: ${routeInformation.location}'); | ||
| 326 | - final page = Get.routeTree.matchRoute(routeInformation.location!); | ||
| 327 | - print(page.parameters); | ||
| 328 | - final val = page.route!.copy( | ||
| 329 | - name: routeInformation.location, | ||
| 330 | - parameter: Map.from(page.parameters), | ||
| 331 | - ); | ||
| 332 | - return SynchronousFuture(val); | ||
| 333 | - } | ||
| 334 | - | ||
| 335 | - @override | ||
| 336 | - RouteInformation restoreRouteInformation(GetPage uri) { | ||
| 337 | - print('restore $uri'); | ||
| 338 | - | ||
| 339 | - return RouteInformation(location: uri.name); | ||
| 340 | - } | ||
| 341 | -} | ||
| 342 | - | ||
| 343 | -class GetNav { | ||
| 344 | - GetNav({GetDelegate? routerDelegate, required this.pages}) | ||
| 345 | - : routerDelegate = routerDelegate ?? GetDelegate() { | ||
| 346 | - Get.registerRoutes(pages); | ||
| 347 | - Get.addKey(this.routerDelegate.navigatorKey); | ||
| 348 | - } | ||
| 349 | - | ||
| 350 | - Future<T?> toNamed<T>(String route) { | ||
| 351 | - return routerDelegate.toNamed(route); | ||
| 352 | - } | ||
| 353 | - | ||
| 354 | - Future<T?> pushRoute<T>( | ||
| 355 | - GetPage route, { | ||
| 356 | - bool removeUntil = false, | ||
| 357 | - bool replaceCurrent = false, | ||
| 358 | - bool rebuildStack = true, | ||
| 359 | - }) { | ||
| 360 | - return routerDelegate.pushRoute(route, | ||
| 361 | - removeUntil: removeUntil, | ||
| 362 | - replaceCurrent: replaceCurrent, | ||
| 363 | - rebuildStack: rebuildStack); | ||
| 364 | - } | ||
| 365 | - | ||
| 366 | - Future<bool> popRoute() { | ||
| 367 | - return routerDelegate.popRoute(); | ||
| 368 | - } | ||
| 369 | - | ||
| 370 | - Future<T?> offUntil<T>(String route) { | ||
| 371 | - return routerDelegate.offUntil(route); | ||
| 372 | - } | ||
| 373 | - | ||
| 374 | - final GetDelegate routerDelegate; | ||
| 375 | - final GetInformationParser routeInformationParser = GetInformationParser(); | ||
| 376 | - final List<GetPage> pages; | ||
| 377 | -} | ||
| 378 | - | ||
| 379 | -class GetDelegate extends RouterDelegate<GetPage> | ||
| 380 | - with | ||
| 381 | - // ignore: prefer_mixin | ||
| 382 | - ListNotifier, | ||
| 383 | - PopNavigatorRouterDelegateMixin<GetPage> { | ||
| 384 | - final List<GetPage> routes = <GetPage>[]; | ||
| 385 | - | ||
| 386 | - final GetPage? notFoundRoute; | ||
| 387 | - | ||
| 388 | - final List<NavigatorObserver>? dipNavObservers; | ||
| 389 | - final TransitionDelegate<dynamic>? transitionDelegate; | ||
| 390 | - | ||
| 391 | - GetDelegate( | ||
| 392 | - {this.notFoundRoute, this.dipNavObservers, this.transitionDelegate}); | ||
| 393 | - | ||
| 394 | - /// Called by the [Router] at startup with the structure that the | ||
| 395 | - /// [RouteInformationParser] obtained from parsing the initial route. | ||
| 396 | - @override | ||
| 397 | - Widget build(BuildContext context) { | ||
| 398 | - return Navigator( | ||
| 399 | - key: navigatorKey, | ||
| 400 | - onPopPage: _onPopPage, | ||
| 401 | - pages: routes.toList(), | ||
| 402 | - observers: [GetObserver()], | ||
| 403 | - transitionDelegate: | ||
| 404 | - transitionDelegate ?? const DefaultTransitionDelegate<dynamic>(), | ||
| 405 | - ); | ||
| 406 | - } | ||
| 407 | - | ||
| 408 | - @override | ||
| 409 | - final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); | ||
| 410 | - | ||
| 411 | - @override | ||
| 412 | - Future<void> setInitialRoutePath(GetPage configuration) async { | ||
| 413 | - return pushRoute(configuration); | ||
| 414 | - } | ||
| 415 | - | ||
| 416 | - @override | ||
| 417 | - Future<void> setNewRoutePath(GetPage configuration) { | ||
| 418 | - routes.clear(); | ||
| 419 | - return pushRoute(configuration); | ||
| 420 | - } | ||
| 421 | - | ||
| 422 | - /// Called by the [Router] when it detects a route information may have | ||
| 423 | - /// changed as a result of rebuild. | ||
| 424 | - @override | ||
| 425 | - GetPage get currentConfiguration { | ||
| 426 | - final route = routes.last; | ||
| 427 | - return route; | ||
| 428 | - } | ||
| 429 | - | ||
| 430 | - Future<T?> toNamed<T>(String route) { | ||
| 431 | - final page = Get.routeTree.matchRoute(route); | ||
| 432 | - if (page.route != null) { | ||
| 433 | - return pushRoute(page.route!.copy(name: route)); | ||
| 434 | - } else { | ||
| 435 | - return pushRoute(_notFound()); | ||
| 436 | - } | ||
| 437 | - } | ||
| 438 | - | ||
| 439 | - Future<T?> offUntil<T>(String route) { | ||
| 440 | - final page = Get.routeTree.matchRoute(route); | ||
| 441 | - if (page.route != null) { | ||
| 442 | - return pushRoute(page.route!.copy(name: route), removeUntil: true); | ||
| 443 | - } else { | ||
| 444 | - return pushRoute(_notFound()); | ||
| 445 | - } | ||
| 446 | - } | ||
| 447 | - | ||
| 448 | - GetPage _notFound() { | ||
| 449 | - return notFoundRoute ?? | ||
| 450 | - GetPage( | ||
| 451 | - name: '/404', | ||
| 452 | - page: () => Scaffold( | ||
| 453 | - body: Text('not found'), | ||
| 454 | - ), | ||
| 455 | - ); | ||
| 456 | - } | ||
| 457 | - | ||
| 458 | - Future<T?> pushRoute<T>( | ||
| 459 | - GetPage route, { | ||
| 460 | - bool removeUntil = false, | ||
| 461 | - bool replaceCurrent = false, | ||
| 462 | - bool rebuildStack = true, | ||
| 463 | - }) async { | ||
| 464 | - route = route.copy(unknownRoute: _notFound()); | ||
| 465 | - assert(!(removeUntil && replaceCurrent), | ||
| 466 | - 'Only removeUntil or replaceCurrent should by true!'); | ||
| 467 | - if (removeUntil) { | ||
| 468 | - routes.clear(); | ||
| 469 | - } else if (replaceCurrent && routes.isNotEmpty) { | ||
| 470 | - routes.removeLast(); | ||
| 471 | - } | ||
| 472 | - _addRoute(route); | ||
| 473 | - if (rebuildStack) { | ||
| 474 | - refresh(); | ||
| 475 | - } | ||
| 476 | - } | ||
| 477 | - | ||
| 478 | - @override | ||
| 479 | - Future<bool> popRoute() { | ||
| 480 | - if (routes.length > 1) { | ||
| 481 | - _removePage(routes.last); | ||
| 482 | - return Future.value(true); | ||
| 483 | - } | ||
| 484 | - return Future.value(false); | ||
| 485 | - } | ||
| 486 | - | ||
| 487 | - bool canPop() { | ||
| 488 | - return routes.isNotEmpty; | ||
| 489 | - } | ||
| 490 | - | ||
| 491 | - bool _onPopPage(Route<dynamic> route, dynamic result) { | ||
| 492 | - final didPop = route.didPop(result); | ||
| 493 | - if (!didPop) { | ||
| 494 | - return false; | ||
| 495 | - } | ||
| 496 | - routes.remove(route.settings); | ||
| 497 | - refresh(); | ||
| 498 | - return true; | ||
| 499 | - } | ||
| 500 | - | ||
| 501 | - void _removePage(GetPage page) { | ||
| 502 | - routes.remove(page); | ||
| 503 | - | ||
| 504 | - refresh(); | ||
| 505 | - } | ||
| 506 | - | ||
| 507 | - void _addRoute(GetPage route) { | ||
| 508 | - routes.add( | ||
| 509 | - route, | ||
| 510 | - ); | ||
| 511 | - refresh(); | ||
| 512 | - } | ||
| 513 | - | ||
| 514 | - void addRoutes(List<GetPage> pages) { | ||
| 515 | - routes.addAll(pages); | ||
| 516 | - refresh(); | ||
| 517 | - } | ||
| 518 | -} |
| @@ -24,9 +24,11 @@ class ParseRouteTree { | @@ -24,9 +24,11 @@ class ParseRouteTree { | ||
| 24 | if (parsedParams.isNotEmpty) { | 24 | if (parsedParams.isNotEmpty) { |
| 25 | params.addAll(parsedParams); | 25 | params.addAll(parsedParams); |
| 26 | } | 26 | } |
| 27 | - } else { | ||
| 28 | - Get.log('Route "${uri.path}" not found'); | ||
| 29 | } | 27 | } |
| 28 | + // This logger sends confusing messages | ||
| 29 | + // else { | ||
| 30 | + // // Get.log('Route "${uri.path}" not found'); | ||
| 31 | + // } | ||
| 30 | 32 | ||
| 31 | return RouteDecoder(route, params); | 33 | return RouteDecoder(route, params); |
| 32 | } | 34 | } |
| @@ -6,7 +6,7 @@ import '../../../instance_manager.dart'; | @@ -6,7 +6,7 @@ import '../../../instance_manager.dart'; | ||
| 6 | import '../../get_state_manager.dart'; | 6 | import '../../get_state_manager.dart'; |
| 7 | import '../simple/list_notifier.dart'; | 7 | import '../simple/list_notifier.dart'; |
| 8 | 8 | ||
| 9 | -mixin StateMixin<T> on ListNotifier { | 9 | +mixin StateMixin<T> on ListNotifierMixin { |
| 10 | T? _value; | 10 | T? _value; |
| 11 | RxStatus? _status; | 11 | RxStatus? _status; |
| 12 | 12 |
| @@ -7,7 +7,8 @@ import '../rx_flutter/rx_notifier.dart'; | @@ -7,7 +7,8 @@ import '../rx_flutter/rx_notifier.dart'; | ||
| 7 | import 'list_notifier.dart'; | 7 | import 'list_notifier.dart'; |
| 8 | 8 | ||
| 9 | // ignore: prefer_mixin | 9 | // ignore: prefer_mixin |
| 10 | -abstract class GetxController extends DisposableInterface with ListNotifier { | 10 | +abstract class GetxController extends DisposableInterface |
| 11 | + with ListenableMixin, ListNotifierMixin { | ||
| 11 | /// Rebuilds [GetBuilder] each time you call [update()]; | 12 | /// Rebuilds [GetBuilder] each time you call [update()]; |
| 12 | /// Can take a List of [ids], that will only update the matching | 13 | /// Can take a List of [ids], that will only update the matching |
| 13 | /// `GetBuilder( id: )`, | 14 | /// `GetBuilder( id: )`, |
| @@ -9,7 +9,10 @@ typedef Disposer = void Function(); | @@ -9,7 +9,10 @@ typedef Disposer = void Function(); | ||
| 9 | // if it brings overhead the extra call, | 9 | // if it brings overhead the extra call, |
| 10 | typedef GetStateUpdate = void Function(); | 10 | typedef GetStateUpdate = void Function(); |
| 11 | 11 | ||
| 12 | -class ListNotifier implements Listenable { | 12 | +class ListNotifier extends Listenable with ListenableMixin, ListNotifierMixin {} |
| 13 | + | ||
| 14 | +mixin ListenableMixin implements Listenable {} | ||
| 15 | +mixin ListNotifierMixin on ListenableMixin { | ||
| 13 | // int _version = 0; | 16 | // int _version = 0; |
| 14 | // int _microtask = 0; | 17 | // int _microtask = 0; |
| 15 | 18 |
-
Please register or login to post a comment