Skip to content

Commit

Permalink
bug fixes (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ida631 authored Dec 17, 2024
1 parent e045e61 commit 16d6209
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
47 changes: 38 additions & 9 deletions lib/presentation/chat/views/chat_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,45 @@ class _ChatScreenState extends State<ChatScreen>
setState(() {}); // Rebuild the UI
}
},
child: viewModel.user?.avatarUrl != null
? CircleAvatar(
backgroundImage: NetworkImage(viewModel.user!.avatarUrl!),
radius: 16, // Adjust radius to fit in the app bar
)
: const Icon(
Icons.account_circle,
size: 40,
color: Colors.white,
child: Stack(
alignment: Alignment.topRight, // Align everything to the top-right corner
children: [
// Avatar or default icon
viewModel.user?.avatarUrl != null
? CircleAvatar(
backgroundImage: NetworkImage(viewModel.user!.avatarUrl!),
radius: 20, // Slightly bigger radius for better visuals
)
: const Icon(
Icons.account_circle,
size: 48, // Adjusted size for consistency
color: Colors.white,
),

// Blue verified icon with a white circular background
if (viewModel.user?.isCompositeExpert == true)
Positioned(
right: 0, // Align to the top-right corner
top: 0,
child: Container(
width: 20, // Ensure fixed width
height: 20, // Ensure fixed height
decoration: BoxDecoration(
color: Colors.white, // White background for contrast
shape: BoxShape.circle, // Ensure a perfect circle
),
alignment: Alignment.center, // Center the icon
child: Icon(
Icons.verified,
color: Colors.blue, // Blue verification icon
size: 16, // Size of the icon itself
),
),
),
],
),


),
const SizedBox(width: 8),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/settings/views/forget_password_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class _ForgetPasswordPageState extends State<ForgetPasswordPage> {
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (_) => sl<ForgetPasswordViewModel>(),
create: (_) => sl<ForgetPasswordViewModel>(),//Creates an instance of the ForgetPasswordViewModel using the create function
child: Scaffold(
appBar: AppBar(
title: Text("Reset Password"),
backgroundColor: Color(0xFF33424E),
),
body: Consumer<ForgetPasswordViewModel>(
body: Consumer<ForgetPasswordViewModel>(//widget listens to changes in the ForgetPasswordViewModel
builder: (context, viewModel, child) {
return Padding(
padding: const EdgeInsets.all(16.0),
Expand Down
6 changes: 0 additions & 6 deletions lib/presentation/settings/views/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ class _SettingsPageState extends State<SettingsPage> {
child: ManageCompositeExpertsPage()),
),
);
/*if (result == 'submit') {
await viewModel.fetchAuthSessionNew();
}*/
},
),
if (viewModel.isLoggedIn && !viewModel.isExpert)
Expand All @@ -155,9 +152,6 @@ class _SettingsPageState extends State<SettingsPage> {
builder: (context) => ApplyExpertPage(),
),
);
/*if (result == 'submit') {
await viewModel.fetchAuthSessionNew();
}*/
},
),
MoreRow(
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/settings/views/sigup_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class _SignupFormState extends State<SignupForm> {

@override
Widget build(BuildContext context) {
final viewModel = Provider.of<SignupViewModel>(context);
final viewModel = Provider.of<SignupViewModel>(context); //access an already provided instance of SignupViewModel
return Scaffold(
appBar: AppBar(title: Text('Signup')),
body: SingleChildScrollView(
Expand Down

0 comments on commit 16d6209

Please sign in to comment.