mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
Added Login with email model instead of json encode
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import 'package:syncrow_app/features/auth/model/token.dart';
|
||||
|
||||
class UserModel {
|
||||
final String? id;
|
||||
final String? email;
|
||||
@ -43,10 +45,12 @@ class UserModel {
|
||||
}
|
||||
|
||||
//from token
|
||||
factory UserModel.fromToken(Map<String, dynamic> json) {
|
||||
factory UserModel.fromToken(Token token) {
|
||||
Map<String, dynamic> tempJson = token.decodeToken();
|
||||
|
||||
return UserModel(
|
||||
id: json['userId'].toString(),
|
||||
email: json['email'],
|
||||
id: tempJson['userId'].toString(),
|
||||
email: tempJson['email'],
|
||||
name: null,
|
||||
photoUrl: null,
|
||||
phoneNumber: null,
|
||||
|
Reference in New Issue
Block a user