Browse Source

first commit

Raihan Rizal 5 months ago
commit
ef4145d122
100 changed files with 3323 additions and 0 deletions
  1. 29 0
      .gitignore
  2. 36 0
      .metadata
  3. 3 0
      CHANGELOG.md
  4. 1 0
      LICENSE
  5. 15 0
      README.md
  6. 4 0
      analysis_options.yaml
  7. 9 0
      android/.gitignore
  8. 54 0
      android/build.gradle
  9. 1 0
      android/settings.gradle
  10. 3 0
      android/src/main/AndroidManifest.xml
  11. 34 0
      android/src/main/java/id/kalanusa/flutter_zsdk/FlutterZsdkPlugin.java
  12. 29 0
      android/src/test/java/id/kalanusa/flutter_zsdk/FlutterZsdkPluginTest.java
  13. 43 0
      example/.gitignore
  14. 16 0
      example/README.md
  15. 28 0
      example/analysis_options.yaml
  16. 13 0
      example/android/.gitignore
  17. 57 0
      example/android/app/build.gradle
  18. 7 0
      example/android/app/src/debug/AndroidManifest.xml
  19. 44 0
      example/android/app/src/main/AndroidManifest.xml
  20. 6 0
      example/android/app/src/main/java/id/kalanusa/flutter_zsdk_example/MainActivity.java
  21. 12 0
      example/android/app/src/main/res/drawable-v21/launch_background.xml
  22. 12 0
      example/android/app/src/main/res/drawable/launch_background.xml
  23. BIN
      example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  24. BIN
      example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  25. BIN
      example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  26. BIN
      example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  27. BIN
      example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  28. 18 0
      example/android/app/src/main/res/values-night/styles.xml
  29. 18 0
      example/android/app/src/main/res/values/styles.xml
  30. 7 0
      example/android/app/src/profile/AndroidManifest.xml
  31. 18 0
      example/android/build.gradle
  32. 3 0
      example/android/gradle.properties
  33. 5 0
      example/android/gradle/wrapper/gradle-wrapper.properties
  34. 26 0
      example/android/settings.gradle
  35. 25 0
      example/integration_test/plugin_integration_test.dart
  36. 34 0
      example/ios/.gitignore
  37. 26 0
      example/ios/Flutter/AppFrameworkInfo.plist
  38. 1 0
      example/ios/Flutter/Debug.xcconfig
  39. 1 0
      example/ios/Flutter/Release.xcconfig
  40. 615 0
      example/ios/Runner.xcodeproj/project.pbxproj
  41. 7 0
      example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  42. 8 0
      example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  43. 8 0
      example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  44. 98 0
      example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  45. 7 0
      example/ios/Runner.xcworkspace/contents.xcworkspacedata
  46. 8 0
      example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  47. 8 0
      example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  48. 6 0
      example/ios/Runner/AppDelegate.h
  49. 13 0
      example/ios/Runner/AppDelegate.m
  50. 122 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
  51. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
  52. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
  53. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
  54. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
  55. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
  56. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
  57. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
  58. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
  59. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
  60. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
  61. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
  62. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
  63. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
  64. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
  65. BIN
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
  66. 23 0
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
  67. BIN
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
  68. BIN
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
  69. BIN
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
  70. 5 0
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
  71. 37 0
      example/ios/Runner/Base.lproj/LaunchScreen.storyboard
  72. 26 0
      example/ios/Runner/Base.lproj/Main.storyboard
  73. 49 0
      example/ios/Runner/Info.plist
  74. 9 0
      example/ios/Runner/main.m
  75. 33 0
      example/ios/RunnerTests/RunnerTests.m
  76. 63 0
      example/lib/main.dart
  77. 283 0
      example/pubspec.lock
  78. 85 0
      example/pubspec.yaml
  79. 27 0
      example/test/widget_test.dart
  80. 17 0
      example/windows/.gitignore
  81. 110 0
      example/windows/CMakeLists.txt
  82. 109 0
      example/windows/flutter/CMakeLists.txt
  83. 14 0
      example/windows/flutter/generated_plugin_registrant.cc
  84. 15 0
      example/windows/flutter/generated_plugin_registrant.h
  85. 24 0
      example/windows/flutter/generated_plugins.cmake
  86. 40 0
      example/windows/runner/CMakeLists.txt
  87. 121 0
      example/windows/runner/Runner.rc
  88. 71 0
      example/windows/runner/flutter_window.cpp
  89. 33 0
      example/windows/runner/flutter_window.h
  90. 43 0
      example/windows/runner/main.cpp
  91. 16 0
      example/windows/runner/resource.h
  92. BIN
      example/windows/runner/resources/app_icon.ico
  93. 20 0
      example/windows/runner/runner.exe.manifest
  94. 65 0
      example/windows/runner/utils.cpp
  95. 19 0
      example/windows/runner/utils.h
  96. 288 0
      example/windows/runner/win32_window.cpp
  97. 102 0
      example/windows/runner/win32_window.h
  98. 38 0
      ios/.gitignore
  99. 0 0
      ios/Assets/.gitkeep
  100. 0 0
      ios/Classes/FlutterZsdkPlugin.h

+ 29 - 0
.gitignore

@@ -0,0 +1,29 @@
1
+# Miscellaneous
2
+*.class
3
+*.log
4
+*.pyc
5
+*.swp
6
+.DS_Store
7
+.atom/
8
+.buildlog/
9
+.history
10
+.svn/
11
+migrate_working_dir/
12
+
13
+# IntelliJ related
14
+*.iml
15
+*.ipr
16
+*.iws
17
+.idea/
18
+
19
+# The .vscode folder contains launch configuration and tasks you configure in
20
+# VS Code which you may wish to be included in version control, so this line
21
+# is commented out by default.
22
+#.vscode/
23
+
24
+# Flutter/Dart/Pub related
25
+# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26
+/pubspec.lock
27
+**/doc/api/
28
+.dart_tool/
29
+build/

+ 36 - 0
.metadata

@@ -0,0 +1,36 @@
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: "ba393198430278b6595976de84fe170f553cc728"
8
+  channel: "stable"
9
+
10
+project_type: plugin
11
+
12
+# Tracks metadata for the flutter migrate command
13
+migration:
14
+  platforms:
15
+    - platform: root
16
+      create_revision: ba393198430278b6595976de84fe170f553cc728
17
+      base_revision: ba393198430278b6595976de84fe170f553cc728
18
+    - platform: android
19
+      create_revision: ba393198430278b6595976de84fe170f553cc728
20
+      base_revision: ba393198430278b6595976de84fe170f553cc728
21
+    - platform: ios
22
+      create_revision: ba393198430278b6595976de84fe170f553cc728
23
+      base_revision: ba393198430278b6595976de84fe170f553cc728
24
+    - platform: windows
25
+      create_revision: ba393198430278b6595976de84fe170f553cc728
26
+      base_revision: ba393198430278b6595976de84fe170f553cc728
27
+
28
+  # User provided section
29
+
30
+  # List of Local paths (relative to this file) that should be
31
+  # ignored by the migrate tool.
32
+  #
33
+  # Files that are not part of the templates will be ignored by default.
34
+  unmanaged_files:
35
+    - 'lib/main.dart'
36
+    - 'ios/Runner.xcodeproj/project.pbxproj'

+ 3 - 0
CHANGELOG.md

@@ -0,0 +1,3 @@
1
+## 0.0.1
2
+
3
+* TODO: Describe initial release.

+ 1 - 0
LICENSE

@@ -0,0 +1 @@
1
+TODO: Add your license here.

+ 15 - 0
README.md

@@ -0,0 +1,15 @@
1
+# flutter_zsdk
2
+
3
+A new Flutter plugin project.
4
+
5
+## Getting Started
6
+
7
+This project is a starting point for a Flutter
8
+[plug-in package](https://flutter.dev/developing-packages/),
9
+a specialized package that includes platform-specific implementation code for
10
+Android and/or iOS.
11
+
12
+For help getting started with Flutter development, view the
13
+[online documentation](https://flutter.dev/docs), which offers tutorials,
14
+samples, guidance on mobile development, and a full API reference.
15
+

+ 4 - 0
analysis_options.yaml

@@ -0,0 +1,4 @@
1
+include: package:flutter_lints/flutter.yaml
2
+
3
+# Additional information about this file can be found at
4
+# https://dart.dev/guides/language/analysis-options

+ 9 - 0
android/.gitignore

@@ -0,0 +1,9 @@
1
+*.iml
2
+.gradle
3
+/local.properties
4
+/.idea/workspace.xml
5
+/.idea/libraries
6
+.DS_Store
7
+/build
8
+/captures
9
+.cxx

+ 54 - 0
android/build.gradle

@@ -0,0 +1,54 @@
1
+group 'id.kalanusa.flutter_zsdk'
2
+version '1.0'
3
+
4
+buildscript {
5
+    repositories {
6
+        google()
7
+        mavenCentral()
8
+    }
9
+
10
+    dependencies {
11
+        classpath 'com.android.tools.build:gradle:7.3.0'
12
+    }
13
+}
14
+
15
+rootProject.allprojects {
16
+    repositories {
17
+        google()
18
+        mavenCentral()
19
+    }
20
+}
21
+
22
+apply plugin: 'com.android.library'
23
+
24
+android {
25
+    if (project.android.hasProperty("namespace")) {
26
+        namespace 'id.kalanusa.flutter_zsdk'
27
+    }
28
+
29
+    compileSdk 34
30
+
31
+    compileOptions {
32
+        sourceCompatibility JavaVersion.VERSION_1_8
33
+        targetCompatibility JavaVersion.VERSION_1_8
34
+    }
35
+
36
+    defaultConfig {
37
+        minSdkVersion 19
38
+    }
39
+
40
+    dependencies {
41
+        testImplementation 'junit:junit:4.13.2'
42
+        testImplementation 'org.mockito:mockito-core:5.0.0'
43
+    }
44
+
45
+    testOptions {
46
+        unitTests.all {
47
+            testLogging {
48
+               events "passed", "skipped", "failed", "standardOut", "standardError"
49
+               outputs.upToDateWhen {false}
50
+               showStandardStreams = true
51
+            }
52
+        }
53
+    }
54
+}

+ 1 - 0
android/settings.gradle

@@ -0,0 +1 @@
1
+rootProject.name = 'flutter_zsdk'

+ 3 - 0
android/src/main/AndroidManifest.xml

@@ -0,0 +1,3 @@
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+  package="id.kalanusa.flutter_zsdk">
3
+</manifest>

+ 34 - 0
android/src/main/java/id/kalanusa/flutter_zsdk/FlutterZsdkPlugin.java

@@ -0,0 +1,34 @@
1
+package id.kalanusa.flutter_zsdk;
2
+
3
+import androidx.annotation.NonNull;
4
+
5
+import io.flutter.embedding.engine.plugins.FlutterPlugin;
6
+import io.flutter.plugin.common.MethodCall;
7
+import io.flutter.plugin.common.MethodChannel;
8
+import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
9
+import io.flutter.plugin.common.MethodChannel.Result;
10
+
11
+/** FlutterZsdkPlugin */
12
+public class FlutterZsdkPlugin implements FlutterPlugin, MethodCallHandler {
13
+  /// The MethodChannel that will the communication between Flutter and native Android
14
+  ///
15
+  /// This local reference serves to register the plugin with the Flutter Engine and unregister it
16
+  /// when the Flutter Engine is detached from the Activity
17
+  private MethodChannel channel;
18
+
19
+  @Override
20
+  public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
21
+    channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "flutter_zsdk");
22
+    channel.setMethodCallHandler(this);
23
+  }
24
+
25
+  @Override
26
+  public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
27
+
28
+  }
29
+
30
+  @Override
31
+  public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
32
+    channel.setMethodCallHandler(null);
33
+  }
34
+}

+ 29 - 0
android/src/test/java/id/kalanusa/flutter_zsdk/FlutterZsdkPluginTest.java

@@ -0,0 +1,29 @@
1
+package id.kalanusa.flutter_zsdk;
2
+
3
+import static org.mockito.Mockito.mock;
4
+import static org.mockito.Mockito.verify;
5
+
6
+import io.flutter.plugin.common.MethodCall;
7
+import io.flutter.plugin.common.MethodChannel;
8
+import org.junit.Test;
9
+
10
+/**
11
+ * This demonstrates a simple unit test of the Java portion of this plugin's implementation.
12
+ *
13
+ * Once you have built the plugin's example app, you can run these tests from the command
14
+ * line by running `./gradlew testDebugUnitTest` in the `example/android/` directory, or
15
+ * you can run them directly from IDEs that support JUnit such as Android Studio.
16
+ */
17
+
18
+public class FlutterZsdkPluginTest {
19
+  @Test
20
+  public void onMethodCall_getPlatformVersion_returnsExpectedValue() {
21
+    FlutterZsdkPlugin plugin = new FlutterZsdkPlugin();
22
+
23
+    final MethodCall call = new MethodCall("getPlatformVersion", null);
24
+    MethodChannel.Result mockResult = mock(MethodChannel.Result.class);
25
+    plugin.onMethodCall(call, mockResult);
26
+
27
+    verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE);
28
+  }
29
+}

+ 43 - 0
example/.gitignore

