bloc
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export 'my_user_entity.dart';
|
||||
@@ -0,0 +1,46 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class MyUserEntity extends Equatable {
|
||||
final String id;
|
||||
final String email;
|
||||
final String name;
|
||||
final String? picture;
|
||||
|
||||
const MyUserEntity({
|
||||
required this.id,
|
||||
required this.email,
|
||||
required this.name,
|
||||
this.picture,
|
||||
});
|
||||
|
||||
Map<String, Object?> toDocument() {
|
||||
return {
|
||||
'id': id,
|
||||
'email': email,
|
||||
'name': name,
|
||||
'picture': picture,
|
||||
};
|
||||
}
|
||||
|
||||
static MyUserEntity fromDocument(Map<String, dynamic> doc) {
|
||||
return MyUserEntity(
|
||||
id: doc['id'] as String,
|
||||
email: doc['email'] as String,
|
||||
name: doc['name'] as String,
|
||||
picture: doc['picture'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, email, name, picture];
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '''UserEntity {
|
||||
id: $id
|
||||
email: $email
|
||||
name: $name
|
||||
picture: $picture
|
||||
}''';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user