Task class
A task entity class of Todo feature
This class provides all the functionalities of the entity itself. If the app needs a functionality that is not for the entity itself, it should be served by TodoService.
A task can be assigned to muliple users. To assign a task to a user, use assignTo method.
Constructors
-
Task({required String id, required String title, String content = '', required DateTime createdAt, required DateTime updatedAt, DateTime? startAt, DateTime? endAt, List<
String> assignTo = const []}) -
Task.fromJson(Map<
String, dynamic> json, String id) -
factory
-
Task.fromSnapshot(DocumentSnapshot<
Object?> snapshot) -
factory
Properties
-
assignTo
↔ List<
String> -
getter/setter pair
- content ↔ String
-
getter/setter pair
- createdAt ↔ DateTime
-
getter/setter pair
- endAt ↔ DateTime?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String
-
getter/setter pair
-
ref
→ DocumentReference<
Object?> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startAt ↔ DateTime?
-
getter/setter pair
- title ↔ String
-
getter/setter pair
- updatedAt ↔ DateTime
-
getter/setter pair
Methods
-
delete(
) → Future< void> - Delete a field to a doc of task Delete task including all the related assigns and data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
{String? title, String? content, DateTime? startAt, DateTime? endAt}) → Future< void> - Update task
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited