Skip to content

Commit ff895bc

Browse files
author
xuyingjun
committed
modify constraints property[v1.0.5]
1 parent 66922c4 commit ff895bc

18 files changed

+348
-309
lines changed

.idea/libraries/Dart_SDK.xml

+20-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+198-207
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@
1717

1818
## 1.0.4
1919

20-
* Without the Context to invoke
20+
* Without the Context to invoke
21+
22+
## 1.0.5
23+
24+
* Modify constraints property

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Global dialog function encapsulation, with a semantic way to fill the content in
1717

1818
```yaml
1919
dependencies:
20-
flutter_custom_dialog: ^1.0.4
20+
flutter_custom_dialog: ^1.0.5
2121
```
2222
2323
**2、import**
@@ -83,6 +83,13 @@ import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
8383
<br />
8484
8585
</td>
86+
<td align="center">
87+
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/9.png" width="150px">
88+
<br />
89+
bottom sheet
90+
<br />
91+
92+
</td>
8693
<td align="center">
8794
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/8.png" width="150px">
8895
<br />

README_CN.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
```yaml
1717
dependencies:
18-
flutter_custom_dialog: ^1.0.4
18+
flutter_custom_dialog: ^1.0.5
1919
```
2020
2121
**2、import**
@@ -81,6 +81,13 @@ import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
8181
<br />
8282
8383
</td>
84+
<td align="center">
85+
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/9.png" width="150px">
86+
<br />
87+
bottom sheet
88+
<br />
89+
90+
</td>
8491
<td align="center">
8592
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/8.png" width="150px">
8693
<br />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22
# This is a generated file; do not edit or check into version control.
3-
export "FLUTTER_ROOT=D:\Program Files\flutter"
4-
export "FLUTTER_APPLICATION_PATH=E:\YPlugin\package\flutter_custom_dialog\example"
3+
export "FLUTTER_ROOT=C:\FlutterSDK\flutter"
4+
export "FLUTTER_APPLICATION_PATH=C:\YYLive4-OpenSource\flutter-custom-dialog\example"
55
export "FLUTTER_TARGET=lib\main.dart"
66
export "FLUTTER_BUILD_DIR=build"
77
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
8-
export "FLUTTER_FRAMEWORK_DIR=D:\Program Files\flutter\bin\cache\artifacts\engine\ios"
8+
export "FLUTTER_FRAMEWORK_DIR=C:\FlutterSDK\flutter\bin\cache\artifacts\engine\ios"

example/lib/main.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
library flutter_custom_dialog;
22

