Skip to content

Instantly share code, notes, and snippets.

@Cheersupzoo
Last active July 14, 2020 16:52
Show Gist options
  • Save Cheersupzoo/5a276ab6d08f41ab06e7abf03094d975 to your computer and use it in GitHub Desktop.
Save Cheersupzoo/5a276ab6d08f41ab06e7abf03094d975 to your computer and use it in GitHub Desktop.
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';
import 'package:simple_todos_bloc/models/models.dart';
@immutable
abstract class TodosState extends Equatable {
TodosState([List props = const []]) : super();
@override
List<Object> get props => [];
}
class TodosLoading extends TodosState {
@override
String toString() => 'TodosLoading';
}
class TodosLoaded extends TodosState {
final List<TodoModel> todos;
TodosLoaded([this.todos = const []]) : super([todos]);
@override
String toString() {
return 'TodosLoaded { todos : $todos }';
}
@override
List<Object> get props => [todos];
}
class TodosNotLoaded extends TodosState {
@override
String toString() => 'TodosNotLoaded';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment