如何将警报对话框的组件分成两部分,如下图所示。
即与主体分离的“确定”按钮
那里有一个工作代码
class Demo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[400],
body: Dialog(
elevation: 0,
backgroundColor: Colors.transparent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 256,
color: Colors.white,
),
const SizedBox(height: 20,),
FlatButton(onPressed: (){}, child: const Text("OK"),shape: const CircleBorder(),color: Colors.white,)
],
),
),
);
}
}