@@ -0,0 +1,43 @@
1
+# Miscellaneous
2
+*.class
3
+*.log
4
+*.pyc
5
+*.swp
6
+.DS_Store
7
+.atom/
8
+.buildlog/
9
+.history
10
+.svn/
11
+migrate_working_dir/
12
+
13
+# IntelliJ related
14
+*.iml
15
+*.ipr
16
+*.iws
17
+.idea/
18
+
19
+# The .vscode folder contains launch configuration and tasks you configure in
20
+# VS Code which you may wish to be included in version control, so this line
21
+# is commented out by default.
22
+#.vscode/
23
+
24
+# Flutter/Dart/Pub related
25
+**/doc/api/
26
+**/ios/Flutter/.last_build_id
27
+.dart_tool/
28
+.flutter-plugins
29
+.flutter-plugins-dependencies
30
+.pub-cache/
31
+.pub/
32
+/build/
33
+
34
+# Symbolication related
35
+app.*.symbols
36
+
37
+# Obfuscation related
38
+app.*.map.json
39
+
40
+# Android Studio will place build artifacts here
41
+/android/app/debug
42
+/android/app/profile
43
+/android/app/release

+ 16 - 0
example/README.md

@@ -0,0 +1,16 @@
1
+# flutter_zsdk_example
2
+
3
+Demonstrates how to use the flutter_zsdk plugin.
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://docs.flutter.dev/get-started/codelab)
12
+- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13
+
14
+For help getting started with Flutter development, view the
15
+[online documentation](https://docs.flutter.dev/), which offers tutorials,
16
+samples, guidance on mobile development, and a full API reference.

+ 28 - 0
example/analysis_options.yaml

@@ -0,0 +1,28 @@
1
+# This file configures the analyzer, which statically analyzes Dart code to
2
+# check for errors, warnings, and lints.
3
+#
4
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6
+# invoked from the command line by running `flutter analyze`.
7
+
8
+# The following line activates a set of recommended lints for Flutter apps,
9
+# packages, and plugins designed to encourage good coding practices.
10
+include: package:flutter_lints/flutter.yaml
11
+
12
+linter:
13
+  # The lint rules applied to this project can be customized in the
14
+  # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15
+  # included above or to enable additional rules. A list of all available lints
16
+  # and their documentation is published at https://dart.dev/lints.
17
+  #
18
+  # Instead of disabling a lint rule for the entire project in the
19
+  # section below, it can also be suppressed for a single line of code
20
+  # or a specific dart file by using the `// ignore: name_of_lint` and
21
+  # `// ignore_for_file: name_of_lint` syntax on the line or in the file
22
+  # producing the lint.
23
+  rules:
24
+    # avoid_print: false  # Uncomment to disable the `avoid_print` rule
25
+    # prefer_single_quotes: true  # Uncomment to enable the `prefer_single_quotes` rule
26
+
27
+# Additional information about this file can be found at
28
+# https://dart.dev/guides/language/analysis-options

+ 13 - 0
example/android/.gitignore

@@ -0,0 +1,13 @@
1
+gradle-wrapper.jar
2
+/.gradle
3
+/captures/
4
+/gradlew
5
+/gradlew.bat
6
+/local.properties
7
+GeneratedPluginRegistrant.java
8
+
9
+# Remember to never publicly share your keystore.
10
+# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11
+key.properties
12
+**/*.keystore
13
+**/*.jks

+ 57 - 0
example/android/app/build.gradle

@@ -0,0 +1,57 @@
1
+plugins {
2
+    id "com.android.application"
3
+    id "kotlin-android"
4
+    id "dev.flutter.flutter-gradle-plugin"
5
+}
6
+
7
+def localProperties = new Properties()
8
+def localPropertiesFile = rootProject.file('local.properties')
9
+if (localPropertiesFile.exists()) {
10
+    localPropertiesFile.withReader('UTF-8') { reader ->
11
+        localProperties.load(reader)
12
+    }
13
+}
14
+
15
+def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16
+if (flutterVersionCode == null) {
17
+    flutterVersionCode = '1'
18
+}
19
+
20
+def flutterVersionName = localProperties.getProperty('flutter.versionName')
21
+if (flutterVersionName == null) {
22
+    flutterVersionName = '1.0'
23
+}
24
+
25
+android {
26
+    namespace "id.kalanusa.flutter_zsdk_example"
27
+    compileSdk flutter.compileSdkVersion
28
+    ndkVersion flutter.ndkVersion
29
+
30
+    compileOptions {
31
+        sourceCompatibility JavaVersion.VERSION_1_8
32
+        targetCompatibility JavaVersion.VERSION_1_8
33
+    }
34
+
35
+    defaultConfig {
36
+        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37
+        applicationId "id.kalanusa.flutter_zsdk_example"
38
+        // You can update the following values to match your application needs.
39
+        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
40
+        minSdkVersion flutter.minSdkVersion
41
+        targetSdkVersion flutter.targetSdkVersion
42
+        versionCode flutterVersionCode.toInteger()
43
+        versionName flutterVersionName
44
+    }
45
+
46
+    buildTypes {
47
+        release {
48
+            // TODO: Add your own signing config for the release build.
49
+            // Signing with the debug keys for now, so `flutter run --release` works.
50
+            signingConfig signingConfigs.debug
51
+        }
52
+    }
53
+}
54
+
55
+flutter {
56
+    source '../..'
57
+}

+ 7 - 0
example/android/app/src/debug/AndroidManifest.xml

@@ -0,0 +1,7 @@
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+    <!-- The INTERNET permission is required for development. Specifically,
3
+         the Flutter tool 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>

+ 44 - 0
example/android/app/src/main/AndroidManifest.xml

@@ -0,0 +1,44 @@
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+    <application
3
+        android:label="flutter_zsdk_example"
4
+        android:name="${applicationName}"
5
+        android:icon="@mipmap/ic_launcher">
6
+        <activity
7
+            android:name=".MainActivity"
8
+            android:exported="true"
9
+            android:launchMode="singleTop"
10
+            android:theme="@style/LaunchTheme"
11
+            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
12
+            android:hardwareAccelerated="true"
13
+            android:windowSoftInputMode="adjustResize">
14
+            <!-- Specifies an Android theme to apply to this Activity as soon as
15
+                 the Android process has started. This theme is visible to the user
16
+                 while the Flutter UI initializes. After that, this theme continues
17
+                 to determine the Window background behind the Flutter UI. -->
18
+            <meta-data
19
+              android:name="io.flutter.embedding.android.NormalTheme"
20
+              android:resource="@style/NormalTheme"
21
+              />
22
+            <intent-filter>
23
+                <action android:name="android.intent.action.MAIN"/>
24
+                <category android:name="android.intent.category.LAUNCHER"/>
25
+            </intent-filter>
26
+        </activity>
27
+        <!-- Don't delete the meta-data below.
28
+             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
29
+        <meta-data
30
+            android:name="flutterEmbedding"
31
+            android:value="2" />
32
+    </application>
33
+    <!-- Required to query activities that can process text, see:
34
+         https://developer.android.com/training/package-visibility?hl=en and
35
+         https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
36
+
37
+         In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
38
+    <queries>
39
+        <intent>
40
+            <action android:name="android.intent.action.PROCESS_TEXT"/>
41
+            <data android:mimeType="text/plain"/>
42
+        </intent>
43
+    </queries>
44
+</manifest>

+ 6 - 0
example/android/app/src/main/java/id/kalanusa/flutter_zsdk_example/MainActivity.java

@@ -0,0 +1,6 @@
1
+package id.kalanusa.flutter_zsdk_example;
2
+
3
+import io.flutter.embedding.android.FlutterActivity;
4
+
5
+public class MainActivity extends FlutterActivity {
6
+}

+ 12 - 0
example/android/app/src/main/res/drawable-v21/launch_background.xml

@@ -0,0 +1,12 @@
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>

+ 12 - 0
example/android/app/src/main/res/drawable/launch_background.xml

@@ -0,0 +1,12 @@
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>

BIN
example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 18 - 0
example/android/app/src/main/res/values-night/styles.xml

@@ -0,0 +1,18 @@
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
+             the Flutter engine 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>

+ 18 - 0
example/android/app/src/main/res/values/styles.xml

@@ -0,0 +1,18 @@
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
+             the Flutter engine 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>

+ 7 - 0
example/android/app/src/profile/AndroidManifest.xml

@@ -0,0 +1,7 @@
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+    <!-- The INTERNET permission is required for development. Specifically,
3
+         the Flutter tool 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>

+ 18 - 0
example/android/build.gradle

@@ -0,0 +1,18 @@
1
+allprojects {
2
+    repositories {
3
+        google()
4
+        mavenCentral()
5
+    }
6
+}
7
+
8
+rootProject.buildDir = '../build'
9
+subprojects {
10
+    project.buildDir = "${rootProject.buildDir}/${project.name}"
11
+}
12
+subprojects {
13
+    project.evaluationDependsOn(':app')
14
+}
15
+
16
+tasks.register("clean", Delete) {
17
+    delete rootProject.buildDir
18
+}

+ 3 - 0
example/android/gradle.properties

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

+ 5 - 0
example/android/gradle/wrapper/gradle-wrapper.properties

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

+ 26 - 0
example/android/settings.gradle

@@ -0,0 +1,26 @@
1
+pluginManagement {
2
+    def flutterSdkPath = {
3
+        def properties = new Properties()
4
+        file("local.properties").withInputStream { properties.load(it) }
5
+        def flutterSdkPath = properties.getProperty("flutter.sdk")
6
+        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7
+        return flutterSdkPath
8
+    }
9
+    settings.ext.flutterSdkPath = flutterSdkPath()
10
+
11
+    includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
12
+
13
+    repositories {
14
+        google()
15
+        mavenCentral()
16
+        gradlePluginPortal()
17
+    }
18
+}
19
+
20
+plugins {
21
+    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22
+    id "com.android.application" version "7.3.0" apply false
23
+    id "org.jetbrains.kotlin.android" version "1.7.10" apply false
24
+}
25
+
26
+include ":app"

+ 25 - 0
example/integration_test/plugin_integration_test.dart

@@ -0,0 +1,25 @@
1
+// This is a basic Flutter integration test.
2
+//
3
+// Since integration tests run in a full Flutter application, they can interact
4
+// with the host side of a plugin implementation, unlike Dart unit tests.
5
+//
6
+// For more information about Flutter integration tests, please see
7
+// https://docs.flutter.dev/cookbook/testing/integration/introduction
8
+
9
+
10
+import 'package:flutter_test/flutter_test.dart';
11
+import 'package:integration_test/integration_test.dart';
12
+
13
+import 'package:flutter_zsdk/flutter_zsdk.dart';
14
+
15
+void main() {
16
+  IntegrationTestWidgetsFlutterBinding.ensureInitialized();
17
+
18
+  testWidgets('getPlatformVersion test', (WidgetTester tester) async {
19
+    final FlutterZsdk plugin = FlutterZsdk();
20
+    final String? version = await plugin.getPlatformVersion();
21
+    // The version string depends on the host platform running the test, so
22
+    // just assert that some non-empty string is returned.
23
+    expect(version?.isNotEmpty, true);
24
+  });
25
+}

+ 34 - 0
example/ios/.gitignore

@@ -0,0 +1,34 @@
1
+**/dgph
2
+*.mode1v3
3
+*.mode2v3
4
+*.moved-aside
5
+*.pbxuser
6
+*.perspectivev3
7
+**/*sync/
8
+.sconsign.dblite
9
+.tags*
10
+**/.vagrant/
11
+**/DerivedData/
12
+Icon?
13
+**/Pods/
14
+**/.symlinks/
15
+profile
16
+xcuserdata
17
+**/.generated/
18
+Flutter/App.framework
19
+Flutter/Flutter.framework
20
+Flutter/Flutter.podspec
21
+Flutter/Generated.xcconfig
22
+Flutter/ephemeral/
23
+Flutter/app.flx
24
+Flutter/app.zip
25
+Flutter/flutter_assets/
26
+Flutter/flutter_export_environment.sh
27
+ServiceDefinitions.json
28
+Runner/GeneratedPluginRegistrant.*
29
+
30
+# Exceptions to above rules.
31
+!default.mode1v3
32
+!default.mode2v3
33
+!default.pbxuser
34
+!default.perspectivev3

+ 26 - 0
example/ios/Flutter/AppFrameworkInfo.plist

@@ -0,0 +1,26 @@
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>12.0</string>
25
+</dict>
26
+</plist>

+ 1 - 0
example/ios/Flutter/Debug.xcconfig

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

+ 1 - 0
example/ios/Flutter/Release.xcconfig

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

+ 615 - 0
example/ios/Runner.xcodeproj/project.pbxproj

@@ -0,0 +1,615 @@
1
+// !$*UTF8*$!
2
+{
3
+	archiveVersion = 1;
4
+	classes = {
5
+	};
6
+	objectVersion = 54;
7
+	objects = {
8
+
9
+/* Begin PBXBuildFile section */
10
+		1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11
+		331C80F4294D02FB00263BE5 /* RunnerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 331C80F3294D02FB00263BE5 /* RunnerTests.m */; };
12
+		3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13
+		978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
14
+		97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
15
+		97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
16
+		97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
17
+		97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
18
+/* End PBXBuildFile section */
19
+
20
+/* Begin PBXContainerItemProxy section */
21
+		331C80F5294D02FB00263BE5 /* PBXContainerItemProxy */ = {
22
+			isa = PBXContainerItemProxy;
23
+			containerPortal = 97C146E61CF9000F007C117D /* Project object */;
24
+			proxyType = 1;
25
+			remoteGlobalIDString = 97C146ED1CF9000F007C117D;
26
+			remoteInfo = Runner;
27
+		};
28
+/* End PBXContainerItemProxy section */
29
+
30
+/* Begin PBXCopyFilesBuildPhase section */
31
+		9705A1C41CF9048500538489 /* Embed Frameworks */ = {
32
+			isa = PBXCopyFilesBuildPhase;
33
+			buildActionMask = 2147483647;
34
+			dstPath = "";
35
+			dstSubfolderSpec = 10;
36
+			files = (
37
+			);
38
+			name = "Embed Frameworks";
39
+			runOnlyForDeploymentPostprocessing = 0;
40
+		};
41
+/* End PBXCopyFilesBuildPhase section */
42
+
43
+/* Begin PBXFileReference section */
44
+		1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
45
+		1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
46
+		331C80F1294D02FB00263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
47
+		331C80F3294D02FB00263BE5 /* RunnerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RunnerTests.m; sourceTree = "<group>"; };
48
+		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
49
+		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
50
+		7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
51
+		7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
52
+		9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
53
+		9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
54
+		97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
55
+		97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
56
+		97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
57
+		97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
58
+		97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
59
+		97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
60
+/* End PBXFileReference section */
61
+
62
+/* Begin PBXFrameworksBuildPhase section */
63
+		331C80EE294D02FB00263BE5 /* Frameworks */ = {
64
+			isa = PBXFrameworksBuildPhase;
65
+			buildActionMask = 2147483647;
66
+			files = (
67
+			);
68
+			runOnlyForDeploymentPostprocessing = 0;
69
+		};
70
+		97C146EB1CF9000F007C117D /* Frameworks */ = {
71
+			isa = PBXFrameworksBuildPhase;
72
+			buildActionMask = 2147483647;
73
+			files = (
74
+			);
75
+			runOnlyForDeploymentPostprocessing = 0;
76
+		};
77
+/* End PBXFrameworksBuildPhase section */
78
+
79
+/* Begin PBXGroup section */
80
+		331C80F2294D02FB00263BE5 /* RunnerTests */ = {
81
+			isa = PBXGroup;
82
+			children = (
83
+				331C80F3294D02FB00263BE5 /* RunnerTests.m */,
84
+			);
85
+			path = RunnerTests;
86
+			sourceTree = "<group>";
87
+		};
88
+		9740EEB11CF90186004384FC /* Flutter */ = {
89
+			isa = PBXGroup;
90
+			children = (
91
+				3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
92
+				9740EEB21CF90195004384FC /* Debug.xcconfig */,
93
+				7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
94
+				9740EEB31CF90195004384FC /* Generated.xcconfig */,
95
+			);
96
+			name = Flutter;
97
+			sourceTree = "<group>";
98
+		};
99
+		97C146E51CF9000F007C117D = {
100
+			isa = PBXGroup;
101
+			children = (
102
+				9740EEB11CF90186004384FC /* Flutter */,
103
+				97C146F01CF9000F007C117D /* Runner */,
104
+				331C80F2294D02FB00263BE5 /* RunnerTests */,
105
+				97C146EF1CF9000F007C117D /* Products */,
106
+			);
107
+			sourceTree = "<group>";
108
+		};
109
+		97C146EF1CF9000F007C117D /* Products */ = {
110
+			isa = PBXGroup;
111
+			children = (
112
+				97C146EE1CF9000F007C117D /* Runner.app */,
113
+				331C80F1294D02FB00263BE5 /* RunnerTests.xctest */,
114
+			);
115
+			name = Products;
116
+			sourceTree = "<group>";
117
+		};
118
+		97C146F01CF9000F007C117D /* Runner */ = {
119
+			isa = PBXGroup;
120
+			children = (
121
+				7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
122
+				7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
123
+				97C146FA1CF9000F007C117D /* Main.storyboard */,
124
+				97C146FD1CF9000F007C117D /* Assets.xcassets */,
125
+				97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
126
+				97C147021CF9000F007C117D /* Info.plist */,
127
+				97C146F11CF9000F007C117D /* Supporting Files */,
128
+				1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
129
+				1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
130
+			);
131
+			path = Runner;
132
+			sourceTree = "<group>";
133
+		};
134
+		97C146F11CF9000F007C117D /* Supporting Files */ = {
135
+			isa = PBXGroup;
136
+			children = (
137
+				97C146F21CF9000F007C117D /* main.m */,
138
+			);
139
+			name = "Supporting Files";
140
+			sourceTree = "<group>";
141
+		};
142
+/* End PBXGroup section */
143
+
144
+/* Begin PBXNativeTarget section */
145
+		331C80F0294D02FB00263BE5 /* RunnerTests */ = {
146
+			isa = PBXNativeTarget;
147
+			buildConfigurationList = 331C80F7294D02FB00263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
148
+			buildPhases = (
149
+				331C80ED294D02FB00263BE5 /* Sources */,
150
+				331C80EE294D02FB00263BE5 /* Frameworks */,
151
+				331C80EF294D02FB00263BE5 /* Resources */,
152
+			);
153
+			buildRules = (
154
+			);
155
+			dependencies = (
156
+				331C80F6294D02FB00263BE5 /* PBXTargetDependency */,
157
+			);
158
+			name = RunnerTests;
159
+			productName = RunnerTests;
160
+			productReference = 331C80F1294D02FB00263BE5 /* RunnerTests.xctest */;
161
+			productType = "com.apple.product-type.bundle.unit-test";
162
+		};
163
+		97C146ED1CF9000F007C117D /* Runner */ = {
164
+			isa = PBXNativeTarget;
165
+			buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
166
+			buildPhases = (
167
+				9740EEB61CF901F6004384FC /* Run Script */,
168
+				97C146EA1CF9000F007C117D /* Sources */,
169
+				97C146EB1CF9000F007C117D /* Frameworks */,
170
+				97C146EC1CF9000F007C117D /* Resources */,
171
+				9705A1C41CF9048500538489 /* Embed Frameworks */,
172
+				3B06AD1E1E4923F5004D2608 /* Thin Binary */,
173
+			);
174
+			buildRules = (
175
+			);
176
+			dependencies = (
177
+			);
178
+			name = Runner;
179
+			productName = Runner;
180
+			productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
181
+			productType = "com.apple.product-type.application";
182
+		};
183
+/* End PBXNativeTarget section */
184
+
185
+/* Begin PBXProject section */
186
+		97C146E61CF9000F007C117D /* Project object */ = {
187
+			isa = PBXProject;
188
+			attributes = {
189
+				BuildIndependentTargetsInParallel = YES;
190
+				LastUpgradeCheck = 1510;
191
+				ORGANIZATIONNAME = "";
192
+				TargetAttributes = {
193
+					331C80F0294D02FB00263BE5 = {
194
+						CreatedOnToolsVersion = 14.0;
195
+						TestTargetID = 97C146ED1CF9000F007C117D;
196
+					};
197
+					97C146ED1CF9000F007C117D = {
198
+						CreatedOnToolsVersion = 7.3.1;
199
+					};
200
+				};
201
+			};
202
+			buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
203
+			compatibilityVersion = "Xcode 9.3";
204
+			developmentRegion = en;
205
+			hasScannedForEncodings = 0;
206
+			knownRegions = (
207
+				en,
208
+				Base,
209
+			);
210
+			mainGroup = 97C146E51CF9000F007C117D;
211
+			productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
212
+			projectDirPath = "";
213
+			projectRoot = "";
214
+			targets = (
215
+				97C146ED1CF9000F007C117D /* Runner */,
216
+				331C80F0294D02FB00263BE5 /* RunnerTests */,
217
+			);
218
+		};
219
+/* End PBXProject section */
220
+
221
+/* Begin PBXResourcesBuildPhase section */
222
+		331C80EF294D02FB00263BE5 /* Resources */ = {
223
+			isa = PBXResourcesBuildPhase;
224
+			buildActionMask = 2147483647;
225
+			files = (
226
+			);
227
+			runOnlyForDeploymentPostprocessing = 0;
228
+		};
229
+		97C146EC1CF9000F007C117D /* Resources */ = {
230
+			isa = PBXResourcesBuildPhase;
231
+			buildActionMask = 2147483647;
232
+			files = (
233
+				97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
234
+				3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
235
+				97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
236
+				97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
237
+			);
238
+			runOnlyForDeploymentPostprocessing = 0;
239
+		};
240
+/* End PBXResourcesBuildPhase section */
241
+
242
+/* Begin PBXShellScriptBuildPhase section */
243
+		3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
244
+			isa = PBXShellScriptBuildPhase;
245
+			alwaysOutOfDate = 1;
246
+			buildActionMask = 2147483647;
247
+			files = (
248
+			);
249
+			inputPaths = (
250
+				"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
251
+			);
252
+			name = "Thin Binary";
253
+			outputPaths = (
254
+			);
255
+			runOnlyForDeploymentPostprocessing = 0;
256
+			shellPath = /bin/sh;
257
+			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
258
+		};
259
+		9740EEB61CF901F6004384FC /* Run Script */ = {
260
+			isa = PBXShellScriptBuildPhase;
261
+			alwaysOutOfDate = 1;
262
+			buildActionMask = 2147483647;
263
+			files = (
264
+			);
265
+			inputPaths = (
266
+			);
267
+			name = "Run Script";
268
+			outputPaths = (
269
+			);
270
+			runOnlyForDeploymentPostprocessing = 0;
271
+			shellPath = /bin/sh;
272
+			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
273
+		};
274
+/* End PBXShellScriptBuildPhase section */
275
+
276
+/* Begin PBXSourcesBuildPhase section */
277
+		331C80ED294D02FB00263BE5 /* Sources */ = {
278
+			isa = PBXSourcesBuildPhase;
279
+			buildActionMask = 2147483647;
280
+			files = (
281
+				331C80F4294D02FB00263BE5 /* RunnerTests.m in Sources */,
282
+			);
283
+			runOnlyForDeploymentPostprocessing = 0;
284
+		};
285
+		97C146EA1CF9000F007C117D /* Sources */ = {
286
+			isa = PBXSourcesBuildPhase;
287
+			buildActionMask = 2147483647;
288
+			files = (
289
+				978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
290
+				97C146F31CF9000F007C117D /* main.m in Sources */,
291
+				1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
292
+			);
293
+			runOnlyForDeploymentPostprocessing = 0;
294
+		};
295
+/* End PBXSourcesBuildPhase section */
296
+
297
+/* Begin PBXTargetDependency section */
298
+		331C80F6294D02FB00263BE5 /* PBXTargetDependency */ = {
299
+			isa = PBXTargetDependency;
300
+			target = 97C146ED1CF9000F007C117D /* Runner */;
301
+			targetProxy = 331C80F5294D02FB00263BE5 /* PBXContainerItemProxy */;
302
+		};
303
+/* End PBXTargetDependency section */
304
+
305
+/* Begin PBXVariantGroup section */
306
+		97C146FA1CF9000F007C117D /* Main.storyboard */ = {
307
+			isa = PBXVariantGroup;
308
+			children = (
309
+				97C146FB1CF9000F007C117D /* Base */,
310
+			);
311
+			name = Main.storyboard;
312
+			sourceTree = "<group>";
313
+		};
314
+		97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
315
+			isa = PBXVariantGroup;
316
+			children = (
317
+				97C147001CF9000F007C117D /* Base */,
318
+			);
319
+			name = LaunchScreen.storyboard;
320
+			sourceTree = "<group>";
321
+		};
322
+/* End PBXVariantGroup section */
323
+
324
+/* Begin XCBuildConfiguration section */
325
+		249021D3217E4FDB00AE95B9 /* Profile */ = {
326
+			isa = XCBuildConfiguration;
327
+			buildSettings = {
328
+				ALWAYS_SEARCH_USER_PATHS = NO;
329
+				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
330
+				CLANG_ANALYZER_NONNULL = YES;
331
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
332
+				CLANG_CXX_LIBRARY = "libc++";
333
+				CLANG_ENABLE_MODULES = YES;
334
+				CLANG_ENABLE_OBJC_ARC = YES;
335
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
336
+				CLANG_WARN_BOOL_CONVERSION = YES;
337
+				CLANG_WARN_COMMA = YES;
338
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
339
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
340
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
341
+				CLANG_WARN_EMPTY_BODY = YES;
342
+				CLANG_WARN_ENUM_CONVERSION = YES;
343
+				CLANG_WARN_INFINITE_RECURSION = YES;
344
+				CLANG_WARN_INT_CONVERSION = YES;
345
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
346
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
347
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
348
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
349
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
350
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
351
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
352
+				CLANG_WARN_UNREACHABLE_CODE = YES;
353
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
354
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
355
+				COPY_PHASE_STRIP = NO;
356
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
357
+				ENABLE_NS_ASSERTIONS = NO;
358
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
359
+				ENABLE_USER_SCRIPT_SANDBOXING = NO;
360
+				GCC_C_LANGUAGE_STANDARD = gnu99;
361
+				GCC_NO_COMMON_BLOCKS = YES;
362
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
363
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
364
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
365
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
366
+				GCC_WARN_UNUSED_FUNCTION = YES;
367
+				GCC_WARN_UNUSED_VARIABLE = YES;
368
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
369
+				MTL_ENABLE_DEBUG_INFO = NO;
370
+				SDKROOT = iphoneos;
371
+				SUPPORTED_PLATFORMS = iphoneos;
372
+				TARGETED_DEVICE_FAMILY = "1,2";
373
+				VALIDATE_PRODUCT = YES;
374
+			};
375
+			name = Profile;
376
+		};
377
+		249021D4217E4FDB00AE95B9 /* Profile */ = {
378
+			isa = XCBuildConfiguration;
379
+			baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
380
+			buildSettings = {
381
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
382
+				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
383
+				ENABLE_BITCODE = NO;
384
+				INFOPLIST_FILE = Runner/Info.plist;
385
+				LD_RUNPATH_SEARCH_PATHS = (
386
+					"$(inherited)",
387
+					"@executable_path/Frameworks",
388
+				);
389
+				PRODUCT_BUNDLE_IDENTIFIER = id.kalanusa.flutterZsdkExample;
390
+				PRODUCT_NAME = "$(TARGET_NAME)";
391
+				VERSIONING_SYSTEM = "apple-generic";
392
+			};
393
+			name = Profile;
394
+		};
395
+		331C80F8294D02FB00263BE5 /* Debug */ = {
396
+			isa = XCBuildConfiguration;
397
+			buildSettings = {
398
+				BUNDLE_LOADER = "$(TEST_HOST)";
399
+				CURRENT_PROJECT_VERSION = 1;
400
+				GENERATE_INFOPLIST_FILE = YES;
401
+				MARKETING_VERSION = 1.0;
402
+				PRODUCT_BUNDLE_IDENTIFIER = id.kalanusa.flutterZsdkExample.RunnerTests;
403
+				PRODUCT_NAME = "$(TARGET_NAME)";
404
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
405
+			};
406
+			name = Debug;
407
+		};
408
+		331C80F9294D02FB00263BE5 /* Release */ = {
409
+			isa = XCBuildConfiguration;
410
+			buildSettings = {
411
+				BUNDLE_LOADER = "$(TEST_HOST)";
412
+				CURRENT_PROJECT_VERSION = 1;
413
+				GENERATE_INFOPLIST_FILE = YES;
414
+				MARKETING_VERSION = 1.0;
415
+				PRODUCT_BUNDLE_IDENTIFIER = id.kalanusa.flutterZsdkExample.RunnerTests;
416
+				PRODUCT_NAME = "$(TARGET_NAME)";
417
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
418
+			};
419
+			name = Release;
420
+		};
421
+		331C80FA294D02FB00263BE5 /* Profile */ = {
422
+			isa = XCBuildConfiguration;
423
+			buildSettings = {
424
+				BUNDLE_LOADER = "$(TEST_HOST)";
425
+				CURRENT_PROJECT_VERSION = 1;
426
+				GENERATE_INFOPLIST_FILE = YES;
427
+				MARKETING_VERSION = 1.0;
428
+				PRODUCT_BUNDLE_IDENTIFIER = id.kalanusa.flutterZsdkExample.RunnerTests;
429
+				PRODUCT_NAME = "$(TARGET_NAME)";
430
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
431
+			};
432
+			name = Profile;
433
+		};
434
+		97C147031CF9000F007C117D /* Debug */ = {
435
+			isa = XCBuildConfiguration;
436
+			buildSettings = {
437
+				ALWAYS_SEARCH_USER_PATHS = NO;
438
+				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
439
+				CLANG_ANALYZER_NONNULL = YES;
440
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
441
+				CLANG_CXX_LIBRARY = "libc++";
442
+				CLANG_ENABLE_MODULES = YES;
443
+				CLANG_ENABLE_OBJC_ARC = YES;
444
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
445
+				CLANG_WARN_BOOL_CONVERSION = YES;
446
+				CLANG_WARN_COMMA = YES;
447
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
448
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
449
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
450
+				CLANG_WARN_EMPTY_BODY = YES;
451
+				CLANG_WARN_ENUM_CONVERSION = YES;
452
+				CLANG_WARN_INFINITE_RECURSION = YES;
453
+				CLANG_WARN_INT_CONVERSION = YES;
454
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
455
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
456
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
457
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
458
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
459
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
460
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
461
+				CLANG_WARN_UNREACHABLE_CODE = YES;
462
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
463
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
464
+				COPY_PHASE_STRIP = NO;
465
+				DEBUG_INFORMATION_FORMAT = dwarf;
466
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
467
+				ENABLE_TESTABILITY = YES;
468
+				ENABLE_USER_SCRIPT_SANDBOXING = NO;
469
+				GCC_C_LANGUAGE_STANDARD = gnu99;
470
+				GCC_DYNAMIC_NO_PIC = NO;
471
+				GCC_NO_COMMON_BLOCKS = YES;
472
+				GCC_OPTIMIZATION_LEVEL = 0;
473
+				GCC_PREPROCESSOR_DEFINITIONS = (
474
+					"DEBUG=1",
475
+					"$(inherited)",
476
+				);
477
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
478
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
479
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
480
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
481
+				GCC_WARN_UNUSED_FUNCTION = YES;
482
+				GCC_WARN_UNUSED_VARIABLE = YES;
483
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
484
+				MTL_ENABLE_DEBUG_INFO = YES;
485
+				ONLY_ACTIVE_ARCH = YES;
486
+				SDKROOT = iphoneos;
487
+				TARGETED_DEVICE_FAMILY = "1,2";
488
+			};
489
+			name = Debug;
490
+		};
491
+		97C147041CF9000F007C117D /* Release */ = {
492
+			isa = XCBuildConfiguration;
493
+			buildSettings = {
494
+				ALWAYS_SEARCH_USER_PATHS = NO;
495
+				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
496
+				CLANG_ANALYZER_NONNULL = YES;
497
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
498
+				CLANG_CXX_LIBRARY = "libc++";
499
+				CLANG_ENABLE_MODULES = YES;
500
+				CLANG_ENABLE_OBJC_ARC = YES;
501
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
502
+				CLANG_WARN_BOOL_CONVERSION = YES;
503
+				CLANG_WARN_COMMA = YES;
504
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
505
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
506
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
507
+				CLANG_WARN_EMPTY_BODY = YES;
508
+				CLANG_WARN_ENUM_CONVERSION = YES;
509
+				CLANG_WARN_INFINITE_RECURSION = YES;
510
+				CLANG_WARN_INT_CONVERSION = YES;
511
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
512
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
513
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
514
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
515
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
516
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
517
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
518
+				CLANG_WARN_UNREACHABLE_CODE = YES;
519
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
520
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
521
+				COPY_PHASE_STRIP = NO;
522
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
523
+				ENABLE_NS_ASSERTIONS = NO;
524
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
525
+				ENABLE_USER_SCRIPT_SANDBOXING = NO;
526
+				GCC_C_LANGUAGE_STANDARD = gnu99;
527
+				GCC_NO_COMMON_BLOCKS = YES;
528
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
529
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
530
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
531
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
532
+				GCC_WARN_UNUSED_FUNCTION = YES;
533
+				GCC_WARN_UNUSED_VARIABLE = YES;
534
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
535
+				MTL_ENABLE_DEBUG_INFO = NO;
536
+				SDKROOT = iphoneos;
537
+				SUPPORTED_PLATFORMS = iphoneos;
538
+				TARGETED_DEVICE_FAMILY = "1,2";
539
+				VALIDATE_PRODUCT = YES;
540
+			};
541
+			name = Release;
542
+		};
543
+		97C147061CF9000F007C117D /* Debug */ = {
544
+			isa = XCBuildConfiguration;
545
+			baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
546
+			buildSettings = {
547
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
548
+				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
549
+				ENABLE_BITCODE = NO;
550
+				INFOPLIST_FILE = Runner/Info.plist;
551
+				LD_RUNPATH_SEARCH_PATHS = (
552
+					"$(inherited)",
553
+					"@executable_path/Frameworks",
554
+				);
555
+				PRODUCT_BUNDLE_IDENTIFIER = id.kalanusa.flutterZsdkExample;
556
+				PRODUCT_NAME = "$(TARGET_NAME)";
557
+				VERSIONING_SYSTEM = "apple-generic";
558
+			};
559
+			name = Debug;
560
+		};
561
+		97C147071CF9000F007C117D /* Release */ = {
562
+			isa = XCBuildConfiguration;
563
+			baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
564
+			buildSettings = {
565
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
566
+				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
567
+				ENABLE_BITCODE = NO;
568
+				INFOPLIST_FILE = Runner/Info.plist;
569
+				LD_RUNPATH_SEARCH_PATHS = (
570
+					"$(inherited)",
571
+					"@executable_path/Frameworks",
572
+				);
573
+				PRODUCT_BUNDLE_IDENTIFIER = id.kalanusa.flutterZsdkExample;
574
+				PRODUCT_NAME = "$(TARGET_NAME)";
575
+				VERSIONING_SYSTEM = "apple-generic";
576
+			};
577
+			name = Release;
578
+		};
579
+/* End XCBuildConfiguration section */
580
+
581
+/* Begin XCConfigurationList section */
582
+		331C80F7294D02FB00263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
583
+			isa = XCConfigurationList;
584
+			buildConfigurations = (
585
+				331C80F8294D02FB00263BE5 /* Debug */,
586
+				331C80F9294D02FB00263BE5 /* Release */,
587
+				331C80FA294D02FB00263BE5 /* Profile */,
588
+			);
589
+			defaultConfigurationIsVisible = 0;
590
+			defaultConfigurationName = Release;
591
+		};
592
+		97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
593
+			isa = XCConfigurationList;
594
+			buildConfigurations = (
595
+				97C147031CF9000F007C117D /* Debug */,
596
+				97C147041CF9000F007C117D /* Release */,
597
+				249021D3217E4FDB00AE95B9 /* Profile */,
598
+			);
599
+			defaultConfigurationIsVisible = 0;
600
+			defaultConfigurationName = Release;
601
+		};
602
+		97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
603
+			isa = XCConfigurationList;
604
+			buildConfigurations = (
605
+				97C147061CF9000F007C117D /* Debug */,
606
+				97C147071CF9000F007C117D /* Release */,
607
+				249021D4217E4FDB00AE95B9 /* Profile */,
608
+			);
609
+			defaultConfigurationIsVisible = 0;
610
+			defaultConfigurationName = Release;
611
+		};
612
+/* End XCConfigurationList section */
613
+	};
614
+	rootObject = 97C146E61CF9000F007C117D /* Project object */;
615
+}

