use_in_case 1.4.0 copy "use_in_case: ^1.4.0" to clipboard
use_in_case: ^1.4.0 copied to clipboard

Have you ever tried to follow a clean-architecture approach in your Project? If so, you probably have a lot of UseCases. This package will help you to use them in a more readable way. It's a simple pa [...]

example/use_in_case.dart

// Define an interactor that does something. He must extend/implement a type mentioned above.
import 'package:use_in_case/use_in_case.dart';

final class StringToIntConverter
    implements ParameterizedResultInteractor<String, int> {
  @override
  Future<int> getOrThrow(String input) async {
    return int.parse(input);
  }
}

void main() async {
  final interactor = StringToIntConverter();
  final result = await interactor.getOrThrow('42');
  print(result); // 42
}
3
likes
0
points
144
downloads

Publisher

unverified uploader

Weekly Downloads

Have you ever tried to follow a clean-architecture approach in your Project? If so, you probably have a lot of UseCases. This package will help you to use them in a more readable way. It's a simple package that provides a set of classes and functions to help you configuring your UseCases in a more flexible and readable way. It is designed to be used in combination with Business-Logic-Components (BLoC).

Repository (GitHub)
View/report issues

Topics

#dart #flutter #bloc #utility #clean-architecture

License

unknown (license)

Dependencies

dartz

More

Packages that depend on use_in_case