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 baf2cab

Browse files
布局
1 parent a633f1b commit baf2cab

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

‎example/lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
44
import 'package:flutter_custom_dialog/components/alert_dialog.dart';
55
import 'package:flutter_custom_dialog/components/bean/dialog_gravity.dart';
66
import 'package:flutter_custom_dialog/components/listview_dialog.dart';
7+
import 'package:flutter_custom_dialog/components/progress_dialog.dart';
78

89
void main() => runApp(MyApp());
910

@@ -158,7 +159,9 @@ showProgressDialog(BuildContext context) {
158159
Text("1、demo"),
159160
Row(
160161
children: <Widget>[
161-
makeTextButton("title", () {}),
162+
makeTextButton("body", () {
163+
YYProgressDialogBody(context);
164+
}),
162165
],
163166
),
164167
],

‎lib/components/progress_dialog.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
import 'package:flutter/material.dart';
2+
3+
import '../flutter_custom_dialog.dart';
4+
5+
YYDialog YYProgressDialogBody(BuildContext context) {
6+
return YYDialog().build(context)
7+
..width = 200
8+
..borderRadius = 4.0
9+
..circularProgress(
10+
padding: EdgeInsets.all(24.0),
11+
valueColor: Colors.orange[500],
12+
)
13+
..text(
14+
padding: EdgeInsets.fromLTRB(18.0, 0.0, 18.0, 12.0),
15+
text: "正在加载中...",
16+
alignment: Alignment.center,
17+
color: Colors.orange[500],
18+
fontSize: 18.0,
19+
)
20+
..show();
21+
}

‎lib/flutter_custom_dialog.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@ class YYDialog {
206206
);
207207
}
208208

209+
YYDialog circularProgress(
210+
{padding, backgroundColor, valueColor, strokeWidth}) {
211+
return this.widget(Padding(
212+
padding: padding,
213+
child: CircularProgressIndicator(
214+
strokeWidth: strokeWidth ?? 4.0,
215+
backgroundColor: backgroundColor,
216+
valueColor: AlwaysStoppedAnimation<Color>(valueColor),
217+
),
218+
));
219+
}
220+
209221
YYDialog divider({color, height}) {
210222
return this.widget(
211223
Divider(

0 commit comments

Comments
(0)

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