+ 7 - 0
example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

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

+ 8 - 0
example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

@@ -0,0 +1,8 @@
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>IDEDidComputeMac32BitWarning</key>
6
+	<true/>
7
+</dict>
8
+</plist>

+ 8 - 0
example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

@@ -0,0 +1,8 @@
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>PreviewsEnabled</key>
6
+	<false/>
7
+</dict>
8
+</plist>

+ 98 - 0
example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

@@ -0,0 +1,98 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "1510"
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
+      <MacroExpansion>
31
+         <BuildableReference
32
+            BuildableIdentifier = "primary"
33
+            BlueprintIdentifier = "97C146ED1CF9000F007C117D"
34
+            BuildableName = "Runner.app"
35
+            BlueprintName = "Runner"
36
+            ReferencedContainer = "container:Runner.xcodeproj">
37
+         </BuildableReference>
38
+      </MacroExpansion>
39
+      <Testables>
40
+         <TestableReference
41
+            skipped = "NO"
42
+            parallelizable = "YES">
43
+            <BuildableReference
44
+               BuildableIdentifier = "primary"
45
+               BlueprintIdentifier = "331C80F0294D02FB00263BE5"
46
+               BuildableName = "RunnerTests.xctest"
47
+               BlueprintName = "RunnerTests"
48
+               ReferencedContainer = "container:Runner.xcodeproj">
49
+            </BuildableReference>
50
+         </TestableReference>
51
+      </Testables>
52
+   </TestAction>
53
+   <LaunchAction
54
+      buildConfiguration = "Debug"
55
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57
+      launchStyle = "0"
58
+      useCustomWorkingDirectory = "NO"
59
+      ignoresPersistentStateOnLaunch = "NO"
60
+      debugDocumentVersioning = "YES"
61
+      debugServiceExtension = "internal"
62
+      allowLocationSimulation = "YES">
63
+      <BuildableProductRunnable
64
+         runnableDebuggingMode = "0">
65
+         <BuildableReference
66
+            BuildableIdentifier = "primary"
67
+            BlueprintIdentifier = "97C146ED1CF9000F007C117D"
68
+            BuildableName = "Runner.app"
69
+            BlueprintName = "Runner"
70
+            ReferencedContainer = "container:Runner.xcodeproj">
71
+         </BuildableReference>
72
+      </BuildableProductRunnable>
73
+   </LaunchAction>
74
+   <ProfileAction
75
+      buildConfiguration = "Profile"
76
+      shouldUseLaunchSchemeArgsEnv = "YES"
77
+      savedToolIdentifier = ""
78
+      useCustomWorkingDirectory = "NO"
79
+      debugDocumentVersioning = "YES">
80
+      <BuildableProductRunnable
81
+         runnableDebuggingMode = "0">
82
+         <BuildableReference
83
+            BuildableIdentifier = "primary"
84
+            BlueprintIdentifier = "97C146ED1CF9000F007C117D"
85
+            BuildableName = "Runner.app"
86
+            BlueprintName = "Runner"
87
+            ReferencedContainer = "container:Runner.xcodeproj">
88
+         </BuildableReference>
89
+      </BuildableProductRunnable>
90
+   </ProfileAction>
91
+   <AnalyzeAction
92
+      buildConfiguration = "Debug">
93
+   </AnalyzeAction>
94
+   <ArchiveAction
95
+      buildConfiguration = "Release"
96
+      revealArchiveInOrganizer = "YES">
97
+   </ArchiveAction>
98
+</Scheme>

