Skip to content
Snippets Groups Projects
error-alert.dart 552 B
Newer Older
  • Learn to ignore specific revisions
  • Markin Igor's avatar
    Markin Igor committed
    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();
                },
              ),
            ],
          );
        },
      );
    }