Skip to content

Commit f784696

Browse files
committed
Use showModal with FadeScaleTransitionConfiguration of animations for Material alert dialog
1 parent cedf2af commit f784696

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
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.0
2+
3+
- Use `showModal` with `FadeScaleTransitionConfiguration` of animations for Material alert dialog
4+
15
## 0.2.2
26

37
- Fix showTextAnswerDialog

example/pubspec.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ packages:
77
path: ".."
88
relative: true
99
source: path
10-
version: "0.2.2"
10+
version: "0.3.0"
11+
animations:
12+
dependency: transitive
13+
description:
14+
name: animations
15+
url: "https://pub.dartlang.org"
16+
source: hosted
17+
version: "1.0.0+5"
1118
archive:
1219
dependency: transitive
1320
description:

lib/src/alert_dialog/show_alert_dialog.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:adaptive_dialog/adaptive_dialog.dart';
2+
import 'package:animations/animations.dart';
23
import 'package:flutter/cupertino.dart';
34
import 'package:flutter/material.dart';
45

@@ -43,9 +44,11 @@ Future<T> showAlertDialog<T>({
4344
),
4445
),
4546
)
46-
: showDialog(
47+
: showModal(
4748
context: context,
48-
barrierDismissible: barrierDismissible,
49+
configuration: FadeScaleTransitionConfiguration(
50+
barrierDismissible: barrierDismissible,
51+
),
4952
builder: (context) => AlertDialog(
5053
title: titleText,
5154
content: messageText,

pubspec.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Generated by pub
22
# See https://dart.dev/tools/pub/glossary#lockfile
33
packages:
4+
animations:
5+
dependency: "direct main"
6+
description:
7+
name: animations
8+
url: "https://pub.dartlang.org"
9+
source: hosted
10+
version: "1.0.0+5"
411
archive:
512
dependency: transitive
613
description:

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: adaptive_dialog
22
description: Show alert dialog or modal action sheet adaptively according to platform.
3-
version: 0.2.2
3+
version: 0.3.0
44
homepage: https://github.com/mono0926/adaptive_dialog
55
environment:
66
sdk: ">=2.6.0 <3.0.0"
77
dependencies:
88
flutter:
99
sdk: flutter
10+
animations: ^1.0.0+5
1011
meta: ^1.1.8
1112
dev_dependencies:
1213
flutter_test:

0 commit comments

Comments
 (0)