showDialogChoiceText method

void showDialogChoiceText({
  1. required Object themeOrId,
  2. AFUIStandardChoiceDialogIcon icon = AFUIStandardChoiceDialogIcon.question,
  3. required Object title,
  4. Object? body,
  5. required List<String>? buttonTitles,
  6. void onReturn(
    1. int
    )?,
})
inherited

Implementation

void showDialogChoiceText({
  required Object themeOrId,
  AFUIStandardChoiceDialogIcon icon = AFUIStandardChoiceDialogIcon.question,
  required Object title,
  Object? body,
  required List<String>? buttonTitles,
  void Function(int)? onReturn
}) {
  var richBody;

  var themeActual = _findTheme(themeOrId);
  final richTitle = themeActual.childRichTextBuilderOnCard();
  richTitle.writeBold(title);

  if(body != null) {
    richBody = themeActual.childRichTextBuilderOnCard();
    richBody.writeNormal(body);
  }

  buttonTitles ??= ["OK"];
  showDialogAFib<int>(
     navigate: AFUIStandardChoiceDialog.navigatePush(
        icon: icon,
        title: richTitle,
        body: richBody,
        buttonTitles: buttonTitles,
    ),
    onReturn: (result) {
      if(result != null && onReturn != null) {
        onReturn(result);
      }
    },
  );
}