33
import 'package:flutter/material.dart';
4-
import 'package:flutter_custom_dialog/components/bean/dialog_gravity.dart';
54
import 'package:flutter_custom_dialog/components/example/alert_dialog.dart';
5+
import 'package:flutter_custom_dialog/components/example/bottom_sheet_dialog.dart';
66
import 'package:flutter_custom_dialog/components/example/listview_dialog.dart';
77
import 'package:flutter_custom_dialog/components/example/progress_dialog.dart';
88
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
@@ -71,10 +71,13 @@ showAlertDialog(BuildContext context) {
7171
),
7272
Row(
7373
children: <Widget>[
74-
makeTextButton("nobody", () {
74+
makeTextButton("bottomsheet", () {
75+
YYBottomSheetDialog();
76+
}),
77+
makeTextButton("progress", () {
7578
YYProgressDialogNoBody();
7679
}),
77-
makeTextButton("body", () {
80+
makeTextButton("progress\n&body", () {
7881
YYProgressDialogBody();
7982
}),
8083
makeTextButton("pop\nmenu", () {

example/pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ packages:
4747
path: ".."
4848
relative: true
4949
source: path
50-
version: "1.0.3"
50+
version: "1.0.4"
5151
flutter_test:
5252
dependency: "direct dev"
5353
description: flutter

image/png/9.png

3.01 KB
Loading

lib/components/bean/dialog_gravity.dart

-13
This file was deleted.

lib/components/bean/dialog_item.dart

-39
This file was deleted.

lib/components/example/alert_dialog.dart

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_custom_dialog/components/bean/dialog_gravity.dart';
32
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
43

54
YYDialog YYAlertDialogBody() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
3+
4+
YYDialog YYBottomSheetDialog() {
5+
return YYDialog().build()
6+
..gravity = Gravity.bottom
7+
..gravityAnimationEnable = true
8+
..backgroundColor = Colors.transparent
9+
..widget(Container(
10+
width: 300,
11+
height: 45,
12+
margin: EdgeInsets.only(bottom: 10),
13+
decoration: BoxDecoration(
14+
borderRadius: BorderRadius.circular(8.0),
15+
color: Colors.white,
16+
),
17+
child: Center(
18+
child: Text("Block"),
19+
),
20+
))
21+
..widget(Container(
22+
width: 300,
23+
height: 45,
24+
margin: EdgeInsets.only(bottom: 20),
25+
decoration: BoxDecoration(
26+
borderRadius: BorderRadius.circular(8.0),
27+
color: Colors.white,
28+
),
29+
child: Center(
30+
child: Text(
31+
"cancel",
32+
style: TextStyle(color: Colors.grey[400]),
33+
),
34+
),
35+
))
36+
..show();
37+
}

lib/components/example/listview_dialog.dart

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_custom_dialog/components/bean/dialog_gravity.dart';
3-
import 'package:flutter_custom_dialog/components/bean/dialog_item.dart';
42
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
53

64
var listTileItems = [

lib/flutter_custom_dialog.dart

+53-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_custom_dialog/components/bean/dialog_item.dart';
32

4-
import 'components/bean/dialog_gravity.dart';
53
import 'flutter_custom_dialog_widget.dart';
64

75
export 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
@@ -258,11 +256,7 @@ class YYDialog {
258256
borderRadius: BorderRadius.circular(borderRadius),
259257
color: backgroundColor,
260258
),
261-
constraints: constraints ??
262-
BoxConstraints(
263-
minHeight: size.height * .1,
264-
minWidth: size.width * .1,
265-
),
259+
constraints: constraints ?? BoxConstraints(),
266260
child: CustomDialogChildren(
267261
widgetList: widgetList,
268262
isShowingChange: (bool isShowingChange) {
@@ -505,3 +499,55 @@ class CustomDialog {
505499
);
506500
}
507501
}
502+
503+
//================================弹窗重心======================================
504+
enum Gravity {
505+
left,
506+
top,
507+
bottom,
508+
right,
509+
center,
510+
rightTop,
511+
leftTop,
512+
rightBottom,
513+
leftBottom,
514+
}
515+
//============================================================================
516+
517+
//================================弹窗实体======================================
518+
class ListTileItem {
519+
ListTileItem({
520+
this.padding,
521+
this.leading,
522+
this.text,
523+
this.color,
524+
this.fontSize,
525+
this.fontWeight,
526+
});
527+
528+
EdgeInsets padding;
529+
Widget leading;
530+
String text;
531+
Color color;
532+
double fontSize;
533+
FontWeight fontWeight;
534+
}
535+
536+
class RadioItem {
537+
RadioItem({
538+
this.padding,
539+
this.text,
540+
this.color,
541+
this.fontSize,
542+
this.fontWeight,
543+
this.onTap,
544+
});
545+
546+
EdgeInsets padding;
547+
String text;
548+
Color color;
549+
double fontSize;
550+
FontWeight fontWeight;
551+
Function(int) onTap;
552+
}
553+
//============================================================================

lib/flutter_custom_dialog_widget.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:flutter/material.dart';
22

3-
import 'components/bean/dialog_item.dart';
4-
3+
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
54
export 'package:flutter_custom_dialog/flutter_custom_dialog_widget.dart';
65

76
class YYRadioListTile extends StatefulWidget {

0 commit comments

Comments
 (0)