89 lines
2.9 KiB
Dart
89 lines
2.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class DeleteDialog extends StatefulWidget {
|
|
Function onTap;
|
|
|
|
DeleteDialog({required this.onTap});
|
|
|
|
@override
|
|
State<DeleteDialog> createState() => _DeleteDialogState();
|
|
}
|
|
|
|
class _DeleteDialogState extends State<DeleteDialog> {
|
|
@override
|
|
void initState() {
|
|
// TODO: implement initState
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
type: MaterialType.transparency, //透明类型
|
|
color: Color(0x1A000000),
|
|
child: Center(
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
child: Container(
|
|
width: 280,
|
|
color: Colors.white,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(top: 34),
|
|
child: Text('确认删除该聊天记录吗'),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 36, left: 22, right: 22, bottom: 19),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
},
|
|
child: Container(
|
|
width: 108,
|
|
height: 43,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
|
border: Border.all(color: Color(0xFFD9D9D9), width: 1),
|
|
),
|
|
child: Text(
|
|
'取消',
|
|
style: TextStyle(color: Color(0xFFD9D9D9), fontSize: 12),
|
|
),
|
|
),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {
|
|
widget.onTap(1);
|
|
},
|
|
child: Container(
|
|
width: 108,
|
|
height: 43,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFFD9D9D9),
|
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
|
),
|
|
child: Text(
|
|
'确定',
|
|
style: TextStyle(color: Colors.black, fontSize: 12),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|