joaopaulofcc

[SC] [DBAPI] dog.dart

Nov 25th, 2020
745
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Dog {
  2.   final String id;
  3.   final String name;
  4.   final int age;
  5.  
  6.   Dog({this.id, this.name, this.age});
  7.  
  8.   Map<String, dynamic> toMap() {
  9.     return {
  10.       'id': id,
  11.       'name': name,
  12.       'age': age,
  13.     };
  14.   }
  15.  
  16.   static fromMap(Map<String, dynamic> map) {
  17.     return new Dog(id: map['id'], name: map['name'], age: map['age']);
  18.   }
  19.  
  20.   @override
  21.   String toString() {
  22.     return 'Dados do cachorro $id - Nome: $name, Idade: $age';
  23.   }
  24. }
  25.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×