SHARE
TWEET

Post.dart

rachmadi Mar 11th, 2019 175 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import 'package:firebase_database/firebase_database.dart';
  2.  
  3. class Post{
  4.   String _title;
  5.   String _content;
  6.   String _photo;
  7.   String _userId;
  8.   int _timestamp;
  9.  
  10.  
  11.   Post(this._title, this._content, this._photo, this._userId, this._timestamp);
  12.  
  13.   String get title => _title;
  14.   String get content => _content;
  15.   String get photo => _photo;
  16.   String get userId => _userId;
  17.   int get timestamp => _timestamp;
  18.  
  19.   Post.fromSnapshot(DataSnapshot snapshot){
  20.     _title = snapshot.value['title'];
  21.     _content = snapshot.value['content'];
  22.     _photo = snapshot.value['photo'];
  23.     _userId = snapshot.value['userId'];
  24.     _timestamp = snapshot.value['timestamp'];
  25.   }
  26.  
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top