buildDialog function
Implementation
Widget buildDialog({
required String id,
required Map<String, dynamic> props,
required List<Widget> children,
}) {
if (props['open'] == false) {
return const SizedBox.shrink();
}
final title = props['title']?.toString() ?? '';
final content = props['content'];
return AlertDialog(
key: ValueKey(id),
title: title.isEmpty ? null : Text(title),
content: children.isNotEmpty
? (children.length == 1 ? children.first : Column(children: children))
: Text(content?.toString() ?? ''),
);
}