xBuild_PopUp method

Future<bool?> xBuild_PopUp(
  1. BuildContext context,
  2. K item,
  3. String textTitle
)

Implementation

Future<bool?> xBuild_PopUp(BuildContext context, K item, String textTitle) async {
  return showDialog(
      context: context,
      builder: (BuildContext context) {
        return AlertDialog(
            title: Center(child: Container(child: Text(textTitle, style: XStyles.xStyTextForTextBase()))),
            content: Column(
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: <Widget>[
                    Expanded(
                        child: TextButton(
                            style: TextButton.styleFrom(backgroundColor: Colors.black),
                            child: Text('YES', style: TextStyle(color: Colors.greenAccent)),
                            onPressed: () {
                              Navigator.pop(context, true);
                            })),
                    SizedBox(width: 15),
                    Expanded(
                        child: TextButton(
                      style: TextButton.styleFrom(backgroundColor: Colors.black),
                      child: Text('NO', style: TextStyle(color: Colors.redAccent)),
                      onPressed: () {
                        Navigator.pop(context, false);
                      },
                    )),
                  ],
                ),
              ],
            ));
      });
}