File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -232,4 +232,46 @@ class WidgetHelper {
232232 }
233233 return false ;
234234 }
235+
236+ Future <bool ?> showDialogConfirmation (
237+ BuildContext context,
238+ String title,
239+ String content,
240+ List <Widget > actions,
241+ ) {
242+ return showDialog <bool ?>(
243+ context: context,
244+ builder: (context) {
245+ return AlertDialog (
246+ title: Text (title),
247+ content: Text (content),
248+ actions: actions,
249+ );
250+ },
251+ );
252+ }
253+
254+ Future <void > showDialogMessage (
255+ BuildContext context,
256+ String ? title,
257+ String message,
258+ ) {
259+ return showDialog (
260+ context: context,
261+ builder: (context) {
262+ return AlertDialog (
263+ title: Text (title ?? 'info' .tr ()),
264+ content: Text (message),
265+ actions: [
266+ TextButton (
267+ onPressed: () {
268+ context.pop ();
269+ },
270+ child: Text ('dismiss' .tr ()),
271+ ),
272+ ],
273+ );
274+ },
275+ );
276+ }
235277}
You can’t perform that action at this time.
0 commit comments