import 'package:flutter/material.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class TipDialog extends StatelessWidget {
  String title;

  TipDialog({this.title = "温馨提示", this.content});

  String content;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.transparent,
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Container(
            width: double.infinity,
            decoration: BoxDecoration(
                color: Colors.white, borderRadius: BorderRadius.circular(20)),
            margin: EdgeInsets.only(left: 91.w, right: 91.w),
            child: Column(
              children: <Widget>[
                Padding(
                  padding: const EdgeInsets.only(top: 16),
                  child: Text(
                    title,
                    style: TextStyle(fontSize: 30.sp,fontWeight: FontWeight.w400),
                  ),
                ),
                Container(
                  margin: EdgeInsets.all(16),
                  constraints: BoxConstraints(minHeight: 100),
                  child: Text(
                    content,
                    style: TextStyle(fontSize: 26.sp),
                  ),
                ),
                Row(
                  children: <Widget>[
                    Expanded(
                        child: Padding(
                      padding: const EdgeInsets.only(
                          left: 16, right: 16, bottom: 16),
                      child: FlatButton(
                          padding: EdgeInsets.only(top: 10, bottom: 10),
                          color: HexColor.fromHex("#FFFF4242"),
                          shape: RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(50)),
                          onPressed: () {
                            Navigator.pop(context);
                          },
                          child: Text(
                            "知道了",
                            style: TextStyle(
                                color: HexColor.fromHex("#FFFFFF"),
                                fontSize: 26.sp),
                          )),
                    ))
                  ],
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}
