Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ida631 committed Nov 27, 2024
1 parent b9ff4c0 commit edff9b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/presentation/settings/viewModels/login_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class LoginViewModel extends ChangeNotifier {
if (!isValid) {
throw Exception('Google token validation failed.');
}

// Sync the user data
await syncUser(user.displayName, user.email, user.photoUrl);
}
Expand Down
7 changes: 6 additions & 1 deletion lib/presentation/settings/views/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ class _SettingsPageState extends State<SettingsPage> {
if (viewModel.isLoggedIn)
ListTile(
key: ValueKey(viewModel.user?.name ?? ""),
leading: Icon(
leading: viewModel.user?.avatarUrl != null
? CircleAvatar(
backgroundImage: NetworkImage(viewModel.user!.avatarUrl!),
radius: 22.5, // Adjust the radius to match the icon size
)
: Icon(
Icons.account_circle,
size: 45,
color: Colors.blueGrey,
Expand Down
7 changes: 6 additions & 1 deletion lib/presentation/settings/views/user_profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ class UserProfilePage extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(
viewModel.user?.avatarUrl != null
? CircleAvatar(
backgroundImage: NetworkImage(viewModel.user!.avatarUrl!),
radius: 27.5, // Matches size of 55
)
: Icon(
Icons.account_circle,
size: 55,
color: Colors.blueGrey,
Expand Down

0 comments on commit edff9b8

Please sign in to comment.