Last active
June 8, 2020 18:19
-
-
Save shivanchalaeologic/bb918bdea8f0e94e4684749bc94800b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/rendering.dart'; | |
class Books { | |
int rollNo; | |
String name; | |
Books({ | |
this.rollNo, | |
this.name, | |
}); | |
factory Books.fromJson(Map<String, dynamic> json) => Books( | |
rollNo: json["rollNo"], | |
name: json["name"], | |
); | |
Map<String, dynamic> toJson() => { | |
"rollNo": rollNo, | |
"name": name, | |
}; | |
@override | |
String toString() { | |
// TODO: implement toString | |
return """ | |
id: $rollNo, | |
name: $name | |
---------------------------------- | |
"""; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment