show method
Implementation
Future show() => showDialog(
context: context,
builder: (context) => Dialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(MediaQuery.of(context).size.height/2),
bottomLeft: Radius.circular(MediaQuery.of(context).size.height/2),
topRight: const Radius.circular(32),
bottomRight: const Radius.circular(32))),
child: Container(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 60,
width: 60,
decoration: BoxDecoration(
color: Colors.grey.shade200,
borderRadius: BorderRadius.circular(30)),
child: Center(
child: icon??const Icon(Icons.info_outline,color: Colors.blue,size: 40,),
),
),
20.width,
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title??'Alert!',
style: TextStyle(fontSize: 18,color: titleColor??Colors.black),
),
8.height,
Text(
description??'',
style: TextStyle(fontSize: 14, color:descriptionColor?? Colors.black54),
),
16.height,
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () {
Navigator.pop(context);
onNegativePressed?.call();
},
style: TextButton.styleFrom(primary: negativeButtonColor??Colors.red),
child: Text(negativeButtonName??'No')),
ElevatedButton(
style: ElevatedButton.styleFrom(primary:positiveButtonColor?? Colors.blue),
onPressed: () {
Navigator.pop(context);
onPositivePressed?.call();
},
child: Text(positiveButtonName??'Yes')),
],
),
],
),
),
],
),
),
));