Book Appointment check login
parent
760db6a873
commit
732ab90b2f
@ -0,0 +1,45 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AlertDialogBox {
|
||||
final BuildContext context;
|
||||
|
||||
final confirmMessage;
|
||||
final okText;
|
||||
final Function okFunction;
|
||||
|
||||
AlertDialogBox(
|
||||
{@required this.context,
|
||||
@required this.confirmMessage,
|
||||
@required this.okText,
|
||||
@required this.okFunction});
|
||||
|
||||
showAlertDialog(BuildContext context) {
|
||||
Widget continueButton =
|
||||
FlatButton(child: Text(this.okText), onPressed: this.okFunction);
|
||||
|
||||
// set up the AlertDialog
|
||||
AlertDialog alert = AlertDialog(
|
||||
title: Text(TranslationBase.of(context).confirm),
|
||||
content: Text(this.confirmMessage),
|
||||
actions: [
|
||||
continueButton,
|
||||
],
|
||||
);
|
||||
|
||||
// show the dialog
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return alert;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static closeAlertDialog(BuildContext context) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue