showAlertDialog method
Implementation
showAlertDialog(BuildContext context, String? price) {
Widget cancelButton = TextButton(
child: DefaultText(
textLabel: "Yes",
fontWeight: FontWeight.bold,
),
onPressed: () {
// buyTicket(ticketShop.id);
Navigator.pop(context);
gameShopState?.apiBuyTicket(ticketShop!.id!);
// if ( isSuccess == true) {
// Navigator.pop(context);
// showAlertDialogSuccessorFailed(context, true);
// } else if (isSuccess == false) {
// Navigator.pop(context);
// showAlertDialogSuccessorFailed(context, false);
// }
},
);
Widget continueButton = TextButton(
child: DefaultText(
textLabel: "No",
fontWeight: FontWeight.bold,
colorsText: Colors.red,
),
onPressed: () {
Navigator.pop(context);
},
);
AlertDialog alert = AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(12))),
icon: Image.asset(
Assets.gameDiamondIcon,
width: 40,
height: 40,
),
actionsAlignment: MainAxisAlignment.center,
// title: Text("AlertDialog"),
content:
DefaultText(
textLabel: "Please wait, we will open this shop so soon.",
),
// RichTextDefault(Languanges.of(context).gameAreYouSureYouWantToExchange + "${price} SPT " +Languanges.of(context).withDiamondTicket,["${price}","SPT"],sizeFont: 14.5,),
// RichText(
// textAlign: TextAlign.center,
// text: TextSpan(
// text: Languanges.of(context).gameAreYouSureYouWantToExchange,
// style: TextStyle(
// fontSize: 14,
// fontFamily: Fonts.poppins,
// color: Colors.black,
// ),
// children: [
// TextSpan(
// text: "${price} SPT",
// style: TextStyle(
// fontWeight: FontWeight.bold,
// color: Colors.black,
// fontSize: 14,
// fontFamily: Fonts.poppins)),
// TextSpan(
// text: Languanges.of(context).withDiamondTicket,
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontFamily: Fonts.poppins)),
// ])),
actions: [
cancelButton,
continueButton,
],
);
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}