Code Monkey home page Code Monkey logo

suggest-a-feature-firestore's Introduction

Suggest a Feature Firestore

What the Flutter

Crafted with passion by What the Flutter ๐Ÿฆœ

Pub Build Status CodeFactor


This package is a data source extension for suggest_a_feature package.

Getting started

dependencies:
  suggest_a_feature: ^latest version
  suggest_a_feature_firestore: ^latest version

You need to add Firebase to your project following steps described in this link from official firebase website: https://console.firebase.google.com/

Usage

You need to place FirestoreDataSource class as a suggestionsDataSource field in SuggestionsPage widget. Don't forget to place FirebaseFirestore.instance as firestoreInstance field in FirestoreDataSource class. For example:

SuggestionsPage(
  userId: '1',
  suggestionsDataSource: FirestoreDataSource(
    userId: '1',
    firestoreInstance: FirebaseFirestore.instance,
  ),
  theme: SuggestionsTheme.initial() ,
  onUploadMultiplePhotos: null,
  onSaveToGallery: null,
  onGetUserById: () {},
);

Firestore rules

You also must add following rules to your Firestore in Firebase Console:

match /suggest_a_feature_suggestions/{suggest_a_feature_suggestion}{
  allow read, write: if request.auth != null;
}

match /suggest_a_feature_comments/{suggest_a_feature_comment}{
  allow read, write: if request.auth != null;
}
  • only if those rules are not defined for all lists

Pay your attention

For each delete or update suggestion action we check either user have author rights to fulfil those actions. Author rights is such a concept that only the user who created a suggestion can manipulate it (delete or update it). If somehow happens the situation when user without author rights will try to delete/update a suggestion will be thrown an Exception

We provide batch deleting of all the comments related to deleting suggestion in order save storage place and keep your firestore collections clean.

Cloud Firestore

Data collections names in firebase firestore will be the following ones:

  • suggest_a_feature_suggestions for suggestions collection
  • suggest_a_feature_comments for comments collection

suggest-a-feature-firestore's People

Contributors

alexandersimakov avatar kirillsergeevich avatar tokyolem avatar maksnevor avatar alesiaradkevich avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.