I've created an interface for my use cases that returns a Future, Is it good approach to have an interface for all use cases?
What if I need a Usecase to return Streams instead of a single return (Future), for example listen to snapshots from Firebase Cloud Firestore collection, should I have two interfaces?
import 'package:equatable/equatable.dart';
import '../errors/failure.dart';
import 'package:dartz/dartz.dart';
abstract class Usecase<Input, Output> {
Future<Either<Failure, Output>> call(Input input);
}
class Input<T> extends Equatable {
final T parameter;
Input(this.parameter);
@override
List<Object?> get props => [parameter];
}
class NoInput extends Equatable {
@override
List<Object?> get props => [];
}