+ 7 - 0
example/ios/Runner.xcworkspace/contents.xcworkspacedata

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

+ 8 - 0
example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

@@ -0,0 +1,8 @@
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>IDEDidComputeMac32BitWarning</key>
6
+	<true/>
7
+</dict>
8
+</plist>

+ 8 - 0
example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

@@ -0,0 +1,8 @@
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>PreviewsEnabled</key>
6
+	<false/>
7
+</dict>
8
+</plist>

+ 6 - 0
example/ios/Runner/AppDelegate.h

@@ -0,0 +1,6 @@
1
+#import <Flutter/Flutter.h>
2
+#import <UIKit/UIKit.h>
3
+
4
+@interface AppDelegate : FlutterAppDelegate
5
+
6
+@end

+ 13 - 0
example/ios/Runner/AppDelegate.m

@@ -0,0 +1,13 @@
1
+#import "AppDelegate.h"
2
+#import "GeneratedPluginRegistrant.h"
3
+
4
+@implementation AppDelegate
5
+
6
+- (BOOL)application:(UIApplication *)application
7
+    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8
+  [GeneratedPluginRegistrant registerWithRegistry:self];
9
+  // Override point for customization after application launch.
10
+  return [super application:application didFinishLaunchingWithOptions:launchOptions];
11
+}
12
+
13
+@end

