class BeritaModel {
  final int id;
  final String judul;
  final String? ringkasan;
  final String? gambarUrl;
  final String? kategori;
  final String? penulis;

  BeritaModel({
    required this.id,
    required this.judul,
    this.ringkasan,
    this.gambarUrl,
    this.kategori,
    this.penulis,
  });

  factory BeritaModel.fromJson(Map<String, dynamic> json) {
    return BeritaModel(
      id: json['id'],
      judul: json['judul'],
      ringkasan: json['ringkasan'],
      gambarUrl: json['gambar_url'],
      kategori: json['kategori'],
      penulis: json['penulis'],
    );
  }
}
