fromJson static method

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

Implementation

static NavigatorAction fromJson(Map<String, dynamic> json) {
  if (json['type'] == 'show_dialog') {
    return ShowDialogAction.fromJson(json);
  }
  if (json['type'] == 'show_bottom_sheet') {
    return ShowBottomSheetAction.fromJson(json);
  }
  if (json['type'] == 'change_page') {
    return ChangePageAction.fromJson(json);
  }
  if (json['type'] == 'pop') {
    return PopAction.fromJson(json);
  }
  throw Exception('Unknown action type');
}