I have Main class this is called FullTrip this class has attributes called itineraries and others contain two pieces of data
so i create another class called Hc now i need to use this combination two parse json response from the server
class FullTrip extends Trip{
final List<String> including;
final List<String> excluding;
final List<Hc> itineraries;
final List<Hc> policies;
FullTrip(this.including,this.excluding,this.itineraries,this.policies,int id,String title,double price,String overview,String hero_image):
super(id:id,title:title,price:price,overview:overview,hero_image:hero_image);
factory FullTrip.fromJson(Map<String, dynamic> json) =>
_$FullTripFromJson(json);
}
class Hc {
final String head;
final String content;
Hc({this.head,this.content});
}
when i use the code like that and run serialization command
flutter packages pub run build_runner build --delete-conflicting-outputs
i got error in terminal
[SEVERE] json_serializable on lib/models/fulltrip.dart: Error running JsonSerializableGenerator Could not generate
fromJsoncode foritinerariesbecause of typeHc. None of the providedTypeHelperinstances support the defined type. package:Tourism/models/fulltrip.dart:21:18 final List itineraries; ^^^^^^^^^^^ [WARNING] json_serializable on lib/models/fulltrip.dart: Missing "part 'fulltrip.g.dart';". [INFO] Running build completed, took 3.0s[INFO] Caching finalized dependency graph... [INFO] Caching finalized dependency graph completed, took 68ms