dialogTile method

dynamic dialogTile({
  1. required String text,
  2. Function? callback,
  3. dynamic fontWeight = FontWeight.normal,
  4. double fontSize = 16,
})

Implementation

dialogTile(
    {required String text,
      Function? callback,
      fontWeight = FontWeight.normal,
      double fontSize = 16}) {
  return InkWell(
    onTap: () {
      if (callback != null) {
        Navigator.pop(context);
        callback();
      }
    },
    child: Container(
      width: MediaQuery.of(context).size.width,
      alignment: Alignment.center,
      child: Padding(
        padding: const EdgeInsets.only(
            right: 12.0, left: 12.0, top: 16, bottom: 16),
        child: Text(
          text,
          style: TextStyle(
            color: Colors.black,
            fontSize: fontSize,
            fontWeight: fontWeight,
          ),
        ),
      ),
    ),
  );
}