You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
890 B
Dart
36 lines
890 B
Dart
|
4 years ago
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
import 'AppPermissionHandler.dart';
|
||
|
|
|
||
|
|
Future<ConfirmAction?> showConfirmDialogs(
|
||
|
|
context, msg, positiveText, negativeText) async {
|
||
|
|
return showDialog<ConfirmAction>(
|
||
|
|
context: context,
|
||
|
|
barrierDismissible: false,
|
||
|
|
builder: (context) {
|
||
|
|
return AlertDialog(
|
||
|
|
backgroundColor: Colors.white,
|
||
|
|
title: Text(msg, style: TextStyle(fontSize: 16)),
|
||
|
|
actions: <Widget>[
|
||
|
|
TextButton(
|
||
|
|
child: Text(
|
||
|
|
negativeText,
|
||
|
|
),
|
||
|
|
onPressed: () {
|
||
|
|
Navigator.of(context).pop(ConfirmAction.CANCEL);
|
||
|
|
},
|
||
|
|
),
|
||
|
|
TextButton(
|
||
|
|
child: Text(
|
||
|
|
positiveText,
|
||
|
|
),
|
||
|
|
onPressed: () {
|
||
|
|
Navigator.of(context).pop(ConfirmAction.ACCEPT);
|
||
|
|
},
|
||
|
|
)
|
||
|
|
],
|
||
|
|
);
|
||
|
|
},
|
||
|
|
);
|
||
|
|
}
|