Option.fromJson constructor

Option.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Option.fromJson(Map<String, dynamic> json) {
  return Option(
    text: json['text'] as String? ?? 'defaultText',
  );
}