Advertisement
alvinvin00

comment.dart

Mar 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.60 KB | None | 0 0
  1. import 'package:firebase_database/firebase_database.dart';
  2.  
  3. class Comment {
  4.  
  5.   String _fullName;
  6.   String _comment;
  7.   String _photo;
  8.   int _timestamp;
  9.  
  10.  
  11.   Comment(this._fullName, this._comment, this._photo, this._timestamp);
  12.  
  13.   String get fullName => _fullName;
  14.   String get comment => _comment;
  15.   String get photo => _photo;
  16.   int get timestamp => _timestamp;
  17.  
  18.   Comment.fromSnapshot(DataSnapshot snapshot) {
  19.     _fullName = snapshot.value['fullname'];
  20.     _comment = snapshot.value['comment'];
  21.     _photo = snapshot.value['photo'];
  22.     _timestamp = snapshot.value['timestamp'];
  23.   }
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement