toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'schemaVersion': schemaVersion,
    if (screens.isNotEmpty) 'screens': screens.map((s) => s.toJson()).toList(),
    if (widgets.isNotEmpty)
      'widgets': widgets.map((k, v) => MapEntry(k, v.toJson())),
    if (theme != null) 'theme': theme!.toJson(),
    if (navigation != null) 'navigation': navigation!.toJson(),
    if (state.isNotEmpty)
      'state': state.map((k, v) => MapEntry(k, v.toJson())),
  };
}