Skip to content

Instantly share code, notes, and snippets.

@marcossevilla
Created February 4, 2021 17:28
Show Gist options
  • Save marcossevilla/430aa8a9104ede6d612959836638d963 to your computer and use it in GitHub Desktop.
Save marcossevilla/430aa8a9104ede6d612959836638d963 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart' show DocumentSnapshot;
import 'store_item_model.dart';
class StoreItemFirestore extends StoreItemModel {
StoreItemFirestore({
@required int id,
@required String name,
}) : super(id: id, name: name);
factory StoreItemFirestore.fromFirestore(DocumentSnapshot doc) {
return StoreItemModel.fromJson(doc.data());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment