├── .DS_Store
├── .flutter-plugins
├── .packages
├── README.md
├── dslDemo
└── demo_blog_code.dart
├── example
├── .fhgenerator.json
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── newcoretech
│ │ │ │ │ └── flutter_hot_widget
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── assets
│ └── ast_records_data.json
├── ios
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
├── lib
│ ├── dsl
│ │ └── listview_dsl.dart
│ └── main.dart
├── pubspec.yaml
└── test
│ └── widget_test.dart
├── lib
├── ast_node.dart
├── ast_runtime_class.dart
├── ast_varialble_stack.dart
├── main.dart
└── widget
│ ├── .DS_Store
│ ├── argument_parser
│ ├── argument_circularprogressIndicator_parser.dart
│ ├── argument_comm_parser.dart
│ ├── argument_decoration_parser.dart
│ ├── argument_icon_parser.dart
│ ├── argument_image_parser.dart
│ ├── argument_parser.dart
│ ├── argument_row_column_parser.dart
│ └── argument_text_parser.dart
│ ├── ast_statefulwidget.dart
│ └── widget_builders
│ ├── basebuilder_box.dart
│ ├── basewidget_builder.dart
│ ├── components_builders.dart
│ ├── layout_builders.dart
│ ├── recommand_builder_box.dart
│ ├── widget_builder_factory.dart
│ └── widget_builders.dart
├── pubspec.lock
└── pubspec.yaml
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/.DS_Store
--------------------------------------------------------------------------------
/.flutter-plugins:
--------------------------------------------------------------------------------
1 | connectivity=/Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/connectivity-0.4.6/
2 | flutter_webview_plugin=/Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_webview_plugin-0.3.2/
3 | nc_image_picker=/Users/youngchan/Library/flutter/flutter/.pub-cache/git/ncimagepicker-d167e268d2cb0d59a0141a193e8fbf1bbad0ea67/
4 | ncf_base=/Users/youngchan/Library/flutter/flutter/.pub-cache/git/ncfbase-f86c2a2127a15d73203a64ecce4cc48adc72a03f/
5 | ncf_ui=/Users/youngchan/Library/flutter/flutter/.pub-cache/git/ncfui-fb28d48357eada99f266f96a5c41c246b3a07fc9/
6 | ncfilepicker=/Users/youngchan/Library/flutter/flutter/.pub-cache/git/fileselector-5d09f19240a7d33f2db66ae3ae47d25706eca3e3/
7 | package_info=/Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/package_info-0.4.0+12/
8 | path_provider=/Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider-0.5.0+1/
9 | shared_preferences=/Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.4/
10 | sqflite=/Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/sqflite-1.1.8/
11 |
--------------------------------------------------------------------------------
/.packages:
--------------------------------------------------------------------------------
1 | # Generated by pub on 2020-04-22 18:58:32.035472.
2 | _fe_analyzer_shared:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-1.0.1/lib/
3 | analyzer:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.39.2+1/lib/
4 | args:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0/lib/
5 | async:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.3.0/lib/
6 | boolean_selector:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-1.0.5/lib/
7 | build:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/build-1.2.2/lib/
8 | charcode:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.2/lib/
9 | collection:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.11/lib/
10 | connectivity:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/connectivity-0.4.6/lib/
11 | convert:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1/lib/
12 | crypto:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.1.4/lib/
13 | csslib:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/csslib-0.16.1/lib/
14 | dart_style:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/dart_style-1.3.3/lib/
15 | flutter:file:///Users/youngchan/Library/flutter/flutter/packages/flutter/lib/
16 | flutter_test:file:///Users/youngchan/Library/flutter/flutter/packages/flutter_test/lib/
17 | glob:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/glob-1.2.0/lib/
18 | html:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/html-0.14.0+3/lib/
19 | js:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/js-0.6.1+1/lib/
20 | logging:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/logging-0.11.4/lib/
21 | matcher:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.5/lib/
22 | meta:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.7/lib/
23 | node_interop:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/node_interop-1.0.3/lib/
24 | node_io:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/node_io-1.0.1+2/lib/
25 | package_config:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/package_config-1.1.0/lib/
26 | path:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4/lib/
27 | pedantic:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/pedantic-1.8.0+1/lib/
28 | pub_semver:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/pub_semver-1.4.4/lib/
29 | quiver:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.0.5/lib/
30 | shared_preferences:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.4/lib/
31 | sky_engine:file:///Users/youngchan/Library/flutter/flutter/bin/cache/pkg/sky_engine/lib/
32 | source_gen:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_gen-0.9.5/lib/
33 | source_span:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.5.5/lib/
34 | sqflite:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/sqflite-1.1.8/lib/
35 | stack_trace:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3/lib/
36 | stream_channel:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0/lib/
37 | string_scanner:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5/lib/
38 | synchronized:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/synchronized-2.1.1/lib/
39 | term_glyph:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0/lib/
40 | test_api:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.5/lib/
41 | typed_data:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6/lib/
42 | vector_math:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib/
43 | watcher:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/watcher-0.9.7+14/lib/
44 | yaml:file:///Users/youngchan/Library/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/yaml-2.2.0/lib/
45 | dynamicflutter:lib/
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > 本项目为《Flutter动态化热更新的思考与实践》的示例代码
2 |
3 | 详见:
4 |
5 | 1. [Flutter动态化热更新的思考与实践](https://juejin.im/post/5e8c23536fb9a03c3f1ea10b)
6 | 2. [Flutter 动态化热更新的思考与实践(二)----Dart 代码转换AST](https://juejin.im/post/5e918f22e51d4546d83b105f)
7 | 3. [Flutter 动态化热更新的思考与实践(三)---- 解析AST之Runtime](https://juejin.im/post/5ea016c46fb9a03c875cafd6)
8 |
9 |
10 |
11 | 运行:
12 |
13 | `dart lib/main.dart -f dslDemo/demo_blog_code.dart`
14 |
15 |
--------------------------------------------------------------------------------
/dslDemo/demo_blog_code.dart:
--------------------------------------------------------------------------------
1 | ///
2 | ///Author: YoungChan
3 | ///Date: 2020-04-11 15:11:52
4 | ///LastEditors: YoungChan
5 | ///LastEditTime: 2020-04-22 16:24:14
6 | ///Description: file content
7 | ///
8 |
9 | int incTen(int a) {
10 | int b = a + 10;
11 | return b;
12 | }
13 |
--------------------------------------------------------------------------------
/example/.fhgenerator.json:
--------------------------------------------------------------------------------
1 | [{"name":"ListViewDSL","filePath":"./lib/dsl/listview_dsl.dart","version":"e7bc40472edcac122fa96863a95e2137","classId":"8a6b3c194efcd9aeb6fc6f29a77a97e9","metadata":"FlutterHotWidget"},{"name":"RowColumnDSL","filePath":"./lib/dsl/column_row_dsl.dart","version":"23ebd1dc151d95c519566f4ace953be4","classId":"7251e562a7f2859cd246fdff22d5da74","metadata":"FlutterHotWidget"},{"name":"IconDsl","filePath":"./lib/dsl/icon_dsl.dart","version":"53a6ced7761ea53368e8cd93be6178c6","classId":"a63c89faebb3fb5b2f98ccf086abf367","metadata":"FlutterHotWidget"},{"name":"ScaffoldDSL","filePath":"./lib/dsl/scaffold_dsl.dart","version":"bb4af7e09335b59d3320231b1e7c4ba4","classId":"16c7389376fba1ff879c6f7a91f5f190","metadata":"FlutterHotWidget"}]
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .packages
28 | .pub-cache/
29 | .pub/
30 | /build/
31 |
32 | # Android related
33 | **/android/**/gradle-wrapper.jar
34 | **/android/.gradle
35 | **/android/captures/
36 | **/android/gradlew
37 | **/android/gradlew.bat
38 | **/android/local.properties
39 | **/android/**/GeneratedPluginRegistrant.java
40 |
41 | # iOS/XCode related
42 | **/ios/**/*.mode1v3
43 | **/ios/**/*.mode2v3
44 | **/ios/**/*.moved-aside
45 | **/ios/**/*.pbxuser
46 | **/ios/**/*.perspectivev3
47 | **/ios/**/*sync/
48 | **/ios/**/.sconsign.dblite
49 | **/ios/**/.tags*
50 | **/ios/**/.vagrant/
51 | **/ios/**/DerivedData/
52 | **/ios/**/Icon?
53 | **/ios/**/Pods/
54 | **/ios/**/.symlinks/
55 | **/ios/**/profile
56 | **/ios/**/xcuserdata
57 | **/ios/.generated/
58 | **/ios/Flutter/App.framework
59 | **/ios/Flutter/Flutter.framework
60 | **/ios/Flutter/Generated.xcconfig
61 | **/ios/Flutter/app.flx
62 | **/ios/Flutter/app.zip
63 | **/ios/Flutter/flutter_assets/
64 | **/ios/Flutter/flutter_export_environment.sh
65 | **/ios/ServiceDefinitions.json
66 | **/ios/Runner/GeneratedPluginRegistrant.*
67 |
68 | # Exceptions to above rules.
69 | !**/ios/**/default.mode1v3
70 | !**/ios/**/default.mode2v3
71 | !**/ios/**/default.pbxuser
72 | !**/ios/**/default.perspectivev3
73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
74 | pubspec.lock
75 |
76 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 68587a0916366e9512a78df22c44163d041dd5f3
8 | channel: unknown
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # flutter_hot_widget
2 |
3 | A new Flutter application.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.newcoretech.flutter_hot_widget"
42 | minSdkVersion 21
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
47 | }
48 |
49 | buildTypes {
50 | release {
51 | // TODO: Add your own signing config for the release build.
52 | // Signing with the debug keys for now, so `flutter run --release` works.
53 | signingConfig signingConfigs.debug
54 | }
55 | }
56 | }
57 |
58 | flutter {
59 | source '../..'
60 | }
61 |
62 | dependencies {
63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
64 | testImplementation 'junit:junit:4.12'
65 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
67 | }
68 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
14 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/newcoretech/flutter_hot_widget/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.newcoretech.flutter_hot_widget
2 |
3 | import android.os.Bundle
4 |
5 | import io.flutter.app.FlutterActivity
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 | GeneratedPluginRegistrant.registerWith(this)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.3'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
3 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/example/assets/ast_records_data.json:
--------------------------------------------------------------------------------
1 | [{"name":"ListViewDSL","classId":"8a6b3c194efcd9aeb6fc6f29a77a97e9","version":"e7bc40472edcac122fa96863a95e2137","metadata":"FlutterHotWidget","versionDate":1587095897223,"ast":"{\"type\":\"Program\",\"body\":[{\"type\":\"ClassDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"ListViewDSL\"},\"superClause\":{\"type\":\"Identifier\",\"name\":\"StatefulWidget\"},\"implementsClause\":null,\"mixinClause\":null,\"metadata\":[{\"type\":\"Annotation\",\"id\":{\"type\":\"Identifier\",\"name\":\"FlutterHotWidget\"},\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]}}],\"body\":[{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"createState\"},\"parameters\":{\"type\":\"FormalParameterList\",\"parameterList\":[]},\"typeParameters\":null,\"body\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"_ListViewDSLState\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]},\"selectAstClass\":null},\"returnType\":{\"type\":\"Identifier\",\"name\":\"_ListViewDSLState\"}}]},{\"type\":\"ClassDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"_ListViewDSLState\"},\"superClause\":{\"type\":\"Identifier\",\"name\":\"State\"},\"implementsClause\":null,\"mixinClause\":null,\"metadata\":[],\"body\":[{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"build\"},\"parameters\":{\"type\":\"FormalParameterList\",\"parameterList\":[{\"type\":\"SimpleFormalParameter\",\"typeAnnotaion\":{\"type\":\"Identifier\",\"name\":\"BuildContext\"},\"id\":{\"type\":\"Identifier\",\"name\":\"context\"}}]},\"typeParameters\":null,\"body\":{\"type\":\"BlockStatement\",\"body\":[{\"type\":\"ReturnStatement\",\"argument\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Scaffold\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"appBar\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"AppBar\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"backgroundColor\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"red\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"title\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"ListViewDSL\"},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"style\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"TextStyle\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"fontSize\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":20}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"white\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"centerTitle\"},\"expression\":{\"type\":\"BooleanLiteral\",\"value\":true}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"body\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"ListView\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"padding\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"EdgeInsets\"},\"property\":{\"type\":\"Identifier\",\"name\":\"only\"}},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"left\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":16}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"right\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":16}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"children\"},\"expression\":{\"type\":\"ListLiteral\",\"elements\":[{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Hellow world 1\"}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"blue\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"height\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":45}}]},\"selectAstClass\":null},{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Hellow world 2\"},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"style\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"TextStyle\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"fontSize\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":18}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"red\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"height\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":45}}]},\"selectAstClass\":null},{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Hellow world 3\"}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"green\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"alignment\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"centerLeft\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Alignment\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"padding\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"EdgeInsets\"},\"property\":{\"type\":\"Identifier\",\"name\":\"only\"}},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"left\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":16}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"height\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":45}}]},\"selectAstClass\":null}]}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}}]},\"returnType\":{\"type\":\"Identifier\",\"name\":\"Widget\"}}]}]}"},{"name":"RowColumnDSL","classId":"7251e562a7f2859cd246fdff22d5da74","version":"23ebd1dc151d95c519566f4ace953be4","metadata":"FlutterHotWidget","versionDate":1587095897224,"ast":"{\"type\":\"Program\",\"body\":[{\"type\":\"ClassDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"RowColumnDSL\"},\"superClause\":{\"type\":\"Identifier\",\"name\":\"StatefulWidget\"},\"implementsClause\":null,\"mixinClause\":null,\"metadata\":[{\"type\":\"Annotation\",\"id\":{\"type\":\"Identifier\",\"name\":\"FlutterHotWidget\"},\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]}}],\"body\":[{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"createState\"},\"parameters\":{\"type\":\"FormalParameterList\",\"parameterList\":[]},\"typeParameters\":null,\"body\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"_RowColumnDSLState\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]},\"selectAstClass\":null},\"returnType\":{\"type\":\"Identifier\",\"name\":\"_RowColumnDSLState\"}}]},{\"type\":\"ClassDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"_RowColumnDSLState\"},\"superClause\":{\"type\":\"Identifier\",\"name\":\"State\"},\"implementsClause\":null,\"mixinClause\":null,\"metadata\":[],\"body\":[{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"build\"},\"parameters\":{\"type\":\"FormalParameterList\",\"parameterList\":[{\"type\":\"SimpleFormalParameter\",\"typeAnnotaion\":{\"type\":\"Identifier\",\"name\":\"BuildContext\"},\"id\":{\"type\":\"Identifier\",\"name\":\"context\"}}]},\"typeParameters\":null,\"body\":{\"type\":\"BlockStatement\",\"body\":[{\"type\":\"ReturnStatement\",\"argument\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Scaffold\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"appBar\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"AppBar\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"backgroundColor\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"red\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"title\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"RowColumnDSL\"},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"style\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"TextStyle\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"fontSize\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":20}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"white\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"centerTitle\"},\"expression\":{\"type\":\"BooleanLiteral\",\"value\":true}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"body\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Column\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"children\"},\"expression\":{\"type\":\"ListLiteral\",\"elements\":[{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Row\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"children\"},\"expression\":{\"type\":\"ListLiteral\",\"elements\":[{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Hellow world 1\"}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"blue\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"height\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":45}}]},\"selectAstClass\":null},{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Hellow world 2\"},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"style\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"TextStyle\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"fontSize\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":18}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"red\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"height\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":45}}]},\"selectAstClass\":null}]}}]},\"selectAstClass\":null},{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Row\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"children\"},\"expression\":{\"type\":\"ListLiteral\",\"elements\":[{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Hellow world 2\"},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"style\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"TextStyle\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"fontSize\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":18}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"red\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"height\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":45}}]},\"selectAstClass\":null},{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Hellow world 3\"}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"green\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"alignment\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"centerLeft\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Alignment\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"padding\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"EdgeInsets\"},\"property\":{\"type\":\"Identifier\",\"name\":\"only\"}},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"left\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":16}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"height\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":45}}]},\"selectAstClass\":null}]}}]},\"selectAstClass\":null}]}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}}]},\"returnType\":{\"type\":\"Identifier\",\"name\":\"Widget\"}}]}]}"},{"name":"IconDsl","classId":"a63c89faebb3fb5b2f98ccf086abf367","version":"53a6ced7761ea53368e8cd93be6178c6","metadata":"FlutterHotWidget","versionDate":1587095897224,"ast":"{\"type\":\"Program\",\"body\":[{\"type\":\"ClassDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"IconDsl\"},\"superClause\":{\"type\":\"Identifier\",\"name\":\"StatefulWidget\"},\"implementsClause\":{\"type\":\"ImplementsClause\",\"implements\":[{\"type\":\"Identifier\",\"name\":\"FHBaseWidget\"}]},\"mixinClause\":null,\"metadata\":[{\"type\":\"Annotation\",\"id\":{\"type\":\"Identifier\",\"name\":\"FlutterHotWidget\"},\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]}}],\"body\":[{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"createState\"},\"parameters\":{\"type\":\"FormalParameterList\",\"parameterList\":[]},\"typeParameters\":null,\"body\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"_IconDslState\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]},\"selectAstClass\":null},\"returnType\":{\"type\":\"Identifier\",\"name\":\"_IconDslState\"}},{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"widget\"},\"parameters\":null,\"typeParameters\":null,\"body\":null,\"returnType\":{\"type\":\"Identifier\",\"name\":\"Widget\"}}]},{\"type\":\"ClassDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"_IconDslState\"},\"superClause\":{\"type\":\"Identifier\",\"name\":\"State\"},\"implementsClause\":null,\"mixinClause\":null,\"metadata\":[],\"body\":[{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"build\"},\"parameters\":{\"type\":\"FormalParameterList\",\"parameterList\":[{\"type\":\"SimpleFormalParameter\",\"typeAnnotaion\":{\"type\":\"Identifier\",\"name\":\"BuildContext\"},\"id\":{\"type\":\"Identifier\",\"name\":\"context\"}}]},\"typeParameters\":null,\"body\":{\"type\":\"BlockStatement\",\"body\":[{\"type\":\"ReturnStatement\",\"argument\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"blue\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"margin\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"EdgeInsets\"},\"property\":{\"type\":\"Identifier\",\"name\":\"all\"}},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NumericLiteral\",\"value\":16}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"alignment\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"center\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Alignment\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Hello world\"},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"style\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"TextStyle\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"white\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"fontSize\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":24}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}}]},\"returnType\":{\"type\":\"Identifier\",\"name\":\"Widget\"}}]}]}"},{"name":"ScaffoldDSL","classId":"16c7389376fba1ff879c6f7a91f5f190","version":"bb4af7e09335b59d3320231b1e7c4ba4","metadata":"FlutterHotWidget","versionDate":1587095897225,"ast":"{\"type\":\"Program\",\"body\":[{\"type\":\"ClassDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"ScaffoldDSL\"},\"superClause\":{\"type\":\"Identifier\",\"name\":\"StatefulWidget\"},\"implementsClause\":null,\"mixinClause\":null,\"metadata\":[{\"type\":\"Annotation\",\"id\":{\"type\":\"Identifier\",\"name\":\"FlutterHotWidget\"},\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]}}],\"body\":[{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"createState\"},\"parameters\":{\"type\":\"FormalParameterList\",\"parameterList\":[]},\"typeParameters\":null,\"body\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"_ScaffoldDSLState\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]},\"selectAstClass\":null},\"returnType\":{\"type\":\"Identifier\",\"name\":\"_ScaffoldDSLState\"}}]},{\"type\":\"ClassDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"_ScaffoldDSLState\"},\"superClause\":{\"type\":\"Identifier\",\"name\":\"State\"},\"implementsClause\":null,\"mixinClause\":null,\"metadata\":[],\"body\":[{\"type\":\"MethodDeclaration\",\"id\":{\"type\":\"Identifier\",\"name\":\"build\"},\"parameters\":{\"type\":\"FormalParameterList\",\"parameterList\":[{\"type\":\"SimpleFormalParameter\",\"typeAnnotaion\":{\"type\":\"Identifier\",\"name\":\"BuildContext\"},\"id\":{\"type\":\"Identifier\",\"name\":\"context\"}}]},\"typeParameters\":null,\"body\":{\"type\":\"BlockStatement\",\"body\":[{\"type\":\"ReturnStatement\",\"argument\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Scaffold\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"appBar\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"AppBar\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"backgroundColor\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"red\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"title\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Text\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"StringLiteral\",\"value\":\"Scaffold\"},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"style\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"TextStyle\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"fontSize\"},\"expression\":{\"type\":\"NumericLiteral\",\"value\":20}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"white\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"centerTitle\"},\"expression\":{\"type\":\"BooleanLiteral\",\"value\":true}}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"body\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"Container\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"color\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"blue\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Colors\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"margin\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"EdgeInsets\"},\"property\":{\"type\":\"Identifier\",\"name\":\"all\"}},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"NumericLiteral\",\"value\":16}]},\"selectAstClass\":null}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"alignment\"},\"expression\":{\"type\":\"PrefixedIdentifier\",\"identifier\":{\"type\":\"Identifier\",\"name\":\"center\"},\"prefix\":{\"type\":\"Identifier\",\"name\":\"Alignment\"}}},{\"type\":\"NamedExpression\",\"id\":{\"type\":\"Identifier\",\"name\":\"child\"},\"expression\":{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"selectWidget\"},\"typeArguments\":{\"type\":\"TypeArgumentList\",\"arguments\":[{\"type\":\"Identifier\",\"name\":\"IconDsl\"}]},\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[{\"type\":\"MethodInvocation\",\"callee\":{\"type\":\"Identifier\",\"name\":\"IconDsl\"},\"typeArguments\":null,\"argumentList\":{\"type\":\"ArgumentList\",\"argumentList\":[]},\"selectAstClass\":null}]},\"selectAstClass\":{\"classId\":\"a63c89faebb3fb5b2f98ccf086abf367\",\"filePath\":\"./lib/dsl/icon_dsl.dart\",\"version\":\"53a6ced7761ea53368e8cd93be6178c6\",\"name\":\"IconDsl\",\"metadata\":\"FlutterHotWidget\"}}}]},\"selectAstClass\":null}}]},\"selectAstClass\":null}}]},\"returnType\":{\"type\":\"Identifier\",\"name\":\"Widget\"}}]}]}"}]
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def parse_KV_file(file, separator='=')
14 | file_abs_path = File.expand_path(file)
15 | if !File.exists? file_abs_path
16 | return [];
17 | end
18 | pods_ary = []
19 | skip_line_start_symbols = ["#", "/"]
20 | File.foreach(file_abs_path) { |line|
21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22 | plugin = line.split(pattern=separator)
23 | if plugin.length == 2
24 | podname = plugin[0].strip()
25 | path = plugin[1].strip()
26 | podpath = File.expand_path("#{path}", file_abs_path)
27 | pods_ary.push({:name => podname, :path => podpath});
28 | else
29 | puts "Invalid plugin specification: #{line}"
30 | end
31 | }
32 | return pods_ary
33 | end
34 |
35 | target 'Runner' do
36 | use_frameworks!
37 |
38 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
39 | # referring to absolute paths on developers' machines.
40 | system('rm -rf .symlinks')
41 | system('mkdir -p .symlinks/plugins')
42 |
43 | # Flutter Pods
44 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
45 | if generated_xcode_build_settings.empty?
46 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
47 | end
48 | generated_xcode_build_settings.map { |p|
49 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
50 | symlink = File.join('.symlinks', 'flutter')
51 | File.symlink(File.dirname(p[:path]), symlink)
52 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
53 | end
54 | }
55 |
56 | # Plugin Pods
57 | plugin_pods = parse_KV_file('../.flutter-plugins')
58 | plugin_pods.map { |p|
59 | symlink = File.join('.symlinks', 'plugins', p[:name])
60 | File.symlink(p[:path], symlink)
61 | pod p[:name], :path => File.join(symlink, 'ios')
62 | }
63 | end
64 |
65 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
66 | install! 'cocoapods', :disable_input_output_paths => true
67 |
68 | post_install do |installer|
69 | installer.pods_project.targets.each do |target|
70 | target.build_configurations.each do |config|
71 | config.build_settings['ENABLE_BITCODE'] = 'NO'
72 | end
73 | end
74 | end
75 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
18 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXCopyFilesBuildPhase section */
24 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
25 | isa = PBXCopyFilesBuildPhase;
26 | buildActionMask = 2147483647;
27 | dstPath = "";
28 | dstSubfolderSpec = 10;
29 | files = (
30 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
31 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
32 | );
33 | name = "Embed Frameworks";
34 | runOnlyForDeploymentPostprocessing = 0;
35 | };
36 | /* End PBXCopyFilesBuildPhase section */
37 |
38 | /* Begin PBXFileReference section */
39 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
40 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
41 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
42 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
43 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
44 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
45 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
46 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
47 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
48 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
49 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
50 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
51 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
52 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
53 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
54 | /* End PBXFileReference section */
55 |
56 | /* Begin PBXFrameworksBuildPhase section */
57 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
58 | isa = PBXFrameworksBuildPhase;
59 | buildActionMask = 2147483647;
60 | files = (
61 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
62 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
63 | );
64 | runOnlyForDeploymentPostprocessing = 0;
65 | };
66 | /* End PBXFrameworksBuildPhase section */
67 |
68 | /* Begin PBXGroup section */
69 | 9740EEB11CF90186004384FC /* Flutter */ = {
70 | isa = PBXGroup;
71 | children = (
72 | 3B80C3931E831B6300D905FE /* App.framework */,
73 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
74 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
75 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
76 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
77 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
78 | );
79 | name = Flutter;
80 | sourceTree = "";
81 | };
82 | 97C146E51CF9000F007C117D = {
83 | isa = PBXGroup;
84 | children = (
85 | 9740EEB11CF90186004384FC /* Flutter */,
86 | 97C146F01CF9000F007C117D /* Runner */,
87 | 97C146EF1CF9000F007C117D /* Products */,
88 | );
89 | sourceTree = "";
90 | };
91 | 97C146EF1CF9000F007C117D /* Products */ = {
92 | isa = PBXGroup;
93 | children = (
94 | 97C146EE1CF9000F007C117D /* Runner.app */,
95 | );
96 | name = Products;
97 | sourceTree = "";
98 | };
99 | 97C146F01CF9000F007C117D /* Runner */ = {
100 | isa = PBXGroup;
101 | children = (
102 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
103 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
104 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
105 | 97C147021CF9000F007C117D /* Info.plist */,
106 | 97C146F11CF9000F007C117D /* Supporting Files */,
107 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
108 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
109 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
110 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
111 | );
112 | path = Runner;
113 | sourceTree = "";
114 | };
115 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
116 | isa = PBXGroup;
117 | children = (
118 | );
119 | name = "Supporting Files";
120 | sourceTree = "";
121 | };
122 | /* End PBXGroup section */
123 |
124 | /* Begin PBXNativeTarget section */
125 | 97C146ED1CF9000F007C117D /* Runner */ = {
126 | isa = PBXNativeTarget;
127 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
128 | buildPhases = (
129 | 9740EEB61CF901F6004384FC /* Run Script */,
130 | 97C146EA1CF9000F007C117D /* Sources */,
131 | 97C146EB1CF9000F007C117D /* Frameworks */,
132 | 97C146EC1CF9000F007C117D /* Resources */,
133 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
134 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
135 | );
136 | buildRules = (
137 | );
138 | dependencies = (
139 | );
140 | name = Runner;
141 | productName = Runner;
142 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
143 | productType = "com.apple.product-type.application";
144 | };
145 | /* End PBXNativeTarget section */
146 |
147 | /* Begin PBXProject section */
148 | 97C146E61CF9000F007C117D /* Project object */ = {
149 | isa = PBXProject;
150 | attributes = {
151 | LastUpgradeCheck = 1020;
152 | ORGANIZATIONNAME = "The Chromium Authors";
153 | TargetAttributes = {
154 | 97C146ED1CF9000F007C117D = {
155 | CreatedOnToolsVersion = 7.3.1;
156 | LastSwiftMigration = 0910;
157 | };
158 | };
159 | };
160 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
161 | compatibilityVersion = "Xcode 3.2";
162 | developmentRegion = en;
163 | hasScannedForEncodings = 0;
164 | knownRegions = (
165 | en,
166 | Base,
167 | );
168 | mainGroup = 97C146E51CF9000F007C117D;
169 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
170 | projectDirPath = "";
171 | projectRoot = "";
172 | targets = (
173 | 97C146ED1CF9000F007C117D /* Runner */,
174 | );
175 | };
176 | /* End PBXProject section */
177 |
178 | /* Begin PBXResourcesBuildPhase section */
179 | 97C146EC1CF9000F007C117D /* Resources */ = {
180 | isa = PBXResourcesBuildPhase;
181 | buildActionMask = 2147483647;
182 | files = (
183 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
184 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
185 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
186 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
187 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
188 | );
189 | runOnlyForDeploymentPostprocessing = 0;
190 | };
191 | /* End PBXResourcesBuildPhase section */
192 |
193 | /* Begin PBXShellScriptBuildPhase section */
194 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
195 | isa = PBXShellScriptBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | );
199 | inputPaths = (
200 | );
201 | name = "Thin Binary";
202 | outputPaths = (
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | shellPath = /bin/sh;
206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
207 | };
208 | 9740EEB61CF901F6004384FC /* Run Script */ = {
209 | isa = PBXShellScriptBuildPhase;
210 | buildActionMask = 2147483647;
211 | files = (
212 | );
213 | inputPaths = (
214 | );
215 | name = "Run Script";
216 | outputPaths = (
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | shellPath = /bin/sh;
220 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
221 | };
222 | /* End PBXShellScriptBuildPhase section */
223 |
224 | /* Begin PBXSourcesBuildPhase section */
225 | 97C146EA1CF9000F007C117D /* Sources */ = {
226 | isa = PBXSourcesBuildPhase;
227 | buildActionMask = 2147483647;
228 | files = (
229 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
230 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
231 | );
232 | runOnlyForDeploymentPostprocessing = 0;
233 | };
234 | /* End PBXSourcesBuildPhase section */
235 |
236 | /* Begin PBXVariantGroup section */
237 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
238 | isa = PBXVariantGroup;
239 | children = (
240 | 97C146FB1CF9000F007C117D /* Base */,
241 | );
242 | name = Main.storyboard;
243 | sourceTree = "";
244 | };
245 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
246 | isa = PBXVariantGroup;
247 | children = (
248 | 97C147001CF9000F007C117D /* Base */,
249 | );
250 | name = LaunchScreen.storyboard;
251 | sourceTree = "";
252 | };
253 | /* End PBXVariantGroup section */
254 |
255 | /* Begin XCBuildConfiguration section */
256 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
257 | isa = XCBuildConfiguration;
258 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
259 | buildSettings = {
260 | ALWAYS_SEARCH_USER_PATHS = NO;
261 | CLANG_ANALYZER_NONNULL = YES;
262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
263 | CLANG_CXX_LIBRARY = "libc++";
264 | CLANG_ENABLE_MODULES = YES;
265 | CLANG_ENABLE_OBJC_ARC = YES;
266 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
267 | CLANG_WARN_BOOL_CONVERSION = YES;
268 | CLANG_WARN_COMMA = YES;
269 | CLANG_WARN_CONSTANT_CONVERSION = YES;
270 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
271 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
272 | CLANG_WARN_EMPTY_BODY = YES;
273 | CLANG_WARN_ENUM_CONVERSION = YES;
274 | CLANG_WARN_INFINITE_RECURSION = YES;
275 | CLANG_WARN_INT_CONVERSION = YES;
276 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
277 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
281 | CLANG_WARN_STRICT_PROTOTYPES = YES;
282 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
283 | CLANG_WARN_UNREACHABLE_CODE = YES;
284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
286 | COPY_PHASE_STRIP = NO;
287 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
288 | ENABLE_NS_ASSERTIONS = NO;
289 | ENABLE_STRICT_OBJC_MSGSEND = YES;
290 | GCC_C_LANGUAGE_STANDARD = gnu99;
291 | GCC_NO_COMMON_BLOCKS = YES;
292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
294 | GCC_WARN_UNDECLARED_SELECTOR = YES;
295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
296 | GCC_WARN_UNUSED_FUNCTION = YES;
297 | GCC_WARN_UNUSED_VARIABLE = YES;
298 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
299 | MTL_ENABLE_DEBUG_INFO = NO;
300 | SDKROOT = iphoneos;
301 | TARGETED_DEVICE_FAMILY = "1,2";
302 | VALIDATE_PRODUCT = YES;
303 | };
304 | name = Profile;
305 | };
306 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
307 | isa = XCBuildConfiguration;
308 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
309 | buildSettings = {
310 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
311 | CLANG_ENABLE_MODULES = YES;
312 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
313 | ENABLE_BITCODE = NO;
314 | FRAMEWORK_SEARCH_PATHS = (
315 | "$(inherited)",
316 | "$(PROJECT_DIR)/Flutter",
317 | );
318 | INFOPLIST_FILE = Runner/Info.plist;
319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
320 | LIBRARY_SEARCH_PATHS = (
321 | "$(inherited)",
322 | "$(PROJECT_DIR)/Flutter",
323 | );
324 | PRODUCT_BUNDLE_IDENTIFIER = com.newcoretech.flutterHotWidget;
325 | PRODUCT_NAME = "$(TARGET_NAME)";
326 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
327 | SWIFT_VERSION = 4.0;
328 | VERSIONING_SYSTEM = "apple-generic";
329 | };
330 | name = Profile;
331 | };
332 | 97C147031CF9000F007C117D /* Debug */ = {
333 | isa = XCBuildConfiguration;
334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
335 | buildSettings = {
336 | ALWAYS_SEARCH_USER_PATHS = NO;
337 | CLANG_ANALYZER_NONNULL = YES;
338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
339 | CLANG_CXX_LIBRARY = "libc++";
340 | CLANG_ENABLE_MODULES = YES;
341 | CLANG_ENABLE_OBJC_ARC = YES;
342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
343 | CLANG_WARN_BOOL_CONVERSION = YES;
344 | CLANG_WARN_COMMA = YES;
345 | CLANG_WARN_CONSTANT_CONVERSION = YES;
346 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
348 | CLANG_WARN_EMPTY_BODY = YES;
349 | CLANG_WARN_ENUM_CONVERSION = YES;
350 | CLANG_WARN_INFINITE_RECURSION = YES;
351 | CLANG_WARN_INT_CONVERSION = YES;
352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
353 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
354 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
357 | CLANG_WARN_STRICT_PROTOTYPES = YES;
358 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
359 | CLANG_WARN_UNREACHABLE_CODE = YES;
360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
362 | COPY_PHASE_STRIP = NO;
363 | DEBUG_INFORMATION_FORMAT = dwarf;
364 | ENABLE_STRICT_OBJC_MSGSEND = YES;
365 | ENABLE_TESTABILITY = YES;
366 | GCC_C_LANGUAGE_STANDARD = gnu99;
367 | GCC_DYNAMIC_NO_PIC = NO;
368 | GCC_NO_COMMON_BLOCKS = YES;
369 | GCC_OPTIMIZATION_LEVEL = 0;
370 | GCC_PREPROCESSOR_DEFINITIONS = (
371 | "DEBUG=1",
372 | "$(inherited)",
373 | );
374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
376 | GCC_WARN_UNDECLARED_SELECTOR = YES;
377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
378 | GCC_WARN_UNUSED_FUNCTION = YES;
379 | GCC_WARN_UNUSED_VARIABLE = YES;
380 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
381 | MTL_ENABLE_DEBUG_INFO = YES;
382 | ONLY_ACTIVE_ARCH = YES;
383 | SDKROOT = iphoneos;
384 | TARGETED_DEVICE_FAMILY = "1,2";
385 | };
386 | name = Debug;
387 | };
388 | 97C147041CF9000F007C117D /* Release */ = {
389 | isa = XCBuildConfiguration;
390 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
391 | buildSettings = {
392 | ALWAYS_SEARCH_USER_PATHS = NO;
393 | CLANG_ANALYZER_NONNULL = YES;
394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
395 | CLANG_CXX_LIBRARY = "libc++";
396 | CLANG_ENABLE_MODULES = YES;
397 | CLANG_ENABLE_OBJC_ARC = YES;
398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
399 | CLANG_WARN_BOOL_CONVERSION = YES;
400 | CLANG_WARN_COMMA = YES;
401 | CLANG_WARN_CONSTANT_CONVERSION = YES;
402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
404 | CLANG_WARN_EMPTY_BODY = YES;
405 | CLANG_WARN_ENUM_CONVERSION = YES;
406 | CLANG_WARN_INFINITE_RECURSION = YES;
407 | CLANG_WARN_INT_CONVERSION = YES;
408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
413 | CLANG_WARN_STRICT_PROTOTYPES = YES;
414 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
415 | CLANG_WARN_UNREACHABLE_CODE = YES;
416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
418 | COPY_PHASE_STRIP = NO;
419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
420 | ENABLE_NS_ASSERTIONS = NO;
421 | ENABLE_STRICT_OBJC_MSGSEND = YES;
422 | GCC_C_LANGUAGE_STANDARD = gnu99;
423 | GCC_NO_COMMON_BLOCKS = YES;
424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
426 | GCC_WARN_UNDECLARED_SELECTOR = YES;
427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
428 | GCC_WARN_UNUSED_FUNCTION = YES;
429 | GCC_WARN_UNUSED_VARIABLE = YES;
430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
431 | MTL_ENABLE_DEBUG_INFO = NO;
432 | SDKROOT = iphoneos;
433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
434 | TARGETED_DEVICE_FAMILY = "1,2";
435 | VALIDATE_PRODUCT = YES;
436 | };
437 | name = Release;
438 | };
439 | 97C147061CF9000F007C117D /* Debug */ = {
440 | isa = XCBuildConfiguration;
441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
442 | buildSettings = {
443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
444 | CLANG_ENABLE_MODULES = YES;
445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
446 | ENABLE_BITCODE = NO;
447 | FRAMEWORK_SEARCH_PATHS = (
448 | "$(inherited)",
449 | "$(PROJECT_DIR)/Flutter",
450 | );
451 | INFOPLIST_FILE = Runner/Info.plist;
452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
453 | LIBRARY_SEARCH_PATHS = (
454 | "$(inherited)",
455 | "$(PROJECT_DIR)/Flutter",
456 | );
457 | PRODUCT_BUNDLE_IDENTIFIER = com.newcoretech.flutterHotWidget;
458 | PRODUCT_NAME = "$(TARGET_NAME)";
459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
461 | SWIFT_VERSION = 4.0;
462 | VERSIONING_SYSTEM = "apple-generic";
463 | };
464 | name = Debug;
465 | };
466 | 97C147071CF9000F007C117D /* Release */ = {
467 | isa = XCBuildConfiguration;
468 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
469 | buildSettings = {
470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
471 | CLANG_ENABLE_MODULES = YES;
472 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
473 | ENABLE_BITCODE = NO;
474 | FRAMEWORK_SEARCH_PATHS = (
475 | "$(inherited)",
476 | "$(PROJECT_DIR)/Flutter",
477 | );
478 | INFOPLIST_FILE = Runner/Info.plist;
479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
480 | LIBRARY_SEARCH_PATHS = (
481 | "$(inherited)",
482 | "$(PROJECT_DIR)/Flutter",
483 | );
484 | PRODUCT_BUNDLE_IDENTIFIER = com.newcoretech.flutterHotWidget;
485 | PRODUCT_NAME = "$(TARGET_NAME)";
486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
487 | SWIFT_VERSION = 4.0;
488 | VERSIONING_SYSTEM = "apple-generic";
489 | };
490 | name = Release;
491 | };
492 | /* End XCBuildConfiguration section */
493 |
494 | /* Begin XCConfigurationList section */
495 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
496 | isa = XCConfigurationList;
497 | buildConfigurations = (
498 | 97C147031CF9000F007C117D /* Debug */,
499 | 97C147041CF9000F007C117D /* Release */,
500 | 249021D3217E4FDB00AE95B9 /* Profile */,
501 | );
502 | defaultConfigurationIsVisible = 0;
503 | defaultConfigurationName = Release;
504 | };
505 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
506 | isa = XCConfigurationList;
507 | buildConfigurations = (
508 | 97C147061CF9000F007C117D /* Debug */,
509 | 97C147071CF9000F007C117D /* Release */,
510 | 249021D4217E4FDB00AE95B9 /* Profile */,
511 | );
512 | defaultConfigurationIsVisible = 0;
513 | defaultConfigurationName = Release;
514 | };
515 | /* End XCConfigurationList section */
516 |
517 | };
518 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
519 | }
520 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Newcore-mobile/DynamicFlutter/d4481f61011b2f5746a907ba2e93cec9b8e7dfa8/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_hot_widget
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/example/lib/dsl/listview_dsl.dart:
--------------------------------------------------------------------------------
1 | ///
2 | ///Author: YoungChan
3 | ///Date: 2020-04-16 15:37:16
4 | ///LastEditors: YoungChan
5 | ///LastEditTime: 2020-04-22 20:33:59
6 | ///Description: file content
7 | ///
8 | import 'package:flutter/material.dart';
9 |
10 | class ListViewDSL extends StatefulWidget {
11 | @override
12 | _ListViewDSLState createState() => _ListViewDSLState();
13 | }
14 |
15 | class _ListViewDSLState extends State {
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | backgroundColor: Colors.red,
21 | title: Text(
22 | 'ListViewDSL',
23 | style: TextStyle(fontSize: 20, color: Colors.white),
24 | ),
25 | centerTitle: true,
26 | ),
27 | body: ListView.builder(
28 | itemBuilder: (context, index) {
29 | return Container(
30 | padding: EdgeInsets.only(left: 16, right: 16),
31 | alignment: Alignment.centerLeft,
32 | child: Text('Hellow World',
33 | style: TextStyle(color: Colors.white, fontSize: 18)),
34 | color: Colors.lightBlue.shade300,
35 | height: 45,
36 | );
37 | },
38 | itemCount: 50,
39 | ),
40 | );
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/services.dart';
5 | import 'dsl/listview_dsl.dart';
6 | import 'package:dynamicflutter/widget/ast_statefulwidget.dart';
7 |
8 | import 'package:flutter/services.dart' show rootBundle;
9 |
10 | void main() => runApp(MyApp());
11 |
12 | class MyApp extends StatelessWidget {
13 | // This widget is the root of your application.
14 | @override
15 | Widget build(BuildContext context) {
16 | return MaterialApp(
17 | title: 'Flutter Demo',
18 | theme: ThemeData(
19 | // This is the theme of your application.
20 | //
21 | // Try running your application with \"flutter run\". You'll see the
22 | // application has a blue toolbar. Then, without quitting the app, try
23 | // changing the primarySwatch below to Colors.green and then invoke
24 | // \"hot reload\" (press \"r\" in the console where you ran \"flutter run\",
25 | // or simply save your changes to \"hot reload\" in a Flutter IDE).
26 | // Notice that the counter didn't reset back to zero; the application
27 | // is not restarted.
28 | primarySwatch: Colors.blue,
29 | ),
30 | home: MyHomePage(title: 'Flutter Demo Home Page'),
31 | );
32 | }
33 | }
34 |
35 | class MyHomePage extends StatefulWidget {
36 | MyHomePage({Key key, this.title}) : super(key: key);
37 |
38 | final String title;
39 |
40 | @override
41 | _MyHomePageState createState() => _MyHomePageState();
42 | }
43 |
44 | class _MyHomePageState extends State {
45 | @override
46 | Widget build(BuildContext context) {
47 | return Scaffold(
48 | appBar: AppBar(
49 | // Here we take the value from the MyHomePage object that was created by
50 | // the App.build method, and use it to set our appbar title.
51 | title: Text(widget.title),
52 | ),
53 | body: ListView(
54 | children: [
55 | ListTile(
56 | title: Text('DSL模板'),
57 | onTap: () {
58 | Navigator.push(context,
59 | MaterialPageRoute(builder: (context) => _DSLListPage()));
60 | },
61 | ),
62 | ListTile(
63 | title: Text('动态渲染'),
64 | onTap: () {
65 | Navigator.push(
66 | context,
67 | MaterialPageRoute(
68 | builder: (context) => _DynamicFlutterList()));
69 | },
70 | ),
71 | ],
72 | ));
73 | }
74 | }
75 |
76 | class _DSLListPage extends StatelessWidget {
77 | @override
78 | Widget build(BuildContext context) {
79 | return Scaffold(
80 | appBar: AppBar(
81 | title: Text('DSL模板列表'),
82 | ),
83 | body: ListView(
84 | children: [
85 | ListTile(
86 | title: Text('ListView'),
87 | onTap: () {
88 | Navigator.push(context,
89 | MaterialPageRoute(builder: (context) => ListViewDSL()));
90 | },
91 | ),
92 | ],
93 | ),
94 | );
95 | }
96 | }
97 |
98 | class _DynamicFlutterList extends StatelessWidget {
99 | @override
100 | Widget build(BuildContext context) {
101 | return Scaffold(
102 | appBar: AppBar(
103 | title: Text('动态渲染列表'),
104 | ),
105 | body: ListView(
106 | children: [
107 | ListTile(
108 | title: Text('ListView'),
109 | onTap: () async {
110 | Navigator.push(
111 | context,
112 | MaterialPageRoute(
113 | builder: (context) =>
114 | AstStatefulWidget(jsonDecode(listViewAst) as Map)));
115 | },
116 | ),
117 | ],
118 | ),
119 | );
120 | }
121 | }
122 |
123 | const listViewAst =
124 | '{"type":"Program","body":[{"type":"ClassDeclaration","id":{"type":"Identifier","name":"ListViewDSL"},"superClause":{"type":"TypeName","name":"StatefulWidget"},"implementsClause":null,"mixinClause":null,"metadata":[],"body":[{"type":"MethodDeclaration","id":{"type":"Identifier","name":"createState"},"parameters":{"type":"FormalParameterList","parameterList":[]},"typeParameters":null,"body":null,"isAsync":false,"returnType":{"type":"TypeName","name":"_ListViewDSLState"}}]},{"type":"ClassDeclaration","id":{"type":"Identifier","name":"_ListViewDSLState"},"superClause":{"type":"TypeName","name":"State"},"implementsClause":null,"mixinClause":null,"metadata":[],"body":[{"type":"MethodDeclaration","id":{"type":"Identifier","name":"build"},"parameters":{"type":"FormalParameterList","parameterList":[{"type":"SimpleFormalParameter","paramType":{"type":"TypeName","name":"BuildContext"},"name":"context"}]},"typeParameters":null,"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"MethodInvocation","callee":{"type":"Identifier","name":"Scaffold"},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"NamedExpression","id":{"type":"Identifier","name":"appBar"},"expression":{"type":"MethodInvocation","callee":{"type":"Identifier","name":"AppBar"},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"NamedExpression","id":{"type":"Identifier","name":"backgroundColor"},"expression":{"type":"PrefixedIdentifier","identifier":{"type":"Identifier","name":"red"},"prefix":{"type":"Identifier","name":"Colors"}}},{"type":"NamedExpression","id":{"type":"Identifier","name":"title"},"expression":{"type":"MethodInvocation","callee":{"type":"Identifier","name":"Text"},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"StringLiteral","value":"ListViewDSL"},{"type":"NamedExpression","id":{"type":"Identifier","name":"style"},"expression":{"type":"MethodInvocation","callee":{"type":"Identifier","name":"TextStyle"},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"NamedExpression","id":{"type":"Identifier","name":"fontSize"},"expression":{"type":"NumericLiteral","value":20}},{"type":"NamedExpression","id":{"type":"Identifier","name":"color"},"expression":{"type":"PrefixedIdentifier","identifier":{"type":"Identifier","name":"white"},"prefix":{"type":"Identifier","name":"Colors"}}}]}}}]}}},{"type":"NamedExpression","id":{"type":"Identifier","name":"centerTitle"},"expression":{"type":"BooleanLiteral","value":true}}]}}},{"type":"NamedExpression","id":{"type":"Identifier","name":"body"},"expression":{"type":"MethodInvocation","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"ListView"},"property":{"type":"Identifier","name":"builder"}},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"NamedExpression","id":{"type":"Identifier","name":"itemBuilder"},"expression":{"type":"FunctionExpression","parameters":{"type":"FormalParameterList","parameterList":[{"type":"SimpleFormalParameter","paramType":null,"name":"context"},{"type":"SimpleFormalParameter","paramType":null,"name":"index"}]},"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"MethodInvocation","callee":{"type":"Identifier","name":"Container"},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"NamedExpression","id":{"type":"Identifier","name":"padding"},"expression":{"type":"MethodInvocation","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"EdgeInsets"},"property":{"type":"Identifier","name":"only"}},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"NamedExpression","id":{"type":"Identifier","name":"left"},"expression":{"type":"NumericLiteral","value":16}},{"type":"NamedExpression","id":{"type":"Identifier","name":"right"},"expression":{"type":"NumericLiteral","value":16}}]}}},{"type":"NamedExpression","id":{"type":"Identifier","name":"alignment"},"expression":{"type":"PrefixedIdentifier","identifier":{"type":"Identifier","name":"centerLeft"},"prefix":{"type":"Identifier","name":"Alignment"}}},{"type":"NamedExpression","id":{"type":"Identifier","name":"child"},"expression":{"type":"MethodInvocation","callee":{"type":"Identifier","name":"Text"},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"StringLiteral","value":"Hellow World"},{"type":"NamedExpression","id":{"type":"Identifier","name":"style"},"expression":{"type":"MethodInvocation","callee":{"type":"Identifier","name":"TextStyle"},"typeArguments":null,"argumentList":{"type":"ArgumentList","argumentList":[{"type":"NamedExpression","id":{"type":"Identifier","name":"color"},"expression":{"type":"PrefixedIdentifier","identifier":{"type":"Identifier","name":"white"},"prefix":{"type":"Identifier","name":"Colors"}}},{"type":"NamedExpression","id":{"type":"Identifier","name":"fontSize"},"expression":{"type":"NumericLiteral","value":18}}]}}}]}}},{"type":"NamedExpression","id":{"type":"Identifier","name":"color"},"expression":{"type":"PropertyAccess","id":{"type":"Identifier","name":"shade300"},"expression":{"type":"PrefixedIdentifier","identifier":{"type":"Identifier","name":"lightBlue"},"prefix":{"type":"Identifier","name":"Colors"}}}},{"type":"NamedExpression","id":{"type":"Identifier","name":"height"},"expression":{"type":"NumericLiteral","value":45}}]}}}]},"isAsync":false}},{"type":"NamedExpression","id":{"type":"Identifier","name":"itemCount"},"expression":{"type":"NumericLiteral","value":50}}]}}}]}}}]},"isAsync":false,"returnType":{"type":"TypeName","name":"Widget"}}]}]}';
125 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: dynamic_flutter_widget
2 | description: 动态widget 示例
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # In Android, build-name is used as versionName while build-number used as versionCode.
10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12 | # Read more about iOS versioning at
13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14 | version: 1.0.0+1
15 |
16 | environment:
17 | sdk: ">=2.1.0 <3.0.0"
18 |
19 | dependencies:
20 | flutter:
21 | sdk: flutter
22 |
23 | # The following adds the Cupertino Icons font to your application.
24 | # Use with the CupertinoIcons class for iOS style icons.
25 | cupertino_icons: ^0.1.2
26 |
27 | dev_dependencies:
28 | flutter_test:
29 | sdk: flutter
30 |
31 | dynamicflutter:
32 | path: ../
33 |
34 | # For information on the generic Dart part of this file, see the
35 | # following page: https://dart.dev/tools/pub/pubspec
36 |
37 | # The following section is specific to Flutter.
38 | flutter:
39 | # The following line ensures that the Material Icons font is
40 | # included with your application, so that you can use the icons in
41 | # the material Icons class.
42 | uses-material-design: true
43 | assets:
44 | - assets/
45 | # To add assets to your application, add an assets section, like this:
46 | # assets:
47 | # - images/a_dot_burr.jpeg
48 | # - images/a_dot_ham.jpeg
49 | # An image asset can refer to one or more resolution-specific "variants", see
50 | # https://flutter.dev/assets-and-images/#resolution-aware.
51 | # For details regarding adding assets from package dependencies, see
52 | # https://flutter.dev/assets-and-images/#from-packages
53 | # To add custom fonts to your application, add a fonts section here,
54 | # in this "flutter" section. Each entry in this list should have a
55 | # "family" key with the font family name, and a "fonts" key with a
56 | # list giving the asset and other descriptors for the font. For
57 | # example:
58 | # fonts:
59 | # - family: Schyler
60 | # fonts:
61 | # - asset: fonts/Schyler-Regular.ttf
62 | # - asset: fonts/Schyler-Italic.ttf
63 | # style: italic
64 | # - family: Trajan Pro
65 | # fonts:
66 | # - asset: fonts/TrajanPro.ttf
67 | # - asset: fonts/TrajanPro_Bold.ttf
68 | # weight: 700
69 | #
70 | # For details regarding fonts from package dependencies,
71 | # see https://flutter.dev/custom-fonts/#from-packages
72 |
--------------------------------------------------------------------------------
/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | ///
2 | ///Author: YoungChan
3 | ///Date: 2020-04-14 19:23:02
4 | ///LastEditors: YoungChan
5 | ///LastEditTime: 2020-04-22 18:50:08
6 | ///Description: file content
7 | ///
8 | // This is a basic Flutter widget test.
9 | //
10 | // To perform an interaction with a widget in your test, use the WidgetTester
11 | // utility that Flutter provides. For example, you can send tap and scroll
12 | // gestures. You can also use WidgetTester to find child widgets in the widget
13 | // tree, read text, and verify that the values of widget properties are correct.
14 |
15 | import 'package:flutter/material.dart';
16 | import 'package:flutter_test/flutter_test.dart';
17 |
18 | void main() {
19 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {});
20 | }
21 |
--------------------------------------------------------------------------------
/lib/ast_runtime_class.dart:
--------------------------------------------------------------------------------
1 | ///
2 | ///Author: YoungChan
3 | ///Date: 2020-04-18 19:47:09
4 | ///LastEditors: YoungChan
5 | ///LastEditTime: 2020-04-22 17:42:57
6 | ///Description: runtime 数据类定义
7 | ///
8 | import 'ast_node.dart';
9 | import 'ast_varialble_stack.dart';
10 |
11 | String _TAG = "[Ast Runtime Class] ";
12 |
13 | class AstRuntime {
14 | AstClass _astClass;
15 | AstVariableStack _variableStack;
16 |
17 | AstRuntime(Map ast) {
18 | if (ast['type'] == astNodeNameValue(AstNodeName.Program)) {
19 | var body = ast['body'] as List;
20 | _variableStack = AstVariableStack();
21 | _variableStack.blockIn();
22 | body?.forEach((b) {
23 | if (b['type'] == astNodeNameValue(AstNodeName.ClassDeclaration)) {
24 | //解析类
25 | _astClass = AstClass.fromAst(b, variableStack: _variableStack);
26 | } else if (b['type'] ==
27 | astNodeNameValue(AstNodeName.FunctionDeclaration)) {
28 | //解析全局函数
29 | var func = AstFunction.fromAst(b);
30 | _variableStack.setFunctionInstance(func.name, func);
31 | }
32 | });
33 | }
34 | }
35 |
36 | ///调用类方法,注意参数列表顺序与模版代码相同
37 | Future callMethod(String methodName, {List params}) async {
38 | if (_astClass != null) {
39 | return _astClass.callMethod(methodName, params: params);
40 | }
41 | return Future.value();
42 | }
43 |
44 | ///调用全局函数,注意参数列表顺序与模版代码相同
45 | Future callFunction(String functionName, {List params}) async {
46 | var function =
47 | _variableStack.getFunctionInstance(functionName);
48 | if (function != null) {
49 | return function.invoke(params, variableStack: _variableStack);
50 | }
51 | return Future.value();
52 | }
53 | }
54 |
55 | class AstClass {
56 | AstVariableStack _variableStack;
57 |
58 | AstClass(this._variableStack);
59 |
60 | dynamic callMethod(String name, {List params}) {
61 | var method = _variableStack.getFunctionInstance(name);
62 | if (method != null) {
63 | return method.invoke(params, variableStack: _variableStack);
64 | }
65 | return null;
66 | }
67 |
68 | factory AstClass.fromAst(Map ast, {AstVariableStack variableStack}) {
69 | if (ast['type'] == astNodeNameValue(AstNodeName.ClassDeclaration)) {
70 | var classNode = ClassDeclaration.fromAst(ast);
71 |
72 | if (variableStack == null) {
73 | variableStack = AstVariableStack();
74 | }
75 | variableStack.blockIn();
76 |
77 | for (var b in classNode.body) {
78 | if (b.isMethodDeclaration) {
79 | //解析类方法
80 | var method = b.asMethodDeclaration;
81 | variableStack.setFunctionInstance(
82 | method.name,
83 | AstFunction(method.name, method.parameterList, method.body,
84 | method.isAsync));
85 | } else if (b.isVariableDeclarationList) {
86 | //解析类成员变量
87 | variableStack.setVariableValue(
88 | b.asVariableDeclarationList.declarationList[0].name,
89 | _executeBaseExpression(b, variableStack));
90 | }
91 | }
92 | return AstClass(variableStack);
93 | }
94 | return null;
95 | }
96 | }
97 |
98 | class AstFunction {
99 | List _parameterList;
100 | BlockStatement _body;
101 | String name;
102 | bool _isAsync;
103 | AstFunction(this.name, this._parameterList, this._body, this._isAsync);
104 |
105 | Future invoke(List params, {AstVariableStack variableStack}) async {
106 | if (variableStack == null) {
107 | variableStack = AstVariableStack();
108 | }
109 | variableStack.blockIn();
110 | //初始化函数参数
111 | if (params?.isNotEmpty == true && params.length == _parameterList.length) {
112 | for (var i = 0; i < params.length; i++) {
113 | variableStack.setVariableValue(_parameterList[i].name, params[i]);
114 | }
115 | }
116 |
117 | var result = await _executeBlockStatement(_body, variableStack);
118 | variableStack.blockOut();
119 | return Future.value(result);
120 | }
121 |
122 | factory AstFunction.fromExpression(Expression expression) {
123 | if (expression.isFunctionDeclaration) {
124 | var function = expression.asFunctionDeclaration;
125 | return AstFunction(function.name, function.expression.parameterList,
126 | function.expression.body, function.expression.isAsync);
127 | } else if (expression.isMethodDeclaration) {
128 | var method = expression.asMethodDeclaration;
129 | return AstFunction(
130 | method.name, method.parameterList, method.body, method.isAsync);
131 | }
132 |
133 | return null;
134 | }
135 |
136 | factory AstFunction.fromAst(Map ast) {
137 | if (ast != null) {
138 | if (ast['type'] == astNodeNameValue(AstNodeName.MethodDeclaration)) {
139 | var method = MethodDeclaration.fromAst(ast);
140 | return AstFunction(
141 | method.name, method.parameterList, method.body, method.isAsync);
142 | } else if (ast['type'] ==
143 | astNodeNameValue(AstNodeName.FunctionDeclaration)) {
144 | var function = FunctionDeclaration.fromAst(ast);
145 | return AstFunction(function.name, function.expression.parameterList,
146 | function.expression.body, function.expression.isAsync);
147 | }
148 | }
149 | return null;
150 | }
151 | }
152 |
153 | Future _executeBlockStatement(
154 | BlockStatement block, AstVariableStack variableStack) async {
155 | variableStack.blockIn();
156 | var result;
157 | if (block.body?.isNotEmpty == true) {
158 | for (var expression in block.body) {
159 | result = await _executeBodyExpression(expression, variableStack);
160 | }
161 | }
162 |
163 | variableStack.blockOut();
164 | return Future.value(result);
165 | }
166 |
167 | //解析执行语法逻辑
168 | Future _executeBodyExpression(
169 | Expression expression, AstVariableStack variableStack) async {
170 | if (expression.isVariableDeclarationList) {
171 | await _executeVariableDeclaration(
172 | expression.asVariableDeclarationList, variableStack);
173 | } else if (expression.isAssignmentExpression) {
174 | await _executeAssignmentExpression(
175 | expression.asAssignmentExpression, variableStack);
176 | } else if (expression.isIfStatement) {
177 | await _executeIfStatement(expression.asIfStatement, variableStack);
178 | } else if (expression.isForStatement) {
179 | await _executeForStatement(expression.asForStatement, variableStack);
180 | } else if (expression.isExpressionStatement) {
181 | await _executeBodyExpression(expression.asExpression, variableStack);
182 | } else if (expression.isSwitchStatement) {
183 | await _executeSwitchStatement(expression.asSwitchStatement, variableStack);
184 | } else if (expression.isFunctionDeclaration) {
185 | //构造函数调用的参数值
186 | var params = [];
187 | var function = expression.asFunctionDeclaration;
188 | function.expression.parameterList?.forEach((p) {
189 | params.add(variableStack.getVariableValue(p.name).value);
190 | });
191 | return AstFunction.fromExpression(expression)
192 | .invoke(params, variableStack: variableStack);
193 | } else if (expression.isMethodDeclaration) {
194 | //构造方法调用的参数值
195 | var params = [];
196 | var function = expression.asFunctionDeclaration.expression;
197 | function.parameterList?.forEach((p) {
198 | params.add(variableStack.getVariableValue(p.name).value);
199 | });
200 | return AstFunction.fromExpression(expression)
201 | .invoke(params, variableStack: variableStack);
202 | } else if (expression.isReturnStatement) {
203 | return _executeBaseExpression(
204 | expression.asReturnStatement.argument, variableStack);
205 | }
206 | return Future.value();
207 | }
208 |
209 | ///解析有返回值的基础表达式
210 | dynamic _executeBaseExpression(
211 | Expression expression, AstVariableStack variableStack) {
212 | if (expression.isIdentifier) {
213 | return variableStack.getVariableValue(expression.asIdentifier.name)?.value;
214 | } else if (expression.isStringLiteral) {
215 | return expression.asStringLiteral.value;
216 | } else if (expression.isNumericLiteral) {
217 | return expression.asNumericLiteral.value;
218 | } else if (expression.isBooleanLiteral) {
219 | return expression.asBooleanLiteral.value;
220 | } else if (expression.isListLiteral) {
221 | return _executeListLiteral(expression.asListLiteral, variableStack);
222 | } else if (expression.isMapLiteral) {
223 | return _executeMapLiteral(expression.asMapLiteral, variableStack);
224 | } else if (expression.isBinaryExpression) {
225 | return _executeBinaryExpression(
226 | expression.asBinaryExpression, variableStack);
227 | } else if (expression.isPrefixedIdentifier) {
228 | //TODO prefix identifier
229 | } else if (expression.isIndexExpression) {
230 | return _executeIndexExpression(expression.asIndexExpression, variableStack);
231 | }
232 | return null;
233 | }
234 |
235 | List _executeListLiteral(
236 | ListLiteral listLiteral, AstVariableStack variableStack) {
237 | var list = [];
238 | listLiteral.elements.forEach((e) {
239 | list.add(_executeBaseExpression(e, variableStack));
240 | });
241 | return list;
242 | }
243 |
244 | Map _executeMapLiteral(MapLiteral mapLiteral, AstVariableStack variableStack) {
245 | var map = {};
246 | mapLiteral.elements.forEach((k, v) {
247 | map[k] = _executeBaseExpression(v, variableStack);
248 | });
249 | return map;
250 | }
251 |
252 | Future _executeVariableDeclaration(
253 | VariableDeclarationList variableDeclarationList,
254 | AstVariableStack variableStack) async {
255 | var variableDeclarator = variableDeclarationList.declarationList[0];
256 | if (variableDeclarator.init.isAwaitExpression) {
257 | //await expression;
258 | var value = await _executeMethodInvocation(
259 | variableDeclarator.init.asAwaitExpression.expression, variableStack);
260 | //存入声明的初始化变量值
261 | variableStack.setVariableValue(variableDeclarator.name, value);
262 | } else if (variableDeclarator.init.isMethodInvocation) {
263 | var value = await _executeMethodInvocation(
264 | variableDeclarator.init.asMethodInvocation, variableStack);
265 | //存入声明的初始化变量值
266 | variableStack.setVariableValue(variableDeclarator.name, value);
267 | } else {
268 | //存入声明的初始化变量值
269 | var v = _executeBaseExpression(variableDeclarator.init, variableStack);
270 | variableStack.setVariableValue(variableDeclarator.name, v);
271 | }
272 | return Future.value();
273 | }
274 |
275 | Future _executeIfStatement(
276 | IfStatement ifStatement, AstVariableStack variableStack) async {
277 | bool condition =
278 | _executeBinaryExpression(ifStatement.condition, variableStack) as bool;
279 | if (condition) {
280 | await _executeBlockStatement(ifStatement.consequent, variableStack);
281 | } else {
282 | await _executeBlockStatement(ifStatement.alternate, variableStack);
283 | }
284 | return Future.value();
285 | }
286 |
287 | Future _executeForStatement(
288 | ForStatement forStatement, AstVariableStack variableStack) async {
289 | var forLoopParts = forStatement.forLoopParts;
290 | //for...in... 语句处理
291 | if (forStatement.type == ForLoopParts.forEachPartsWithDeclaration) {
292 | //获取迭代数据集
293 | var iterableValue =
294 | (variableStack.getVariableValue(forLoopParts.iterable)?.value ?? [])
295 | as List;
296 | if (iterableValue?.isNotEmpty == true) {
297 | iterableValue.forEach((v) {
298 | //将迭代值存入变量栈
299 | variableStack.setVariableValue(forLoopParts.loopVariable, v);
300 | //执行循环内的逻辑
301 | _executeBlockStatement(forStatement.body, variableStack);
302 | });
303 | }
304 | } else {
305 | //初始化
306 | if (forStatement.type == ForLoopParts.forPartsWithDeclarations) {
307 | await _executeVariableDeclaration(
308 | forLoopParts.variableList, variableStack);
309 | } else if (forStatement.type == ForLoopParts.forPartsWithExpression) {
310 | await _executeAssignmentExpression(
311 | forLoopParts.initialization, variableStack);
312 | }
313 | //循环判断条件位
314 | bool condition =
315 | _executeBinaryExpression(forLoopParts.condition, variableStack);
316 | while (condition) {
317 | //解析循环步长
318 | if (forLoopParts.updater.isPrefixExpression) {
319 | _executePrefixExpression(
320 | forLoopParts.updater.asPrefixExpression, variableStack);
321 | } else if (forLoopParts.updater.isAssignmentExpression) {
322 | await _executeAssignmentExpression(
323 | forLoopParts.updater.asAssignmentExpression, variableStack);
324 | }
325 | //执行循环体的逻辑
326 | _executeBlockStatement(forStatement.body, variableStack);
327 | //循环判断条件位
328 | condition =
329 | _executeBinaryExpression(forLoopParts.condition, variableStack);
330 | }
331 | }
332 | return Future.value();
333 | }
334 |
335 | Future _executeSwitchStatement(
336 | SwitchStatement switchStatement, AstVariableStack variableStack) async {
337 | var conditionValue;
338 | if (switchStatement.checkValue.isIdentifier) {
339 | conditionValue = variableStack
340 | .getVariableValue(switchStatement.checkValue.asIdentifier.name)
341 | ?.value;
342 | } else {
343 | //TODO Others expression
344 | }
345 | for (var c in switchStatement.body) {
346 | if (c.isDefault ||
347 | conditionValue == _executeBaseExpression(c.condition, variableStack)) {
348 | for (var b in c.statements) {
349 | await _executeBodyExpression(b, variableStack);
350 | }
351 | break;
352 | }
353 | }
354 | return Future.value();
355 | }
356 |
357 | num _executePrefixExpression(
358 | PrefixExpression prefixExpression, AstVariableStack variableStack) {
359 | var argValue = variableStack.getVariableValue(prefixExpression.argument);
360 | num returnValue;
361 | if (argValue?.value is int || argValue?.value is double) {
362 | if (prefixExpression.operator == '++') {
363 | if (prefixExpression.prefix) {
364 | returnValue = ++argValue.value;
365 | } else {
366 | returnValue = argValue.value++;
367 | }
368 | } else if (prefixExpression.operator == '--') {
369 | if (prefixExpression.prefix) {
370 | returnValue = --argValue.value;
371 | } else {
372 | returnValue = argValue.value--;
373 | }
374 | }
375 | }
376 | return returnValue;
377 | }
378 |
379 | dynamic _executeIndexExpression(
380 | IndexExpression indexExpression, AstVariableStack variableStack) {
381 | var target;
382 | if (indexExpression.target.isIndexExpression) {
383 | target = _executeIndexExpression(
384 | indexExpression.target.asIndexExpression, variableStack);
385 | } else if (indexExpression.target.isIdentifier) {
386 | target = variableStack
387 | .getVariableValue(indexExpression.target.asIdentifier.name)
388 | ?.value;
389 | }
390 | if (target != null) {
391 | if (target is List) {
392 | var index = indexExpression.index.asNumericLiteral.value;
393 | if (target.length > index) {
394 | return target[index];
395 | }
396 | } else if (target is Map) {
397 | var index = indexExpression.index.asIdentifier.name;
398 | return target[index];
399 | }
400 | }
401 |
402 | return null;
403 | }
404 |
405 | ///更新IndexExpression 表达式的值
406 | void _updateIndexExpressionValue(IndexExpression indexExpression, dynamic value,
407 | AstVariableStack variableStack) {
408 | var target;
409 | if (indexExpression.target.isIndexExpression) {
410 | target = _executeIndexExpression(
411 | indexExpression.target.asIndexExpression, variableStack);
412 | } else if (indexExpression.target.isIdentifier) {
413 | target = variableStack
414 | .getVariableValue(indexExpression.target.asIdentifier.name)
415 | ?.value;
416 | }
417 | if (target != null) {
418 | if (target is List) {
419 | var index = indexExpression.index.asNumericLiteral.value;
420 | if (target.length > index) {
421 | target[index] = value;
422 | }
423 | } else if (target is Map) {
424 | var index = indexExpression.index.asIdentifier.name;
425 | target[index] = value;
426 | }
427 | }
428 | }
429 |
430 | Future _executeAssignmentExpression(AssignmentExpression assignmentExpression,
431 | AstVariableStack variableStack) async {
432 | var leftValue =
433 | _executeBaseExpression(assignmentExpression.left, variableStack);
434 | var rightValue;
435 | if (assignmentExpression.right.isAwaitExpression) {
436 | rightValue = await _executeMethodInvocation(
437 | assignmentExpression.right.asAwaitExpression.expression, variableStack);
438 | }
439 | if (assignmentExpression.right.isMethodInvocation) {
440 | rightValue = await _executeMethodInvocation(
441 | assignmentExpression.right.asMethodInvocation, variableStack);
442 | } else {
443 | rightValue =
444 | _executeBaseExpression(assignmentExpression.right, variableStack);
445 | }
446 |
447 | switch (assignmentExpression.operator) {
448 | case '+=':
449 | rightValue = leftValue + rightValue;
450 | break;
451 | case '+=':
452 | rightValue = leftValue - rightValue;
453 | break;
454 | case '*=':
455 | rightValue = leftValue * rightValue;
456 | break;
457 | case '/=':
458 | rightValue = leftValue / rightValue;
459 | break;
460 | }
461 | if (assignmentExpression.left.isIdentifier) {
462 | var variableValue = variableStack
463 | .getVariableValue(assignmentExpression.left.asIdentifier.name);
464 | variableValue.value = rightValue;
465 | } else if (assignmentExpression.left.isPrefixedIdentifier) {
466 | //TODO: Prefixed 类型处理
467 | } else if (assignmentExpression.left.isIndexExpression) {
468 | _updateIndexExpressionValue(
469 | assignmentExpression.left.asIndexExpression, rightValue, variableStack);
470 | }
471 | return Future.value();
472 | }
473 |
474 | dynamic _executeBinaryExpression(
475 | BinaryExpression binaryExpression, AstVariableStack variableStack) {
476 | //获取左操作符的值
477 | var leftValue = _executeBaseExpression(binaryExpression.left, variableStack);
478 |
479 | //获取右操作符的值
480 | var rightValue =
481 | _executeBaseExpression(binaryExpression.right, variableStack);
482 |
483 | //操作符
484 | switch (binaryExpression.operator) {
485 | case '+':
486 | return leftValue + rightValue;
487 | case '-':
488 | return leftValue - rightValue;
489 | case '*':
490 | return leftValue * rightValue;
491 | case '/':
492 | return leftValue / rightValue;
493 | case '<':
494 | return leftValue < rightValue;
495 | case '>':
496 | return leftValue > rightValue;
497 | case '<=':
498 | return leftValue <= rightValue;
499 | case '>=':
500 | return leftValue >= rightValue;
501 | case '==':
502 | return leftValue == rightValue;
503 | case '&&':
504 | return leftValue && rightValue;
505 | case '||':
506 | return leftValue || rightValue;
507 | case '%':
508 | return leftValue % rightValue;
509 | case '<<':
510 | return leftValue << rightValue;
511 | case '|':
512 | return leftValue | rightValue;
513 | case '&':
514 | return leftValue & rightValue;
515 | case '>>':
516 | return leftValue >> rightValue;
517 | default:
518 | return null;
519 | }
520 | }
521 |
522 | Future _executeMethodInvocation(
523 | MethodInvocation invocation, AstVariableStack variableStack) async {
524 | if (invocation.callee.isIdentifier) {
525 | var methodName = invocation.callee.asIdentifier.name;
526 | if (methodName == 'selectNewModel') {
527 | return Future.value({});
528 | } else {
529 | //构造方法参数值
530 | var params = [];
531 | if (invocation.argumentList?.isNotEmpty == true) {
532 | for (var arg in invocation.argumentList) {
533 | params.add(_executeBaseExpression(arg, variableStack));
534 | }
535 | }
536 | var method = variableStack.getFunctionInstance(methodName);
537 | if (method != null) {
538 | //调用方法
539 | return method.invoke(params, variableStack: variableStack);
540 | }
541 | }
542 | } else if (invocation.callee.isMemberExpression) {
543 | //TODO MemberExression
544 | }
545 | return Future.value();
546 | }
547 |
--------------------------------------------------------------------------------
/lib/ast_varialble_stack.dart:
--------------------------------------------------------------------------------
1 | ///
2 | ///Author: YoungChan
3 | ///Date: 2020-04-18 13:37:28
4 | ///LastEditors: YoungChan
5 | ///LastEditTime: 2020-04-22 17:42:22
6 | ///Description: 变量栈
7 | ///
8 | /// 标识变量类型
9 | enum AstVariableType {
10 | ///基础数据类型
11 | Base,
12 |
13 | ///函数
14 | Function,
15 | }
16 |
17 | class AstVariableStack {
18 | List