Skip to content

Commit

Permalink
modify constraints property[v1.0.5]
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyingjun committed Oct 8, 2019
1 parent 66922c4 commit ff895bc
Show file tree
Hide file tree
Showing 18 changed files with 348 additions and 309 deletions.
40 changes: 20 additions & 20 deletions .idea/libraries/Dart_SDK.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

405 changes: 198 additions & 207 deletions .idea/workspace.xml

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@

## 1.0.4

* Without the Context to invoke
* Without the Context to invoke

## 1.0.5

* Modify constraints property
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Global dialog function encapsulation, with a semantic way to fill the content in

```yaml
dependencies:
flutter_custom_dialog: ^1.0.4
flutter_custom_dialog: ^1.0.5
```
**2、import**
Expand Down Expand Up @@ -83,6 +83,13 @@ import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
<br />
</td>
<td align="center">
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/9.png" width="150px">
<br />
bottom sheet
<br />
</td>
<td align="center">
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/8.png" width="150px">
<br />
Expand Down
9 changes: 8 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

```yaml
dependencies:
flutter_custom_dialog: ^1.0.4
flutter_custom_dialog: ^1.0.5
```
**2、import**
Expand Down Expand Up @@ -81,6 +81,13 @@ import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
<br />
</td>
<td align="center">
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/9.png" width="150px">
<br />
bottom sheet
<br />
</td>
<td align="center">
<img src="https://github.com/YYFlutter/flutter-custom-dialog/raw/master/image/png/8.png" width="150px">
<br />
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=D:\Program Files\flutter"
export "FLUTTER_APPLICATION_PATH=E:\YPlugin\package\flutter_custom_dialog\example"
export "FLUTTER_ROOT=C:\FlutterSDK\flutter"
export "FLUTTER_APPLICATION_PATH=C:\YYLive4-OpenSource\flutter-custom-dialog\example"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_FRAMEWORK_DIR=D:\Program Files\flutter\bin\cache\artifacts\engine\ios"
export "FLUTTER_FRAMEWORK_DIR=C:\FlutterSDK\flutter\bin\cache\artifacts\engine\ios"
9 changes: 6 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
library flutter_custom_dialog;

import 'package:flutter/material.dart';
import 'package:flutter_custom_dialog/components/bean/dialog_gravity.dart';
import 'package:flutter_custom_dialog/components/example/alert_dialog.dart';
import 'package:flutter_custom_dialog/components/example/bottom_sheet_dialog.dart';
import 'package:flutter_custom_dialog/components/example/listview_dialog.dart';
import 'package:flutter_custom_dialog/components/example/progress_dialog.dart';
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
Expand Down Expand Up @@ -71,10 +71,13 @@ showAlertDialog(BuildContext context) {
),
Row(
children: <Widget>[
makeTextButton("nobody", () {
makeTextButton("bottomsheet", () {
YYBottomSheetDialog();
}),
makeTextButton("progress", () {
YYProgressDialogNoBody();
}),
makeTextButton("body", () {
makeTextButton("progress\n&body", () {
YYProgressDialogBody();
}),
makeTextButton("pop\nmenu", () {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.3"
version: "1.0.4"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
Binary file added image/png/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions lib/components/bean/dialog_gravity.dart

This file was deleted.

39 changes: 0 additions & 39 deletions lib/components/bean/dialog_item.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/components/example/alert_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_custom_dialog/components/bean/dialog_gravity.dart';
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';

YYDialog YYAlertDialogBody() {
Expand Down
37 changes: 37 additions & 0 deletions lib/components/example/bottom_sheet_dialog.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';

YYDialog YYBottomSheetDialog() {
return YYDialog().build()
..gravity = Gravity.bottom
..gravityAnimationEnable = true
..backgroundColor = Colors.transparent
..widget(Container(
width: 300,
height: 45,
margin: EdgeInsets.only(bottom: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
color: Colors.white,
),
child: Center(
child: Text("Block"),
),
))
..widget(Container(
width: 300,
height: 45,
margin: EdgeInsets.only(bottom: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
color: Colors.white,
),
child: Center(
child: Text(
"cancel",
style: TextStyle(color: Colors.grey[400]),
),
),
))
..show();
}
2 changes: 0 additions & 2 deletions lib/components/example/listview_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_custom_dialog/components/bean/dialog_gravity.dart';
import 'package:flutter_custom_dialog/components/bean/dialog_item.dart';
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';

var listTileItems = [
Expand Down
60 changes: 53 additions & 7 deletions lib/flutter_custom_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_custom_dialog/components/bean/dialog_item.dart';

import 'components/bean/dialog_gravity.dart';
import 'flutter_custom_dialog_widget.dart';

export 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
Expand Down Expand Up @@ -258,11 +256,7 @@ class YYDialog {
borderRadius: BorderRadius.circular(borderRadius),
color: backgroundColor,
),
constraints: constraints ??
BoxConstraints(
minHeight: size.height * .1,
minWidth: size.width * .1,
),
constraints: constraints ?? BoxConstraints(),
child: CustomDialogChildren(
widgetList: widgetList,
isShowingChange: (bool isShowingChange) {
Expand Down Expand Up @@ -505,3 +499,55 @@ class CustomDialog {
);
}
}

//================================弹窗重心======================================
enum Gravity {
left,
top,
bottom,
right,
center,
rightTop,
leftTop,
rightBottom,
leftBottom,
}
//============================================================================

//================================弹窗实体======================================
class ListTileItem {
ListTileItem({
this.padding,
this.leading,
this.text,
this.color,
this.fontSize,
this.fontWeight,
});

EdgeInsets padding;
Widget leading;
String text;
Color color;
double fontSize;
FontWeight fontWeight;
}

class RadioItem {
RadioItem({
this.padding,
this.text,
this.color,
this.fontSize,
this.fontWeight,
this.onTap,
});

EdgeInsets padding;
String text;
Color color;
double fontSize;
FontWeight fontWeight;
Function(int) onTap;
}
//============================================================================
3 changes: 1 addition & 2 deletions lib/flutter_custom_dialog_widget.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';

import 'components/bean/dialog_item.dart';

import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
export 'package:flutter_custom_dialog/flutter_custom_dialog_widget.dart';

class YYRadioListTile extends StatefulWidget {
Expand Down
Loading

0 comments on commit ff895bc

Please sign in to comment.