├── .gitignore
├── .idea
├── libraries
│ └── Dart_SDK.xml
├── modules.xml
├── runConfigurations
│ └── example_lib_main_dart.xml
└── workspace.xml
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── README_CH.md
├── doc
├── bestpratice.md
└── widgets.md
├── example
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── yingzi_flutter_dynamicpage_example
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── .last_build_id
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Podfile.lock
│ ├── 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
│ ├── demo
│ │ ├── actions.dart
│ │ ├── adapter.dart
│ │ ├── bestpratice.dart
│ │ ├── config.dart
│ │ ├── dsl.dart
│ │ └── helloworld.dart
│ ├── grammar
│ │ ├── base.dart
│ │ ├── bool.dart
│ │ ├── controlflow.dart
│ │ ├── dsl.dart
│ │ ├── list.dart
│ │ ├── map.dart
│ │ ├── math.dart
│ │ ├── number.dart
│ │ ├── operators_lo.dart
│ │ ├── operators_re.dart
│ │ ├── set.dart
│ │ ├── string.dart
│ │ ├── unittesting.dart
│ │ └── user_code.dart
│ └── main.dart
├── pubspec.lock
├── pubspec.yaml
└── test
│ └── widget_test.dart
├── lib
├── main.dart
├── pages
│ ├── basic
│ │ ├── lifecycle.dart
│ │ ├── page.dart
│ │ └── utils.dart
│ ├── builder.dart
│ ├── custompage.dart
│ ├── formpage.dart
│ ├── formwidget.dart
│ └── model
│ │ └── page_config.dart
├── tools
│ ├── action.dart
│ ├── actions
│ │ ├── all.dart
│ │ ├── control_flow.dart
│ │ ├── core.dart
│ │ ├── iterable.dart
│ │ ├── list.dart
│ │ ├── map.dart
│ │ ├── math.dart
│ │ ├── number.dart
│ │ ├── regexp.dart
│ │ ├── router.dart
│ │ ├── set.dart
│ │ └── string.dart
│ ├── code.dart
│ ├── code
│ │ └── lexical_analyzer.dart
│ ├── common.dart
│ ├── network.dart
│ ├── rule.dart
│ └── variable.dart
└── widgets
│ ├── alert_dialog.dart
│ ├── align.dart
│ ├── all.dart
│ ├── app_bar.dart
│ ├── basic.dart
│ ├── basic
│ ├── action.dart
│ ├── data.dart
│ ├── event.dart
│ ├── handler.dart
│ ├── utils.dart
│ └── widget.dart
│ ├── button.dart
│ ├── center.dart
│ ├── checkbox.dart
│ ├── clip_rrect.dart
│ ├── column.dart
│ ├── container.dart
│ ├── dialog.dart
│ ├── divider.dart
│ ├── expanded.dart
│ ├── flexible.dart
│ ├── form.dart
│ ├── gesture_detector.dart
│ ├── image.dart
│ ├── listView.dart
│ ├── model
│ └── widget_config.dart
│ ├── offstage.dart
│ ├── padding.dart
│ ├── positioned.dart
│ ├── radio.dart
│ ├── row.dart
│ ├── safe_area.dart
│ ├── scaffold.dart
│ ├── scroll_view.dart
│ ├── simple_dialog.dart
│ ├── stack.dart
│ ├── statefulwidget.dart
│ ├── statelesswidget.dart
│ ├── text.dart
│ ├── text_field.dart
│ └── wrap.dart
├── pubspec.lock
├── pubspec.yaml
├── test
└── yz_flutter_dynamic_test.dart
└── yz_flutter_dynamic.iml
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/example_lib_main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/.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: f30b7f4db93ee747cd727df747941a28ead25ff5
8 | channel: stable
9 |
10 | project_type: plugin
11 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 0.0.1
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/doc/bestpratice.md:
--------------------------------------------------------------------------------
1 | ## Best Practice (最佳实践)
2 | > 此文档我们将一步步按展示如何使用flutter_dynamic完成动态创建页面的过程。如果想看真实的效果,请运行example工程里的Best Practice。
3 |
4 |
5 |
6 |
7 |
8 | ### Step 1
9 | > 先创建具有两个输入框和一个按扭的描述UI的数据;
10 |
11 |
12 | TextFieldA
13 | ```dart
14 | var _textFieldA = {
15 | "xKey": "_TextFieldA",
16 | "widgetName": "TextField",
17 | "props": {
18 | "style": {
19 | "color": "0xff000000",
20 | "fontWeight": "bold"
21 | },
22 | "keyboardType": "number",
23 | "value": "Input",
24 | "decoration" : {
25 | "hint": "I am TextFieldA",
26 | "border": {
27 | "color": "0xffffff00",
28 | "width": "2"
29 | }
30 | }
31 | }
32 | };
33 | ```
34 |
35 | TextFieldB
36 | ```dart
37 | var _textFieldB = {
38 | "xKey": "_TextFieldB",
39 | "widgetName": "TextField",
40 | "props": {
41 | "style": {
42 | "color": "0xff000000",
43 | "fontWeight": "bold"
44 | },
45 | "value": "Input",
46 | "decoration" : {
47 | "hint": "I am TextFieldB",
48 | "border": {
49 | "color": "0xffffff00",
50 | "width": "2"
51 | }
52 | }
53 | }
54 | };
55 | ```
56 |
57 | button
58 | ```dart
59 | var _button = {
60 | "xKey": "_RawMaterialButton",
61 | "widgetName": "RawMaterialButton",
62 | "props": {
63 | "fillColor": "0xfff2f2f2",
64 | "padding": "[10,0,10,0]",
65 | "child": {
66 | "type": "sysWidget",
67 | "widgetName": "Text",
68 | "props": {
69 | "data": "'RawMaterialButton'. Click",
70 | "color": "0xff123456",
71 | "backgroundColor": "0xff00ff00",
72 | "fontSize": "16",
73 | "fontWeight": "bold",
74 | "lineHeight": "1.2"
75 | }
76 | }
77 | }
78 | };
79 | ```
80 |
81 | ### Step 2
82 | > 为了更好地演示效果,我们需要将Step 1的json数据放在Scaffold类型的Material widget里,并通过单独的页面来展示它:
83 |
84 |
85 | ```dart
86 | var _dslRootWidget = {
87 | "xKey": "",
88 | "widgetName": "Scaffold",
89 | "props": {
90 | "appBar": {
91 | "xKey": "",
92 | "widgetName": "AppBar",
93 | "props": {
94 | "title": {
95 | "widgetName": "Text",
96 | "props": {"data": "Navigator"}
97 | }
98 | }
99 | },
100 | "body": {
101 | "xKey": "",
102 | "widgetName": "SafeArea",
103 | "props": {
104 | "child": {
105 | "xKey": "",
106 | "widgetName": "Column",
107 | "props": {
108 | "children": [
109 | _textFieldA,
110 | _textFieldB,
111 | _button
112 | ]
113 | }
114 | }
115 | }
116 | }
117 | }
118 | };
119 | ```
120 |
121 | ### Step 3
122 | > 通过Step 1和Step 2,我们就可以创建一个完整的UI了。具体效果见example/lib/main.dart里的Best Practice演示效果:
123 |
124 | ```dart
125 |
126 | Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext contex){
127 | return YZDynamic.buildWidget(context, bestPraticeDsl, preConfig: null);
128 | }));
129 |
130 | ```
131 |
132 | ### Step 4
133 | > 如果点击button的时候需要获取TextFieldA和TextFieldB的值,我们该如何实现呢?很简单,在button json里加入如下定义就可以了:
134 |
135 | event
136 | ```dart
137 | "xEvents": [
138 | {
139 | "eventType": "onClick",
140 | "code": '''
141 | =;
142 | action:yzToast(tip:)
143 | '''
144 | }
145 | ]
146 |
147 | ```
148 |
149 | and button json will show as:
150 | ```dart
151 | var _button = {
152 | "xKey": "_RawMaterialButton",
153 | "widgetName": "RawMaterialButton",
154 | "props": {
155 | "fillColor": "0xfff2f2f2",
156 | "padding": "[10,0,10,0]",
157 | "child": {
158 | "type": "sysWidget",
159 | "widgetName": "Text",
160 | "props": {
161 | "data": "Button",
162 | "color": "0xff123456",
163 | "backgroundColor": "0xff00ff00",
164 | "fontSize": "16",
165 | "fontWeight": "bold",
166 | "lineHeight": "1.2"
167 | }
168 | }
169 | },
170 | "xEvents": [
171 | {
172 | "eventType": "onClick",
173 | "code": '''
174 | =;
175 | action:yzToast(tip:)
176 | '''
177 | }
178 | ]
179 | };
180 | ```
181 |
182 | ### Step 5
183 | > Building more wonderful application, Please read [Document](https://github.com/Yingzi-Technology/flutter_dynamic)
184 |
--------------------------------------------------------------------------------
/doc/widgets.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/doc/widgets.md
--------------------------------------------------------------------------------
/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 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 |
--------------------------------------------------------------------------------
/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: 0b8abb4724aa590dd0f429683339b1e045a1594d
8 | channel: unknown
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # yingzi_flutter_dynamicpage_example
2 |
3 | Demonstrates how to use the yz_flutter_dynamic plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://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/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/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.example.yingzi_flutter_dynamicpage_example"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "androidx.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 'androidx.test:runner:1.1.1'
66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
67 | }
68 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
26 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/yingzi_flutter_dynamicpage_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.yingzi_flutter_dynamicpage_example
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity
5 | import io.flutter.embedding.engine.FlutterEngine
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10 | GeneratedPluginRegistrant.registerWith(flutterEngine);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/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.6.2-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/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/example/ios/Flutter/.last_build_id:
--------------------------------------------------------------------------------
1 | 83bcff09dfccf1b706d26d99ca6b484e
--------------------------------------------------------------------------------
/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 flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - fluttertoast (0.0.2):
4 | - Flutter
5 | - Toast
6 | - Toast (4.0.0)
7 |
8 | DEPENDENCIES:
9 | - Flutter (from `Flutter`)
10 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
11 |
12 | SPEC REPOS:
13 | trunk:
14 | - Toast
15 |
16 | EXTERNAL SOURCES:
17 | Flutter:
18 | :path: Flutter
19 | fluttertoast:
20 | :path: ".symlinks/plugins/fluttertoast/ios"
21 |
22 | SPEC CHECKSUMS:
23 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
24 | fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
25 | Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
26 |
27 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
28 |
29 | COCOAPODS: 1.10.1
30 |
--------------------------------------------------------------------------------
/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 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yingzi-Technology/flutter_dynamic/dd0f3b58dbfccca095835220a2335a5b0b851e21/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 | yingzi_flutter_dynamicpage_example
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/demo/actions.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2020-09-19 13:45:48
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2020-11-19 11:18:56
6 | */
7 |
8 | import 'package:fluttertoast/fluttertoast.dart';
9 | import 'package:yz_flutter_dynamic/main.dart';
10 |
11 | /*
12 | * Custum action
13 | * 自定义 action
14 | */
15 | class YZToastHandler extends YZDynamicPublicActionHandler{
16 | @override
17 | void action(BuildContext context, {
18 | Map params,
19 | YZDynamicRequest request,
20 | List rules,
21 | Map localVariables,
22 | State state,
23 | }) {
24 | String tip = params['tip'];
25 | Fluttertoast.showToast(
26 | msg: tip,
27 | toastLength: Toast.LENGTH_SHORT,
28 | gravity: ToastGravity.CENTER,
29 | timeInSecForIosWeb: 1,
30 | backgroundColor: Colors.red,
31 | textColor: Colors.white,
32 | fontSize: 16.0
33 | );
34 | }
35 |
36 | @override
37 | String get actionName => 'yzToast';
38 |
39 | }
--------------------------------------------------------------------------------
/example/lib/demo/adapter.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2021-07-15 13:43:44
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2021-07-15 13:52:47
6 | * @Describe: 组件属性适配
7 | */
8 |
9 | // Text widget adapter
10 | Map yzTextWidgetAdapter(Map json) {
11 |
12 | Map _json = {};
13 | for (var key in json.keys) {
14 | _json[key] = json[key];
15 | }
16 |
17 | if (_json['props'] != null &&
18 | (_json['props'] is Map) &&
19 | _json['props']['style'] == null) {
20 |
21 | _json['props']['style'] = {
22 | "color" : json['props']['fontColor'],
23 | "background" : json['props']['bgColor'],
24 | "fontSize" : json['props']['fontSize'],
25 | "fontWeight" : json['props']['fontWeight'],
26 | "fontStyle" : json['props']['fontStyle'],
27 | "letterSpacing" : json['props']['letterSpacing'],
28 | "wordSpacing" : json['props']['wordSpacing'],
29 | "height" : json['props']['height'],
30 | };
31 |
32 | }
33 |
34 | return _json;
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/example/lib/demo/bestpratice.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2020-12-21 16:54:50
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2020-12-21 17:58:51
6 | */
7 |
8 | Map bestPraticeDsl = _dslRootWidget;
9 |
10 | var _dslRootWidget = {
11 | "xKey": "",
12 | "widgetName": "Scaffold",
13 | "props": {
14 | "appBar": {
15 | "xKey": "",
16 | "widgetName": "AppBar",
17 | "props": {
18 | "title": {
19 | "widgetName": "Text",
20 | "props": {"data": "Navigator"}
21 | }
22 | }
23 | },
24 | "body": {
25 | "xKey": "",
26 | "widgetName": "SafeArea",
27 | "props": {
28 | "child": {
29 | "xKey": "",
30 | "widgetName": "Column",
31 | "props": {
32 | "children": [
33 | _textFieldA,
34 | _textFieldB,
35 | _button,
36 | _button2
37 | ]
38 | }
39 | }
40 | }
41 | }
42 | }
43 | };
44 |
45 | var _textFieldA = {
46 | "xKey": "_TextFieldA",
47 | "widgetName": "TextField",
48 | "props": {
49 | "value": "I am TextFieldA",
50 | "style": {
51 | "color": "0xff000000",
52 | "fontWeight": "bold"
53 | },
54 | "keyboardType": "number",
55 | "decoration" : {
56 | "hint": "I am TextFieldA"
57 | }
58 | }
59 | };
60 |
61 | var _textFieldB = {
62 | "xKey": "_TextFieldB",
63 | "widgetName": "TextField",
64 | "props": {
65 | "style": {
66 | "color": "0xff000000",
67 | "fontWeight": "bold"
68 | },
69 | "decoration" : {
70 | "hint": "I am TextFieldB"
71 | }
72 | }
73 | };
74 |
75 | var _button = {
76 | "xKey": "_RawMaterialButton",
77 | "widgetName": "RawMaterialButton",
78 | "props": {
79 | "fillColor": "0xfff2f2f2",
80 | "padding": "[10,0,10,0]",
81 | "child": {
82 | "type": "sysWidget",
83 | "widgetName": "Text",
84 | "props": {
85 | "data": "Button",
86 | "color": "0xff123456",
87 | "backgroundColor": "0xff00ff00",
88 | "fontSize": "16",
89 | "fontWeight": "bold",
90 | "lineHeight": "1.2"
91 | }
92 | }
93 | },
94 | "xEvents": [
95 | // {
96 | // "eventType": "onClick",
97 | // "code": '''
98 | // =;
99 | // action:yzToast(tip:)
100 | // '''
101 | // },
102 | {
103 | "name": "",
104 | "eventType": "onClick",
105 | "actions": [
106 | {
107 | "actionName":"yzToast",
108 | "params":{"tip":""},
109 | "targetKey": ""
110 | }
111 | ],
112 | "code": ""
113 | }
114 | ]
115 | };
116 |
117 | var _button2 = {
118 | "xKey": "_RawMaterialButton2",
119 | "widgetName": "RawMaterialButton",
120 | "props": {
121 | "fillColor": "0xfff2f2f2",
122 | "padding": "[10,0,10,0]",
123 | "child": {
124 | "type": "sysWidget",
125 | "widgetName": "Text",
126 | "props": {
127 | "data": "访问传入页面的回调方法",
128 | "color": "0xff123456",
129 | "backgroundColor": "0xff00ff00",
130 | "fontSize": "16",
131 | "fontWeight": "bold",
132 | "lineHeight": "1.2"
133 | }
134 | }
135 | },
136 | "xEvents": [
137 | {
138 | "name": "",
139 | "eventType": "onClick",
140 | "actions": [
141 | {
142 | "actionName":"outDoorAction"
143 | }
144 | ],
145 | "code": ""
146 | }
147 | ]
148 | };
149 |
150 |
--------------------------------------------------------------------------------
/example/lib/demo/config.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2020-09-03 09:24:58
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2021-07-15 13:45:13
6 | **/
7 |
8 | import 'actions.dart';
9 |
10 | import 'package:yz_flutter_dynamic/main.dart';
11 |
12 | import 'adapter.dart';
13 |
14 | /// The third part config
15 |
16 | bool isDynamicpageConfigFPFInit = false;
17 |
18 | dynamicpageConfigDemo() {
19 |
20 | if (isDynamicpageConfigFPFInit == true) return;
21 | isDynamicpageConfigFPFInit = true;
22 |
23 | //Register the third part widget
24 | //注册扩展的第三方控件
25 | // YZDynamicCommon.reginsterWidgetHandler(...);
26 |
27 | //Register the third part action
28 | //注册扩展的第三方action
29 | YZDynamicCommon.reginsterPublicActionHandler(YZToastHandler());
30 |
31 | YZDynamicCommon.addWidgetConfigInterceptor('Text', yzTextWidgetAdapter);
32 |
33 | //注册网络库
34 | //Register the network lib
35 | // YZDynamicCommon.network = YZDynamicDataNetworkFPF.getInstance();
36 |
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/example/lib/grammar/base.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2020-12-02 14:43:45
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2020-12-02 17:42:52
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:yz_flutter_dynamic/main.dart';
10 |
11 | import 'dsl.dart';
12 |
13 | class UTBaseState extends State {
14 |
15 | external List getItem();
16 | external String get getTitle;
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return Scaffold(
21 | appBar: AppBar(title: Text(this.getTitle)),
22 | body: Padding(
23 | padding: EdgeInsets.all(10),
24 | child: SingleChildScrollView(
25 | child: Column(
26 | crossAxisAlignment: CrossAxisAlignment.start,
27 | children: this.getItem(),
28 | )
29 | )
30 | ),
31 | );
32 | }
33 |
34 | Widget createItem(String kw, String code) {
35 | TextEditingController control = TextEditingController.fromValue(
36 | TextEditingValue(
37 | text:
38 | '''$code'''
39 | )
40 | );
41 | return Column(
42 | crossAxisAlignment: CrossAxisAlignment.start,
43 | children: [
44 | Container(
45 | margin: EdgeInsets.only(bottom: 10),
46 | child: FlatButton(
47 | color: Colors.black12,
48 | child: Text(kw, style: TextStyle(fontSize: 14, color: Colors.lightBlue)),
49 | onPressed: (){
50 | YZDynamic.handle(
51 | context, getDemoDsl(control.text)
52 | );
53 | }
54 | )
55 | ),
56 | TextField(
57 | maxLines: null,
58 | decoration: InputDecoration(
59 | contentPadding: EdgeInsets.zero
60 | ),
61 | scrollPadding: EdgeInsets.zero,
62 | textAlign: TextAlign.start,
63 | controller: control,
64 | )
65 | ],
66 | );
67 | }
68 |
69 | }
--------------------------------------------------------------------------------
/example/lib/grammar/bool.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yangyiting
3 | * @Date: 2021-03-01 09:29:56
4 | * @Last Modified by: yangyiting
5 | * @Last Modified time: 2021-03-01 11:38:37
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 |
10 | import 'base.dart';
11 |
12 | class UTBool extends StatefulWidget {
13 | @override
14 | _UTBoolState createState() => _UTBoolState();
15 | }
16 |
17 | class _UTBoolState extends UTBaseState {
18 |
19 | String get getTitle => "bool";
20 |
21 | List getItem() {
22 | return [
23 | createItem('bool', '=action:bool(true)'),
24 | createItem('Sys.bool', '=action:Sys.bool(true)'),
25 | createItem('Sys.bool', '=action:Sys.bool(false)'),
26 | createItem('Sys.bool.toString', '=action:bool.toString(false)'),
27 | ];
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/example/lib/grammar/controlflow.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2020-12-01 11:20:04
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2020-12-02 18:20:56
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:yz_flutter_dynamic/main.dart';
10 |
11 | import 'base.dart';
12 |
13 | class UTIfElse extends StatefulWidget {
14 | @override
15 | _UTIfElseState createState() => _UTIfElseState();
16 | }
17 |
18 | class _UTIfElseState extends UTBaseState {
19 |
20 | String get getTitle => "if else operators";
21 |
22 | List getItem() {
23 | return [
24 | createItem("if",
25 | '''
26 | var:=bool(true);
27 | if () {
28 | var:=if;
29 | var:=var:
30 | }
31 | '''),
32 | createItem("if else",
33 | '''
34 | var:=bool(true);
35 | if () {
36 | var:=if;
37 | var:=var:
38 | } else {
39 | var:=else;
40 | var:=var:
41 | }
42 | '''),
43 | createItem("if else if",
44 | '''
45 | var:=bool(true);
46 | var:=bool(false);
47 | var:=;
48 | if () {
49 | var:=if;
50 | var:=var:
51 | } else if (var:) {
52 | var:=elseif;
53 | var:=var:
54 | } else {
55 | var:=else;
56 | var:=var:
57 | }
58 | ''')
59 | ];
60 | }
61 |
62 | }
63 |
64 |
65 | class UTSwitchCase extends StatefulWidget {
66 | @override
67 | _UTSwitchCaseState createState() => _UTSwitchCaseState();
68 | }
69 |
70 | class _UTSwitchCaseState extends UTBaseState {
71 |
72 | String get getTitle => "switch case operators";
73 |
74 | List getItem() {
75 | return [
76 | createItem("switch case",
77 | '''
78 | var:=int(2);
79 | switch () {
80 | case 1: {
81 | var:=1;
82 | var:=var:;
83 | break;
84 | }
85 | case int(2): {
86 | var:=2;
87 | var:=var:;
88 | break;
89 | }
90 | default: {
91 | var:=default;
92 | var:=var:;
93 | break;
94 | }
95 | }
96 | ''')
97 | ];
98 | }
99 |
100 | }
101 |
102 | class UTForloop extends StatefulWidget {
103 | @override
104 | _UTForloopState createState() => _UTForloopState();
105 | }
106 |
107 | class _UTForloopState extends UTBaseState {
108 |
109 | String get getTitle => "forloop operators";
110 |
111 | List getItem() {
112 | return [
113 | createItem("for",
114 | '''
115 | var:=List(a,b,c);
116 | var:=int(3);
117 | for ( = 0; i < var:; ++) {
118 | var:=action:List.valueOfIndex(list:, index:);
119 | var:=var:;
120 | }
121 | ''')
122 | ];
123 | }
124 |
125 | }
126 |
127 | class UTWhile extends StatefulWidget {
128 | @override
129 | _UTWhileState createState() => _UTWhileState();
130 | }
131 |
132 | class _UTWhileState extends UTBaseState {
133 |
134 | String get getTitle => "while operators";
135 |
136 | List getItem() {
137 | return [
138 | createItem("while",
139 | '''
140 | var:=int(0);
141 | while (Sys.<=(, int(10))) {
142 | var:=num.+(, 1);
143 | };
144 | var:=var:;
145 | ''')
146 | ];
147 | }
148 |
149 | }
--------------------------------------------------------------------------------
/example/lib/grammar/dsl.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2020-12-01 12:00:04
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2020-12-02 16:26:07
6 | */
7 |
8 | getDemoDsl(String code) {
9 |
10 | code = code.trim();
11 |
12 | var result;
13 | if (code.startsWith('userCode:')) {
14 | result = code;
15 | } else {
16 | result = '''code:
17 | $code
18 | var:=`The result is: var:`;
19 | action:Sys.print(var:);
20 | action:String(var:)
21 | ''';
22 |
23 | if (!code.startsWith("var")) {
24 | code = "var:=$code;";
25 | } else if (!code.endsWith(';')){
26 | code = '$code;';
27 | }
28 | }
29 |
30 | var text = {
31 | "xKey": "_Text",
32 | "type": "sysWidget",
33 | "widgetName": "Text",
34 | "props": {
35 | "data": "var:",
36 | },
37 | "xVar": {
38 | "result": result
39 | }
40 | };
41 |
42 | var tip = {
43 | "xKey": "_TextTip",
44 | "type": "sysWidget",
45 | "widgetName": "Text",
46 | "props": {
47 | "data": "如果希望显示语句结果,需要把语句结果赋值给,如=num.+(1,2);\n\r输出结果如下:\n\r",
48 | }
49 | };
50 |
51 | var _dslRootWidget = {
52 | "xKey": "",
53 | "widgetName": "Scaffold",
54 | "props": {
55 | "appBar": {
56 | "xKey": "",
57 | "widgetName": "AppBar",
58 | "props": {
59 | "title": {
60 | "widgetName": "Text",
61 | "props": {"data": "Demo"}
62 | }
63 | }
64 | },
65 | "body": {
66 | "xKey": "",
67 | "widgetName": "Column",
68 | "props": {
69 | "children": [
70 | {
71 | "xKey": "",
72 | "widgetName": "SingleChildScrollView",
73 | "props": {
74 | "child": {
75 | "xKey": "",
76 | "widgetName": "Column",
77 | "props": {
78 | "children": [
79 | tip,
80 | text,
81 | ]
82 | }
83 | }
84 | }
85 | }
86 | ]
87 | }
88 | }
89 | }
90 | };
91 |
92 | Map demoDsl =
93 | {
94 | "page": {
95 | "presentMode": "dialog",
96 | "rootWidget": _dslRootWidget
97 | }
98 | };
99 |
100 | return demoDsl;
101 |
102 | }
103 |
104 |
--------------------------------------------------------------------------------
/example/lib/grammar/map.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2020-12-01 11:20:04
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2020-12-02 17:40:03
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:yz_flutter_dynamic/main.dart';
10 |
11 | import 'base.dart';
12 |
13 | class UTMap extends StatefulWidget {
14 | @override
15 | _UTMapState createState() => _UTMapState();
16 | }
17 |
18 | class _UTMapState extends UTBaseState {
19 |
20 | String get getTitle => "Map";
21 |
22 | List getItem() {
23 | return [
24 | createItem("Map", 'action:Map({"k1":"v1", "k2":"v2"});'),
25 | createItem("MapEntry", 'var:=action:MapEntry(key:k1,value:v1);'),
26 | createItem("Map.valueOfKey", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.valueOfKey(map:var:, key:k1);'),
27 | createItem("Map.isEmpty", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.isEmpty(map:var:);'),
28 | createItem("Map.isNotEmpty", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.isNotEmpty(map:var:);'),
29 | createItem("Map.length", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.length(map:var:);'),
30 | createItem("Map.containsValue", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.containsValue(map:var:, value:v1);'),
31 | createItem("Map.containsKey", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.containsKey(map:var:, key:k1);'),
32 | createItem("Map.remove", 'var:=Map({"k1":"v1", "k2":"v2"});\naction:Map.remove(map:var:, key:k1));\nvar:=var:'),
33 | createItem("Map.clear", 'var:=Map({"k1":"v1", "k2":"v2"});\naction:Map.clear(map:var:));\nvar:=var:'),
34 | createItem("Map.keys", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.keys(map:var:));'),
35 | createItem("Map.values", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.values(map:var:));'),
36 | createItem("Map.entries", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.entries(map:var:);\nvar:=action:Iterable.elementAt(iterable:var:,index:0);'),
37 | createItem("Map.addAll", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=Map({"k3":"v3", "k4":"v4"});\naction:Map.addAll(map:var:,other:var:,));\nvar:=var:'),
38 | createItem("Map.toString", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.toString(map:var:);'),
39 | createItem("Map.from", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.from(other:var:);'),
40 | createItem("Map.of", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.of(other:var:);'),
41 | createItem("Map.identity", 'var:=action:Map.identity();'),
42 | createItem("Map.fromIterable",'var:=List(1,2,3,4);\nvar:=action:Map.fromIterable(entries:var:)'),
43 | createItem("Map.fromIterables",'var:=List(1,2,3,4);\nvar:=List(a,b,c,d);\nvar:=action:Map.fromIterables(keys:var:,values:var:)'),
44 | // FIXME: addEntries、fromEntries;不传入泛型如何解决这个问题
45 | // createItem("Map.fromEntries", 'var:=action:MapEntry(key:k3,value:v3);\nvar:=action:List();\naction:List.add(value:var:,list:var:);\nvar:=action:Map.fromEntries(entries:var:);'),
46 | // createItem("Map.addEntries", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=MapEntry(key:k3,value:v3);\nvar:=List();\naction:List.add(value:var:,list:var:);\naction:Map.addEntries(newEntries:var:, map:var:);\nvar:=var:'),
47 | createItem("Map.unmodifiable", 'var:=Map({"k1":"v1", "k2":"v2"});\nvar:=action:Map.unmodifiable(other:var:);'),
48 | ];
49 | }
50 |
51 | }
--------------------------------------------------------------------------------
/example/lib/grammar/math.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yangyiting
3 | * @Date: 2021-03-24 10:39:25
4 | * @Last Modified by: yangyiting
5 | * @Last Modified time: 2021-03-24 17:50:04
6 | * @Describe: math
7 | */
8 |
9 | import 'package:flutter/material.dart';
10 | import 'package:yz_flutter_dynamic/main.dart';
11 |
12 | import 'base.dart';
13 |
14 | class UTMath extends StatefulWidget {
15 | @override
16 | _UTMathState createState() => _UTMathState();
17 | }
18 |
19 | class _UTMathState extends UTBaseState {
20 |
21 | String get getTitle => "Math";
22 |
23 | List getItem() {
24 | return [
25 | createItem("Math.sqrt", "var:=action:num(123);\n=action:Math.sqrt(value:var:);"),
26 | createItem("Math.exp", "var:=action:num(3);\n=action:Math.exp(value:var:);"),
27 | createItem("Math.log", "var:=action:num(123);\n=action:Math.log(value:var:);"),
28 | createItem("Math.min", "var:=action:num(228);\nvar:=action:num(188);\n=action:Math.min(value1:var:,value2:var:);"),
29 | createItem("Math.max", "var:=action:num(228);\nvar:=action:num(188);\n=action:Math.max(value1:var:,value2:var:);"),
30 | createItem("Math.pow", "var:=action:num(5);\nvar:=action:num(3);\n=action:Math.pow(value:var:,exponent:var:);"),
31 | createItem("Math.sin", "var:=action:num(228);\n=action:Math.sin(value:var:);"),
32 | createItem("Math.cos", "var:=action:num(228);\n=action:Math.cos(value:var:);"),
33 | createItem("Math.tan", "var:=action:num(228);\n=action:Math.tan(value:var:);"),
34 | createItem("Math.asin", "var:=action:num(0.5);\n=action:Math.asin(value:var:);"),
35 | createItem("Math.acos", "var:=action:num(0.5);\n=action:Math.acos(value:var:);"),
36 | createItem("Math.atan", "var:=action:num(0.5);\n=action:Math.atan(value:var:);"),
37 | createItem("Math.atan2", "var:=action:num(0.5);\nvar:=action:num(0.5);\n=action:Math.atan2(value1:var:,value2:var:);"),
38 | createItem("Math.e", "=action:Math.e()"),
39 | createItem("Math.ln10", "=action:Math.ln10()"),
40 | createItem("Math.ln2", "=action:Math.ln2()"),
41 | createItem("Math.log2e", "=action:Math.log2e()"),
42 | createItem("Math.log10e", "=action:Math.log10e()"),
43 | createItem("Math.pi", "=action:Math.pi()"),
44 | createItem("Math.sqrt1_2", "=action:Math.sqrt1_2()"),
45 | createItem("Math.sqrt2", "=action:Math.sqrt2()"),
46 | ];
47 | }
48 |
49 | }
--------------------------------------------------------------------------------
/example/lib/grammar/number.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: yz.yujingzhou
3 | * @Date: 2020-12-01 11:20:04
4 | * @Last Modified by: yz.yujingzhou
5 | * @Last Modified time: 2020-12-02 14:49:05
6 | */
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:yz_flutter_dynamic/main.dart';
10 |
11 | import 'base.dart';
12 |
13 | class UTNumber extends StatefulWidget {
14 | @override
15 | _UTNumberState createState() => _UTNumberState();
16 | }
17 |
18 | class _UTNumberState extends UTBaseState {
19 |
20 | String get getTitle => "Number";
21 |
22 | List getItem() {
23 | return [
24 | createItem("int", "=action:int(123);"),
25 | createItem("double", "=action:double(123);"),
26 | createItem("num", "=action:num(123);"),
27 | createItem("num.+", "=action:num.+(1, 2);"),
28 | createItem("num.-", "=action:num.-(2, 1, 1);"),
29 | createItem("num./", "=action:num./(5, 2);"),
30 | createItem("num.%", "=action:num.%(5, 2);"),
31 | createItem("num.+=", "var:=num(5);\nvar:=num(2);\n=action:num.+=(ret:var:, opt:var:);\n"),
32 | createItem("num.-=", "var:=num(5);\nvar:=num(2);\n=action:num.-=(ret:var:, opt:var:);"),
33 | createItem("num.*=", "var:=num(5);\nvar:=num(2);\n=action:num.*=(ret:var:, opt:var:);"),
34 | createItem("num./=", "var:=num(5);\nvar: