@@ -31,21 +31,21 @@ import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
31
31
<td align="center">
32
32
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/1.png" width="150px">
33
33
<br />
34
- body
34
+ divider
35
35
<br />
36
36
✅
37
37
</td>
38
38
<td align="center">
39
39
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/2.png" width="150px">
40
40
<br />
41
- head
41
+ body
42
42
<br />
43
43
✅
44
44
</td>
45
45
<td align="center">
46
46
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/3.png" width="150px">
47
47
<br />
48
- divider
48
+ head&body
49
49
<br />
50
50
✅
51
51
</td>
@@ -145,12 +145,112 @@ import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
145
145
146
146
** 3、use**
147
147
148
- > 弹窗支持功能
148
+ > 功能属性的设置
149
+
150
+ 属性的设置通过成员变量的方法去调用,具体详见下表
149
151
152
+ ``` dart
153
+ YYDialog YYAlertDialogWithDivider(BuildContext context) {
154
+ return YYDialog().build(context)
155
+ ..width = 220
156
+ ..borderRadius = 4.0
157
+ ..show();
158
+ }
159
+ ```
160
+
161
+ 支持的功能属性
150
162
163
+ property|description|default
164
+ --|--|--|
165
+ width|弹窗宽度|0
166
+ height|弹窗高度|自适应组件高度
167
+ duration|弹窗动画出现的时间|250毫秒
168
+ gravity|弹窗出现的位置|居中
169
+ barrierColor|弹窗外的背景色|30%黑色
170
+ backgroundColor|弹窗内的背景色|白色
171
+ borderRadius|弹窗圆角|0.0
172
+ constraints|弹窗约束|最小宽高不低于10%
173
+ animatedFunc|弹窗出现的动画|从中间出现
174
+ barrierDismissible|是否点击弹出外部消失|true
151
175
152
176
> 语义化组件
153
177
178
+ 弹窗内部的组件内容提前通过语义化的函数封装好常用的组件,以便快速构建出弹窗,具体见下表
179
+
180
+ ``` dart
181
+ YYDialog YYAlertDialogWithDivider(BuildContext context) {
182
+ return YYDialog().build(context)
183
+ ..width = 220
184
+ ..borderRadius = 4.0
185
+ ..text(
186
+ padding: EdgeInsets.all(25.0),
187
+ alignment: Alignment.center,
188
+ text: "确定要退出登录吗?",
189
+ color: Colors.black,
190
+ fontSize: 14.0,
191
+ fontWeight: FontWeight.w500,
192
+ )
193
+ ..divider()
194
+ ..doubleButton(
195
+ padding: EdgeInsets.only(top: 10.0),
196
+ gravity: Gravity.center,
197
+ withDivider: true,
198
+ text1: "取消",
199
+ color1: Colors.redAccent,
200
+ fontSize1: 14.0,
201
+ fontWeight1: FontWeight.bold,
202
+ onTap1: () {
203
+ print("取消");
204
+ },
205
+ text2: "确定",
206
+ color2: Colors.redAccent,
207
+ fontSize2: 14.0,
208
+ fontWeight2: FontWeight.bold,
209
+ onTap2: () {
210
+ print("确定");
211
+ },
212
+ )
213
+ ..show();
214
+ }
215
+ ```
216
+
217
+ 支持的语义化组件
218
+
219
+ method|description
220
+ --|--|
221
+ text|文本控件
222
+ doubleButton|双按钮控件
223
+ listViewOfListTile|列表Tile组件
224
+ listViewOfRadioButton|列表按钮组件
225
+ divider|分割线组件
226
+ height|弹窗高度
227
+ widget|自定义语义化组件
228
+
229
+ 由于组件提供只是辅助快速搭建UI,在实际项目开发中远远不能满足需求,所以提供了自定义语义化组件的插入
230
+
231
+ > 例如:text语义化组件
232
+
233
+ ``` dart
234
+ YYDialog text({padding, text, color, fontSize, alignment, fontWeight}) {
235
+ return this.widget(
236
+ Padding(
237
+ padding: padding ?? EdgeInsets.all(0.0),
238
+ child: Align(
239
+ alignment: alignment ?? Alignment.centerLeft,
240
+ child: Text(
241
+ text ?? "",
242
+ style: TextStyle(
243
+ color: color ?? Colors.black,
244
+ fontSize: fontSize ?? 14.0,
245
+ fontWeight: fontWeight,
246
+ ),
247
+ ),
248
+ ),
249
+ ),
250
+ );
251
+ }
252
+ ```
253
+
154
254
## Bugs/Requests
155
255
156
256
* If your application has problems, please submit your code and effect to Issue.
0 commit comments