Page MenuHomec4science

showAlertDialog.Dart
No OneTemporary

File Metadata

Created
Fri, Jul 26, 12:28

showAlertDialog.Dart

import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
showAlertDialog(BuildContext context, String title, String content) {
// set up the button
Widget okButton = FlatButton(
child: Text("OK"),
onPressed: () {},
);
// set up the AlertDialog
AlertDialog alert =
AlertDialog(title: Text(title), content: Text(content), actions: <Widget>[
FlatButton(
child: Text('Ok'),
onPressed: () {
// Navigator.of(context).pop();
},
)
]);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}

Event Timeline