
import 'package:chat/generated/i18n.dart';
import 'package:flutter/material.dart';
class NotPermissionDialog extends StatefulWidget {

  final String title;
  NotPermissionDialog(this.title);

  @override
  _NotPermissionDialogState createState() => _NotPermissionDialogState();
}

class _NotPermissionDialogState extends State<NotPermissionDialog> {
  @override
  Widget build(BuildContext context) {

    return AlertDialog(
      title: Text(widget.title),
      actions: <Widget>[
        FlatButton(
          onPressed: _onCancel,
          child: Text(I18n.of(context).cancel),
        ),
        FlatButton(
          onPressed: _onSure,
          child: Text(I18n.of(context).go_open),
        ),
      ],
    );
  }

  void _onCancel() {
    Navigator.pop(context);
  }

  void _onSure() {
    Navigator.pop(context, true);
  }
}
