├── .dart_tool
└── package_config.json
├── .idea
├── codeStyles
│ └── Project.xml
├── kumi_popup_window.iml
├── libraries
│ ├── Dart_SDK.xml
│ └── Flutter_Plugins.xml
├── modules.xml
├── vcs.xml
└── workspace.xml
├── .packages
├── CHANGELOG.md
├── LICENSE
├── README.md
├── README_CN.md
├── demo
├── popup_1.png
└── popup_2.png
├── example
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── 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
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── 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
│ └── main.dart
├── pubspec.lock
├── pubspec.yaml
└── test
│ └── widget_test.dart
├── kumi_popup_window.iml
├── lib
├── PopRoute.dart
└── kumi_popup_window.dart
├── pubspec.lock
├── pubspec.yaml
└── test
└── kumi_popup_window_test.dart
/.dart_tool/package_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "configVersion": 2,
3 | "packages": [
4 | {
5 | "name": "async",
6 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2",
7 | "packageUri": "lib/",
8 | "languageVersion": "2.12"
9 | },
10 | {
11 | "name": "boolean_selector",
12 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0",
13 | "packageUri": "lib/",
14 | "languageVersion": "2.12"
15 | },
16 | {
17 | "name": "characters",
18 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0",
19 | "packageUri": "lib/",
20 | "languageVersion": "2.12"
21 | },
22 | {
23 | "name": "charcode",
24 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1",
25 | "packageUri": "lib/",
26 | "languageVersion": "2.12"
27 | },
28 | {
29 | "name": "clock",
30 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0",
31 | "packageUri": "lib/",
32 | "languageVersion": "2.12"
33 | },
34 | {
35 | "name": "collection",
36 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.16.0",
37 | "packageUri": "lib/",
38 | "languageVersion": "2.12"
39 | },
40 | {
41 | "name": "fake_async",
42 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.3.0",
43 | "packageUri": "lib/",
44 | "languageVersion": "2.12"
45 | },
46 | {
47 | "name": "flutter",
48 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/packages/flutter",
49 | "packageUri": "lib/",
50 | "languageVersion": "2.12"
51 | },
52 | {
53 | "name": "flutter_test",
54 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/packages/flutter_test",
55 | "packageUri": "lib/",
56 | "languageVersion": "2.17"
57 | },
58 | {
59 | "name": "matcher",
60 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11",
61 | "packageUri": "lib/",
62 | "languageVersion": "2.12"
63 | },
64 | {
65 | "name": "material_color_utilities",
66 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.4",
67 | "packageUri": "lib/",
68 | "languageVersion": "2.13"
69 | },
70 | {
71 | "name": "meta",
72 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0",
73 | "packageUri": "lib/",
74 | "languageVersion": "2.12"
75 | },
76 | {
77 | "name": "path",
78 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.1",
79 | "packageUri": "lib/",
80 | "languageVersion": "2.12"
81 | },
82 | {
83 | "name": "sky_engine",
84 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/bin/cache/pkg/sky_engine",
85 | "packageUri": "lib/",
86 | "languageVersion": "2.12"
87 | },
88 | {
89 | "name": "source_span",
90 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.2",
91 | "packageUri": "lib/",
92 | "languageVersion": "2.14"
93 | },
94 | {
95 | "name": "stack_trace",
96 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0",
97 | "packageUri": "lib/",
98 | "languageVersion": "2.12"
99 | },
100 | {
101 | "name": "stream_channel",
102 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0",
103 | "packageUri": "lib/",
104 | "languageVersion": "2.12"
105 | },
106 | {
107 | "name": "string_scanner",
108 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0",
109 | "packageUri": "lib/",
110 | "languageVersion": "2.12"
111 | },
112 | {
113 | "name": "term_glyph",
114 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0",
115 | "packageUri": "lib/",
116 | "languageVersion": "2.12"
117 | },
118 | {
119 | "name": "test_api",
120 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.9",
121 | "packageUri": "lib/",
122 | "languageVersion": "2.12"
123 | },
124 | {
125 | "name": "vector_math",
126 | "rootUri": "file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.2",
127 | "packageUri": "lib/",
128 | "languageVersion": "2.14"
129 | },
130 | {
131 | "name": "kumi_popup_window",
132 | "rootUri": "../",
133 | "packageUri": "lib/",
134 | "languageVersion": "2.17"
135 | }
136 | ],
137 | "generated": "2022-05-13T09:24:56.949911Z",
138 | "generator": "pub",
139 | "generatorVersion": "2.17.0"
140 | }
141 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/kumi_popup_window.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.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 |
--------------------------------------------------------------------------------
/.idea/libraries/Flutter_Plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.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 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | 1582799273433
83 |
84 |
85 | 1582799273433
86 |
87 |
88 | 1582807192811
89 |
90 |
91 |
92 | 1582807192811
93 |
94 |
95 | 1582809035362
96 |
97 |
98 |
99 | 1582809035362
100 |
101 |
102 | 1582809261582
103 |
104 |
105 |
106 | 1582809261582
107 |
108 |
109 | 1582809270079
110 |
111 |
112 |
113 | 1582809270079
114 |
115 |
116 | 1582809448094
117 |
118 |
119 |
120 | 1582809448095
121 |
122 |
123 | 1582809953004
124 |
125 |
126 |
127 | 1582809953004
128 |
129 |
130 | 1582897294751
131 |
132 |
133 |
134 | 1582897294751
135 |
136 |
137 | 1582897330765
138 |
139 |
140 |
141 | 1582897330765
142 |
143 |
144 | 1582897887822
145 |
146 |
147 |
148 | 1582897887822
149 |
150 |
151 | 1582969668603
152 |
153 |
154 |
155 | 1582969668603
156 |
157 |
158 | 1583111267985
159 |
160 |
161 |
162 | 1583111267985
163 |
164 |
165 | 1583377449677
166 |
167 |
168 |
169 | 1583377449677
170 |
171 |
172 | 1583502742659
173 |
174 |
175 |
176 | 1583502742659
177 |
178 |
179 | 1584339728659
180 |
181 |
182 |
183 | 1584339728659
184 |
185 |
186 | 1584613327077
187 |
188 |
189 |
190 | 1584613327077
191 |
192 |
193 | 1584621939700
194 |
195 |
196 |
197 | 1584621939700
198 |
199 |
200 | 1586870020442
201 |
202 |
203 |
204 | 1586870020442
205 |
206 |
207 | 1589005321764
208 |
209 |
210 |
211 | 1589005321764
212 |
213 |
214 | 1591861704894
215 |
216 |
217 |
218 | 1591861704894
219 |
220 |
221 | 1603727880215
222 |
223 |
224 |
225 | 1603727880215
226 |
227 |
228 | 1604050602540
229 |
230 |
231 |
232 | 1604050602540
233 |
234 |
235 | 1604050718211
236 |
237 |
238 |
239 | 1604050718211
240 |
241 |
242 | 1615888678233
243 |
244 |
245 |
246 | 1615888678233
247 |
248 |
249 | 1615947076040
250 |
251 |
252 |
253 | 1615947076040
254 |
255 |
256 | 1652434246532
257 |
258 |
259 |
260 | 1652434246532
261 |
262 |
263 |
264 |
265 |
266 |
267 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
--------------------------------------------------------------------------------
/.packages:
--------------------------------------------------------------------------------
1 | # This file is deprecated. Tools should instead consume
2 | # `.dart_tool/package_config.json`.
3 | #
4 | # For more info see: https://dart.dev/go/dot-packages-deprecation
5 | #
6 | # Generated by pub on 2022-05-13 17:24:56.927903.
7 | async:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2/lib/
8 | boolean_selector:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib/
9 | characters:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0/lib/
10 | charcode:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1/lib/
11 | clock:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/lib/
12 | collection:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.16.0/lib/
13 | fake_async:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.3.0/lib/
14 | flutter:file:///D:/App/flutter_windows_2.5.1-stable/flutter/packages/flutter/lib/
15 | flutter_test:file:///D:/App/flutter_windows_2.5.1-stable/flutter/packages/flutter_test/lib/
16 | matcher:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11/lib/
17 | material_color_utilities:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.4/lib/
18 | meta:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/
19 | path:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.1/lib/
20 | sky_engine:file:///D:/App/flutter_windows_2.5.1-stable/flutter/bin/cache/pkg/sky_engine/lib/
21 | source_span:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.2/lib/
22 | stack_trace:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/lib/
23 | stream_channel:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/lib/
24 | string_scanner:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/lib/
25 | term_glyph:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/lib/
26 | test_api:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.9/lib/
27 | vector_math:file:///D:/App/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.2/lib/
28 | kumi_popup_window:lib/
29 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [2.0.1]
2 | * 更新flutter到3.0.0
3 | * Update flutter to 3.0.0,
4 |
5 |
6 | ## [2.0.0-nullsafety]
7 | * 更新flutter到2.0.2,空安全支持
8 | * Update flutter to 2.0.2, null safety support
9 |
10 | ## [1.0.12]
11 | * 新增弹出框的安全显示控制参数needSafeDisplay,详见注释
12 | * 优化相对于屏幕的弹出框,如果是相对于屏幕的弹框,可以不写宽高,默认可撑满屏幕
13 | * Newly added security display control parameter needsafedisplay in pop-up box, see note for details
14 | * Optimize the pop-up box relative to the screen. If it is a pop-up box relative to the screen, you can not write the width and height. By default, it can hold the full screen
15 |
16 | ## [1.0.11]
17 | * 测试升级到flutter 1.22.2版本成功
18 | * 优化动画,新增curve属性用于自定义插值器
19 | * Flutter upgrade to 1.22.2 test success
20 | * Optimize animation, add curve attribute for custom interpolator
21 |
22 | ## [1.0.10]
23 | * 测试升级到flutter 1.7.3版本成功
24 | * Flutter upgrade to 1.7.3 test success
25 |
26 | ## [1.0.9]
27 | * 调用dismiss()之前判断isShow
28 | * Determine isShow before calling dismiss ()
29 |
30 | ## [1.0.8]
31 | * 删除SafeArea
32 | * Delete SafeArea
33 |
34 | ## [1.0.7]
35 | * 新增isShow属性
36 | * Added isShow property
37 |
38 | ## [1.0.6]
39 | * dismiss()方法添加禁止动画的参数
40 | * dismiss () method adds a parameter that prohibits animation
41 |
42 | ## [1.0.5]
43 | * 修改默认遮罩层颜色
44 | * Modify the default mask layer color
45 |
46 | ## [1.0.4]
47 | * 为dismiss()法新增可选参数
48 | * Added optional parameters for dismiss()
49 |
50 | ## [1.0.3]
51 | * fix bug
52 |
53 | ## [1.0.2]
54 |
55 | * 新增onClickOut()和onClickBack()
56 | * Added onClickOut () and onClickBack ()
57 |
58 | ## [1.0.1]
59 |
60 | *修改部分方法
61 | * Modification method.
62 |
63 | ## [1.0.0]
64 |
65 | * first version.
66 |
67 |
68 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 q876625596
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ✨ kumi_popup_window
2 |
3 | [](https://pub.dev/packages/kumi_popup_window)
4 |
5 | **[Language]** [English](README.md) | [中文文档](README_CN.md)
6 |
7 | A simple and easy-to-use pop-up window. There are no flashy preset templates. Everything you want to pop up is customized by you.
8 |
9 | **1.Install**
10 |
11 | ```yaml
12 | dependencies:
13 | kumi_popup_window: ^2.0.1
14 | ```
15 |
16 | **2.Import**
17 |
18 | ```dart
19 | import 'package:kumi_popup_window/kumi_popup_window.dart';
20 | ```
21 |
22 | **3.Use**
23 | ```dart
24 | //both sowPopupWindow and createPopupWindow
25 | showPopupWindow(
26 | context,
27 | gravity: KumiPopupGravity.rightBottom,
28 | //curve: Curves.elasticOut,
29 | bgColor: Colors.grey.withOpacity(0.5),
30 | clickOutDismiss: true,
31 | clickBackDismiss: true,
32 | customAnimation: false,
33 | customPop: false,
34 | customPage: false,
35 | //targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
36 | //needSafeDisplay: true,
37 | underStatusBar: false,
38 | underAppBar: true,
39 | offsetX: 0,
40 | offsetY: 0,
41 | duration: Duration(milliseconds: 200),
42 | onShowStart: (pop) {
43 | print("showStart");
44 | },
45 | onShowFinish: (pop) {
46 | print("showFinish");
47 | },
48 | onDismissStart: (pop) {
49 | print("dismissStart");
50 | },
51 | onDismissFinish: (pop) {
52 | print("dismissFinish");
53 | },
54 | onClickOut: (pop){
55 | print("onClickOut");
56 | },
57 | onClickBack: (pop){
58 | print("onClickBack");
59 | },
60 | childFun: (pop) {
61 | return Container(
62 | key: GlobalKey(),
63 | padding: EdgeInsets.all(10),
64 | height: 100,
65 | width: 100,
66 | color: Colors.redAccent,
67 | );
68 | },
69 | );
70 |
71 | ```
72 |
73 | **4.Demo screen**
74 |
75 |
76 |
77 | **note**
78 | **Data update if using setState, please see [example] (example/lib/main.dart)**
79 |
80 | Brief description, see [here](lib/kumi_popup_window.dart) for details
81 |
82 |
83 | params|description|default
84 | --|--|--|
85 | childFun|Method for customizing the content of the popup window. The returned widget will be used as the content of the popup window|null,(require)
86 | gravity|Relative position of the pop-up window.|KumiPopupGravity.center
87 | curve|Animation interpolator|Curves.decelerate
88 | customAnimation|Custom popupWindow animation|false
89 | customPop|Customize the position and animation of popupWindow|false
90 | customPage|Customize the entire page, including Scaffold|false
91 | bgColor|The color of the mask layer|Colors.black.withOpacity(0.5)
92 | targetRenderBox|RenderBox of the target widget|null
93 | underStatusBar|When the top pops up, is it below the statusBar|false
94 | underAppBar|When the top pops up, is it below the AppBar|false
95 | clickOutDismiss|Click outside the pop-up window to dismiss|true
96 | clickBackDismiss|Click the physical back button to dismiss|true
97 | offsetX|Offset at horizontal axis edge|0.0
98 | offsetY|Offset at vertical axis edge|0.0
99 | duration|Duration of the animation|Duration(milliseconds: 300)
100 | needSafeDisplay|Do you need to display pop ups safely|false
101 | onShowStart|When the popupWindow show animation start|null
102 | onShowEnd|When the popupWindow show animation finish|null
103 | onDismissStart|When the popupWindow dismiss animation start|null
104 | onDismissEnd|When the popupWindow dismiss animation finish|null
105 | onClickOut|Click on the listener outside the popup|null
106 | onClickBack|Listening on clicking the physical back button|null
107 |
108 | property/method|description
109 | --|--|
110 | child|Popup window widget,Get its size and position by GlobalKey
111 | isShow|Is the current pop-up displayed
112 | controller|Animation Controller
113 | show()|popup window show
114 | dismiss()|popup window dismiss
115 |
116 | ## About
117 |
118 | * QQ:876625596
119 | * Email:876625596@qq.com
120 | * Github:https://github.com/q876625596
121 |
122 | ## License
123 |
124 | MIT License
125 |
126 | Copyright (c) 2020 q876625596
127 |
128 | Permission is hereby granted, free of charge, to any person obtaining a copy
129 | of this software and associated documentation files (the "Software"), to deal
130 | in the Software without restriction, including without limitation the rights
131 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
132 | copies of the Software, and to permit persons to whom the Software is
133 | furnished to do so, subject to the following conditions:
134 |
135 | The above copyright notice and this permission notice shall be included in all
136 | copies or substantial portions of the Software.
137 |
138 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
139 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
140 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
141 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
142 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
143 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
144 | SOFTWARE.
145 |
--------------------------------------------------------------------------------
/README_CN.md:
--------------------------------------------------------------------------------
1 | # ✨ kumi_popup_window
2 |
3 | [](https://pub.dev/packages/kumi_popup_window)
4 |
5 | **[语言切换]** [English](README.md) | [中文文档](README_CN.md)
6 |
7 | 一个简单易用的弹窗,没有花里胡哨的预设样板,麻雀虽小五脏俱全,想弹出什么全都由你自定义。
8 |
9 | **1.获取**
10 |
11 | ```yaml
12 | dependencies:
13 | kumi_popup_window: ^2.0.1
14 | ```
15 |
16 | **2.导入**
17 |
18 | ```dart
19 | import 'package:kumi_popup_window/kumi_popup_window.dart';
20 | ```
21 |
22 | **3.使用**
23 | ```dart
24 | //showPopupWindow 和 createPopupWindow 均可
25 | showPopupWindow(
26 | context,
27 | gravity: KumiPopupGravity.rightBottom,
28 | //curve: Curves.elasticOut,
29 | bgColor: Colors.grey.withOpacity(0.5),
30 | clickOutDismiss: true,
31 | clickBackDismiss: true,
32 | customAnimation: false,
33 | customPop: false,
34 | customPage: false,
35 | //targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
36 | //needSafeDisplay: true,
37 | underStatusBar: false,
38 | underAppBar: true,
39 | offsetX: 0,
40 | offsetY: 0,
41 | duration: Duration(milliseconds: 200),
42 | onShowStart: (pop) {
43 | print("showStart");
44 | },
45 | onShowFinish: (pop) {
46 | print("showFinish");
47 | },
48 | onDismissStart: (pop) {
49 | print("dismissStart");
50 | },
51 | onDismissFinish: (pop) {
52 | print("dismissFinish");
53 | },
54 | onClickOut: (pop){
55 | print("onClickOut");
56 | },
57 | onClickBack: (pop){
58 | print("onClickBack");
59 | },
60 | childFun: (pop) {
61 | return Container(
62 | key: GlobalKey(),
63 | padding: EdgeInsets.all(10),
64 | height: 100,
65 | width: 100,
66 | color: Colors.redAccent,
67 | );
68 | },
69 | );
70 |
71 | ```
72 |
73 | **注意**
74 | **数据更新如果使用setState,请查看[示例](example/lib/main.dart)**
75 |
76 | 简要说明,详细说明请看[这里](lib/kumi_popup_window.dart)
77 |
78 |
79 | 参数|描述|默认值
80 | --|--|--|
81 | childFun|自定义弹出框内容的方法,返回的widget将作为弹出框内容|无默认,必填
82 | gravity|弹出框的相对位置|KumiPopupGravity.center
83 | curve|动画插值器|Curves.decelerate
84 | customAnimation|自定义popupWindow的动画|false
85 | customPop|自定义popupWindow的位置与动画|false
86 | customPage|自定义整个页面,包括Scaffold|false
87 | bgColor|遮罩层的颜色|Colors.black.withOpacity(0.5)
88 | targetRenderBox|目标widget的RenderBox|null
89 | underStatusBar|顶部弹出时,是否在statusBar下方|false
90 | underAppBar|顶部弹出时,是否在AppBar下方|false
91 | clickOutDismiss|点击弹出框以外的区域是否收起|true
92 | clickBackDismiss|点击物理返回按钮是否收起|true
93 | offsetX|横轴贴边处偏移量|0.0
94 | offsetY|纵轴贴边处偏移量|0.0
95 | duration|动画的时长|Duration(milliseconds: 300)
96 | needSafeDisplay|是否需要安全显示弹出框
97 | onShowStart|弹出动画开始的监听|null
98 | onShowEnd|弹出动画结束的监听|null
99 | onDismissStart|收起动画开始的监听|null
100 | onDismissEnd|收起动画结束的监听|null
101 | onClickOut|点击弹框以外的监听|null
102 | onClickBack|点击物理返回按钮的监听|null
103 |
104 | 属性/方法|描述
105 | --|--|
106 | child|弹出框的widget,可通过GlobalKey获取其尺寸和位置
107 | isShow|当前弹框是否已经显示
108 | controller|动画控制器
109 | show()|显示popup window
110 | dismiss()|收起popup window
111 |
112 | ## 联系我
113 |
114 | * QQ:876625596
115 | * Email:876625596@qq.com
116 | * Github:https://github.com/q876625596
117 |
118 | ## License
119 |
120 | MIT License
121 |
122 | Copyright (c) 2020 q876625596
123 |
124 | Permission is hereby granted, free of charge, to any person obtaining a copy
125 | of this software and associated documentation files (the "Software"), to deal
126 | in the Software without restriction, including without limitation the rights
127 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
128 | copies of the Software, and to permit persons to whom the Software is
129 | furnished to do so, subject to the following conditions:
130 |
131 | The above copyright notice and this permission notice shall be included in all
132 | copies or substantial portions of the Software.
133 |
134 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
135 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
136 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
137 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
138 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
139 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
140 | SOFTWARE.
141 |
142 |
--------------------------------------------------------------------------------
/demo/popup_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/demo/popup_1.png
--------------------------------------------------------------------------------
/demo/popup_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/demo/popup_2.png
--------------------------------------------------------------------------------
/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: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 |
8 |
9 | MIT License
10 |
11 | Copyright (c) 2020 q876625596
12 |
13 | Permission is hereby granted, free of charge, to any person obtaining a copy
14 | of this software and associated documentation files (the "Software"), to deal
15 | in the Software without restriction, including without limitation the rights
16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 | copies of the Software, and to permit persons to whom the Software is
18 | furnished to do so, subject to the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be included in all
21 | copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 | SOFTWARE.
--------------------------------------------------------------------------------
/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 31
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.example"
42 | minSdkVersion 16
43 | targetSdkVersion 31
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/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity
5 | import io.flutter.embedding.engine.FlutterEngine
6 |
7 | class MainActivity: FlutterActivity() {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.4'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
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-6.7-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/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 "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/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 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
18 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
19 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXCopyFilesBuildPhase section */
23 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
24 | isa = PBXCopyFilesBuildPhase;
25 | buildActionMask = 2147483647;
26 | dstPath = "";
27 | dstSubfolderSpec = 10;
28 | files = (
29 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
30 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
31 | );
32 | name = "Embed Frameworks";
33 | runOnlyForDeploymentPostprocessing = 0;
34 | };
35 | /* End PBXCopyFilesBuildPhase section */
36 |
37 | /* Begin PBXFileReference section */
38 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
39 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
40 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
41 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
42 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
43 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
45 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
46 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
47 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
48 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
49 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
50 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
51 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
52 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
53 | /* End PBXFileReference section */
54 |
55 | /* Begin PBXFrameworksBuildPhase section */
56 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
57 | isa = PBXFrameworksBuildPhase;
58 | buildActionMask = 2147483647;
59 | files = (
60 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
61 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
62 | );
63 | runOnlyForDeploymentPostprocessing = 0;
64 | };
65 | /* End PBXFrameworksBuildPhase section */
66 |
67 | /* Begin PBXGroup section */
68 | 9740EEB11CF90186004384FC /* Flutter */ = {
69 | isa = PBXGroup;
70 | children = (
71 | 3B80C3931E831B6300D905FE /* App.framework */,
72 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
73 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
74 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
75 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
76 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
77 | );
78 | name = Flutter;
79 | sourceTree = "";
80 | };
81 | 97C146E51CF9000F007C117D = {
82 | isa = PBXGroup;
83 | children = (
84 | 9740EEB11CF90186004384FC /* Flutter */,
85 | 97C146F01CF9000F007C117D /* Runner */,
86 | 97C146EF1CF9000F007C117D /* Products */,
87 | );
88 | sourceTree = "";
89 | };
90 | 97C146EF1CF9000F007C117D /* Products */ = {
91 | isa = PBXGroup;
92 | children = (
93 | 97C146EE1CF9000F007C117D /* Runner.app */,
94 | );
95 | name = Products;
96 | sourceTree = "";
97 | };
98 | 97C146F01CF9000F007C117D /* Runner */ = {
99 | isa = PBXGroup;
100 | children = (
101 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
102 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
103 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
104 | 97C147021CF9000F007C117D /* Info.plist */,
105 | 97C146F11CF9000F007C117D /* Supporting Files */,
106 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
107 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
108 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
109 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
110 | );
111 | path = Runner;
112 | sourceTree = "";
113 | };
114 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
115 | isa = PBXGroup;
116 | children = (
117 | );
118 | name = "Supporting Files";
119 | sourceTree = "";
120 | };
121 | /* End PBXGroup section */
122 |
123 | /* Begin PBXNativeTarget section */
124 | 97C146ED1CF9000F007C117D /* Runner */ = {
125 | isa = PBXNativeTarget;
126 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
127 | buildPhases = (
128 | 9740EEB61CF901F6004384FC /* Run Script */,
129 | 97C146EA1CF9000F007C117D /* Sources */,
130 | 97C146EB1CF9000F007C117D /* Frameworks */,
131 | 97C146EC1CF9000F007C117D /* Resources */,
132 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
133 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
134 | );
135 | buildRules = (
136 | );
137 | dependencies = (
138 | );
139 | name = Runner;
140 | productName = Runner;
141 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
142 | productType = "com.apple.product-type.application";
143 | };
144 | /* End PBXNativeTarget section */
145 |
146 | /* Begin PBXProject section */
147 | 97C146E61CF9000F007C117D /* Project object */ = {
148 | isa = PBXProject;
149 | attributes = {
150 | LastUpgradeCheck = 1020;
151 | ORGANIZATIONNAME = "The Chromium Authors";
152 | TargetAttributes = {
153 | 97C146ED1CF9000F007C117D = {
154 | CreatedOnToolsVersion = 7.3.1;
155 | LastSwiftMigration = 1100;
156 | };
157 | };
158 | };
159 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
160 | compatibilityVersion = "Xcode 3.2";
161 | developmentRegion = en;
162 | hasScannedForEncodings = 0;
163 | knownRegions = (
164 | en,
165 | Base,
166 | );
167 | mainGroup = 97C146E51CF9000F007C117D;
168 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
169 | projectDirPath = "";
170 | projectRoot = "";
171 | targets = (
172 | 97C146ED1CF9000F007C117D /* Runner */,
173 | );
174 | };
175 | /* End PBXProject section */
176 |
177 | /* Begin PBXResourcesBuildPhase section */
178 | 97C146EC1CF9000F007C117D /* Resources */ = {
179 | isa = PBXResourcesBuildPhase;
180 | buildActionMask = 2147483647;
181 | files = (
182 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
183 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
184 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
185 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
186 | );
187 | runOnlyForDeploymentPostprocessing = 0;
188 | };
189 | /* End PBXResourcesBuildPhase section */
190 |
191 | /* Begin PBXShellScriptBuildPhase section */
192 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
193 | isa = PBXShellScriptBuildPhase;
194 | buildActionMask = 2147483647;
195 | files = (
196 | );
197 | inputPaths = (
198 | );
199 | name = "Thin Binary";
200 | outputPaths = (
201 | );
202 | runOnlyForDeploymentPostprocessing = 0;
203 | shellPath = /bin/sh;
204 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
205 | };
206 | 9740EEB61CF901F6004384FC /* Run Script */ = {
207 | isa = PBXShellScriptBuildPhase;
208 | buildActionMask = 2147483647;
209 | files = (
210 | );
211 | inputPaths = (
212 | );
213 | name = "Run Script";
214 | outputPaths = (
215 | );
216 | runOnlyForDeploymentPostprocessing = 0;
217 | shellPath = /bin/sh;
218 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
219 | };
220 | /* End PBXShellScriptBuildPhase section */
221 |
222 | /* Begin PBXSourcesBuildPhase section */
223 | 97C146EA1CF9000F007C117D /* Sources */ = {
224 | isa = PBXSourcesBuildPhase;
225 | buildActionMask = 2147483647;
226 | files = (
227 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
228 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
229 | );
230 | runOnlyForDeploymentPostprocessing = 0;
231 | };
232 | /* End PBXSourcesBuildPhase section */
233 |
234 | /* Begin PBXVariantGroup section */
235 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
236 | isa = PBXVariantGroup;
237 | children = (
238 | 97C146FB1CF9000F007C117D /* Base */,
239 | );
240 | name = Main.storyboard;
241 | sourceTree = "";
242 | };
243 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
244 | isa = PBXVariantGroup;
245 | children = (
246 | 97C147001CF9000F007C117D /* Base */,
247 | );
248 | name = LaunchScreen.storyboard;
249 | sourceTree = "";
250 | };
251 | /* End PBXVariantGroup section */
252 |
253 | /* Begin XCBuildConfiguration section */
254 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
255 | isa = XCBuildConfiguration;
256 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
257 | buildSettings = {
258 | ALWAYS_SEARCH_USER_PATHS = NO;
259 | CLANG_ANALYZER_NONNULL = YES;
260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
261 | CLANG_CXX_LIBRARY = "libc++";
262 | CLANG_ENABLE_MODULES = YES;
263 | CLANG_ENABLE_OBJC_ARC = YES;
264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
265 | CLANG_WARN_BOOL_CONVERSION = YES;
266 | CLANG_WARN_COMMA = YES;
267 | CLANG_WARN_CONSTANT_CONVERSION = YES;
268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
270 | CLANG_WARN_EMPTY_BODY = YES;
271 | CLANG_WARN_ENUM_CONVERSION = YES;
272 | CLANG_WARN_INFINITE_RECURSION = YES;
273 | CLANG_WARN_INT_CONVERSION = YES;
274 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
275 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
276 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
279 | CLANG_WARN_STRICT_PROTOTYPES = YES;
280 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
281 | CLANG_WARN_UNREACHABLE_CODE = YES;
282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
284 | COPY_PHASE_STRIP = NO;
285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
286 | ENABLE_NS_ASSERTIONS = NO;
287 | ENABLE_STRICT_OBJC_MSGSEND = YES;
288 | GCC_C_LANGUAGE_STANDARD = gnu99;
289 | GCC_NO_COMMON_BLOCKS = YES;
290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
292 | GCC_WARN_UNDECLARED_SELECTOR = YES;
293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
294 | GCC_WARN_UNUSED_FUNCTION = YES;
295 | GCC_WARN_UNUSED_VARIABLE = YES;
296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
297 | MTL_ENABLE_DEBUG_INFO = NO;
298 | SDKROOT = iphoneos;
299 | SUPPORTED_PLATFORMS = iphoneos;
300 | TARGETED_DEVICE_FAMILY = "1,2";
301 | VALIDATE_PRODUCT = YES;
302 | };
303 | name = Profile;
304 | };
305 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
306 | isa = XCBuildConfiguration;
307 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
308 | buildSettings = {
309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
310 | CLANG_ENABLE_MODULES = YES;
311 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
312 | ENABLE_BITCODE = NO;
313 | FRAMEWORK_SEARCH_PATHS = (
314 | "$(inherited)",
315 | "$(PROJECT_DIR)/Flutter",
316 | );
317 | INFOPLIST_FILE = Runner/Info.plist;
318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
319 | LIBRARY_SEARCH_PATHS = (
320 | "$(inherited)",
321 | "$(PROJECT_DIR)/Flutter",
322 | );
323 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
324 | PRODUCT_NAME = "$(TARGET_NAME)";
325 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
326 | SWIFT_VERSION = 5.0;
327 | VERSIONING_SYSTEM = "apple-generic";
328 | };
329 | name = Profile;
330 | };
331 | 97C147031CF9000F007C117D /* Debug */ = {
332 | isa = XCBuildConfiguration;
333 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
334 | buildSettings = {
335 | ALWAYS_SEARCH_USER_PATHS = NO;
336 | CLANG_ANALYZER_NONNULL = YES;
337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
338 | CLANG_CXX_LIBRARY = "libc++";
339 | CLANG_ENABLE_MODULES = YES;
340 | CLANG_ENABLE_OBJC_ARC = YES;
341 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
342 | CLANG_WARN_BOOL_CONVERSION = YES;
343 | CLANG_WARN_COMMA = YES;
344 | CLANG_WARN_CONSTANT_CONVERSION = YES;
345 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
347 | CLANG_WARN_EMPTY_BODY = YES;
348 | CLANG_WARN_ENUM_CONVERSION = YES;
349 | CLANG_WARN_INFINITE_RECURSION = YES;
350 | CLANG_WARN_INT_CONVERSION = YES;
351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
352 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
356 | CLANG_WARN_STRICT_PROTOTYPES = YES;
357 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
358 | CLANG_WARN_UNREACHABLE_CODE = YES;
359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
361 | COPY_PHASE_STRIP = NO;
362 | DEBUG_INFORMATION_FORMAT = dwarf;
363 | ENABLE_STRICT_OBJC_MSGSEND = YES;
364 | ENABLE_TESTABILITY = YES;
365 | GCC_C_LANGUAGE_STANDARD = gnu99;
366 | GCC_DYNAMIC_NO_PIC = NO;
367 | GCC_NO_COMMON_BLOCKS = YES;
368 | GCC_OPTIMIZATION_LEVEL = 0;
369 | GCC_PREPROCESSOR_DEFINITIONS = (
370 | "DEBUG=1",
371 | "$(inherited)",
372 | );
373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
375 | GCC_WARN_UNDECLARED_SELECTOR = YES;
376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
377 | GCC_WARN_UNUSED_FUNCTION = YES;
378 | GCC_WARN_UNUSED_VARIABLE = YES;
379 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
380 | MTL_ENABLE_DEBUG_INFO = YES;
381 | ONLY_ACTIVE_ARCH = YES;
382 | SDKROOT = iphoneos;
383 | TARGETED_DEVICE_FAMILY = "1,2";
384 | };
385 | name = Debug;
386 | };
387 | 97C147041CF9000F007C117D /* Release */ = {
388 | isa = XCBuildConfiguration;
389 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
390 | buildSettings = {
391 | ALWAYS_SEARCH_USER_PATHS = NO;
392 | CLANG_ANALYZER_NONNULL = YES;
393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
394 | CLANG_CXX_LIBRARY = "libc++";
395 | CLANG_ENABLE_MODULES = YES;
396 | CLANG_ENABLE_OBJC_ARC = YES;
397 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
398 | CLANG_WARN_BOOL_CONVERSION = YES;
399 | CLANG_WARN_COMMA = YES;
400 | CLANG_WARN_CONSTANT_CONVERSION = YES;
401 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
403 | CLANG_WARN_EMPTY_BODY = YES;
404 | CLANG_WARN_ENUM_CONVERSION = YES;
405 | CLANG_WARN_INFINITE_RECURSION = YES;
406 | CLANG_WARN_INT_CONVERSION = YES;
407 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
408 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
409 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
411 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
412 | CLANG_WARN_STRICT_PROTOTYPES = YES;
413 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
414 | CLANG_WARN_UNREACHABLE_CODE = YES;
415 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
416 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
417 | COPY_PHASE_STRIP = NO;
418 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
419 | ENABLE_NS_ASSERTIONS = NO;
420 | ENABLE_STRICT_OBJC_MSGSEND = YES;
421 | GCC_C_LANGUAGE_STANDARD = gnu99;
422 | GCC_NO_COMMON_BLOCKS = YES;
423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
425 | GCC_WARN_UNDECLARED_SELECTOR = YES;
426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
427 | GCC_WARN_UNUSED_FUNCTION = YES;
428 | GCC_WARN_UNUSED_VARIABLE = YES;
429 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
430 | MTL_ENABLE_DEBUG_INFO = NO;
431 | SDKROOT = iphoneos;
432 | SUPPORTED_PLATFORMS = 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.example.example;
458 | PRODUCT_NAME = "$(TARGET_NAME)";
459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
461 | SWIFT_VERSION = 5.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.example.example;
485 | PRODUCT_NAME = "$(TARGET_NAME)";
486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
487 | SWIFT_VERSION = 5.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 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
518 | }
519 |
--------------------------------------------------------------------------------
/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/q876625596/kumi_popup_window/30de90156e7f6212fbac3ad1c69d3f0f506f3e45/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 | 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/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:kumi_popup_window/kumi_popup_window.dart';
3 |
4 | void main() => runApp(MyApp());
5 |
6 | class MyApp extends StatelessWidget {
7 | // This widget is the root of your application.
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | title: 'Flutter Demo',
12 | theme: ThemeData(
13 | // This is the theme of your application.
14 | //
15 | // Try running your application with "flutter run". You'll see the
16 | // application has a blue toolbar. Then, without quitting the app, try
17 | // changing the primarySwatch below to Colors.green and then invoke
18 | // "hot reload" (press "r" in the console where you ran "flutter run",
19 | // or simply save your changes to "hot reload" in a Flutter IDE).
20 | // Notice that the counter didn't reset back to zero; the application
21 | // is not restarted.
22 | primarySwatch: Colors.blue,
23 | ),
24 | home: MyHomePage(title: 'Flutter Demo Home Page'),
25 | );
26 | }
27 | }
28 |
29 | class MyHomePage extends StatefulWidget {
30 | MyHomePage({Key? key, this.title}) : super(key: key);
31 |
32 | // This widget is the home page of your application. It is stateful, meaning
33 | // that it has a State object (defined below) that contains fields that affect
34 | // how it looks.
35 |
36 | // This class is the configuration for the state. It holds the values (in this
37 | // case the title) provided by the parent (in this case the App widget) and
38 | // used by the build method of the State. Fields in a Widget subclass are
39 | // always marked "final".
40 |
41 | final String? title;
42 |
43 | @override
44 | _MyHomePageState createState() => _MyHomePageState();
45 | }
46 |
47 | class _MyHomePageState extends State {
48 | GlobalKey btnKey = GlobalKey();
49 | KumiPopupWindow? popupWindow;
50 |
51 | ValueNotifier isSelect = ValueNotifier(false);
52 | var aaa = "false";
53 |
54 | @override
55 | Widget build(BuildContext context) {
56 | // This method is rerun every time setState is called, for instance as done
57 | // by the _incrementCounter method above.
58 | //
59 | // The Flutter framework has been optimized to make rerunning build methods
60 | // fast, so that you can just rebuild anything that needs updating rather
61 | // than having to individually change instances of widgets.
62 | return Scaffold(
63 | appBar: AppBar(
64 | // Here we take the value from the MyHomePage object that was created by
65 | // the App.build method, and use it to set our appbar title.
66 | title: Text(widget.title ?? ""),
67 | ),
68 | body: Center(
69 | // Center is a layout widget. It takes a single child and positions it
70 | // in the middle of the parent.
71 | child: Column(
72 | mainAxisAlignment: MainAxisAlignment.center,
73 | children: [
74 | ValueListenableBuilder(
75 | valueListenable: isSelect,
76 | builder: (context, bool select, child) {
77 | return Text(isSelect.value == false ? "popup child function onclick is false" : "popup child function onclick is true");
78 | }),
79 | SizedBox(
80 | height: 20,
81 | ),
82 | MaterialButton(
83 | key: btnKey,
84 | height: 50,
85 | child: Text("popup"),
86 | color: Colors.redAccent,
87 | onPressed: () {
88 | /*showModalBottomSheet(
89 | context: context,
90 | isScrollControlled: true,
91 | builder: (BuildContext context) {
92 | return StatefulBuilder(
93 | builder: (context1, StateSetter setBottomSheetState) {
94 | return SingleChildScrollView(
95 | child: Container(
96 | padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
97 | child: Column(
98 | mainAxisSize: MainAxisSize.min,
99 | children: [
100 | TextButton(
101 | onPressed: () {
102 | setBottomSheetState(() {
103 | aaa = "true";
104 | });
105 | },
106 | child: Text("asdasdasd"),
107 | ),
108 | TextField(
109 | controller: TextEditingController(text: aaa),
110 | keyboardType: TextInputType.number,
111 | inputFormatters: [WhitelistingTextInputFormatter.digitsOnly], //只允许输入数字
112 | textInputAction: TextInputAction.done,
113 | ),
114 | ],
115 | ),
116 | ),
117 | );
118 | },
119 | );
120 | });*/
121 | showPopupWindow(
122 | context,
123 | //childSize:Size(240, 800),
124 | gravity: KumiPopupGravity.centerBottom,
125 | //curve: Curves.elasticOut,
126 | bgColor: Colors.grey.withOpacity(0.5),
127 | clickOutDismiss: true,
128 | clickBackDismiss: true,
129 | customAnimation: false,
130 | customPop: false,
131 | customPage: false,
132 | // targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
133 | //needSafeDisplay: true,
134 | underStatusBar: false,
135 | underAppBar: false,
136 | //offsetX: -180,
137 | //offsetY: 50,
138 | duration: Duration(milliseconds: 300),
139 | onShowStart: (pop) {
140 | print("showStart");
141 | },
142 | onShowFinish: (pop) {
143 | print("showFinish");
144 | },
145 | onDismissStart: (pop) {
146 | print("dismissStart");
147 | },
148 | onDismissFinish: (pop) {
149 | print("dismissFinish");
150 | },
151 | onClickOut: (pop) {
152 | print("onClickOut");
153 | },
154 | onClickBack: (pop) {
155 | print("onClickBack");
156 | },
157 | childFun: (pop) {
158 | return StatefulBuilder(
159 | key: GlobalKey(),
160 | builder: (popContext, popState) {
161 | return GestureDetector(
162 | onTap: () {
163 | //isSelect.value = !isSelect.value;
164 | popState(() {
165 | aaa = "sasdasd";
166 | });
167 | },
168 | child: Container(
169 | padding: EdgeInsets.all(10),
170 | height: 800,
171 | width: 300,
172 | color: Colors.redAccent,
173 | alignment: Alignment.center,
174 | child: Text(aaa),
175 | ),
176 | );
177 | });
178 | },
179 | );
180 | }),
181 | ],
182 | ),
183 | ), // This trailing comma makes auto-formatting nicer for build methods.
184 | );
185 | }
186 | }
187 |
--------------------------------------------------------------------------------
/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.flutter-io.cn"
9 | source: hosted
10 | version: "2.8.2"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.flutter-io.cn"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.flutter-io.cn"
23 | source: hosted
24 | version: "1.2.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.flutter-io.cn"
30 | source: hosted
31 | version: "1.3.1"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.flutter-io.cn"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.flutter-io.cn"
44 | source: hosted
45 | version: "1.16.0"
46 | cupertino_icons:
47 | dependency: "direct main"
48 | description:
49 | name: cupertino_icons
50 | url: "https://pub.flutter-io.cn"
51 | source: hosted
52 | version: "1.0.4"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.flutter-io.cn"
58 | source: hosted
59 | version: "1.3.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | kumi_popup_window:
71 | dependency: "direct main"
72 | description:
73 | path: ".."
74 | relative: true
75 | source: path
76 | version: "2.0.1"
77 | matcher:
78 | dependency: transitive
79 | description:
80 | name: matcher
81 | url: "https://pub.flutter-io.cn"
82 | source: hosted
83 | version: "0.12.11"
84 | material_color_utilities:
85 | dependency: transitive
86 | description:
87 | name: material_color_utilities
88 | url: "https://pub.flutter-io.cn"
89 | source: hosted
90 | version: "0.1.4"
91 | meta:
92 | dependency: transitive
93 | description:
94 | name: meta
95 | url: "https://pub.flutter-io.cn"
96 | source: hosted
97 | version: "1.7.0"
98 | path:
99 | dependency: transitive
100 | description:
101 | name: path
102 | url: "https://pub.flutter-io.cn"
103 | source: hosted
104 | version: "1.8.1"
105 | sky_engine:
106 | dependency: transitive
107 | description: flutter
108 | source: sdk
109 | version: "0.0.99"
110 | source_span:
111 | dependency: transitive
112 | description:
113 | name: source_span
114 | url: "https://pub.flutter-io.cn"
115 | source: hosted
116 | version: "1.8.2"
117 | stack_trace:
118 | dependency: transitive
119 | description:
120 | name: stack_trace
121 | url: "https://pub.flutter-io.cn"
122 | source: hosted
123 | version: "1.10.0"
124 | stream_channel:
125 | dependency: transitive
126 | description:
127 | name: stream_channel
128 | url: "https://pub.flutter-io.cn"
129 | source: hosted
130 | version: "2.1.0"
131 | string_scanner:
132 | dependency: transitive
133 | description:
134 | name: string_scanner
135 | url: "https://pub.flutter-io.cn"
136 | source: hosted
137 | version: "1.1.0"
138 | term_glyph:
139 | dependency: transitive
140 | description:
141 | name: term_glyph
142 | url: "https://pub.flutter-io.cn"
143 | source: hosted
144 | version: "1.2.0"
145 | test_api:
146 | dependency: transitive
147 | description:
148 | name: test_api
149 | url: "https://pub.flutter-io.cn"
150 | source: hosted
151 | version: "0.4.9"
152 | vector_math:
153 | dependency: transitive
154 | description:
155 | name: vector_math
156 | url: "https://pub.flutter-io.cn"
157 | source: hosted
158 | version: "2.1.2"
159 | sdks:
160 | dart: ">=2.17.0 <3.0.0"
161 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example
2 | description: A new Flutter project.
3 | publish_to: none
4 |
5 | # The following defines the version and build number for your application.
6 | # A version number is three numbers separated by dots, like 1.2.43
7 | # followed by an optional build number separated by a +.
8 | # Both the version and the builder number may be overridden in flutter
9 | # build by specifying --build-name and --build-number, respectively.
10 | # In Android, build-name is used as versionName while build-number used as versionCode.
11 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
12 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
13 | # Read more about iOS versioning at
14 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
15 | version: 1.0.0+1
16 |
17 | environment:
18 | sdk: ">=2.16.2 <3.0.0"
19 |
20 | dependencies:
21 | flutter:
22 | sdk: flutter
23 | kumi_popup_window:
24 | path: ../
25 |
26 | # The following adds the Cupertino Icons font to your application.
27 | # Use with the CupertinoIcons class for iOS style icons.
28 | cupertino_icons: ^1.0.4
29 |
30 | dev_dependencies:
31 | flutter_test:
32 | sdk: flutter
33 |
34 |
35 | # For information on the generic Dart part of this file, see the
36 | # following page: https://dart.dev/tools/pub/pubspec
37 |
38 | # The following section is specific to Flutter.
39 | flutter:
40 |
41 | # The following line ensures that the Material Icons font is
42 | # included with your application, so that you can use the icons in
43 | # the material Icons class.
44 | uses-material-design: true
45 |
46 | # To add assets to your application, add an assets section, like this:
47 | # assets:
48 | # - images/a_dot_burr.jpeg
49 | # - images/a_dot_ham.jpeg
50 |
51 | # An image asset can refer to one or more resolution-specific "variants", see
52 | # https://flutter.dev/assets-and-images/#resolution-aware.
53 |
54 | # For details regarding adding assets from package dependencies, see
55 | # https://flutter.dev/assets-and-images/#from-packages
56 |
57 | # To add custom fonts to your application, add a fonts section here,
58 | # in this "flutter" section. Each entry in this list should have a
59 | # "family" key with the font family name, and a "fonts" key with a
60 | # list giving the asset and other descriptors for the font. For
61 | # example:
62 | # fonts:
63 | # - family: Schyler
64 | # fonts:
65 | # - asset: fonts/Schyler-Regular.ttf
66 | # - asset: fonts/Schyler-Italic.ttf
67 | # style: italic
68 | # - family: Trajan Pro
69 | # fonts:
70 | # - asset: fonts/TrajanPro.ttf
71 | # - asset: fonts/TrajanPro_Bold.ttf
72 | # weight: 700
73 | #
74 | # For details regarding fonts from package dependencies,
75 | # see https://flutter.dev/custom-fonts/#from-packages
76 |
--------------------------------------------------------------------------------
/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:example/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/kumi_popup_window.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/lib/PopRoute.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class PopRoute extends PopupRoute {
4 | final Widget _child;
5 |
6 | PopRoute({
7 | required Widget child,
8 | }):
9 | _child = child;
10 |
11 |
12 | @override
13 | Color? get barrierColor => null;
14 |
15 | @override
16 | bool get barrierDismissible => true;
17 |
18 | @override
19 | String? get barrierLabel => null;
20 |
21 | @override
22 | Duration get transitionDuration => Duration(milliseconds: 0);
23 |
24 | @override
25 | Widget buildPage(BuildContext context, Animation animation, Animation secondaryAnimation) {
26 | return _child;
27 | }
28 |
29 | @override
30 | Widget buildTransitions (BuildContext context, Animation animation,
31 | Animation secondaryAnimation, Widget child) {
32 | return child;
33 | //return FadeTransition(opacity: animation, child: child);
34 | /*if (child is AnimatedWidget) {
35 | return child;
36 | }
37 | const Offset topLeft = const Offset(0.0, 0.0);
38 | const Offset topRight = const Offset(0.0, 0.0);
39 | const Offset bottomLeft = const Offset(0.0, 1.0);
40 | const Offset bottomRight = const Offset(0.0, 0.0);
41 | Offset startOffset = bottomLeft;
42 | Offset endOffset = topLeft;
43 |
44 | startOffset = bottomLeft;
45 | endOffset = bottomRight;
46 |
47 | return SlideTransition(
48 | position: Tween(
49 | begin: startOffset,
50 | end: endOffset,
51 | ).animate(animation),
52 | child: child,
53 | );*/
54 | }
55 |
56 |
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/lib/kumi_popup_window.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'PopRoute.dart';
4 |
5 | KumiPopupWindow showPopupWindow(
6 | BuildContext context, {
7 | Widget Function(KumiPopupWindow popup)? childFun,
8 | Size? childSize,
9 | KumiPopupGravity? gravity,
10 | Curve? curve,
11 | bool? customAnimation,
12 | bool? customPop,
13 | bool? customPage,
14 | Color? bgColor,
15 | RenderBox? targetRenderBox,
16 | bool? underStatusBar,
17 | bool? underAppBar,
18 | bool? clickOutDismiss,
19 | bool? clickBackDismiss,
20 | double? offsetX,
21 | double? offsetY,
22 | Duration? duration,
23 | bool? needSafeDisplay,
24 | Function(KumiPopupWindow popup)? onShowStart,
25 | Function(KumiPopupWindow popup)? onShowFinish,
26 | Function(KumiPopupWindow popup)? onDismissStart,
27 | Function(KumiPopupWindow popup)? onDismissFinish,
28 | Function(KumiPopupWindow popup)? onClickOut,
29 | Function(KumiPopupWindow popup)? onClickBack,
30 | }) {
31 | var popup = KumiPopupWindow(
32 | gravity: gravity,
33 | curve: curve,
34 | customAnimation: customAnimation,
35 | customPop: customPop,
36 | customPage: customPage,
37 | bgColor: bgColor,
38 | childFun: childFun,
39 | childSize: childSize,
40 | targetRenderBox: targetRenderBox,
41 | underStatusBar: underStatusBar,
42 | underAppBar: underAppBar,
43 | clickOutDismiss: clickOutDismiss,
44 | clickBackDismiss: clickBackDismiss,
45 | offsetX: offsetX,
46 | offsetY: offsetY,
47 | duration: duration,
48 | needSafeDisplay: needSafeDisplay,
49 | onShowStart: onShowStart,
50 | onShowFinish: onShowFinish,
51 | onDismissStart: onDismissStart,
52 | onDismissFinish: onDismissFinish,
53 | onClickOut: onClickOut,
54 | onClickBack: onClickBack,
55 | );
56 | popup.show(context);
57 | return popup;
58 | }
59 |
60 | KumiPopupWindow createPopupWindow(
61 | BuildContext context, {
62 | Widget Function(KumiPopupWindow popup)? childFun,
63 | Size? childSize,
64 | KumiPopupGravity? gravity,
65 | bool? customAnimation,
66 | bool? customPop,
67 | bool? customPage,
68 | Color? bgColor,
69 | RenderBox? targetRenderBox,
70 | bool? underStatusBar,
71 | bool? underAppBar,
72 | bool? clickOutDismiss,
73 | bool? clickBackDismiss,
74 | double? offsetX,
75 | double? offsetY,
76 | Duration? duration,
77 | bool? needSafeDisplay,
78 | Function(KumiPopupWindow popup)? onShowStart,
79 | Function(KumiPopupWindow popup)? onShowFinish,
80 | Function(KumiPopupWindow popup)? onDismissStart,
81 | Function(KumiPopupWindow popup)? onDismissFinish,
82 | Function(KumiPopupWindow popup)? onClickOut,
83 | Function(KumiPopupWindow popup)? onClickBack,
84 | }) {
85 | return KumiPopupWindow(
86 | gravity: gravity,
87 | customAnimation: customAnimation,
88 | customPop: customPop,
89 | customPage: customPage,
90 | bgColor: bgColor,
91 | childFun: childFun,
92 | childSize: childSize,
93 | targetRenderBox: targetRenderBox,
94 | underStatusBar: underStatusBar,
95 | underAppBar: underAppBar,
96 | clickOutDismiss: clickOutDismiss,
97 | clickBackDismiss: clickBackDismiss,
98 | offsetX: offsetX,
99 | offsetY: offsetY,
100 | duration: duration,
101 | needSafeDisplay: needSafeDisplay,
102 | onShowStart: onShowStart,
103 | onShowFinish: onShowFinish,
104 | onDismissStart: onDismissStart,
105 | onDismissFinish: onDismissFinish,
106 | onClickOut: onClickOut,
107 | onClickBack: onClickBack,
108 | );
109 | }
110 |
111 | // ignore: must_be_immutable
112 | class KumiPopupWindow extends StatefulWidget {
113 | /// 自定义弹出框内容的方法,返回的widget将作为弹出框内容,然后赋值给[_child]
114 | /// 如果[_childSize] == null,那么当绘制完成以后,会将[_child]的尺寸赋值给[_childSize]
115 | /// Method for customizing the content of the popup window. The returned widget will be used as the content of the popup window, and then assigned to [_child]
116 | /// If [_childSize] == null, the size of [_child] will be assigned to [_childSize] when the drawing is completed
117 | final Widget Function(KumiPopupWindow popup)? _childFun;
118 |
119 | /// 弹出框的相对位置
120 | /// 默认为 [KumiPopupGravity.center]
121 | /// 如果[_targetRenderBox] == null,那么此时弹出框的位置相对于屏幕,
122 | /// 如果[_targetRenderBox] != null,那么此时弹出框的位置相对于目标widget
123 | /// Relative position of the pop-up window.
124 | /// The default is [KumiPopupGravity.center]
125 | /// If [_targetRenderBox] == null, then the position of the pop-up window is relative to the screen.
126 | /// If [_targetRenderBox]! = Null, then the position of the popup window is relative to the target widget
127 | final KumiPopupGravity _gravity;
128 |
129 | /// 动画插值器
130 | /// 默认为[Curves.decelerate]
131 | /// 如果不自定义动画,那么可以使用此属性来改变动画曲线
132 | /// Animation interpolator
133 | /// The default is[Curves.decelerate]
134 | /// If you do not customize the animation, you can use this property to change the animation curve
135 | final Curve _curve;
136 |
137 | /// 自定义popupWindow的动画
138 | /// 默认为false。
139 | /// 如果为true,那么此时默认动画无效,需要为[_childFun]返回的widget自定义动画
140 | /// Custom popupWindow animation
141 | ///The default is false.
142 | ///If true, then the default animation is invalid at this time, you need to customize the animation for the widget returned by [_childFun]
143 | final bool _customAnimation;
144 |
145 | ///自定义popupWindow的位置与动画
146 | /// 默认为false。
147 | /// 如果为true,那么此时[_gravity]和默认动画均无效,需要为[_childFun]返回的widget自定义位置与动画
148 | /// Customize the position and animation of popupWindow
149 | ///The default is false.
150 | ///If true, then both [_gravity] and the default animation are invalid. You need to customize the position and animation for the widget returned by [_childFun]
151 | final bool _customPop;
152 |
153 | /// 自定义整个页面,包括[Scaffold]
154 | /// 默认为false。
155 | /// 如果为true,需要为[_childFun]返回的widget自定义整个页面
156 | /// Customize the entire page, including [Scaffold]
157 | ///The default is false.
158 | ///If true, you need to customize the entire page for the widget returned by [_childFun]
159 | final bool _customPage;
160 |
161 | ///遮罩层的颜色
162 | ///默认为[Colors.black].withOpacity(0.5)
163 | ///The color of the mask layer
164 | ///The default is [Colors.black].withOpacity(0.5)
165 | final Color _bgColor;
166 |
167 | ///目标widget的[RenderBox]
168 | ///默认为null
169 | ///通过该属性获取目标widget的位置与尺寸
170 | ///具体看[_gravity]的说明
171 | ///[RenderBox] of the target widget
172 | ///The default is null
173 | ///Get the position and size of the target widget through this property
174 | ///See the description of [_gravity]
175 | final RenderBox? _targetRenderBox;
176 |
177 | ///顶部弹出时,是否在statusBar下方
178 | ///默认为false
179 | ///When the top pops up, is it below the statusBar
180 | ///The default is false
181 | final bool _underStatusBar;
182 |
183 | ///顶部弹出时,是否在AppBar下方
184 | ///默认为false
185 | ///When the top pops up, is it below the AppBar
186 | ///The default is false
187 | final bool _underAppBar;
188 |
189 | ///点击弹出框以外的区域是否收起
190 | ///默认为true
191 | ///Click outside the pop-up window to dismiss
192 | ///The default is true
193 | final bool _clickOutDismiss;
194 |
195 | ///点击物理返回按钮是否收起
196 | ///默认为true
197 | ///Click the physical back button to dismiss
198 | ///The default is true
199 | final bool _clickBackDismiss;
200 |
201 | ///横轴贴边处相对偏移量
202 | ///默认为0.0
203 | /// 如果 [_targetRenderBox] 为null,那么该值表示相对于屏幕边缘的横向偏移量,不能小于0.0
204 | /// 如果 [_targetRenderBox] 不为null,那么该值表示相对于目标widget边缘的横向偏移量,小于0表示向左偏移,大于0表示向右偏移
205 | ///Relative offset at the edge of the horizontal axis
206 | ///The default is 0.0,Cannot be less than 0.0
207 | ///If [_targetRenderBox] is null, then this value represents the horizontal offset from the edge of the screen, which cannot be less than 0.0
208 | ///If [_targetRenderBox] is not null, then this value represents the horizontal offset relative to the edge of the target widget, less than 0 means left offset, and greater than 0 means right offset
209 | final double _relativeOffsetX;
210 |
211 | ///纵轴贴边处相对偏移量
212 | ///默认为0.0
213 | /// 如果 [_targetRenderBox] 为null,那么该值表示相对于屏幕边缘的纵向偏移量,不能小于0.0
214 | /// 如果 [_targetRenderBox] 不为null,那么该值表示相对于目标widget边缘的纵向偏移量,小于0表示向上偏移,大于0表示向下偏移
215 | ///Offset at vertical axis edge
216 | ///The default is 0.0
217 | ///If [_targetRenderBox] is null, then this value represents the vertical offset relative to the edge of the screen and cannot be less than 0.0
218 | ///If [_targetRenderBox] is not null, then this value represents the vertical offset relative to the edge of the target widget, less than 0 means up offset, and greater than 0 represents downward offset
219 | final double _relativeOffsetY;
220 |
221 | ///动画的时长
222 | ///默认为 200ms
223 | ///Duration of the animation
224 | ///The default is 200ms
225 | final Duration _duration;
226 |
227 | /// 是否需要安全显示弹出框
228 | /// 如果为true,并且[_targetRenderBox]不为null时,当弹出框超出边界时,会自动贴边
229 | /// Do you need to display pop ups safely
230 | /// IfIf it is true and [_targetRenderBox] is not null, when the pop-up box exceeds the boundary, it will be automatically trimmed
231 | final bool _needSafeDisplay;
232 |
233 | /// 当前弹框是否已经显示
234 | /// Is the current pop-up displayed
235 | bool? _isShow;
236 |
237 | bool? get isShow => _isShow;
238 |
239 | ///弹出动画开始的监听
240 | /// When the popupWindow show animation start
241 | final Function(KumiPopupWindow popup)? _onShowStart;
242 |
243 | ///弹出动画结束的监听
244 | /// When the popupWindow show animation finish
245 | final Function(KumiPopupWindow popup)? _onShowEnd;
246 |
247 | ///收起动画开始的监听
248 | /// When the popupWindow dismiss animation start
249 | final Function(KumiPopupWindow popup)? _onDismissStart;
250 |
251 | ///收起动画结束的监听
252 | /// When the popupWindow dismiss animation finish
253 | final Function(KumiPopupWindow popup)? _onDismissEnd;
254 |
255 | ///点击弹框以外的监听
256 | ///只有当[_clickOutDismiss] == false 才有效
257 | /// Click on the listener outside the popup
258 | /// Only works when [_clickOutDismiss] == false
259 | final Function(KumiPopupWindow popup)? _onClickOut;
260 |
261 | ///点击物理返回按钮的监听
262 | ///只有当[_clickBackDismiss] == false 才有效
263 | /// Listening on clicking the physical back button
264 | /// Only works when [_clickBackDismiss] == false
265 | final Function(KumiPopupWindow popup)? _onClickBack;
266 |
267 | ///弹出框的尺寸
268 | ///如果为null,那么将在绘制完成之后计算并赋值
269 | /// PopupWindow size
270 | /// If null, it will be calculated and assigned after drawing
271 | Size? _childSize;
272 |
273 | Size? get childSize => _childSize;
274 |
275 | ///弹出框的widget
276 | ///[_childFun]返回的widget
277 | ///Popup window widget
278 | ///[_childFun] Returned widget
279 | Widget? _child;
280 |
281 | Widget? get child => _child;
282 |
283 | ///动画控制器
284 | //AnimationController
285 | AnimationController? _controller;
286 |
287 | AnimationController? get controller => _controller;
288 |
289 | KumiPopupWindow({
290 | required Widget Function(KumiPopupWindow popup)? childFun,
291 | Size? childSize,
292 | KumiPopupGravity? gravity,
293 | Curve? curve,
294 | bool? customAnimation,
295 | bool? customPop,
296 | bool? customPage,
297 | Color? bgColor,
298 | RenderBox? targetRenderBox,
299 | bool? underStatusBar,
300 | bool? underAppBar,
301 | bool? clickOutDismiss,
302 | bool? clickBackDismiss,
303 | double? offsetX,
304 | double? offsetY,
305 | Duration? duration,
306 | bool? needSafeDisplay,
307 | Function(KumiPopupWindow popup)? onShowStart,
308 | Function(KumiPopupWindow popup)? onShowFinish,
309 | Function(KumiPopupWindow popup)? onDismissStart,
310 | Function(KumiPopupWindow popup)? onDismissFinish,
311 | Function(KumiPopupWindow popup)? onClickOut,
312 | Function(KumiPopupWindow popup)? onClickBack,
313 | }) : _childFun = childFun,
314 | _childSize = childSize,
315 | _gravity = gravity ?? KumiPopupGravity.center,
316 | _curve = curve ?? Curves.decelerate,
317 | _customAnimation = customAnimation ?? false,
318 | _customPop = customPop ?? false,
319 | _customPage = customPage ?? false,
320 | _bgColor = bgColor ?? Colors.black.withOpacity(0.5),
321 | _targetRenderBox = targetRenderBox,
322 | _underStatusBar = underStatusBar ?? false,
323 | _underAppBar = underAppBar ?? false,
324 | _clickOutDismiss = clickOutDismiss ?? true,
325 | _clickBackDismiss = clickBackDismiss ?? true,
326 | _relativeOffsetX = offsetX ?? 0,
327 | _relativeOffsetY = offsetY ?? 0,
328 | _duration = duration ?? Duration(milliseconds: 300),
329 | _needSafeDisplay = needSafeDisplay ?? false,
330 | _onShowStart = onShowStart,
331 | _onShowEnd = onShowFinish,
332 | _onDismissStart = onDismissStart,
333 | _onDismissEnd = onDismissFinish,
334 | _onClickOut = onClickOut,
335 | _onClickBack = onClickBack;
336 |
337 | @override
338 | _KumiPopupWindowState createState() => _KumiPopupWindowState();
339 |
340 | ///收起弹框
341 | ///popup window dismiss
342 | Future dismiss(BuildContext context, {bool? notStartAnimation, Function(KumiPopupWindow pop)? onFinish}) async {
343 | if (_isShow == false) {
344 | return;
345 | }
346 | _isShow = false;
347 | if (notStartAnimation == true) {
348 | Navigator.pop(context);
349 | if (onFinish != null) {
350 | onFinish(this);
351 | }
352 | return;
353 | }
354 | await _controller!.reverse();
355 | Navigator.pop(context);
356 | if (onFinish != null) {
357 | onFinish(this);
358 | }
359 | }
360 |
361 | ///弹出弹框
362 | ///popup window show
363 | Future show(BuildContext context) async {
364 | Navigator.push(
365 | context,
366 | PopRoute(
367 | child: this,
368 | ),
369 | );
370 | _isShow = true;
371 | }
372 | }
373 |
374 | class _KumiPopupWindowState extends State with SingleTickerProviderStateMixin {
375 | Animation? animation;
376 |
377 | @override
378 | void initState() {
379 | super.initState();
380 | widget._controller = AnimationController(duration: widget._duration, vsync: this);
381 | widget._controller!.addStatusListener((status) {
382 | switch (status) {
383 | case AnimationStatus.forward:
384 | if (widget._onShowStart != null) {
385 | widget._onShowStart!(widget);
386 | }
387 | break;
388 | case AnimationStatus.dismissed:
389 | if (widget._onDismissEnd != null) {
390 | widget._onDismissEnd!(widget);
391 | }
392 | break;
393 | case AnimationStatus.reverse:
394 | if (widget._onDismissStart != null) {
395 | widget._onDismissStart!(widget);
396 | }
397 | break;
398 | case AnimationStatus.completed:
399 | if (widget._onShowEnd != null) {
400 | widget._onShowEnd!(widget);
401 | }
402 | break;
403 | }
404 | });
405 |
406 | ///将弹出框保存起来,保证其唯一性
407 | ///Save the popup window to ensure its uniqueness
408 | widget._child = widget._childFun!(widget);
409 |
410 | ///如果已经设置过弹出框的尺寸,那么可以直接开始动画
411 | ///If you have set the size of the popup window, you can start the animation directly
412 | if (widget._childSize != null) {
413 | widget._controller!.forward();
414 | }
415 |
416 | ///绘制完成的监听
417 | ///Draw completed listener
418 | WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
419 | if (widget._customPage) {
420 | widget._controller!.forward();
421 | return;
422 | }
423 | if (widget._customPop) {
424 | widget._controller!.forward();
425 | return;
426 | }
427 |
428 | ///如果未设置弹出框的尺寸
429 | ///If the size of the popup box is not set
430 | if (widget._childSize == null) {
431 | ///那么此时可以直接获取弹出框绘制完成之后的尺寸
432 | ///Then you can directly get the size after the popup window is drawn.
433 | widget._childSize = (widget._child!.key as GlobalKey).currentContext!.size;
434 |
435 | ///并且开始动画,必须放在setState里面
436 | ///And start the animation, must be placed in setState
437 | setState(() {
438 | widget._controller!.forward();
439 | });
440 | }
441 | });
442 | }
443 |
444 | dispose() {
445 | widget._controller!.dispose();
446 | super.dispose();
447 | }
448 |
449 | ///获取statusBar的高度
450 | ///Get the height of statusBar
451 | double _getStatusBar(BuildContext context) {
452 | MediaQueryData mediaQuery = MediaQuery.of(context);
453 | return mediaQuery.padding.top;
454 | }
455 |
456 | ///获取statusBar和appBar的总高度
457 | ///Get the total height of statusBar and appBar
458 | double _getStatusBarAndAppBarHeight(BuildContext context) {
459 | MediaQueryData mediaQuery = MediaQuery.of(context);
460 | return mediaQuery.padding.top + kToolbarHeight;
461 | }
462 |
463 | ///判断是否需要将弹出框显示在statusBar或者appBar下方,并返回偏移量
464 | ///Determines whether the pop-up window needs to be displayed below the statusBar or appBar and returns the offset
465 | double _getTopPadding(BuildContext context) {
466 | return widget._underAppBar == true ? _getStatusBarAndAppBarHeight(context) : (widget._underStatusBar == true ? _getStatusBar(context) : 0);
467 | }
468 |
469 | /* ///当popup window的中心点与屏幕中心点重合时,此时popup window的x轴坐标
470 | ///When the center point of the popup window coincides with the center point of the screen, the x-axis coordinate of the popup window at this time
471 | double _getScreenCenterX() {
472 | MediaQueryData mediaQuery = MediaQuery.of(context);
473 | if (widget._childSize == null) {
474 | return mediaQuery.size.width / 2;
475 | }
476 | return (mediaQuery.size.width - widget._childSize.width) / 2;
477 | }*/
478 |
479 | /*
480 | ///当popup window的中心点与屏幕中心点重合时,此时popup window的y轴坐标
481 | ///When the center point of the popup window coincides with the center point of the screen, the y-axis coordinate of the popup window at this time
482 | double _getScreenCenterY() {
483 | MediaQueryData mediaQuery = MediaQuery.of(context);
484 | if (widget._childSize == null) {
485 | return mediaQuery.size.height / 2;
486 | }
487 | return (mediaQuery.size.height - widget._childSize.height) / 2;
488 | }
489 | */
490 |
491 | Widget getLayout(BuildContext context) {
492 | ///如果想要自定义整个页面
493 | ///If you want to customize the entire page
494 | if (widget._customPage) {
495 | return WillPopScope(
496 | child: widget._child!,
497 | onWillPop: () {
498 | if (widget._clickBackDismiss) {
499 | widget.dismiss(context);
500 | }
501 | return Future.value(false);
502 | });
503 | }
504 |
505 | ///如果想要自定义popup window的位置和动画
506 | ///If you want to customize the position and animation of the popup window
507 | if (widget._customPop) {
508 | return WillPopScope(
509 | child: Scaffold(
510 | backgroundColor: Colors.transparent,
511 | body: Stack(
512 | children: [
513 | Align(
514 | child: GestureDetector(
515 | child: FadeTransition(
516 | opacity: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
517 | child: Container(
518 | alignment: Alignment.center,
519 | color: widget._bgColor,
520 | ),
521 | ),
522 | onTap: () {
523 | if (widget._clickOutDismiss) {
524 | widget.dismiss(context);
525 | return;
526 | }
527 | if (widget._onClickOut != null) {
528 | widget._onClickOut!(widget);
529 | }
530 | },
531 | ),
532 | ),
533 | if (widget._child != null) widget._child!,
534 | ],
535 | ),
536 | ),
537 | onWillPop: () {
538 | if (widget._clickBackDismiss) {
539 | widget.dismiss(context);
540 | return Future.value(false);
541 | }
542 | if (widget._onClickBack != null) {
543 | widget._onClickBack!(widget);
544 | }
545 | return Future.value(false);
546 | });
547 | }
548 |
549 | ///popup window的最终widget
550 | ///The final widget of the popup window
551 | var childView;
552 |
553 | ///目标widget的坐标
554 | ///The position of the target widget
555 | late Offset targetOffset;
556 |
557 | ///目标widget的尺寸
558 | ///The size of the target widget
559 | late Size targetSize;
560 |
561 | ///当popup window的位置相对于某个目标widget时,需要初始化目标widget的坐标与尺寸
562 | ///When the position of the popup window is relative to a target widget, you need to initialize the position and size of the target widget
563 | if (widget._targetRenderBox != null) {
564 | targetOffset = widget._targetRenderBox!.localToGlobal(Offset.zero);
565 | targetSize = widget._targetRenderBox!.size;
566 | }
567 | switch (widget._gravity) {
568 | case KumiPopupGravity.leftTop:
569 | if (widget._targetRenderBox == null) {
570 | ///如果位置相对于屏幕,从屏幕左上角弹出
571 | ///If the position is relative to the screen,Pop up from the top left corner of the screen
572 | childView = Align(
573 | alignment: Alignment.topLeft,
574 | child: Padding(
575 | padding: EdgeInsets.only(
576 | left: widget._relativeOffsetX,
577 | top: _getTopPadding(context) + widget._relativeOffsetY,
578 | ),
579 | child: widget._customAnimation
580 | ? widget._child
581 | : ScaleTransition(
582 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
583 | child: SlideTransition(
584 | position: Tween(begin: Offset(-1, -1), end: Offset(0, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
585 | child: FadeTransition(
586 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
587 | child: widget._child,
588 | ),
589 | ),
590 | ),
591 | ),
592 | );
593 | } else {
594 | var safeWidth = 0.0;
595 | var safeHeight = 0.0;
596 | if (widget._childSize != null && widget._needSafeDisplay) {
597 | safeWidth = widget._childSize!.width - widget._relativeOffsetX - targetOffset.dx;
598 | safeHeight = widget._childSize!.height - widget._relativeOffsetY - targetOffset.dy;
599 | }
600 |
601 | ///如果位置相对于目标widget,从目标widget的左上角弹出
602 | ///弹出之前,弹出框左上角与目标widget的左上角对齐
603 | ///If the position is relative to the target widget, pop up from the upper left corner of the target widget
604 | ///Before popup, the upper left corner of the popup box is aligned with the upper left corner of the target widget
605 | childView = Positioned(
606 | left: targetOffset.dx + widget._relativeOffsetX + (safeWidth > 0 ? safeWidth : 0),
607 | top: targetOffset.dy + widget._relativeOffsetY + (safeHeight > 0 ? safeHeight : 0),
608 | child: widget._customAnimation
609 | ? widget._child!
610 | : ScaleTransition(
611 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
612 | child: SlideTransition(
613 | position: Tween(begin: Offset(0, 0), end: Offset(-1, -1)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
614 | child: FadeTransition(
615 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
616 | child: widget._child,
617 | ),
618 | ),
619 | ),
620 | );
621 | }
622 | break;
623 | case KumiPopupGravity.centerTop:
624 | if (widget._targetRenderBox == null) {
625 | ///如果位置相对于屏幕,从屏幕正上方弹出
626 | ///If the position is relative to the screen,Pop up from the top center corner of the screen
627 | childView = Align(
628 | alignment: Alignment.topCenter,
629 | child: Padding(
630 | padding: EdgeInsets.only(
631 | top: _getTopPadding(context) + widget._relativeOffsetY,
632 | ),
633 | child: widget._customAnimation
634 | ? widget._child
635 | : SlideTransition(
636 | position: Tween(begin: Offset(0, -1), end: Offset(0, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
637 | child: FadeTransition(
638 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
639 | child: widget._child,
640 | ),
641 | ),
642 | ),
643 | );
644 | } else {
645 | var safeHeight = 0.0;
646 | if (widget._childSize != null && widget._needSafeDisplay) {
647 | safeHeight = widget._childSize!.height - widget._relativeOffsetY - targetOffset.dy;
648 | }
649 |
650 | ///如果位置相对于目标widget,从目标widget的正上方弹出
651 | ///弹出之前,弹出框的x轴中心点与目标widget的x轴中心点对齐,弹出框的上边与目标widget的上边对齐
652 | ///If the position is relative to the target widget, pop up from directly above the target widget
653 | ///Before the pop-up, the x-axis center point of the popup window is aligned with the x-axis center point of the target widget, and the top of the popup window is aligned with the top of the target widget
654 | childView = Positioned(
655 | left: targetOffset.dx - (widget._childSize == null ? 0 : widget._childSize!.width - targetSize.width) / 2 + widget._relativeOffsetX,
656 | top: targetOffset.dy + widget._relativeOffsetY + (safeHeight > 0 ? safeHeight : 0),
657 | child: widget._customAnimation
658 | ? widget._child!
659 | : ScaleTransition(
660 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
661 | child: SlideTransition(
662 | position: Tween(begin: Offset(0, 0), end: Offset(0, -1)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
663 | child: FadeTransition(
664 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
665 | child: widget._child,
666 | ),
667 | ),
668 | ),
669 | );
670 | }
671 | break;
672 | case KumiPopupGravity.rightTop:
673 | if (widget._targetRenderBox == null) {
674 | ///如果位置相对于屏幕,从屏幕右上角弹出
675 | ///If the position is relative to the screen,Pop up from the top right corner of the screen
676 | childView = Align(
677 | alignment: Alignment.topRight,
678 | child: Padding(
679 | padding: EdgeInsets.only(
680 | right: widget._relativeOffsetX,
681 | top: _getTopPadding(context) + widget._relativeOffsetY,
682 | ),
683 | child: widget._customAnimation
684 | ? widget._child
685 | : ScaleTransition(
686 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
687 | child: SlideTransition(
688 | position: Tween(begin: Offset(1, -1), end: Offset(0, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
689 | child: FadeTransition(
690 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
691 | child: widget._child,
692 | ),
693 | ),
694 | ),
695 | ),
696 | );
697 | } else {
698 | var safeWidth = 0.0;
699 | var safeHeight = 0.0;
700 | if (widget._childSize != null && widget._needSafeDisplay) {
701 | safeWidth = widget._childSize!.width + widget._relativeOffsetX - (MediaQuery.of(context).size.width - targetOffset.dx - targetSize.width);
702 | safeHeight = widget._childSize!.height - widget._relativeOffsetY - targetOffset.dy;
703 | }
704 |
705 | ///如果位置相对于目标widget,从目标widget的右上方弹出
706 | ///弹出之前,弹出框的右上角与目标widget的右上角对齐
707 | ///If the position is relative to the target widget, pop up from the upper right of the target widget
708 | ///Before popup, the upper right corner of the popup box is aligned with the upper right corner of the target widget
709 | childView = Positioned(
710 | left: targetOffset.dx -
711 | (widget._childSize == null ? 0 : widget._childSize!.width - targetSize.width) +
712 | widget._relativeOffsetX -
713 | (safeWidth > 0 ? safeWidth : 0),
714 | top: targetOffset.dy + widget._relativeOffsetY + (safeHeight > 0 ? safeHeight : 0),
715 | child: widget._customAnimation
716 | ? widget._child!
717 | : ScaleTransition(
718 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
719 | child: SlideTransition(
720 | position: Tween(begin: Offset(0, 0), end: Offset(1, -1)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
721 | child: FadeTransition(
722 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
723 | child: widget._child,
724 | ),
725 | ),
726 | ),
727 | );
728 | }
729 | break;
730 | case KumiPopupGravity.leftCenter:
731 | if (widget._targetRenderBox == null) {
732 | ///如果位置相对于屏幕,从屏幕正左方弹出
733 | ///If the position is relative to the screen, pop up from the left of the screen
734 | childView = Align(
735 | alignment: Alignment.centerLeft,
736 | child: Padding(
737 | padding: EdgeInsets.only(
738 | left: widget._relativeOffsetX,
739 | top: _getTopPadding(context),
740 | ),
741 | child: widget._customAnimation
742 | ? widget._child
743 | : SlideTransition(
744 | position: Tween(begin: Offset(-1, 0), end: Offset(0, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
745 | child: FadeTransition(
746 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
747 | child: widget._child,
748 | ),
749 | ),
750 | ),
751 | );
752 | } else {
753 | var safeWidth = 0.0;
754 | if (widget._childSize != null && widget._needSafeDisplay) {
755 | safeWidth = widget._childSize!.width + widget._relativeOffsetX - (MediaQuery.of(context).size.width - targetOffset.dx - targetSize.width);
756 | }
757 |
758 | ///如果位置相对于目标widget,从目标widget的正左方弹出
759 | ///弹出之前,弹出框的y轴中心点与目标widget的y轴中心点对齐,弹出框的左边与目标widget的左边对齐
760 | ///If the position is relative to the target widget, pop up from the left of the target widget
761 | ///Before the pop-up, the y-axis center point of the popup window is aligned with the y-axis center point of the target widget, and the left side of the popup window is aligned with the left side of the target widget
762 | childView = Positioned(
763 | left: targetOffset.dx + widget._relativeOffsetX + (safeWidth > 0 ? safeWidth : 0),
764 | top: targetOffset.dy - (widget._childSize == null ? 0 : widget._childSize!.height - targetSize.height) / 2 + widget._relativeOffsetY,
765 | child: widget._customAnimation
766 | ? widget._child!
767 | : ScaleTransition(
768 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
769 | child: SlideTransition(
770 | position: Tween(begin: Offset(0, 0), end: Offset(-1, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
771 | child: FadeTransition(
772 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
773 | child: widget._child,
774 | ),
775 | ),
776 | ),
777 | );
778 | }
779 | break;
780 | case KumiPopupGravity.center:
781 | if (widget._targetRenderBox == null) {
782 | ///如果位置相对于屏幕,从屏幕正中心弹出
783 | ///If the position is relative to the screen, pop up from the center of the screen
784 | childView = Align(
785 | alignment: Alignment.center,
786 | child: Padding(
787 | padding: EdgeInsets.only(left: widget._relativeOffsetX, top: widget._relativeOffsetY + _getTopPadding(context)),
788 | child: widget._customAnimation
789 | ? widget._child
790 | : ScaleTransition(
791 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
792 | child: FadeTransition(
793 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
794 | child: widget._child,
795 | ),
796 | ),
797 | ),
798 | );
799 | } else {
800 | ///如果位置相对于目标widget,从目标widget的正中心弹出
801 | ///弹出之前,弹出框的中心点与目标widget的中心点对齐
802 | ///If the position is relative to the target widget, pop it up from the center of the target widget
803 | ///Before pop-up, the center point of the popup window is aligned with the center point of the target widget
804 | childView = Positioned(
805 | left: targetOffset.dx - (widget._childSize == null ? 0 : widget._childSize!.width - targetSize.width) / 2 + widget._relativeOffsetX,
806 | top: targetOffset.dy - (widget._childSize == null ? 0 : widget._childSize!.height - targetSize.height) / 2 + widget._relativeOffsetY,
807 | child: widget._customAnimation
808 | ? widget._child!
809 | : ScaleTransition(
810 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
811 | child: FadeTransition(
812 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
813 | child: widget._child,
814 | )),
815 | );
816 | }
817 | break;
818 | case KumiPopupGravity.rightCenter:
819 | if (widget._targetRenderBox == null) {
820 | ///如果位置相对于屏幕,从屏幕正右方弹出
821 | ///If the position is relative to the screen, pop up from the right of the screen
822 | childView = Align(
823 | alignment: Alignment.centerRight,
824 | child: Padding(
825 | padding: EdgeInsets.only(
826 | right: widget._relativeOffsetX,
827 | top: _getTopPadding(context),
828 | ),
829 | child: widget._customAnimation
830 | ? widget._child
831 | : SlideTransition(
832 | position: Tween(begin: Offset(1, 0), end: Offset(0, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
833 | child: FadeTransition(
834 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
835 | child: widget._child,
836 | ),
837 | ),
838 | ),
839 | );
840 | } else {
841 | var safeWidth = 0.0;
842 | if (widget._childSize != null && widget._needSafeDisplay) {
843 | safeWidth = widget._childSize!.width + widget._relativeOffsetX - (MediaQuery.of(context).size.width - targetOffset.dx - targetSize.width);
844 | }
845 |
846 | ///如果位置相对于目标widget,从目标widget的正右方弹出
847 | ///弹出之前,弹出框的y轴中心点与目标widget的y轴中心点对齐,弹出框的右边与目标widget的右边对齐
848 | ///If the position is relative to the target widget, pop up from the left of the target widget
849 | ///Before the pop-up, the y-axis center point of the popup window is aligned with the y-axis center point of the target widget, and the right side of the popup window is aligned with the right side of the target widget
850 | childView = Positioned(
851 | left: targetOffset.dx -
852 | (widget._childSize == null ? 0 : widget._childSize!.width - targetSize.width) +
853 | widget._relativeOffsetX -
854 | (safeWidth > 0 ? safeWidth : 0),
855 | top: targetOffset.dy - (widget._childSize == null ? 0 : widget._childSize!.height - targetSize.height) / 2 + widget._relativeOffsetY,
856 | child: widget._customAnimation
857 | ? widget._child!
858 | : ScaleTransition(
859 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
860 | child: SlideTransition(
861 | position: Tween(begin: Offset(0, 0), end: Offset(1, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
862 | child: FadeTransition(
863 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
864 | child: widget._child,
865 | ),
866 | ),
867 | ),
868 | );
869 | }
870 | break;
871 | case KumiPopupGravity.leftBottom:
872 | if (widget._targetRenderBox == null) {
873 | ///如果位置相对于屏幕,从屏幕左下方弹出
874 | ///If the position is relative to the screen, pop up from the bottom left of the screen
875 | childView = Align(
876 | alignment: Alignment.bottomLeft,
877 | child: Padding(
878 | padding: EdgeInsets.only(
879 | left: widget._relativeOffsetX,
880 | bottom: widget._relativeOffsetY,
881 | ),
882 | child: widget._customAnimation
883 | ? widget._child
884 | : ScaleTransition(
885 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
886 | child: SlideTransition(
887 | position: Tween(begin: Offset(-1, 1), end: Offset(0, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
888 | child: FadeTransition(
889 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
890 | child: widget._child,
891 | ),
892 | ),
893 | ),
894 | ),
895 | );
896 | } else {
897 | var safeWidth = 0.0;
898 | var safeHeight = 0.0;
899 | if (widget._childSize != null && widget._needSafeDisplay) {
900 | safeWidth = widget._childSize!.width - widget._relativeOffsetX - targetOffset.dx;
901 | safeHeight = widget._childSize!.height + widget._relativeOffsetY - (MediaQuery.of(context).size.height - targetOffset.dy - targetSize.height);
902 | }
903 |
904 | ///如果位置相对于目标widget,从目标widget的左下方弹出
905 | ///弹出之前,弹出框的左下角与目标widget的左下角对齐
906 | ///If the position is relative to the target widget, pop up from the bottom left of the target widget
907 | ///Before popping up, the bottom left corner of the popup box is aligned with the bottom left corner of the target widget
908 | childView = Positioned(
909 | left: targetOffset.dx + widget._relativeOffsetX + (safeWidth > 0 ? safeWidth : 0),
910 | top: targetOffset.dy -
911 | (widget._childSize == null ? 0 : widget._childSize!.height - targetSize.height) +
912 | widget._relativeOffsetY -
913 | (safeHeight > 0 ? safeHeight : 0),
914 | child: widget._customAnimation
915 | ? widget._child!
916 | : ScaleTransition(
917 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
918 | child: SlideTransition(
919 | position: Tween(begin: Offset(0, 0), end: Offset(-1, 1)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
920 | child: FadeTransition(
921 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
922 | child: widget._child,
923 | ),
924 | ),
925 | ),
926 | );
927 | }
928 | break;
929 | case KumiPopupGravity.centerBottom:
930 | if (widget._targetRenderBox == null) {
931 | ///如果位置相对于屏幕,从屏幕正下方弹出
932 | ///If the position is relative to the screen, it pops up right below the screen
933 | childView = Align(
934 | alignment: Alignment.bottomCenter,
935 | child: Padding(
936 | padding: EdgeInsets.only(
937 | bottom: widget._relativeOffsetY,
938 | ),
939 | child: widget._customAnimation
940 | ? widget._child
941 | : SlideTransition(
942 | position: Tween(begin: Offset(0, 1), end: Offset(0, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
943 | child: FadeTransition(
944 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
945 | child: widget._child,
946 | ),
947 | ),
948 | ),
949 | );
950 | } else {
951 | var safeHeight = 0.0;
952 | if (widget._childSize != null && widget._needSafeDisplay) {
953 | safeHeight = widget._childSize!.height + widget._relativeOffsetY - (MediaQuery.of(context).size.height - targetOffset.dy - targetSize.height);
954 | }
955 |
956 | ///如果位置相对于目标widget,从目标widget的正下方弹出
957 | ///弹出之前,弹出框的x轴中心点与目标widget的x轴中心点对齐,弹出框的右边与目标widget的下边对齐
958 | ///If the position is relative to the target widget, pop up from directly below the target widget
959 | ///Before the pop-up, the x-axis center point of the popup window is aligned with the x-axis center point of the target widget, and the right side of the popup window is aligned with the bottom of the target widget
960 | childView = Positioned(
961 | left: targetOffset.dx - (widget._childSize == null ? 0 : widget._childSize!.width - targetSize.width) / 2 + widget._relativeOffsetX,
962 | top: targetOffset.dy -
963 | (widget._childSize == null ? 0 : widget._childSize!.height - targetSize.height) +
964 | widget._relativeOffsetY -
965 | (safeHeight > 0 ? safeHeight : 0),
966 | child: widget._customAnimation
967 | ? widget._child!
968 | : ScaleTransition(
969 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
970 | child: SlideTransition(
971 | position: Tween(begin: Offset(0, 0), end: Offset(0, 1)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
972 | child: FadeTransition(
973 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
974 | child: widget._child,
975 | ),
976 | ),
977 | ),
978 | );
979 | }
980 | break;
981 | case KumiPopupGravity.rightBottom:
982 | if (widget._targetRenderBox == null) {
983 | ///如果位置相对于屏幕,从屏幕右下方弹出
984 | ///If the position is relative to the screen, pop up from the bottom right of the screen
985 | childView = Align(
986 | alignment: Alignment.bottomRight,
987 | child: Padding(
988 | padding: EdgeInsets.only(
989 | right: widget._relativeOffsetX,
990 | bottom: widget._relativeOffsetY,
991 | ),
992 | child: widget._customAnimation
993 | ? widget._child
994 | : ScaleTransition(
995 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
996 | child: SlideTransition(
997 | position: Tween(begin: Offset(1, 1), end: Offset(0, 0)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
998 | child: FadeTransition(
999 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
1000 | child: widget._child,
1001 | ),
1002 | ),
1003 | ),
1004 | ),
1005 | );
1006 | } else {
1007 | var safeWidth = 0.0;
1008 | var safeHeight = 0.0;
1009 | if (widget._childSize != null && widget._needSafeDisplay) {
1010 | safeWidth = widget._childSize!.width + widget._relativeOffsetX - (MediaQuery.of(context).size.width - targetOffset.dx - targetSize.width);
1011 | safeHeight = widget._childSize!.height + widget._relativeOffsetY - (MediaQuery.of(context).size.height - targetOffset.dy - targetSize.height);
1012 | }
1013 |
1014 | ///如果位置相对于目标widget,从目标widget的右下方弹出
1015 | ///弹出之前,弹出框的右下角与目标widget的右下角对齐
1016 | ///If the position is relative to the target widget, pop up from the bottom right of the target widget
1017 | ///Before popping up, the bottom right corner of the popup box is aligned with the bottom right corner of the target widget
1018 | childView = Positioned(
1019 | left: targetOffset.dx -
1020 | (widget._childSize == null ? 0 : widget._childSize!.width - targetSize.width) +
1021 | widget._relativeOffsetX -
1022 | (safeWidth > 0 ? safeWidth : 0),
1023 | top: targetOffset.dy -
1024 | (widget._childSize == null ? 0 : widget._childSize!.height - targetSize.height) +
1025 | widget._relativeOffsetY -
1026 | (safeHeight > 0 ? safeHeight : 0),
1027 | child: widget._customAnimation
1028 | ? widget._child!
1029 | : ScaleTransition(
1030 | scale: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
1031 | child: SlideTransition(
1032 | position: Tween(begin: Offset(0, 0), end: Offset(1, 1)).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
1033 | child: FadeTransition(
1034 | opacity: Tween(begin: -1.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
1035 | child: widget._child,
1036 | ),
1037 | ),
1038 | ),
1039 | );
1040 | }
1041 | break;
1042 | default:
1043 | break;
1044 | }
1045 | return WillPopScope(
1046 | child: Scaffold(
1047 | backgroundColor: Colors.transparent,
1048 | body: Stack(
1049 | clipBehavior: Clip.none,
1050 | children: [
1051 | Positioned(
1052 | child: GestureDetector(
1053 | child: FadeTransition(
1054 | opacity: Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: widget._curve)).animate(widget._controller!),
1055 | child: Container(
1056 | alignment: Alignment.center,
1057 | color: widget._bgColor,
1058 | ),
1059 | ),
1060 | onTap: () {
1061 | if (widget._clickOutDismiss) {
1062 | widget.dismiss(context);
1063 | return;
1064 | }
1065 | if (widget._onClickOut != null) {
1066 | widget._onClickOut!(widget);
1067 | }
1068 | },
1069 | ),
1070 | ),
1071 | childView,
1072 | ],
1073 | ),
1074 | ),
1075 | onWillPop: () {
1076 | if (widget._clickBackDismiss) {
1077 | widget.dismiss(context);
1078 | return Future.value(false);
1079 | }
1080 | if (widget._onClickBack != null) {
1081 | widget._onClickBack!(widget);
1082 | }
1083 | return Future.value(false);
1084 | });
1085 | }
1086 |
1087 | @override
1088 | Widget build(BuildContext context) {
1089 | return getLayout(context);
1090 | }
1091 | }
1092 |
1093 | enum KumiPopupGravity { leftTop, centerTop, rightTop, leftCenter, center, rightCenter, leftBottom, centerBottom, rightBottom }
1094 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.flutter-io.cn"
9 | source: hosted
10 | version: "2.8.2"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.flutter-io.cn"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.flutter-io.cn"
23 | source: hosted
24 | version: "1.2.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.flutter-io.cn"
30 | source: hosted
31 | version: "1.3.1"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.flutter-io.cn"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.flutter-io.cn"
44 | source: hosted
45 | version: "1.16.0"
46 | fake_async:
47 | dependency: transitive
48 | description:
49 | name: fake_async
50 | url: "https://pub.flutter-io.cn"
51 | source: hosted
52 | version: "1.3.0"
53 | flutter:
54 | dependency: "direct main"
55 | description: flutter
56 | source: sdk
57 | version: "0.0.0"
58 | flutter_test:
59 | dependency: "direct dev"
60 | description: flutter
61 | source: sdk
62 | version: "0.0.0"
63 | matcher:
64 | dependency: transitive
65 | description:
66 | name: matcher
67 | url: "https://pub.flutter-io.cn"
68 | source: hosted
69 | version: "0.12.11"
70 | material_color_utilities:
71 | dependency: transitive
72 | description:
73 | name: material_color_utilities
74 | url: "https://pub.flutter-io.cn"
75 | source: hosted
76 | version: "0.1.4"
77 | meta:
78 | dependency: transitive
79 | description:
80 | name: meta
81 | url: "https://pub.flutter-io.cn"
82 | source: hosted
83 | version: "1.7.0"
84 | path:
85 | dependency: transitive
86 | description:
87 | name: path
88 | url: "https://pub.flutter-io.cn"
89 | source: hosted
90 | version: "1.8.1"
91 | sky_engine:
92 | dependency: transitive
93 | description: flutter
94 | source: sdk
95 | version: "0.0.99"
96 | source_span:
97 | dependency: transitive
98 | description:
99 | name: source_span
100 | url: "https://pub.flutter-io.cn"
101 | source: hosted
102 | version: "1.8.2"
103 | stack_trace:
104 | dependency: transitive
105 | description:
106 | name: stack_trace
107 | url: "https://pub.flutter-io.cn"
108 | source: hosted
109 | version: "1.10.0"
110 | stream_channel:
111 | dependency: transitive
112 | description:
113 | name: stream_channel
114 | url: "https://pub.flutter-io.cn"
115 | source: hosted
116 | version: "2.1.0"
117 | string_scanner:
118 | dependency: transitive
119 | description:
120 | name: string_scanner
121 | url: "https://pub.flutter-io.cn"
122 | source: hosted
123 | version: "1.1.0"
124 | term_glyph:
125 | dependency: transitive
126 | description:
127 | name: term_glyph
128 | url: "https://pub.flutter-io.cn"
129 | source: hosted
130 | version: "1.2.0"
131 | test_api:
132 | dependency: transitive
133 | description:
134 | name: test_api
135 | url: "https://pub.flutter-io.cn"
136 | source: hosted
137 | version: "0.4.9"
138 | vector_math:
139 | dependency: transitive
140 | description:
141 | name: vector_math
142 | url: "https://pub.flutter-io.cn"
143 | source: hosted
144 | version: "2.1.2"
145 | sdks:
146 | dart: ">=2.17.0 <3.0.0"
147 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: kumi_popup_window
2 | description: A simple and easy-to-use pop-up window. There are no flashy preset templates. Everything you want to pop up is customized by you.
3 | version: 2.0.1
4 | homepage: https://github.com/q876625596/kumi_popup_window
5 |
6 | environment:
7 | sdk: ">=2.17.0 <3.0.0"
8 |
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 |
13 | dev_dependencies:
14 | flutter_test:
15 | sdk: flutter
16 |
17 | # For information on the generic Dart part of this file, see the
18 | # following page: https://dart.dev/tools/pub/pubspec
19 |
20 | # The following section is specific to Flutter.
21 | flutter:
22 |
23 | # To add assets to your package, add an assets section, like this:
24 | # assets:
25 | # - images/a_dot_burr.jpeg
26 | # - images/a_dot_ham.jpeg
27 | #
28 | # For details regarding assets in packages, see
29 | # https://flutter.dev/assets-and-images/#from-packages
30 | #
31 | # An image asset can refer to one or more resolution-specific "variants", see
32 | # https://flutter.dev/assets-and-images/#resolution-aware.
33 |
34 | # To add custom fonts to your package, add a fonts section here,
35 | # in this "flutter" section. Each entry in this list should have a
36 | # "family" key with the font family name, and a "fonts" key with a
37 | # list giving the asset and other descriptors for the font. For
38 | # example:
39 | # fonts:
40 | # - family: Schyler
41 | # fonts:
42 | # - asset: fonts/Schyler-Regular.ttf
43 | # - asset: fonts/Schyler-Italic.ttf
44 | # style: italic
45 | # - family: Trajan Pro
46 | # fonts:
47 | # - asset: fonts/TrajanPro.ttf
48 | # - asset: fonts/TrajanPro_Bold.ttf
49 | # weight: 700
50 | #
51 | # For details regarding fonts in packages, see
52 | # https://flutter.dev/custom-fonts/#from-packages
53 |
--------------------------------------------------------------------------------
/test/kumi_popup_window_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 |
4 | void main() {
5 | test('adds one to input values', () {
6 |
7 | });
8 | }
9 |
--------------------------------------------------------------------------------