mucke/lib/system/models/album_model.dart

36 lines
807 B
Dart
Raw Normal View History

2020-03-24 22:17:03 +01:00
import 'package:meta/meta.dart';
import '../../domain/entities/album.dart';
import '../datasources/moor_music_data_source.dart';
class AlbumModel extends Album {
2020-03-26 10:19:36 +01:00
AlbumModel({
this.id,
@required String title,
@required String artist,
String albumArtPath,
int year,
}) : super(
title: title,
artist: artist,
albumArtPath: albumArtPath,
year: year,
);
2020-03-24 22:17:03 +01:00
factory AlbumModel.fromMoor(MoorAlbum moorAlbum) => AlbumModel(
2020-03-26 10:19:36 +01:00
title: moorAlbum.title,
artist: moorAlbum.artist,
albumArtPath: moorAlbum.albumArtPath,
year: moorAlbum.year,
);
final int id;
2020-03-24 22:17:03 +01:00
MoorAlbum toMoor() => MoorAlbum(
2020-03-26 10:19:36 +01:00
title: title,
artist: artist,
albumArtPath: albumArtPath,
year: year,
);
2020-03-24 22:17:03 +01:00
}