+ 122 - 0
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -0,0 +1,122 @@
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
+}

BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png


BIN
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png


+ 23 - 0
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json

@@ -0,0 +1,23 @@
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
+}

BIN
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png


BIN
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png


BIN
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png


+ 5 - 0
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md

@@ -0,0 +1,5 @@
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.

+ 37 - 0
example/ios/Runner/Base.lproj/LaunchScreen.storyboard

@@ -0,0 +1,37 @@
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>

+ 26 - 0
example/ios/Runner/Base.lproj/Main.storyboard

@@ -0,0 +1,26 @@
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>

+ 49 - 0
example/ios/Runner/Info.plist

@@ -0,0 +1,49 @@
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>CFBundleDisplayName</key>
8
+	<string>Flutter Zsdk</string>
9
+	<key>CFBundleExecutable</key>
10
+	<string>$(EXECUTABLE_NAME)</string>
11
+	<key>CFBundleIdentifier</key>
12
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+	<key>CFBundleInfoDictionaryVersion</key>
14
+	<string>6.0</string>
15
+	<key>CFBundleName</key>
16
+	<string>flutter_zsdk_example</string>
17
+	<key>CFBundlePackageType</key>
18
+	<string>APPL</string>
19
+	<key>CFBundleShortVersionString</key>
20
+	<string>$(FLUTTER_BUILD_NAME)</string>
21
+	<key>CFBundleSignature</key>
22
+	<string>????</string>
23
+	<key>CFBundleVersion</key>
24
+	<string>$(FLUTTER_BUILD_NUMBER)</string>
25
+	<key>LSRequiresIPhoneOS</key>
26
+	<true/>
27
+	<key>UILaunchStoryboardName</key>
28
+	<string>LaunchScreen</string>
29
+	<key>UIMainStoryboardFile</key>
30
+	<string>Main</string>
31
+	<key>UISupportedInterfaceOrientations</key>
32
+	<array>
33
+		<string>UIInterfaceOrientationPortrait</string>
34
+		<string>UIInterfaceOrientationLandscapeLeft</string>
35
+		<string>UIInterfaceOrientationLandscapeRight</string>
36
+	</array>
37
+	<key>UISupportedInterfaceOrientations~ipad</key>
38
+	<array>
39
+		<string>UIInterfaceOrientationPortrait</string>
40
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
41
+		<string>UIInterfaceOrientationLandscapeLeft</string>
42
+		<string>UIInterfaceOrientationLandscapeRight</string>
43
+	</array>
44
+	<key>CADisableMinimumFrameDurationOnPhone</key>
45
+	<true/>
46
+	<key>UIApplicationSupportsIndirectInputEvents</key>
47
+	<true/>
48
+</dict>
49
+</plist>

+ 9 - 0
example/ios/Runner/main.m

@@ -0,0 +1,9 @@
1
+#import <Flutter/Flutter.h>
2
+#import <UIKit/UIKit.h>
3
+#import "AppDelegate.h"
4
+
5
+int main(int argc, char* argv[]) {
6
+  @autoreleasepool {
7
+    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8
+  }
9
+}

+ 33 - 0
example/ios/RunnerTests/RunnerTests.m

@@ -0,0 +1,33 @@
1
+#import <Flutter/Flutter.h>
2
+#import <UIKit/UIKit.h>
3
+#import <XCTest/XCTest.h>
4
+
5
+@import flutter_zsdk;
6
+
7
+// This demonstrates a simple unit test of the Objective-C portion of this plugin's implementation.
8
+//
9
+// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10
+
11
+@interface RunnerTests : XCTestCase
12
+
13
+@end
14
+
15
+@implementation RunnerTests
16
+
17
+- (void)testExample {
18
+  FlutterZsdkPlugin *plugin = [[FlutterZsdkPlugin alloc] init];
19
+
20
+  FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"getPlatformVersion"
21
+                                                              arguments:nil];
22
+  XCTestExpectation *expectation = [self expectationWithDescription:@"result block must be called"];
23
+  [plugin handleMethodCall:call
24
+                    result:^(id result) {
25
+                      NSString *expected = [NSString
26
+                          stringWithFormat:@"iOS %@", UIDevice.currentDevice.systemVersion];
27
+                      XCTAssertEqualObjects(result, expected);
28
+                      [expectation fulfill];
29
+                    }];
30
+  [self waitForExpectationsWithTimeout:1 handler:nil];
31
+}
32
+
33
+@end

+ 63 - 0
example/lib/main.dart

@@ -0,0 +1,63 @@
1
+import 'package:flutter/material.dart';
2
+import 'dart:async';
3
+
4
+import 'package:flutter/services.dart';
5
+import 'package:flutter_zsdk/flutter_zsdk.dart';
6
+
7
+void main() {
8
+  runApp(const MyApp());
9
+}
10
+
11
+class MyApp extends StatefulWidget {
12
+  const MyApp({super.key});
13
+
14
+  @override
15
+  State<MyApp> createState() => _MyAppState();
16
+}
17
+
18
+class _MyAppState extends State<MyApp> {
19
+  String _platformVersion = 'Unknown';
20
+  final _flutterZsdkPlugin = FlutterZsdk();
21
+
22
+  @override
23
+  void initState() {
24
+    super.initState();
25
+    initPlatformState();
26
+  }
27
+
28
+  // Platform messages are asynchronous, so we initialize in an async method.
29
+  Future<void> initPlatformState() async {
30
+    String platformVersion;
31
+    // Platform messages may fail, so we use a try/catch PlatformException.
32
+    // We also handle the message potentially returning null.
33
+    try {
34
+      platformVersion =
35
+          await _flutterZsdkPlugin.getPlatformVersion() ?? 'Unknown platform version';
36
+    } on PlatformException {
37
+      platformVersion = 'Failed to get platform version.';
38
+    }
39
+
40
+    // If the widget was removed from the tree while the asynchronous platform
41
+    // message was in flight, we want to discard the reply rather than calling
42
+    // setState to update our non-existent appearance.
43
+    if (!mounted) return;
44
+
45
+    setState(() {
46
+      _platformVersion = platformVersion;
47
+    });
48
+  }
49
+
50
+  @override
51
+  Widget build(BuildContext context) {
52
+    return MaterialApp(
53
+      home: Scaffold(
54
+        appBar: AppBar(
55
+          title: const Text('Plugin example app'),
56
+        ),
57
+        body: Center(
58
+          child: Text('Running on: $_platformVersion\n'),
59
+        ),
60
+      ),
61
+    );
62
+  }
63
+}

+ 283 - 0
example/pubspec.lock

@@ -0,0 +1,283 @@
1
+# Generated by pub
2
+# See https://dart.dev/tools/pub/glossary#lockfile
3
+packages:
4
+  async:
5
+    dependency: transitive
6
+    description:
7
+      name: async
8
+      sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
9
+      url: "https://pub.dev"
10
+    source: hosted
11
+    version: "2.11.0"
12
+  boolean_selector:
13
+    dependency: transitive
14
+    description:
15
+      name: boolean_selector
16
+      sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17
+      url: "https://pub.dev"
18
+    source: hosted
19
+    version: "2.1.1"
20
+  characters:
21
+    dependency: transitive
22
+    description:
23
+      name: characters
24
+      sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
25
+      url: "https://pub.dev"
26
+    source: hosted
27
+    version: "1.3.0"
28
+  clock:
29
+    dependency: transitive
30
+    description:
31
+      name: clock
32
+      sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33
+      url: "https://pub.dev"
34
+    source: hosted
35
+    version: "1.1.1"
36
+  collection:
37
+    dependency: transitive
38
+    description:
39
+      name: collection
40
+      sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
41
+      url: "https://pub.dev"
42
+    source: hosted
43
+    version: "1.18.0"
44
+  cupertino_icons:
45
+    dependency: "direct main"
46
+    description:
47
+      name: cupertino_icons
48
+      sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
49
+      url: "https://pub.dev"
50
+    source: hosted
51
+    version: "1.0.8"
52
+  fake_async:
53
+    dependency: transitive
54
+    description:
55
+      name: fake_async
56
+      sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
57
+      url: "https://pub.dev"
58
+    source: hosted
59
+    version: "1.3.1"
60
+  file:
61
+    dependency: transitive
62
+    description:
63
+      name: file
64
+      sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
65
+      url: "https://pub.dev"
66
+    source: hosted
67
+    version: "7.0.0"
68
+  flutter:
69
+    dependency: "direct main"
70
+    description: flutter
71
+    source: sdk
72
+    version: "0.0.0"
73
+  flutter_driver:
74
+    dependency: transitive
75
+    description: flutter
76
+    source: sdk
77
+    version: "0.0.0"
78
+  flutter_lints:
79
+    dependency: "direct dev"
80
+    description:
81
+      name: flutter_lints
82
+      sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
83
+      url: "https://pub.dev"
84
+    source: hosted
85
+    version: "3.0.2"
86
+  flutter_test:
87
+    dependency: "direct dev"
88
+    description: flutter
89
+    source: sdk
90
+    version: "0.0.0"
91
+  flutter_zsdk:
92
+    dependency: "direct main"
93
+    description:
94
+      path: ".."
95
+      relative: true
96
+    source: path
97
+    version: "0.0.1"
98
+  fuchsia_remote_debug_protocol:
99
+    dependency: transitive
100
+    description: flutter
101
+    source: sdk
102
+    version: "0.0.0"
103
+  integration_test:
104
+    dependency: "direct dev"
105
+    description: flutter
106
+    source: sdk
107
+    version: "0.0.0"
108
+  leak_tracker:
109
+    dependency: transitive
110
+    description:
111
+      name: leak_tracker
112
+      sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
113
+      url: "https://pub.dev"
114
+    source: hosted
115
+    version: "10.0.0"
116
+  leak_tracker_flutter_testing:
117
+    dependency: transitive
118
+    description:
119
+      name: leak_tracker_flutter_testing
120
+      sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
121
+      url: "https://pub.dev"
122
+    source: hosted
123
+    version: "2.0.1"
124
+  leak_tracker_testing:
125
+    dependency: transitive
126
+    description:
127
+      name: leak_tracker_testing
128
+      sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
129
+      url: "https://pub.dev"
130
+    source: hosted
131
+    version: "2.0.1"
132
+  lints:
133
+    dependency: transitive
134
+    description:
135
+      name: lints
136
+      sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
137
+      url: "https://pub.dev"
138
+    source: hosted
139
+    version: "3.0.0"
140
+  matcher:
141
+    dependency: transitive
142
+    description:
143
+      name: matcher
144
+      sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
145
+      url: "https://pub.dev"
146
+    source: hosted
147
+    version: "0.12.16+1"
148
+  material_color_utilities:
149
+    dependency: transitive
150
+    description:
151
+      name: material_color_utilities
152
+      sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
153
+      url: "https://pub.dev"
154
+    source: hosted
155
+    version: "0.8.0"
156
+  meta:
157
+    dependency: transitive
158
+    description:
159
+      name: meta
160
+      sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
161
+      url: "https://pub.dev"
162
+    source: hosted
163
+    version: "1.11.0"
164
+  path:
165
+    dependency: transitive
166
+    description:
167
+      name: path
168
+      sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
169
+      url: "https://pub.dev"
170
+    source: hosted
171
+    version: "1.9.0"
172
+  platform:
173
+    dependency: transitive
174
+    description:
175
+      name: platform
176
+      sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
177
+      url: "https://pub.dev"
178
+    source: hosted
179
+    version: "3.1.4"
180
+  plugin_platform_interface:
181
+    dependency: transitive
182
+    description:
183
+      name: plugin_platform_interface
184
+      sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
185
+      url: "https://pub.dev"
186
+    source: hosted
187
+    version: "2.1.8"
188
+  process:
189
+    dependency: transitive
190
+    description:
191
+      name: process
192
+      sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32"
193
+      url: "https://pub.dev"
194
+    source: hosted
195
+    version: "5.0.2"
196
+  sky_engine:
197
+    dependency: transitive
198
+    description: flutter
199
+    source: sdk
200
+    version: "0.0.99"
201
+  source_span:
202
+    dependency: transitive
203
+    description:
204
+      name: source_span
205
+      sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
206
+      url: "https://pub.dev"
207
+    source: hosted
208
+    version: "1.10.0"
209
+  stack_trace:
210
+    dependency: transitive
211
+    description:
212
+      name: stack_trace
213
+      sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
214
+      url: "https://pub.dev"
215
+    source: hosted
216
+    version: "1.11.1"
217
+  stream_channel:
218
+    dependency: transitive
219
+    description:
220
+      name: stream_channel
221
+      sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
222
+      url: "https://pub.dev"
223
+    source: hosted
224
+    version: "2.1.2"
225
+  string_scanner:
226
+    dependency: transitive
227
+    description:
228
+      name: string_scanner
229
+      sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
230
+      url: "https://pub.dev"
231
+    source: hosted
232
+    version: "1.2.0"
233
+  sync_http:
234
+    dependency: transitive
235
+    description:
236
+      name: sync_http
237
+      sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961"
238
+      url: "https://pub.dev"
239
+    source: hosted
240
+    version: "0.3.1"
241
+  term_glyph:
242
+    dependency: transitive
243
+    description:
244
+      name: term_glyph
245
+      sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
246
+      url: "https://pub.dev"
247
+    source: hosted
248
+    version: "1.2.1"
249
+  test_api:
250
+    dependency: transitive
251
+    description:
252
+      name: test_api
253
+      sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
254
+      url: "https://pub.dev"
255
+    source: hosted
256
+    version: "0.6.1"
257
+  vector_math:
258
+    dependency: transitive
259
+    description:
260
+      name: vector_math
261
+      sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
262
+      url: "https://pub.dev"
263
+    source: hosted
264
+    version: "2.1.4"
265
+  vm_service:
266
+    dependency: transitive
267
+    description:
268
+      name: vm_service
269
+      sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
270
+      url: "https://pub.dev"
271
+    source: hosted
272
+    version: "13.0.0"
273
+  webdriver:
274
+    dependency: transitive
275
+    description:
276
+      name: webdriver
277
+      sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e"
278
+      url: "https://pub.dev"
279
+    source: hosted
280
+    version: "3.0.3"
281
+sdks:
282
+  dart: ">=3.3.1 <4.0.0"
283
+  flutter: ">=3.3.0"

