Advertisement
rachmadi

Note.dart

Oct 4th, 2018
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.58 KB | None | 0 0
  1. import 'package:firebase_database/firebase_database.dart';
  2.  
  3. class Note {
  4.   String _id;
  5.   String _title;
  6.   String _description;
  7.  
  8.   Note(this._id, this._title, this._description);
  9.  
  10.   Note.map(dynamic obj) {
  11.     this._id = obj['id'];
  12.     this._title = obj['title'];
  13.     this._description = obj['description'];
  14.   }
  15.  
  16.   String get id => _id;
  17.   String get title => _title;
  18.   String get description => _description;
  19.  
  20.   Note.fromSnapshot(DataSnapshot snapshot) {
  21.     _id = snapshot.key;
  22.     _title = snapshot.value['title'];
  23.     _description = snapshot.value['description'];
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement