Skip to content

Commit e3f1af0

Browse files
committed
Add showDialog2020
1 parent 5af0659 commit e3f1af0

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.1
2+
3+
- Add `showDialog2020`, which wraps `showModal` with `FadeScaleTransitionConfiguration()`.
4+
15
## 0.3.0
26

37
- Use `showModal` with `FadeScaleTransitionConfiguration` of [animations](https://pub.dev/packages/animations) for Material alert dialog

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
path: ".."
88
relative: true
99
source: path
10-
version: "0.3.0+1"
10+
version: "0.3.1"
1111
animations:
1212
dependency: transitive
1313
description:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export 'alert_dialog_action.dart';
22
export 'show_alert_dialog.dart';
3+
export 'show_dialog.dart';
34
export 'show_ok_alert_dialog.dart';
45
export 'show_ok_cancel_alert_dialog.dart';

lib/src/alert_dialog/show_alert_dialog.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,8 @@ Future<T> showAlertDialog<T>({
4444
),
4545
),
4646
)
47-
: showModal(
47+
: showDialog2020(
4848
context: context,
49-
configuration: FadeScaleTransitionConfiguration(
50-
barrierDismissible: barrierDismissible,
51-
),
5249
builder: (context) => AlertDialog(
5350
title: titleText,
5451
content: messageText,

lib/src/alert_dialog/show_dialog.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import 'package:animations/animations.dart';
2+
import 'package:flutter/material.dart';
3+
4+
Future<T> showDialog2020<T>({
5+
@required BuildContext context,
6+
bool useRootNavigator = true,
7+
WidgetBuilder builder,
8+
}) {
9+
return showModal<T>(
10+
context: context,
11+
configuration: FadeScaleTransitionConfiguration(),
12+
useRootNavigator: useRootNavigator,
13+
builder: builder,
14+
);
15+
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: adaptive_dialog
22
description: Show alert dialog or modal action sheet adaptively according to platform.
3-
version: 0.3.0+1
3+
version: 0.3.1
44
homepage: https://github.com/mono0926/adaptive_dialog
55
environment:
66
sdk: ">=2.6.0 <3.0.0"

0 commit comments

Comments
 (0)