mucke/lib/system/models/album_model.dart

28 lines
729 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 {
final int id;
AlbumModel({this.id, @required title, @required artist, albumArtPath, year})
: super(
title: title,
artist: artist,
albumArtPath: albumArtPath,
year: year);
factory AlbumModel.fromMoor(MoorAlbum moorAlbum) => AlbumModel(
title: moorAlbum.title,
artist: moorAlbum.artist,
albumArtPath: moorAlbum.albumArtPath,
year: moorAlbum.year);
MoorAlbum toMoor() => MoorAlbum(
title: title,
artist: artist,
albumArtPath: albumArtPath,
year: year);
}