Skip to content

Commit

Permalink
fix(#58): adiciona user name
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielCostaDeOliveira committed Jan 26, 2025
1 parent 3fa496c commit 5bc1efc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/core/network/token_manager/model/user_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ import 'dart:convert';
class UserModel {
final String id;
final String name;
final String userName;
final String email;
final String role;

UserModel({
required this.id,
required this.name,
required this.userName,
required this.email,
required this.role,
});

UserModel.fromMap(Map<String, dynamic> json)
: id = json['userId']! as String,
name = json['name']! as String,
userName = json['username']! as String,
email = json['email']! as String,
role = json['role']! as String;

Expand All @@ -24,6 +27,7 @@ class UserModel {
return UserModel(
id: json['userId']! as String,
name: json['name']! as String,
userName: json['username']! as String,
email: json['email']! as String,
role: json['role']! as String,
);
Expand All @@ -38,4 +42,3 @@ class UserModel {
});
}
}

1 change: 1 addition & 0 deletions lib/ui/edit_profile/view/edit_profile_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class EditProfileScreen extends StatelessWidget {
label: "Nome de Usuário",
controller: userNameController,
padding: const EdgeInsets.symmetric(vertical: 0),
initialText: user?.userName ?? "",
),
const SizedBox(height: 20),
TextEmail(
Expand Down

0 comments on commit 5bc1efc

Please sign in to comment.