Merge branch 'master' of https://github.com/jonataslaw/getx into master
Showing
1 changed file
with
35 additions
and
27 deletions
| @@ -519,6 +519,7 @@ extension GetNavigation on GetInterface { | @@ -519,6 +519,7 @@ extension GetNavigation on GetInterface { | ||
| 519 | /// Custom UI Dialog. | 519 | /// Custom UI Dialog. | 
| 520 | Future<T> defaultDialog<T>({ | 520 | Future<T> defaultDialog<T>({ | 
| 521 | String title = "Alert", | 521 | String title = "Alert", | 
| 522 | + TextStyle titleStyle, | ||
| 522 | Widget content, | 523 | Widget content, | 
| 523 | VoidCallback onConfirm, | 524 | VoidCallback onConfirm, | 
| 524 | VoidCallback onCancel, | 525 | VoidCallback onCancel, | 
| @@ -534,7 +535,9 @@ extension GetNavigation on GetInterface { | @@ -534,7 +535,9 @@ extension GetNavigation on GetInterface { | ||
| 534 | Color backgroundColor, | 535 | Color backgroundColor, | 
| 535 | Color buttonColor, | 536 | Color buttonColor, | 
| 536 | String middleText = "Dialog made in 3 lines of code", | 537 | String middleText = "Dialog made in 3 lines of code", | 
| 538 | + TextStyle middleTextStyle, | ||
| 537 | double radius = 20.0, | 539 | double radius = 20.0, | 
| 540 | + // ThemeData themeData, | ||
| 538 | List<Widget> actions, | 541 | List<Widget> actions, | 
| 539 | }) { | 542 | }) { | 
| 540 | var leanCancel = onCancel != null || textCancel != null; | 543 | var leanCancel = onCancel != null || textCancel != null; | 
| @@ -583,34 +586,39 @@ extension GetNavigation on GetInterface { | @@ -583,34 +586,39 @@ extension GetNavigation on GetInterface { | ||
| 583 | })); | 586 | })); | 
| 584 | } | 587 | } | 
| 585 | } | 588 | } | 
| 586 | - return dialog(AlertDialog( | ||
| 587 | - titlePadding: EdgeInsets.all(8), | ||
| 588 | - contentPadding: EdgeInsets.all(8), | ||
| 589 | - backgroundColor: backgroundColor ?? theme.dialogBackgroundColor, | ||
| 590 | - shape: RoundedRectangleBorder( | ||
| 591 | - borderRadius: BorderRadius.all(Radius.circular(radius))), | ||
| 592 | - title: Text(title, textAlign: TextAlign.center), | ||
| 593 | - content: Column( | ||
| 594 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 595 | - mainAxisSize: MainAxisSize.min, | ||
| 596 | - children: [ | ||
| 597 | - content ?? Text(middleText ?? "", textAlign: TextAlign.center), | ||
| 598 | - SizedBox(height: 16), | ||
| 599 | - ButtonTheme( | ||
| 600 | - minWidth: 78.0, | ||
| 601 | - height: 34.0, | ||
| 602 | - child: Wrap( | ||
| 603 | - alignment: WrapAlignment.center, | ||
| 604 | - spacing: 8, | ||
| 605 | - runSpacing: 8, | ||
| 606 | - children: actions, | ||
| 607 | - ), | ||
| 608 | - ) | ||
| 609 | - ], | 589 | + | 
| 590 | + return dialog( | ||
| 591 | + AlertDialog( | ||
| 592 | + titlePadding: EdgeInsets.all(8), | ||
| 593 | + contentPadding: EdgeInsets.all(8), | ||
| 594 | + backgroundColor: backgroundColor ?? theme.dialogBackgroundColor, | ||
| 595 | + shape: RoundedRectangleBorder( | ||
| 596 | + borderRadius: BorderRadius.all(Radius.circular(radius))), | ||
| 597 | + title: Text(title, textAlign: TextAlign.center, style: titleStyle), | ||
| 598 | + content: Column( | ||
| 599 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 600 | + mainAxisSize: MainAxisSize.min, | ||
| 601 | + children: [ | ||
| 602 | + content ?? | ||
| 603 | + Text(middleText ?? "", | ||
| 604 | + textAlign: TextAlign.center, style: middleTextStyle), | ||
| 605 | + SizedBox(height: 16), | ||
| 606 | + ButtonTheme( | ||
| 607 | + minWidth: 78.0, | ||
| 608 | + height: 34.0, | ||
| 609 | + child: Wrap( | ||
| 610 | + alignment: WrapAlignment.center, | ||
| 611 | + spacing: 8, | ||
| 612 | + runSpacing: 8, | ||
| 613 | + children: actions, | ||
| 614 | + ), | ||
| 615 | + ) | ||
| 616 | + ], | ||
| 617 | + ), | ||
| 618 | + // actions: actions, // ?? <Widget>[cancelButton, confirmButton], | ||
| 619 | + buttonPadding: EdgeInsets.zero, | ||
| 610 | ), | 620 | ), | 
| 611 | - // actions: actions, // ?? <Widget>[cancelButton, confirmButton], | ||
| 612 | - buttonPadding: EdgeInsets.zero, | ||
| 613 | - )); | 621 | + ); | 
| 614 | } | 622 | } | 
| 615 | 623 | ||
| 616 | Future<T> bottomSheet<T>( | 624 | Future<T> bottomSheet<T>( | 
- 
Please register or login to post a comment