You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.1 KiB
Dart

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'package:flutter/material.dart';
import 'package:hyzp_ybqx511528_xingwen/components/dioFun.dart';
import 'commonFun.dart';
//确认对话框
class CustomDialogHysh extends Dialog {
String title;
String content;
String shjg; //审核结果
bool ret = false;
CustomDialogHysh({@required this.shjg, this.title = "", this.content});
@override
Widget build(BuildContext context) {
Size mediaSize = MediaQuery.of(context).size;
return WillPopScope(
child: Material(
type: MaterialType.transparency,
child: Container(
padding: EdgeInsets.only(top: 122),
alignment: Alignment(0, -1),
color: Colors.black12,
child: Container(
// height: 260,
// width: 300,
height: mediaSize.height * 0.35,
width: mediaSize.width * 0.98,
//color: Colors.white, //Cannot provide both a color and a decoration
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.blue, width: 2.0),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.fromLTRB(10, 10, 10, 0),
child: Stack(
children: <Widget>[
Align(
alignment: Alignment.center,
child: Text(
"${title}确认",
style: TextStyle(
fontSize: 20.0,
),
),
),
Align(
alignment: Alignment.centerRight,
child: InkWell(
child: Icon(Icons.close),
onTap: () {
Navigator.pop(context, ret);
},
),
)
],
),
),
Divider(),
Container(
padding: EdgeInsets.fromLTRB(20, 5, 20, 10),
width: double.infinity,
height: mediaSize.height * 0.15,
child: SingleChildScrollView(
child: RichText(
text: TextSpan(children: [
TextSpan(
text: '${title}',
style: TextStyle(fontSize: 18.0, color: Colors.blue)),
TextSpan(
text: shjg,
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
color: shjg == hyc_text ? Colors.red : Colors.green)),
TextSpan(
text: '' + content,
style: TextStyle(fontSize: 18.0, color: Colors.blue)),
]),
),
),
),
SizedBox(height: 0),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
RaisedButton(
onPressed: () async {
ret = true;
Navigator.pop(context, ret); //关闭弹框返回sRet
},
child: Text("确认"),
),
RaisedButton(
child: Text("取消"),
onPressed: () async {
Navigator.pop(context, ret); //关闭弹框返回sRet
},
)
],
),
],
),
),
),
),
onWillPop: () {
// 屏蔽点击返回键的操作
Navigator.pop(context, ret);
},
);
}
}