entryDialog method

  1. @override
Widget entryDialog(
  1. AppModel app,
  2. BuildContext context, {
  3. Key? key,
  4. bool? includeHeading,
  5. required String title,
  6. String? ackButtonLabel,
  7. String? nackButtonLabel,
  8. String? hintText,
  9. required dynamic onPressed(
    1. String? response
    ),
  10. String? initialValue,
  11. double? widthFraction,
})
override

Implementation

@override
Widget entryDialog(
  AppModel app,
  BuildContext context, {
  Key? key,
  bool? includeHeading,
  required String title,
  String? ackButtonLabel,
  String? nackButtonLabel,
  String? hintText,
  required Function(String? response) onPressed,
  String? initialValue,
  double? widthFraction, // percentage of screen width
}) {
  String? feedback;
  return dialogHelper.build(
    app,
    context,
    width: widthFraction == null
        ? null
        : fullScreenWidth(context) * widthFraction,
    key: key,
    includeHeading: includeHeading,
    dialogButtonPosition: DialogButtonPosition.topRight,
    title: title,
    contents: dialogHelper.getListTile(
        leading: Icon(Icons.message),
        title: DialogField(
          app: app,
          valueChanged: (value) => feedback = value,
          initialValue: initialValue,
          decoration: InputDecoration(
            hintText: hintText,
            labelText: hintText,
          ),
        )),
    buttons: dialogHelper.getAckNackButtons(
      app,
      context,
      ackFunction: () {
        Navigator.of(context).pop();
        onPressed(feedback);
      },
      nackFunction: () {
        Navigator.of(context).pop();
        onPressed(null);
      },
      ackButtonLabel: ackButtonLabel,
      nackButtonLabel: nackButtonLabel,
    ),
    dialogBackgroundColor:
        _style.monaStyleAttributesModel.dialogBackgroundColor,
    dialogSeperatorColor:
        _style.monaStyleAttributesModel.dialogSeperatorColor,
  );
}