+ 85 - 0
example/pubspec.yaml

@@ -0,0 +1,85 @@
1
+name: flutter_zsdk_example
2
+description: "Demonstrates how to use the flutter_zsdk plugin."
3
+# The following line prevents the package from being accidentally published to
4
+# pub.dev using `flutter pub publish`. This is preferred for private packages.
5
+publish_to: 'none' # Remove this line if you wish to publish to pub.dev
6
+
7
+environment:
8
+  sdk: '>=3.3.1 <4.0.0'
9
+
10
+# Dependencies specify other packages that your package needs in order to work.
11
+# To automatically upgrade your package dependencies to the latest versions
12
+# consider running `flutter pub upgrade --major-versions`. Alternatively,
13
+# dependencies can be manually updated by changing the version numbers below to
14
+# the latest version available on pub.dev. To see which dependencies have newer
15
+# versions available, run `flutter pub outdated`.
16
+dependencies:
17
+  flutter:
18
+    sdk: flutter
19
+
20
+  flutter_zsdk:
21
+    # When depending on this package from a real application you should use:
22
+    #   flutter_zsdk: ^x.y.z
23
+    # See https://dart.dev/tools/pub/dependencies#version-constraints
24
+    # The example app is bundled with the plugin so we use a path dependency on
25
+    # the parent directory to use the current plugin's version.
26
+    path: ../
27
+
28
+  # The following adds the Cupertino Icons font to your application.
29
+  # Use with the CupertinoIcons class for iOS style icons.
30
+  cupertino_icons: ^1.0.6
31
+
32
+dev_dependencies:
33
+  integration_test:
34
+    sdk: flutter
35
+  flutter_test:
36
+    sdk: flutter
37
+
38
+  # The "flutter_lints" package below contains a set of recommended lints to
39
+  # encourage good coding practices. The lint set provided by the package is
40
+  # activated in the `analysis_options.yaml` file located at the root of your
41
+  # package. See that file for information about deactivating specific lint
42
+  # rules and activating additional ones.
43
+  flutter_lints: ^3.0.0
44
+
45
+# For information on the generic Dart part of this file, see the
46
+# following page: https://dart.dev/tools/pub/pubspec
47
+
48
+# The following section is specific to Flutter packages.
49
+flutter:
50
+
51
+  # The following line ensures that the Material Icons font is
52
+  # included with your application, so that you can use the icons in
53
+  # the material Icons class.
54
+  uses-material-design: true
55
+
56
+  # To add assets to your application, add an assets section, like this:
57
+  # assets:
58
+  #   - images/a_dot_burr.jpeg
59
+  #   - images/a_dot_ham.jpeg
60
+
61
+  # An image asset can refer to one or more resolution-specific "variants", see
62
+  # https://flutter.dev/assets-and-images/#resolution-aware
63
+
64
+  # For details regarding adding assets from package dependencies, see
65
+  # https://flutter.dev/assets-and-images/#from-packages
66
+
67
+  # To add custom fonts to your application, add a fonts section here,
68
+  # in this "flutter" section. Each entry in this list should have a
69
+  # "family" key with the font family name, and a "fonts" key with a
70
+  # list giving the asset and other descriptors for the font. For
71
+  # example:
72
+  # fonts:
73
+  #   - family: Schyler
74
+  #     fonts:
75
+  #       - asset: fonts/Schyler-Regular.ttf
76
+  #       - asset: fonts/Schyler-Italic.ttf
77
+  #         style: italic
78
+  #   - family: Trajan Pro
79
+  #     fonts:
80
+  #       - asset: fonts/TrajanPro.ttf
81
+  #       - asset: fonts/TrajanPro_Bold.ttf
82
+  #         weight: 700
83
+  #
84
+  # For details regarding fonts from package dependencies,
85
+  # see https://flutter.dev/custom-fonts/#from-packages

+ 27 - 0
example/test/widget_test.dart

@@ -0,0 +1,27 @@
1
+// This is a basic Flutter widget test.
2
+//
3
+// To perform an interaction with a widget in your test, use the WidgetTester
4
+// utility in the flutter_test package. For example, you can send tap and scroll
5
+// gestures. You can also use WidgetTester to find child widgets in the widget
6
+// tree, read text, and verify that the values of widget properties are correct.
7
+
8
+import 'package:flutter/material.dart';
9
+import 'package:flutter_test/flutter_test.dart';
10
+
11
+import 'package:flutter_zsdk_example/main.dart';
12
+
13
+void main() {
14
+  testWidgets('Verify Platform version', (WidgetTester tester) async {
15
+    // Build our app and trigger a frame.
16
+    await tester.pumpWidget(const MyApp());
17
+
18
+    // Verify that platform version is retrieved.
19
+    expect(
20
+      find.byWidgetPredicate(
21
+        (Widget widget) => widget is Text &&
22
+                           widget.data!.startsWith('Running on:'),
23
+      ),
24
+      findsOneWidget,
25
+    );
26
+  });
27
+}

+ 17 - 0
example/windows/.gitignore

@@ -0,0 +1,17 @@
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/

+ 110 - 0
example/windows/CMakeLists.txt

@@ -0,0 +1,110 @@
1
+# Project-level configuration.
2
+cmake_minimum_required(VERSION 3.14)
3
+project(flutter_zsdk_example LANGUAGES CXX)
4
+
5
+# The name of the executable created for the application. Change this to change
6
+# the on-disk name of your application.
7
+set(BINARY_NAME "flutter_zsdk_example")
8
+
9
+# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10
+# versions of CMake.
11
+cmake_policy(VERSION 3.14...3.25)
12
+
13
+# Define build configuration option.
14
+get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
15
+if(IS_MULTICONFIG)
16
+  set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
17
+    CACHE STRING "" FORCE)
18
+else()
19
+  if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
20
+    set(CMAKE_BUILD_TYPE "Debug" CACHE
21
+      STRING "Flutter build mode" FORCE)
22
+    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
23
+      "Debug" "Profile" "Release")
24
+  endif()
25
+endif()
26
+# Define settings for the Profile build mode.
27
+set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
28
+set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
29
+set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
30
+set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
31
+
32
+# Use Unicode for all projects.
33
+add_definitions(-DUNICODE -D_UNICODE)
34
+
35
+# Compilation settings that should be applied to most targets.
36
+#
37
+# Be cautious about adding new options here, as plugins use this function by
38
+# default. In most cases, you should add new options to specific targets instead
39
+# of modifying this function.
40
+function(APPLY_STANDARD_SETTINGS TARGET)
41
+  target_compile_features(${TARGET} PUBLIC cxx_std_17)
42
+  target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
43
+  target_compile_options(${TARGET} PRIVATE /EHsc)
44
+  target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
45
+  target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
46
+endfunction()
47
+
48
+# Flutter library and tool build rules.
49
+set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
50
+add_subdirectory(${FLUTTER_MANAGED_DIR})
51
+
52
+# Application build; see runner/CMakeLists.txt.
53
+add_subdirectory("runner")
54
+
55
+# Enable the test target.
56
+set(include_flutter_zsdk_tests TRUE)
57
+
58
+# Generated plugin build rules, which manage building the plugins and adding
59
+# them to the application.
60
+include(flutter/generated_plugins.cmake)
61
+
62
+
63
+# === Installation ===
64
+# Support files are copied into place next to the executable, so that it can
65
+# run in place. This is done instead of making a separate bundle (as on Linux)
66
+# so that building and running from within Visual Studio will work.
67
+set(BUILD_BUNDLE_DIR "$<TARGET_FILE_DIR:${BINARY_NAME}>")
68
+# Make the "install" step default, as it's required to run.
69
+set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
70
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
71
+  set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
72
+endif()
73
+
74
+set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
75
+set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
76
+
77
+install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
78
+  COMPONENT Runtime)
79
+
80
+install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
81
+  COMPONENT Runtime)
82
+
83
+install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
84
+  COMPONENT Runtime)
85
+
86
+if(PLUGIN_BUNDLED_LIBRARIES)
87
+  install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
88
+    DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
89
+    COMPONENT Runtime)
90
+endif()
91
+
92
+# Copy the native assets provided by the build.dart from all packages.
93
+set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")
94
+install(DIRECTORY "${NATIVE_ASSETS_DIR}"
95
+   DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
96
+   COMPONENT Runtime)
97
+
98
+# Fully re-copy the assets directory on each build to avoid having stale files
99
+# from a previous install.
100
+set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
101
+install(CODE "
102
+  file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
103
+  " COMPONENT Runtime)
104
+install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
105
+  DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
106
+
107
+# Install the AOT library on non-Debug builds only.
108
+install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
109
+  CONFIGURATIONS Profile;Release
110
+  COMPONENT Runtime)

+ 109 - 0
example/windows/flutter/CMakeLists.txt

