Line data Source code
1 : import 'package:app_pym/core/usecases/usecase.dart';
2 : import 'package:app_pym/data/services/authentication_service.dart';
3 : import 'package:injectable/injectable.dart';
4 :
5 : @prod
6 : @lazySingleton
7 : class AuthSignUp extends Usecase<Future<void>, SignUpCredentials> {
8 : final AuthenticationService service;
9 :
10 0 : const AuthSignUp(this.service);
11 :
12 0 : @override
13 : Future<void> call(SignUpCredentials credentials) {
14 : // No error handling, error will be displayed through BLoC
15 0 : return service.signUp(credentials.email, credentials.password);
16 : }
17 : }
18 :
19 : class SignUpCredentials {
20 : final String email;
21 : final String password;
22 :
23 0 : const SignUpCredentials(this.email, this.password);
24 : }
|