Skip to content

Instantly share code, notes, and snippets.

Avatar
coding

Felix Angelov felangel

coding
View GitHub Profile
@felangel
felangel / user_repository.dart
Created Aug 4, 2019
[flutter_firestore_todos] user repository package root
View user_repository.dart
library user_repository;
export 'src/user_repository.dart';
@felangel
felangel / pubspec.yaml
Created Aug 4, 2019
[flutter_firestore_todos] user repository pubspec
View pubspec.yaml
name: user_repository
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
@felangel
felangel / firebase_todos_repository.dart
Created Aug 4, 2019
[flutter_firestore_todos] firebase todos repository
View firebase_todos_repository.dart
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:todos_repository/todos_repository.dart';
import 'entities/entities.dart';
class FirebaseTodosRepository implements TodosRepository {
final todoCollection = Firestore.instance.collection('todos');
@override
@felangel
felangel / todos_repository.dart
Created Aug 4, 2019
[flutter_firestore_todos] todos repository base
View todos_repository.dart
import 'dart:async';
import 'package:todos_repository/todos_repository.dart';
abstract class TodosRepository {
Future<void> addNewTodo(Todo todo);
Future<void> deleteTodo(Todo todo);
Stream<List<Todo>> todos();
@felangel
felangel / todo.dart
Created Aug 4, 2019
[flutter_firestore_todos] todo model
View todo.dart
import 'package:meta/meta.dart';
import '../entities/entities.dart';
@immutable
class Todo {
final bool complete;
final String id;
final String note;
final String task;
@felangel
felangel / models.dart
Created Aug 4, 2019
[flutter_firestore_todos] models barrel
View models.dart
export 'todo.dart';
@felangel
felangel / todo.dart
Created Aug 4, 2019
[flutter_firestore_todos] todo entity
View todo.dart
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:equatable/equatable.dart';
class TodoEntity extends Equatable {
final bool complete;
final String id;
final String note;
final String task;
TodoEntity(this.task, this.id, this.note, this.complete);
@felangel
felangel / entities.dart
Created Aug 4, 2019
[flutter_firestore_todos] entities barrel
View entities.dart
export 'todo_entity.dart';
@felangel
felangel / todos_repository.dart
Created Aug 4, 2019
[flutter_firestore_todos] todos_repository root
View todos_repository.dart
library todos_repository;
export 'src/firebase_todos_repository.dart';
export 'src/models/models.dart';
export 'src/todos_repository.dart';
@felangel
felangel / pubspec.yaml
Created Aug 4, 2019
[flutter_firestore_todos] pubspec
View pubspec.yaml
name: todos_repository
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
You can’t perform that action at this time.