@@ -0,0 +1,109 @@
1
+# This file controls Flutter-level build steps. It should not be edited.
2
+cmake_minimum_required(VERSION 3.14)
3
+
4
+set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5
+
6
+# Configuration provided via flutter tool.
7
+include(${EPHEMERAL_DIR}/generated_config.cmake)
8
+
9
+# TODO: Move the rest of this into files in ephemeral. See
10
+# https://github.com/flutter/flutter/issues/57146.
11
+set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
12
+
13
+# Set fallback configurations for older versions of the flutter tool.
14
+if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
15
+  set(FLUTTER_TARGET_PLATFORM "windows-x64")
16
+endif()
17
+
18
+# === Flutter Library ===
19
+set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
20
+
21
+# Published to parent scope for install step.
22
+set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
23
+set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
24
+set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
25
+set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
26
+
27
+list(APPEND FLUTTER_LIBRARY_HEADERS
28
+  "flutter_export.h"
29
+  "flutter_windows.h"
30
+  "flutter_messenger.h"
31
+  "flutter_plugin_registrar.h"
32
+  "flutter_texture_registrar.h"
33
+)
34
+list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
35
+add_library(flutter INTERFACE)
36
+target_include_directories(flutter INTERFACE
37
+  "${EPHEMERAL_DIR}"
38
+)
39
+target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
40
+add_dependencies(flutter flutter_assemble)
41
+
42
+# === Wrapper ===
43
+list(APPEND CPP_WRAPPER_SOURCES_CORE
44
+  "core_implementations.cc"
45
+  "standard_codec.cc"
46
+)
47
+list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
48
+list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
49
+  "plugin_registrar.cc"
50
+)
51
+list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
52
+list(APPEND CPP_WRAPPER_SOURCES_APP
53
+  "flutter_engine.cc"
54
+  "flutter_view_controller.cc"
55
+)
56
+list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
57
+
58
+# Wrapper sources needed for a plugin.
59
+add_library(flutter_wrapper_plugin STATIC
60
+  ${CPP_WRAPPER_SOURCES_CORE}
61
+  ${CPP_WRAPPER_SOURCES_PLUGIN}
62
+)
63
+apply_standard_settings(flutter_wrapper_plugin)
64
+set_target_properties(flutter_wrapper_plugin PROPERTIES
65
+  POSITION_INDEPENDENT_CODE ON)
66
+set_target_properties(flutter_wrapper_plugin PROPERTIES
67
+  CXX_VISIBILITY_PRESET hidden)
68
+target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
69
+target_include_directories(flutter_wrapper_plugin PUBLIC
70
+  "${WRAPPER_ROOT}/include"
71
+)
72
+add_dependencies(flutter_wrapper_plugin flutter_assemble)
73
+
74
+# Wrapper sources needed for the runner.
75
+add_library(flutter_wrapper_app STATIC
76
+  ${CPP_WRAPPER_SOURCES_CORE}
77
+  ${CPP_WRAPPER_SOURCES_APP}
78
+)
79
+apply_standard_settings(flutter_wrapper_app)
80
+target_link_libraries(flutter_wrapper_app PUBLIC flutter)
81
+target_include_directories(flutter_wrapper_app PUBLIC
82
+  "${WRAPPER_ROOT}/include"
83
+)
84
+add_dependencies(flutter_wrapper_app flutter_assemble)
85
+
86
+# === Flutter tool backend ===
87
+# _phony_ is a non-existent file to force this command to run every time,
88
+# since currently there's no way to get a full input/output list from the
89
+# flutter tool.
90
+set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
91
+set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
92
+add_custom_command(
93
+  OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
94
+    ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
95
+    ${CPP_WRAPPER_SOURCES_APP}
96
+    ${PHONY_OUTPUT}
97
+  COMMAND ${CMAKE_COMMAND} -E env
98
+    ${FLUTTER_TOOL_ENVIRONMENT}
99
+    "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
100
+      ${FLUTTER_TARGET_PLATFORM} $<CONFIG>
101
+  VERBATIM
102
+)
103
+add_custom_target(flutter_assemble DEPENDS
104
+  "${FLUTTER_LIBRARY}"
105
+  ${FLUTTER_LIBRARY_HEADERS}
106
+  ${CPP_WRAPPER_SOURCES_CORE}
107
+  ${CPP_WRAPPER_SOURCES_PLUGIN}
108
+  ${CPP_WRAPPER_SOURCES_APP}
109
+)

+ 14 - 0
example/windows/flutter/generated_plugin_registrant.cc

@@ -0,0 +1,14 @@
1
+//
2
+//  Generated file. Do not edit.
3
+//
4
+
5
+// clang-format off
6
+
7
+#include "generated_plugin_registrant.h"
8
+
9
+#include <flutter_zsdk/flutter_zsdk_plugin_c_api.h>
10
+
11
+void RegisterPlugins(flutter::PluginRegistry* registry) {
12
+  FlutterZsdkPluginCApiRegisterWithRegistrar(
13
+      registry->GetRegistrarForPlugin("FlutterZsdkPluginCApi"));
14
+}

+ 15 - 0
example/windows/flutter/generated_plugin_registrant.h

@@ -0,0 +1,15 @@
1
+//
2
+//  Generated file. Do not edit.
3
+//
4
+
5
+// clang-format off
6
+
7
+#ifndef GENERATED_PLUGIN_REGISTRANT_
8
+#define GENERATED_PLUGIN_REGISTRANT_
9
+
10
+#include <flutter/plugin_registry.h>
11
+
12
+// Registers Flutter plugins.
13
+void RegisterPlugins(flutter::PluginRegistry* registry);
14
+
15
+#endif  // GENERATED_PLUGIN_REGISTRANT_

+ 24 - 0
example/windows/flutter/generated_plugins.cmake

@@ -0,0 +1,24 @@
1
+#
2
+# Generated file, do not edit.
3
+#
4
+
5
+list(APPEND FLUTTER_PLUGIN_LIST
6
+  flutter_zsdk
7
+)
8
+
9
+list(APPEND FLUTTER_FFI_PLUGIN_LIST
10
+)
11
+
12
+set(PLUGIN_BUNDLED_LIBRARIES)
13
+
14
+foreach(plugin ${FLUTTER_PLUGIN_LIST})
15
+  add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
16
+  target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17
+  list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
18
+  list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19
+endforeach(plugin)
20
+
21
+foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22
+  add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23
+  list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24
+endforeach(ffi_plugin)

+ 40 - 0
example/windows/runner/CMakeLists.txt

@@ -0,0 +1,40 @@
1
+cmake_minimum_required(VERSION 3.14)
2
+project(runner LANGUAGES CXX)
3
+
4
+# Define the application target. To change its name, change BINARY_NAME in the
5
+# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6
+# work.
7
+#
8
+# Any new source files that you add to the application should be added here.
9
+add_executable(${BINARY_NAME} WIN32
10
+  "flutter_window.cpp"
11
+  "main.cpp"
12
+  "utils.cpp"
13
+  "win32_window.cpp"
14
+  "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15
+  "Runner.rc"
16
+  "runner.exe.manifest"
17
+)
18
+
19
+# Apply the standard set of build settings. This can be removed for applications
20
+# that need different build settings.
21
+apply_standard_settings(${BINARY_NAME})
22
+
23
+# Add preprocessor definitions for the build version.
24
+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25
+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26
+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27
+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28
+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29
+
30
+# Disable Windows macros that collide with C++ standard library functions.
31
+target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32
+
33
+# Add dependency libraries and include directories. Add any application-specific
34
+# dependencies here.
35
+target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36
+target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
37
+target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38
+
39
+# Run the Flutter tool portions of the build. This must not be removed.
40
+add_dependencies(${BINARY_NAME} flutter_assemble)

+ 121 - 0
example/windows/runner/Runner.rc

@@ -0,0 +1,121 @@
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
+#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
64
+#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
65
+#else
66
+#define VERSION_AS_NUMBER 1,0,0,0
67
+#endif
68
+
69
+#if defined(FLUTTER_VERSION)
70
+#define VERSION_AS_STRING FLUTTER_VERSION
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", "id.kalanusa" "\0"
93
+            VALUE "FileDescription", "flutter_zsdk_example" "\0"
94
+            VALUE "FileVersion", VERSION_AS_STRING "\0"
95
+            VALUE "InternalName", "flutter_zsdk_example" "\0"
96
+            VALUE "LegalCopyright", "Copyright (C) 2024 id.kalanusa. All rights reserved." "\0"
97
+            VALUE "OriginalFilename", "flutter_zsdk_example.exe" "\0"
98
+            VALUE "ProductName", "flutter_zsdk_example" "\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

+ 71 - 0
example/windows/runner/flutter_window.cpp

@@ -0,0 +1,71 @@
1
+#include "flutter_window.h"
2
+
3
+#include <optional>
4
+
5
+#include "flutter/generated_plugin_registrant.h"
6
+
7
+FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8
+    : project_(project) {}
9
+
10
+FlutterWindow::~FlutterWindow() {}
11
+
12
+bool FlutterWindow::OnCreate() {
13
+  if (!Win32Window::OnCreate()) {
14
+    return false;
15
+  }
16
+
17
+  RECT frame = GetClientArea();
18
+
19
+  // The size here must match the window dimensions to avoid unnecessary surface
20
+  // creation / destruction in the startup path.
21
+  flutter_controller_ = std::make_unique<flutter::FlutterViewController>(
22
+      frame.right - frame.left, frame.bottom - frame.top, project_);
23
+  // Ensure that basic setup of the controller was successful.
24
+  if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25
+    return false;
26
+  }
27
+  RegisterPlugins(flutter_controller_->engine());
28
+  SetChildContent(flutter_controller_->view()->GetNativeWindow());
29
+
30
+  flutter_controller_->engine()->SetNextFrameCallback([&]() {
31
+    this->Show();
32
+  });
33
+
34
+  // Flutter can complete the first frame before the "show window" callback is
35
+  // registered. The following call ensures a frame is pending to ensure the
36
+  // window is shown. It is a no-op if the first frame hasn't completed yet.
37
+  flutter_controller_->ForceRedraw();
38
+
39
+  return true;
40
+}
41
+
42
+void FlutterWindow::OnDestroy() {
43
+  if (flutter_controller_) {
44
+    flutter_controller_ = nullptr;
45
+  }
46
+
47
+  Win32Window::OnDestroy();
48
+}
49
+
50
+LRESULT
51
+FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
52
+                              WPARAM const wparam,
53
+                              LPARAM const lparam) noexcept {
54
+  // Give Flutter, including plugins, an opportunity to handle window messages.
55
+  if (flutter_controller_) {
56
+    std::optional<LRESULT> result =
57
+        flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
58
+                                                      lparam);
59
+    if (result) {
60
+      return *result;
61
+    }
62
+  }
63
+
64
+  switch (message) {
65
+    case WM_FONTCHANGE:
66
+      flutter_controller_->engine()->ReloadSystemFonts();
67
+      break;
68
+  }
69
+
70
+  return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
71
+}

+ 33 - 0
example/windows/runner/flutter_window.h

@@ -0,0 +1,33 @@
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 "win32_window.h"
10
+
11
+// A window that does nothing but host a Flutter view.
12
+class FlutterWindow : public Win32Window {
13
+ public:
14
+  // Creates a new FlutterWindow hosting a Flutter view running |project|.
15
+  explicit FlutterWindow(const flutter::DartProject& project);
16
+  virtual ~FlutterWindow();
17
+
18
+ protected:
19
+  // Win32Window:
20
+  bool OnCreate() override;
21
+  void OnDestroy() override;
22
+  LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23
+                         LPARAM const lparam) noexcept override;
24
+
25
+ private:
26
+  // The project to run.
27
+  flutter::DartProject project_;
28
+
29
+  // The Flutter instance hosted by this window.
30
+  std::unique_ptr<flutter::FlutterViewController> flutter_controller_;
31
+};
32
+
33
+#endif  // RUNNER_FLUTTER_WINDOW_H_

+ 43 - 0
example/windows/runner/main.cpp

@@ -0,0 +1,43 @@
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 "utils.h"
7
+
8
+int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9
+                      _In_ wchar_t *command_line, _In_ int show_command) {
10
+  // Attach to console when present (e.g., 'flutter run') or create a
11
+  // new console when running with a debugger.
12
+  if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13
+    CreateAndAttachConsole();
14
+  }
15
+
16
+  // Initialize COM, so that it is available for use in the library and/or
17
+  // plugins.
18
+  ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19
+
20
+  flutter::DartProject project(L"data");
21
+
22
+  std::vector<std::string> command_line_arguments =
23
+      GetCommandLineArguments();
24
+
25
+  project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26
+
27
+  FlutterWindow window(project);
28
+  Win32Window::Point origin(10, 10);
29
+  Win32Window::Size size(1280, 720);
30
+  if (!window.Create(L"flutter_zsdk_example", origin, size)) {
31
+    return EXIT_FAILURE;
32
+  }
33
+  window.SetQuitOnClose(true);
34
+
35
+  ::MSG msg;
36
+  while (::GetMessage(&msg, nullptr, 0, 0)) {
37
+    ::TranslateMessage(&msg);
38
+    ::DispatchMessage(&msg);
39
+  }
40
+
41
+  ::CoUninitialize();
42
+  return EXIT_SUCCESS;
43
+}

+ 16 - 0
example/windows/runner/resource.h

@@ -0,0 +1,16 @@
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

BIN
example/windows/runner/resources/app_icon.ico


+ 20 - 0
example/windows/runner/runner.exe.manifest

@@ -0,0 +1,20 @@
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 and Windows 11 -->
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>

+ 65 - 0
example/windows/runner/utils.cpp

@@ -0,0 +1,65 @@
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
+    -1; // remove the trailing null character
52
+  int input_length = (int)wcslen(utf16_string);
53
+  std::string utf8_string;
54
+  if (target_length <= 0 || target_length > utf8_string.max_size()) {
55
+    return utf8_string;
56
+  }
57
+  utf8_string.resize(target_length);
58
+  int converted_length = ::WideCharToMultiByte(
59
+      CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
60
+      input_length, utf8_string.data(), target_length, nullptr, nullptr);
61
+  if (converted_length == 0) {
62
+    return std::string();
63
+  }
64
+  return utf8_string;
65
+}

+ 19 - 0
example/windows/runner/utils.h

@@ -0,0 +1,19 @@
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_

+ 288 - 0
example/windows/runner/win32_window.cpp

