|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import 'package:flutter/material.dart';
- import 'package:zhiying_comm/zhiying_comm.dart';
-
- class TipDialog extends StatelessWidget {
- String title;
-
- String btnText;
-
- TipDialog({this.title = "温馨提示", this.content, this.btnText = "知道了"});
-
- 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>[
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- SizedBox(
- width: 48,
-
- ),
- Text(
- title,
- style: TextStyle(
- fontSize: 30.sp, fontWeight: FontWeight.w400),
- ),
- SizedBox(
- width: 48,
- child: IconButton(
- icon: Icon(Icons.close),
- onPressed: () {
- Navigator.pop(context, false);
- }),
- ),
- ],
- ),
- 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,true);
- },
- child: Text(
- btnText,
- style: TextStyle(
- color: HexColor.fromHex("#FFFFFF"),
- fontSize: 26.sp),
- )),
- ))
- ],
- )
- ],
- ),
- )
- ],
- ),
- );
- }
- }
|