skitAlert function

Future skitAlert(
  1. BuildContext context,
  2. dynamic contents
)

origin: kt_ifm_gtid_mob/lib/global.dart (jeemceAlert) union-of: stm_portal_mob/lib/global.dart (jeemceAlert) author: anovsiradj, opencode-go/glm-5.2 version: 2025-03-03, revised: 2026-08-17

SimpleDialog alert. contents = Widget / String / List of either.

Implementation

Future<dynamic> skitAlert(BuildContext context, dynamic contents) {
  if (contents is! List) {
    contents = [contents];
  }

  return showDialog(
    context: context,
    builder: (context) {
      return SimpleDialog(
        contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
        children: [
          for (final content in contents)
            if (content is Widget)
              content
            else if (content != null)
              Text(content.toString(), style: const TextStyle(fontFamily: 'monospace')),
        ],
      );
    },
  );
}