Library for manage general use cases.

Using

For use use cases


import 'package:base_domain/base_domain.dart';

mixin UsersRepository on GetAllRepository<User> {}

mixin UsersUseCase on GetAllUseCase<User>, SaveUseCase<User, User> {}

class UsersUseCaseAdapter
    with GetAllUseCaseAdapter<User>, SaveUseCaseAdapter<User, User>
    implements UsersUseCase {
  final UsersRepository repository;

  UsersUseCaseAdapter(this.repository);

  @override
  List<Rule<User>> get rules => [
        cannotBeNull((user) => user.name, 'name', 'Name can not be null'),
        cannotBeNull((user) => user.lastname, 'lastname', 'Lastname can not be null'),
      ];
}

Libraries

base_domain
delete_by_id_use_case
get_all_use_case
get_by_id_use_case
repository
rule
rules_factory
save_in_storage_use_case
save_use_case
simple_get_use_case
simple_stream_use_case
stream_all_use_case
stream_by_id_use_case
update_use_case
validator