toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['Easy'] = easy.toJson();
  data['Medium'] = medium.toJson();
  data['Extreme'] = extreme.toJson();
  data['Hard'] = hard.toJson();
  return data;
}