class SliderData { final int id; final String title; final String image; final String link; final bool isViewed; const SliderData({ required this.id, required this.title, required this.image, required this.link, required this.isViewed, }); factory SliderData.fromJson(Map json) => SliderData( id: json['id'], title: json['title'], image: json['image'], link: json['link'], isViewed: json['isViewed'] ?? false, ); Map toJson() => { 'id': id, 'title': title, 'image': image, 'link': link, 'isViewed': isViewed, }; }