Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c8a25c8

Browse files
author
xuyingjun
committed
ReadMe
1 parent 08268ae commit c8a25c8

File tree

2 files changed

+55
-18
lines changed

2 files changed

+55
-18
lines changed

‎README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
对全局弹窗的功能封装,用语义化的方式对弹窗内部的内容进行填充,目前提供的功能
66

7-
1. 提供的语义化方法,填充弹窗内部的组件内容
8-
2. 提供的设置弹窗背景色、前景色、位置、动画、点击外部消失等功能,具体看example
7+
1. 支持少数语义化组件的方法,填充弹窗内部的组件内容
8+
2. 支持自定义语义化组件的方法,供开发者自由填充弹窗内部的组件内容
9+
3. 支持设置弹窗背景色、前景色、位置、动画、点击外部消失等功能,具体看下文
910

1011
## 🎖 Installing
1112

@@ -234,28 +235,33 @@ divider|分割线组件
234235
height|弹窗高度
235236
widget|自定义语义化组件
236237

237-
当前语义化组件的提供只是辅助快速搭建UI,在实际项目开发中远远不能满足需求,所以提供了自定义语义化组件的插入,由开发者自行加入组件到弹窗内
238+
* 由于当前已有的语义化组件只是辅助快速搭建UI,在实际项目开发中远远不能满足需求
239+
* 所以提供了自定义语义化组件的插入,由开发者自行将组件加入到弹窗内
238240

239-
> 例如:text语义化组件
241+
> 例如
240242
241243
```dart
242-
YYDialog text({padding, text, color, fontSize, alignment, fontWeight}) {
243-
return this.widget(
244-
Padding(
245-
padding: padding ?? EdgeInsets.all(0.0),
246-
child: Align(
247-
alignment: alignment ?? Alignment.centerLeft,
248-
child: Text(
249-
text ?? "",
250-
style: TextStyle(
251-
color: color ?? Colors.black,
252-
fontSize: fontSize ?? 14.0,
253-
fontWeight: fontWeight,
244+
YYDialog YYDialogDemo(BuildContext context) {
245+
return YYDialog().build(context)
246+
..width = 220
247+
..height = 500
248+
..widget(
249+
Padding(
250+
padding: EdgeInsets.all(0.0),
251+
child: Align(
252+
alignment: Alignment.centerLeft,
253+
child: Text(
254+
"",
255+
style: TextStyle(
256+
color: Colors.black,
257+
fontSize: 14.0,
258+
fontWeight: FontWeight.w100,
259+
),
254260
),
255261
),
256262
),
257-
),
258-
);
263+
)
264+
..show();
259265
}
260266
```
261267

‎lib/components/example/alert_dialog.dart

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,34 @@ YYDialog YYAlertDialogWithCustomIn(BuildContext context) {
411411
)
412412
..show();
413413
}
414+
415+
YYDialog YYDialogDemo(BuildContext context) {
416+
return YYDialog().build(context)
417+
..width = 220
418+
..height = 500
419+
..barrierColor = Colors.black.withOpacity(.3)
420+
..animatedFunc = (child, animation) {
421+
return ScaleTransition(
422+
child: child,
423+
scale: Tween(begin: 0.0, end: 1.0).animate(animation),
424+
);
425+
}
426+
..borderRadius = 4.0
427+
..widget(
428+
Padding(
429+
padding: EdgeInsets.all(0.0),
430+
child: Align(
431+
alignment: Alignment.centerLeft,
432+
child: Text(
433+
"",
434+
style: TextStyle(
435+
color: Colors.black,
436+
fontSize: 14.0,
437+
fontWeight: FontWeight.w100,
438+
),
439+
),
440+
),
441+
),
442+
)
443+
..show();
444+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /