24 lines
759 B
Dart
24 lines
759 B
Dart
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||
|
|
import 'package:dartz/dartz.dart';
|
||
|
|
|
||
|
|
import '../../common/api/api_failure.dart';
|
||
|
|
|
||
|
|
part 'auth.freezed.dart';
|
||
|
|
|
||
|
|
part 'entities/check_phone_entity.dart';
|
||
|
|
part 'failures/auth_failure.dart';
|
||
|
|
part 'repositories/i_auth_repository.dart';
|
||
|
|
|
||
|
|
enum CheckPhoneStatus { notRegistered, passwordRequired, unknown }
|
||
|
|
|
||
|
|
extension CheckPhoneStatusX on CheckPhoneStatus {
|
||
|
|
String toStringType() => switch (this) {
|
||
|
|
CheckPhoneStatus.notRegistered => 'NOT_REGISTERED',
|
||
|
|
CheckPhoneStatus.passwordRequired => 'PASSWORD_REQUIRED',
|
||
|
|
CheckPhoneStatus.unknown => '',
|
||
|
|
};
|
||
|
|
|
||
|
|
bool get isNotRegistered => this == CheckPhoneStatus.notRegistered;
|
||
|
|
bool get isPasswordRequired => this == CheckPhoneStatus.passwordRequired;
|
||
|
|
}
|