form pro - sin imagenes
This commit is contained in:
@@ -1 +1,2 @@
|
||||
export 'my_user.dart';
|
||||
export 'my_user.dart';
|
||||
export 'pro_state.dart';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
import '../entities/entities.dart';
|
||||
import 'package:user_repository/user_repository.dart';
|
||||
|
||||
class MyUser extends Equatable {
|
||||
final String id;
|
||||
@@ -12,6 +11,7 @@ class MyUser extends Equatable {
|
||||
final String? picture;
|
||||
final String? birthday;
|
||||
final String? gender;
|
||||
final ProState proState;
|
||||
|
||||
const MyUser({
|
||||
required this.id,
|
||||
@@ -23,6 +23,7 @@ class MyUser extends Equatable {
|
||||
this.picture,
|
||||
this.birthday,
|
||||
this.gender,
|
||||
required this.proState,
|
||||
});
|
||||
|
||||
get drawerLabel => email != null && email!.isNotEmpty
|
||||
@@ -42,6 +43,7 @@ class MyUser extends Equatable {
|
||||
picture: '',
|
||||
birthday: '',
|
||||
gender: '',
|
||||
proState: ProState.inactive,
|
||||
);
|
||||
|
||||
/// Modify MyUser parameters
|
||||
@@ -55,6 +57,7 @@ class MyUser extends Equatable {
|
||||
String? picture,
|
||||
String? birthday,
|
||||
String? gender,
|
||||
ProState? proState,
|
||||
}) {
|
||||
return MyUser(
|
||||
id: id ?? this.id,
|
||||
@@ -66,6 +69,7 @@ class MyUser extends Equatable {
|
||||
picture: picture ?? this.picture,
|
||||
birthday: birthday ?? this.birthday,
|
||||
gender: gender ?? this.gender,
|
||||
proState: proState ?? this.proState,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -86,6 +90,7 @@ class MyUser extends Equatable {
|
||||
picture: picture,
|
||||
birthday: birthday,
|
||||
gender: gender,
|
||||
proState: proState,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -100,6 +105,7 @@ class MyUser extends Equatable {
|
||||
picture: entity.picture,
|
||||
birthday: entity.birthday,
|
||||
gender: entity.gender,
|
||||
proState: entity.proState,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -114,5 +120,6 @@ class MyUser extends Equatable {
|
||||
picture,
|
||||
birthday,
|
||||
gender,
|
||||
proState,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
export 'pro_state.dart';
|
||||
|
||||
enum ProState { inactive, pending, active, denied }
|
||||
|
||||
int enumToInt(ProState state) {
|
||||
return state.index;
|
||||
}
|
||||
|
||||
ProState intToEnum(int value) {
|
||||
return ProState.values[value];
|
||||
}
|
||||
Reference in New Issue
Block a user