Merge pull request #7 from Iconica-Development/feature/add-padding-bottomalertdialog

feat: add option to override the padding for BottomAlertDialog
This commit is contained in:
Jelle Schaafsma 2024-09-27 10:50:57 +02:00 committed by GitHub
commit 30d52c2a53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,6 @@
## 1.1.0
- Add option `bottomAlertDialogPadding` to `BottomAlertDialogConfig` for specifying the empty space above the title of a dialog. By default it is an EdgeInsets with top 10px.
## 1.0.0 ## 1.0.0
- Flutter_dialogs and flutter_bottom_alert_dialogs combined into one package - Flutter_dialogs and flutter_bottom_alert_dialogs combined into one package
- Add default padding to the bottom alert dialog that is the size of the safe area of a device. You can disable this by setting `useSafeAreaPadding` to false. - Add default padding to the bottom alert dialog that is the size of the safe area of a device. You can disable this by setting `useSafeAreaPadding` to false.

View file

@ -282,7 +282,7 @@ class BottomAlertDialog extends StatelessWidget {
child: Stack( child: Stack(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top: 10), padding: config.bottomAlertDialogPadding,
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Column( child: Column(

View file

@ -29,6 +29,7 @@ class BottomAlertDialogConfig extends InheritedWidget {
CloseButtonBuilder? closeButtonBuilder, CloseButtonBuilder? closeButtonBuilder,
this.yesText = "Yes", this.yesText = "Yes",
this.noText = "No", this.noText = "No",
this.bottomAlertDialogPadding = const EdgeInsets.only(top: 10),
this.backgroundColor, this.backgroundColor,
super.key, super.key,
}) : _buttonBuilder = buttonBuilder, }) : _buttonBuilder = buttonBuilder,
@ -38,6 +39,10 @@ class BottomAlertDialogConfig extends InheritedWidget {
final CloseButtonBuilder? _closeButtonBuilder; final CloseButtonBuilder? _closeButtonBuilder;
final String yesText; final String yesText;
final String noText; final String noText;
/// The padding that is put between the top of the dialog and the content.
/// This is by default const EdgeInsets.only(top:10).
final EdgeInsets bottomAlertDialogPadding;
final Color? backgroundColor; final Color? backgroundColor;
ButtonBuilder get buttonBuilder => ButtonBuilder get buttonBuilder =>

View file

@ -1,6 +1,6 @@
name: flutter_dialogs name: flutter_dialogs
description: A new Flutter package project. description: A new Flutter package project.
version: 1.0.0 version: 1.1.0
homepage: https://github.com/Iconica-Development/flutter_dialogs homepage: https://github.com/Iconica-Development/flutter_dialogs
environment: environment: