SHARE
TWEET

firebase node class

a guest Jan 23rd, 2020 66 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 Capelli {
  4.   String capelliKey;
  5.   String capelliServizi;
  6.   String capelliDescrizione;
  7.   String capelliTempo;
  8.   String capelliPrezzo;
  9.  
  10.   Capelli(this.capelliServizi, this.capelliDescrizione, this.capelliTempo, this.capelliPrezzo);
  11.  
  12.   Capelli.fromSnapshot(DataSnapshot snapshot)
  13.       : capelliKey = snapshot.key,
  14.         capelliServizi = snapshot.value["servizi"],
  15.         capelliDescrizione = snapshot.value["descrizione"],
  16.         capelliTempo = snapshot.value["tempo"],
  17.         capelliPrezzo = snapshot.value["prezzo"];
  18.  
  19.   toJson() {
  20.     return {
  21.       "servizi": capelliServizi,
  22.       "descrizione": capelliDescrizione,
  23.       "tempo": capelliTempo,
  24.       "prezzo": capelliPrezzo,
  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