dialog style
Added TextStyle to generalDialog title and message
Showing
1 changed file
with
12 additions
and
4 deletions
| @@ -500,6 +500,7 @@ extension GetNavigation on GetInterface { | @@ -500,6 +500,7 @@ extension GetNavigation on GetInterface { | ||
| 500 | /// Custom UI Dialog. | 500 | /// Custom UI Dialog. |
| 501 | Future<T> defaultDialog<T>({ | 501 | Future<T> defaultDialog<T>({ |
| 502 | String title = "Alert", | 502 | String title = "Alert", |
| 503 | + TextStyle titleStyle, | ||
| 503 | Widget content, | 504 | Widget content, |
| 504 | VoidCallback onConfirm, | 505 | VoidCallback onConfirm, |
| 505 | VoidCallback onCancel, | 506 | VoidCallback onCancel, |
| @@ -515,7 +516,9 @@ extension GetNavigation on GetInterface { | @@ -515,7 +516,9 @@ extension GetNavigation on GetInterface { | ||
| 515 | Color backgroundColor, | 516 | Color backgroundColor, |
| 516 | Color buttonColor, | 517 | Color buttonColor, |
| 517 | String middleText = "Dialog made in 3 lines of code", | 518 | String middleText = "Dialog made in 3 lines of code", |
| 519 | + TextStyle middleTextStyle, | ||
| 518 | double radius = 20.0, | 520 | double radius = 20.0, |
| 521 | + ThemeData themeData, | ||
| 519 | List<Widget> actions, | 522 | List<Widget> actions, |
| 520 | }) { | 523 | }) { |
| 521 | bool leanCancel = onCancel != null || textCancel != null; | 524 | bool leanCancel = onCancel != null || textCancel != null; |
| @@ -564,18 +567,22 @@ extension GetNavigation on GetInterface { | @@ -564,18 +567,22 @@ extension GetNavigation on GetInterface { | ||
| 564 | })); | 567 | })); |
| 565 | } | 568 | } |
| 566 | } | 569 | } |
| 567 | - return dialog(AlertDialog( | 570 | + |
| 571 | + return dialog( | ||
| 572 | + AlertDialog( | ||
| 568 | titlePadding: EdgeInsets.all(8), | 573 | titlePadding: EdgeInsets.all(8), |
| 569 | contentPadding: EdgeInsets.all(8), | 574 | contentPadding: EdgeInsets.all(8), |
| 570 | backgroundColor: backgroundColor ?? theme.dialogBackgroundColor, | 575 | backgroundColor: backgroundColor ?? theme.dialogBackgroundColor, |
| 571 | shape: RoundedRectangleBorder( | 576 | shape: RoundedRectangleBorder( |
| 572 | borderRadius: BorderRadius.all(Radius.circular(radius))), | 577 | borderRadius: BorderRadius.all(Radius.circular(radius))), |
| 573 | - title: Text(title, textAlign: TextAlign.center), | 578 | + title: Text(title, textAlign: TextAlign.center, style: titleStyle), |
| 574 | content: Column( | 579 | content: Column( |
| 575 | crossAxisAlignment: CrossAxisAlignment.center, | 580 | crossAxisAlignment: CrossAxisAlignment.center, |
| 576 | mainAxisSize: MainAxisSize.min, | 581 | mainAxisSize: MainAxisSize.min, |
| 577 | children: [ | 582 | children: [ |
| 578 | - content ?? Text(middleText ?? "", textAlign: TextAlign.center), | 583 | + content ?? |
| 584 | + Text(middleText ?? "", | ||
| 585 | + textAlign: TextAlign.center, style: middleTextStyle), | ||
| 579 | SizedBox(height: 16), | 586 | SizedBox(height: 16), |
| 580 | ButtonTheme( | 587 | ButtonTheme( |
| 581 | minWidth: 78.0, | 588 | minWidth: 78.0, |
| @@ -591,7 +598,8 @@ extension GetNavigation on GetInterface { | @@ -591,7 +598,8 @@ extension GetNavigation on GetInterface { | ||
| 591 | ), | 598 | ), |
| 592 | // actions: actions, // ?? <Widget>[cancelButton, confirmButton], | 599 | // actions: actions, // ?? <Widget>[cancelButton, confirmButton], |
| 593 | buttonPadding: EdgeInsets.zero, | 600 | buttonPadding: EdgeInsets.zero, |
| 594 | - )); | 601 | + ), |
| 602 | + ); | ||
| 595 | } | 603 | } |
| 596 | 604 | ||
| 597 | Future<T> bottomSheet<T>( | 605 | Future<T> bottomSheet<T>( |
-
Please register or login to post a comment