amangautam1 / flutter-musicplayer

A complete music player in flutter with cool UI and design.
MIT License
440 stars 138 forks source link

Correct Song class for project #14

Closed paulocoutinhox closed 4 years ago

paulocoutinhox commented 5 years ago

This is the current class for Song that i modify for use:

class Song {

  static final Columns=["id","artist", "title", "album", "albumId", "duration", "uri", "albumArt","count","isFav","timestamp"];

  int id;
  String artist;
  String title;
  String album;
  int albumId;
  int duration;
  String uri;
  String albumArt;
  int count;
  int timestamp;
  int isFav;

  Song(this.id, this.artist, this.title, this.album, this.albumId,
      this.duration, this.uri, this.albumArt);

  Song.fromMap(Map m) {
    id = m["id"];
    artist = m["artist"];
    title = m["title"];
    album = m["album"];
    albumId = m["albumId"];
    duration = m["duration"];
    uri = m["uri"];
    albumArt = m["albumArt"];
  }

  Map<String, dynamic> toMap() {
    Map params = <String, dynamic>{
      "id": id,
      "artist": artist,
      "title": title,
      "album": album,
      "albumId": albumId,
      "duration": duration,
      "uri": uri,
      "albumArt": albumArt,
      "count": count,
      "timestamp": timestamp,
      "isFav": isFav,
    };

    return params;
  }

}
amangautam1 commented 5 years ago

The project uses almost same class.