Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Rakesh Lanjewar
2020-12-07 22:14:27 +0530
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8e12463b71948c9a5451d690eb883918c29ebecf
8e12463b
1 parent
d2aee52c
Added will pop scope to defaultDialog
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
30 deletions
lib/get_navigation/src/extension_navigation.dart
lib/get_navigation/src/extension_navigation.dart
View file @
8e12463
...
...
@@ -314,6 +314,9 @@ extension ExtensionDialog on GetInterface {
double
radius
=
20.0
,
// ThemeData themeData,
List
<
Widget
>
actions
,
// onWillPop Scope
WillPopCallback
onWillPop
,
})
{
var
leanCancel
=
onCancel
!=
null
||
textCancel
!=
null
;
var
leanConfirm
=
onConfirm
!=
null
||
textConfirm
!=
null
;
...
...
@@ -362,37 +365,49 @@ extension ExtensionDialog on GetInterface {
}
}
return
dialog
<
T
>(
AlertDialog
(
titlePadding:
EdgeInsets
.
all
(
8
),
contentPadding:
EdgeInsets
.
all
(
8
),
backgroundColor:
backgroundColor
??
theme
.
dialogBackgroundColor
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
radius
))),
title:
Text
(
title
,
textAlign:
TextAlign
.
center
,
style:
titleStyle
),
content:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
content
??
Text
(
middleText
??
""
,
textAlign:
TextAlign
.
center
,
style:
middleTextStyle
),
SizedBox
(
height:
16
),
ButtonTheme
(
minWidth:
78.0
,
height:
34.0
,
child:
Wrap
(
alignment:
WrapAlignment
.
center
,
spacing:
8
,
runSpacing:
8
,
children:
actions
,
),
)
],
),
// actions: actions, // ?? <Widget>[cancelButton, confirmButton],
buttonPadding:
EdgeInsets
.
zero
,
Widget
baseAlertDialog
=
AlertDialog
(
titlePadding:
EdgeInsets
.
all
(
8
),
contentPadding:
EdgeInsets
.
all
(
8
),
backgroundColor:
backgroundColor
??
theme
.
dialogBackgroundColor
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
radius
))),
title:
Text
(
title
,
textAlign:
TextAlign
.
center
,
style:
titleStyle
),
content:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
content
??
Text
(
middleText
??
""
,
textAlign:
TextAlign
.
center
,
style:
middleTextStyle
),
SizedBox
(
height:
16
),
ButtonTheme
(
minWidth:
78.0
,
height:
34.0
,
child:
Wrap
(
alignment:
WrapAlignment
.
center
,
spacing:
8
,
runSpacing:
8
,
children:
actions
,
),
)
],
),
// actions: actions, // ?? <Widget>[cancelButton, confirmButton],
buttonPadding:
EdgeInsets
.
zero
,
);
if
(
onWillPop
!=
null
)
{
return
dialog
<
T
>(
WillPopScope
(
onWillPop:
onWillPop
,
child:
baseAlertDialog
,
),
barrierDismissible:
barrierDismissible
,
);
}
return
dialog
<
T
>(
baseAlertDialog
,
barrierDismissible:
barrierDismissible
,
);
}
...
...
Please
register
or
login
to post a comment