@@ -0,0 +1,288 @@
1
+#include "win32_window.h"
2
+
3
+#include <dwmapi.h>
4
+#include <flutter_windows.h>
5
+
6
+#include "resource.h"
7
+
8
+namespace {
9
+
10
+/// Window attribute that enables dark mode window decorations.
11
+///
12
+/// Redefined in case the developer's machine has a Windows SDK older than
13
+/// version 10.0.22000.0.
14
+/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute
15
+#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE
16
+#define DWMWA_USE_IMMERSIVE_DARK_MODE 20
17
+#endif
18
+
19
+constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
20
+
21
+/// Registry key for app theme preference.
22
+///
23
+/// A value of 0 indicates apps should use dark mode. A non-zero or missing
24
+/// value indicates apps should use light mode.
25
+constexpr const wchar_t kGetPreferredBrightnessRegKey[] =
26
+  L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";
27
+constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme";
28
+
29
+// The number of Win32Window objects that currently exist.
30
+static int g_active_window_count = 0;
31
+
32
+using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);
33
+
34
+// Scale helper to convert logical scaler values to physical using passed in
35
+// scale factor
36
+int Scale(int source, double scale_factor) {
37
+  return static_cast<int>(source * scale_factor);
38
+}
39
+
40
+// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.
41
+// This API is only needed for PerMonitor V1 awareness mode.
42
+void EnableFullDpiSupportIfAvailable(HWND hwnd) {
43
+  HMODULE user32_module = LoadLibraryA("User32.dll");
44
+  if (!user32_module) {
45
+    return;
46
+  }
47
+  auto enable_non_client_dpi_scaling =
48
+      reinterpret_cast<EnableNonClientDpiScaling*>(
49
+          GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
50
+  if (enable_non_client_dpi_scaling != nullptr) {
51
+    enable_non_client_dpi_scaling(hwnd);
52
+  }
53
+  FreeLibrary(user32_module);
54
+}
55
+
56
+}  // namespace
57
+
58
+// Manages the Win32Window's window class registration.
59
+class WindowClassRegistrar {
60
+ public:
61
+  ~WindowClassRegistrar() = default;
62
+
63
+  // Returns the singleton registrar instance.
64
+  static WindowClassRegistrar* GetInstance() {
65
+    if (!instance_) {
66
+      instance_ = new WindowClassRegistrar();
67
+    }
68
+    return instance_;
69
+  }
70
+
71
+  // Returns the name of the window class, registering the class if it hasn't
72
+  // previously been registered.
73
+  const wchar_t* GetWindowClass();
74
+
75
+  // Unregisters the window class. Should only be called if there are no
76
+  // instances of the window.
77
+  void UnregisterWindowClass();
78
+
79
+ private:
80
+  WindowClassRegistrar() = default;
81
+
82
+  static WindowClassRegistrar* instance_;
83
+
84
+  bool class_registered_ = false;
85
+};
86
+
87
+WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;
88
+
89
+const wchar_t* WindowClassRegistrar::GetWindowClass() {
90
+  if (!class_registered_) {
91
+    WNDCLASS window_class{};
92
+    window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);
93
+    window_class.lpszClassName = kWindowClassName;
94
+    window_class.style = CS_HREDRAW | CS_VREDRAW;
95
+    window_class.cbClsExtra = 0;
96
+    window_class.cbWndExtra = 0;
97
+    window_class.hInstance = GetModuleHandle(nullptr);
98
+    window_class.hIcon =
99
+        LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));
100
+    window_class.hbrBackground = 0;
101
+    window_class.lpszMenuName = nullptr;
102
+    window_class.lpfnWndProc = Win32Window::WndProc;
103
+    RegisterClass(&window_class);
104
+    class_registered_ = true;
105
+  }
106
+  return kWindowClassName;
107
+}
108
+
109
+void WindowClassRegistrar::UnregisterWindowClass() {
110
+  UnregisterClass(kWindowClassName, nullptr);
111
+  class_registered_ = false;
112
+}
113
+
114
+Win32Window::Win32Window() {
115
+  ++g_active_window_count;
116
+}
117
+
118
+Win32Window::~Win32Window() {
119
+  --g_active_window_count;
120
+  Destroy();
121
+}
122
+
123
+bool Win32Window::Create(const std::wstring& title,
124
+                         const Point& origin,
125
+                         const Size& size) {
126
+  Destroy();
127
+
128
+  const wchar_t* window_class =
129
+      WindowClassRegistrar::GetInstance()->GetWindowClass();
130
+
131
+  const POINT target_point = {static_cast<LONG>(origin.x),
132
+                              static_cast<LONG>(origin.y)};
133
+  HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);
134
+  UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
135
+  double scale_factor = dpi / 96.0;
136
+
137
+  HWND window = CreateWindow(
138
+      window_class, title.c_str(), WS_OVERLAPPEDWINDOW,
139
+      Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
140
+      Scale(size.width, scale_factor), Scale(size.height, scale_factor),
141
+      nullptr, nullptr, GetModuleHandle(nullptr), this);
142
+
143
+  if (!window) {
144
+    return false;
145
+  }
146
+
147
+  UpdateTheme(window);
148
+
149
+  return OnCreate();
150
+}
151
+
152
+bool Win32Window::Show() {
153
+  return ShowWindow(window_handle_, SW_SHOWNORMAL);
154
+}
155
+
156
+// static
157
+LRESULT CALLBACK Win32Window::WndProc(HWND const window,
158
+                                      UINT const message,
159
+                                      WPARAM const wparam,
160
+                                      LPARAM const lparam) noexcept {
161
+  if (message == WM_NCCREATE) {
162
+    auto window_struct = reinterpret_cast<CREATESTRUCT*>(lparam);
163
+    SetWindowLongPtr(window, GWLP_USERDATA,
164
+                     reinterpret_cast<LONG_PTR>(window_struct->lpCreateParams));
165
+
166
+    auto that = static_cast<Win32Window*>(window_struct->lpCreateParams);
167
+    EnableFullDpiSupportIfAvailable(window);
168
+    that->window_handle_ = window;
169
+  } else if (Win32Window* that = GetThisFromHandle(window)) {
170
+    return that->MessageHandler(window, message, wparam, lparam);
171
+  }
172
+
173
+  return DefWindowProc(window, message, wparam, lparam);
174
+}
175
+
176
+LRESULT
177
+Win32Window::MessageHandler(HWND hwnd,
178
+                            UINT const message,
179
+                            WPARAM const wparam,
180
+                            LPARAM const lparam) noexcept {
181
+  switch (message) {
182
+    case WM_DESTROY:
183
+      window_handle_ = nullptr;
184
+      Destroy();
185
+      if (quit_on_close_) {
186
+        PostQuitMessage(0);
187
+      }
188
+      return 0;
189
+
190
+    case WM_DPICHANGED: {
191
+      auto newRectSize = reinterpret_cast<RECT*>(lparam);
192
+      LONG newWidth = newRectSize->right - newRectSize->left;
193
+      LONG newHeight = newRectSize->bottom - newRectSize->top;
194
+
195
+      SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,
196
+                   newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
197
+
198
+      return 0;
199
+    }
200
+    case WM_SIZE: {
201
+      RECT rect = GetClientArea();
202
+      if (child_content_ != nullptr) {
203
+        // Size and position the child window.
204
+        MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
205
+                   rect.bottom - rect.top, TRUE);
206
+      }
207
+      return 0;
208
+    }
209
+
210
+    case WM_ACTIVATE:
211
+      if (child_content_ != nullptr) {
212
+        SetFocus(child_content_);
213
+      }
214
+      return 0;
215
+
216
+    case WM_DWMCOLORIZATIONCOLORCHANGED:
217
+      UpdateTheme(hwnd);
218
+      return 0;
219
+  }
220
+
221
+  return DefWindowProc(window_handle_, message, wparam, lparam);
222
+}
223
+
224
+void Win32Window::Destroy() {
225
+  OnDestroy();
226
+
227
+  if (window_handle_) {
228
+    DestroyWindow(window_handle_);
229
+    window_handle_ = nullptr;
230
+  }
231
+  if (g_active_window_count == 0) {
232
+    WindowClassRegistrar::GetInstance()->UnregisterWindowClass();
233
+  }
234
+}
235
+
236
+Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
237
+  return reinterpret_cast<Win32Window*>(
238
+      GetWindowLongPtr(window, GWLP_USERDATA));
239
+}
240
+
241
+void Win32Window::SetChildContent(HWND content) {
242
+  child_content_ = content;
243
+  SetParent(content, window_handle_);
244
+  RECT frame = GetClientArea();
245
+
246
+  MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
247
+             frame.bottom - frame.top, true);
248
+
249
+  SetFocus(child_content_);
250
+}
251
+
252
+RECT Win32Window::GetClientArea() {
253
+  RECT frame;
254
+  GetClientRect(window_handle_, &frame);
255
+  return frame;
256
+}
257
+
258
+HWND Win32Window::GetHandle() {
259
+  return window_handle_;
260
+}
261
+
262
+void Win32Window::SetQuitOnClose(bool quit_on_close) {
263
+  quit_on_close_ = quit_on_close;
264
+}
265
+
266
+bool Win32Window::OnCreate() {
267
+  // No-op; provided for subclasses.
268
+  return true;
269
+}
270
+
271
+void Win32Window::OnDestroy() {
272
+  // No-op; provided for subclasses.
273
+}
274
+
275
+void Win32Window::UpdateTheme(HWND const window) {
276
+  DWORD light_mode;
277
+  DWORD light_mode_size = sizeof(light_mode);
278
+  LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey,
279
+                               kGetPreferredBrightnessRegValue,
280
+                               RRF_RT_REG_DWORD, nullptr, &light_mode,
281
+                               &light_mode_size);
282
+
283
+  if (result == ERROR_SUCCESS) {
284
+    BOOL enable_dark_mode = light_mode == 0;
285
+    DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE,
286
+                          &enable_dark_mode, sizeof(enable_dark_mode));
287
+  }
288
+}

+ 102 - 0
example/windows/runner/win32_window.h

@@ -0,0 +1,102 @@
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 a win32 window with |title| that is positioned and sized 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 this function will scale the inputted width and height as
35
+  // as appropriate for the default monitor. The window is invisible until
36
+  // |Show| is called. Returns true if the window was created successfully.
37
+  bool Create(const std::wstring& title, const Point& origin, const Size& size);
38
+
39
+  // Show the current window. Returns true if the window was successfully shown.
40
+  bool Show();
41
+
42
+  // Release OS resources associated with window.
43
+  void Destroy();
44
+
45
+  // Inserts |content| into the window tree.
46
+  void SetChildContent(HWND content);
47
+
48
+  // Returns the backing Window handle to enable clients to set icon and other
49
+  // window properties. Returns nullptr if the window has been destroyed.
50
+  HWND GetHandle();
51
+
52
+  // If true, closing this window will quit the application.
53
+  void SetQuitOnClose(bool quit_on_close);
54
+
55
+  // Return a RECT representing the bounds of the current client area.
56
+  RECT GetClientArea();
57
+
58
+ protected:
59
+  // Processes and route salient window messages for mouse handling,
60
+  // size change and DPI. Delegates handling of these to member overloads that
61
+  // inheriting classes can handle.
62
+  virtual LRESULT MessageHandler(HWND window,
63
+                                 UINT const message,
64
+                                 WPARAM const wparam,
65
+                                 LPARAM const lparam) noexcept;
66
+
67
+  // Called when CreateAndShow is called, allowing subclass window-related
68
+  // setup. Subclasses should return false if setup fails.
69
+  virtual bool OnCreate();
70
+
71
+  // Called when Destroy is called.
72
+  virtual void OnDestroy();
73
+
74
+ private:
75
+  friend class WindowClassRegistrar;
76
+
77
+  // OS callback called by message pump. Handles the WM_NCCREATE message which
78
+  // is passed when the non-client area is being created and enables automatic
79
+  // non-client DPI scaling so that the non-client area automatically
80
+  // responds to changes in DPI. All other messages are handled by
81
+  // MessageHandler.
82
+  static LRESULT CALLBACK WndProc(HWND const window,
83
+                                  UINT const message,
84
+                                  WPARAM const wparam,
85
+                                  LPARAM const lparam) noexcept;
86
+
87
+  // Retrieves a class instance pointer for |window|
88
+  static Win32Window* GetThisFromHandle(HWND const window) noexcept;
89
+
90
+  // Update the window frame's theme to match the system theme.
91
+  static void UpdateTheme(HWND const window);
92
+
93
+  bool quit_on_close_ = false;
94
+
95
+  // window handle for top level window.
96
+  HWND window_handle_ = nullptr;
97
+
98
+  // window handle for hosted content.
99
+  HWND child_content_ = nullptr;
100
+};
101
+
102
+#endif  // RUNNER_WIN32_WINDOW_H_

+ 38 - 0
ios/.gitignore

@@ -0,0 +1,38 @@
1
+.idea/
2
+.vagrant/
3
+.sconsign.dblite
4
+.svn/
5
+
6
+.DS_Store
7
+*.swp
8
+profile
9
+
10
+DerivedData/
11
+build/
12
+GeneratedPluginRegistrant.h
13
+GeneratedPluginRegistrant.m
14
+
15
+.generated/
16
+
17
+*.pbxuser
18
+*.mode1v3
19
+*.mode2v3
20
+*.perspectivev3
21
+
22
+!default.pbxuser
23
+!default.mode1v3
24
+!default.mode2v3
25
+!default.perspectivev3
26
+
27
+xcuserdata
28
+
29
+*.moved-aside
30
+
31
+*.pyc
32
+*sync/
33
+Icon?
34
+.tags*
35
+
36
+/Flutter/Generated.xcconfig
37
+/Flutter/ephemeral/
38
+/Flutter/flutter_export_environment.sh

+ 0 - 0
ios/Assets/.gitkeep


+ 0 - 0
ios/Classes/FlutterZsdkPlugin.h


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