Newer
Older
import 'package:flutter/material.dart';
Future<void> showErrorAlert(context, errorString, callback) {
return showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text('Authorization error'),
content: Text(errorString),
actions: <Widget>[
FlatButton(
child: Text('Open Dashboard'),
onPressed: () async {
Navigator.of(context).pop();
callback();
},
),
],
);
},
);
}