LifeCycle.fromJson constructor

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

Implementation

factory LifeCycle.fromJson(Map<String, dynamic> json) {
  try {
    return LifeCycle(
      viewName: json['view_name'] ?? '',
      stage: json['stage'] ?? '',
      parentViewName: json['parent_view_name'],
      timeMs: json['time_ms'] is int ? json['time_ms'] : null,
    );
  } catch (e) {
    return LifeCycle(viewName: '', stage: '');
  }
}