GromoreEvent.fromJson constructor

GromoreEvent.fromJson(
  1. Map json
)

解析 AdEvent

Implementation

factory GromoreEvent.fromJson(Map<dynamic,dynamic> json){
  String action = json['action'];
  if(action == GromoreEventActions.onAdError){
   return GromoreErrorEvent.fromJson(json);
  }else if(action == GromoreEventActions.onAdReward){
    return GromoreRewardEvent.fromJson(json);
  }else{
    return GromoreEvent(
      adId: json['adId'],
      action: action,
    );
  }
}