Files
neomovies-mobile/lib/data/models/movie_preview.dart

27 lines
619 B
Dart
Raw Normal View History

2025-07-13 14:01:29 +03:00
import 'package:hive/hive.dart';
2025-07-19 18:13:13 +03:00
import 'package:json_annotation/json_annotation.dart';
2025-07-13 14:01:29 +03:00
part 'movie_preview.g.dart';
@HiveType(typeId: 1) // Use a new typeId to avoid conflicts with Movie
2025-07-19 18:13:13 +03:00
@JsonSerializable()
2025-07-13 14:01:29 +03:00
class MoviePreview extends HiveObject {
@HiveField(0)
final String id;
@HiveField(1)
final String title;
@HiveField(2)
final String? posterPath;
MoviePreview({
required this.id,
required this.title,
this.posterPath,
});
2025-07-19 18:13:13 +03:00
factory MoviePreview.fromJson(Map<String, dynamic> json) => _$MoviePreviewFromJson(json);
Map<String, dynamic> toJson() => _$MoviePreviewToJson(this);
2025-07-13 14:01:29 +03:00
}