DeleterDataSource<Type, Param> class
abstract
Implement this abstract in your data source if it can perform data deletion. Note that 1 class can implements from multiple abstracts.
class SessionDataSource implements DeleterDataSource<Unit, Unit> {
final HttpClient client;
const SessionDataSource({required this.client});
/// Use unit to represent void
@override
FutureOr<Unit> delete({Unit params = unit}) async {
/// Perform sign out
}
}
Instead of throwing an exception, you should return Left instead.
P.S. Signing out means deleting session. Therefore, deleter data source.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
{required Param param}) → FutureOr< Type> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited