
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<String, dynamic> json) => SliderData(
        id: json['id'],
        title: json['title'],
        image: json['image'],
        link: json['link'],
        isViewed: json['isViewed'] ?? false,
      );

  Map<String, dynamic> toJson() => {
        'id': id,
        'title': title,
        'image': image,
        'link': link,
        'isViewed': isViewed,
      };
}