import 'package:flutter/material.dart';

class FailDialog extends Dialog {
  String text;
  FailDialog({Key key, @required this.text}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return  Material(
      //创建透明层
      type: MaterialType.transparency, //透明类型
      child:  Center(
        //保证控件居中效果
        child:  SizedBox(
          width: 240.0,
          height: 120.0,
          child:  Container(
            decoration: const ShapeDecoration(
              color: Color(0xffffffff),
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(
                  Radius.circular(8.0),
                ),
              ),
            ),
            child:  Row(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                 Image.asset('assets/images/icons/fail.png'),
                 Padding(
                  padding: const EdgeInsets.only(
                    top: 20.0,
                  ),
                  child:  Text(
                    text,
                    style:  const TextStyle(fontSize: 12.0),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
