I hope that when using GFAlert and showDialog together, GFAlert can be vertically centered.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the supplied showDialog example with GFAlert, then inspect GFAlert and GFFloatingWidget behavior around alignment and their container requirements. Done means GFAlert is vertically centered when used with showDialog and the requested Material dialog usage is supported without requiring the extra floating widget.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
It seems that the native GFAlert needs to be used with GFFloatingWidget because it requires providing some containers, masks, etc. This is too complicated and inflexible for popping up dialogs on other pages. Therefore, I want to use showDialog with Material to simplify the use of GFAlert. However, I found that GFAlert cannot be vertically centered even if I set the alignment of GFAlert to center. I also tried wrapping GFAlert with a layer of GFFloatingWidget, but it still doesn't work. So, I came here to ask questions, haha.
Describe the solution you'd like
just like:
static void showCustomDialog(BuildContext context,
{required Widget widget, bool refuseBack = true, String? title, VoidCallback? onOk}) {
showDialog(
context: context,
barrierDismissible: false,
barrierColor: Colors.black54,
builder: (BuildContext context) {
return WillPopScope(
onWillPop: () async => !refuseBack,
child: GFAlert(
title: title,
content: widget,
alignment: Alignment.center,
onTapOk: () {
onOk?.call();
Navigator.pop(context);
},
onTapCancel: () {
Navigator.pop(context);
},
),
);
},
);
}
Describe alternatives you've considered
static void showCustomDialog(BuildContext context,
{required Widget widget, bool refuseBack = true, String? title, VoidCallback? onOk}) {
showDialog(
context: context,
barrierDismissible: false,
barrierColor: Colors.black54,
builder: (BuildContext context) {
return WillPopScope(
onWillPop: () async => !refuseBack,
child: GFFloatingWidget(
body: GFAlert(
title: title,
content: widget,
alignment: Alignment.center,
onTapOk: () {
onOk?.call();
Navigator.pop(context);
},
onTapCancel: () {
Navigator.pop(context);
},
),
),
);
},
);
}
Additional context
none
- Dominant language
- Dart
- Stars
- 4.8k
- Forks
- 649
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ionicfirebaseapp/getwidget
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ionicfirebaseapp/getwidget#378 ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
ionicfirebaseapp/getwidget#377 ·
-
GFToggle Open
Difficulty 3/5 1-2 days Newbie friendliness 20/100
ionicfirebaseapp/getwidget#355 ·
-
GfDatePicker Open
Difficulty 4/5 3-5 days Newbie friendliness 15/100
ionicfirebaseapp/getwidget#353 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
ionicfirebaseapp/getwidget#351 ·
All issues in ionicfirebaseapp/getwidget
Similar issues
-
ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
error Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Bug Flutter User Feedbacks
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-dart#4042 · 1 comment ·
-
team-infra
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100