Skip to content

Instantly share code, notes, and snippets.

@Cheersupzoo
Last active July 14, 2020 16:53
Show Gist options
  • Save Cheersupzoo/398bff13ed7ce3aa9a7da71b244afd91 to your computer and use it in GitHub Desktop.
Save Cheersupzoo/398bff13ed7ce3aa9a7da71b244afd91 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 TodosEvent extends Equatable {
TodosEvent([List props = const <dynamic>[]]) : super();
@override
List<Object> get props => [];
}
class LoadTodos extends TodosEvent {
@override
String toString() {
return 'LoadTodos';
}
}
class AddTodos extends TodosEvent {
final TodoModel todo;
AddTodos(this.todo) : super([todo]);
@override
String toString() => 'AddTodos { todo: $todo }';
}
class UpdateTodos extends TodosEvent {
final TodoModel updateTodo;
UpdateTodos(this.updateTodo) : super([updateTodo]);
@override
String toString() => 'UpdateTodos { updateTodo: $updateTodo }';
}
class DeleteTodos extends TodosEvent {
final TodoModel deleteTodo;
DeleteTodos(this.deleteTodo) : super([deleteTodo]);
@override
String toString() => 'DeleteTodos { deleteTodo: $deleteTodo }';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment