Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
Tour Travel Agency AGR
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
Tour Travel Agency AGR
Commits
d9d17121
Commit
d9d17121
authored
Jun 12, 2023
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modal dialog global
parent
00c8153b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
0 deletions
+96
-0
modal_dialog.dart
lib/helper/modal_dialog.dart
+96
-0
No files found.
lib/helper/modal_dialog.dart
0 → 100644
View file @
d9d17121
import
'package:flutter/material.dart'
;
import
'package:tour_travel_agr/helper/components_widget/widget_button.dart'
;
import
'package:tour_travel_agr/resource/font.dart'
;
import
'package:tour_travel_agr/resource/style.dart'
;
Future
<
dynamic
>
modalDialogGlobal
({
required
BuildContext
context
,
Size
?
size
,
required
String
title
,
required
String
contentBody
,
required
String
buttonText
,
required
void
Function
()
tapButton
,
bool
isActiveCancelButton
=
false
,
bool
isCustomSecondButton
=
false
,
String
customSecondButtonText
=
''
,
Widget
?
navigateToCustomButton
,
})
async
{
return
showDialog
(
context:
context
,
barrierDismissible:
false
,
builder:
(
BuildContext
ctxDialog
)
=>
AlertDialog
(
shape:
const
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
15
))),
content:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
title
,
style:
getBoldStyle
(
color:
Colors
.
black
,
fontFamily:
FontConstants
.
inter
,
fontSize:
FontSize
.
s24
,
),
),
const
SizedBox
(
height:
16
,
),
Text
(
contentBody
,
style:
getMediumStyle
(
color:
Colors
.
black
,
fontFamily:
FontConstants
.
openSans
,
fontSize:
FontSize
.
s16
,
),
),
const
SizedBox
(
height:
42
,
),
InkWell
(
onTap:
()
{
tapButton
();
},
child:
CustomButton
(
text:
buttonText
,
),
),
(
isActiveCancelButton
)
?
InkWell
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
const
CustomButton
(
text:
"Cancel"
,
colorButton:
Colors
.
transparent
,
colorText:
Colors
.
black
,
),
)
:
const
SizedBox
(),
(
isCustomSecondButton
)
?
Column
(
children:
[
const
SizedBox
(
height:
10
,
),
InkWell
(
onTap:
()
{
Navigator
.
pop
(
context
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
navigateToCustomButton
!),
);
},
child:
CustomButton
(
text:
customSecondButtonText
,
),
),
],
)
:
const
SizedBox
()
],
),
),
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment