diff --git a/assets/logos/fcscDark.png b/assets/logos/fcscDark.png new file mode 100644 index 00000000..f01097d5 Binary files /dev/null and b/assets/logos/fcscDark.png differ diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index f2d04081..0fc700c6 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -1137,134 +1137,203 @@ class _BaseScaffoldState extends ConsumerState { Expanded( child: ListView( children: [ + // DrawerHeader( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // crossAxisAlignment: CrossAxisAlignment.stretch, + // children: [ + // Row( + // children: [ + // SizedBox( + // width: mywidth / 8, + // child: Image( + // image: AssetImage('assets/logos/fcsc.png'), + // ), + // ), + // ], + // ), + // Divider(thickness: 1, color: Colors.grey), + // InkWell( + // onTap: () { + // if (userId != 'guest') context.go('/editProfile'); + // }, + // child: Row( + // children: [ + // SizedBox( + // width: mywidth / 8, + // height: mywidth / 8, + // child: ClipOval( + // child: _avatarUrl.isNotEmpty + // ? Image( + // image: NetworkImage(_avatarUrl), + // fit: BoxFit.cover, + // width: double.infinity, + // height: double.infinity, + // ) + // : Image( + // image: AssetImage( + // 'assets/edit_profile/profile.jpg', + // ), + // fit: BoxFit.cover, + // width: double.infinity, + // height: double.infinity, + // ), + // ), + // //child: Image(image: AssetImage('assets/edit_profile/profile.png')) + // ), + // SizedBox( + // width: mywidth / 20, + // ), + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // if (userId == "guest") ...[ + // Text( + // userName ?? 'Guest User', + // style: TextStyle( + // color: isDarkTheme + // ? Color(0xFFAAAAAA) + // : null, + // ), + // ), + // ] else ...[ + // Text( + // userName ?? 'Loading...', + // style: TextStyle( + // color: isDarkTheme + // ? Color(0xFFAAAAAA) + // : null, + // ), + // ), + // Tooltip( + // message: userEmail ?? + // 'Loading...', // Shows full email on hover + // child: SizedBox( + // width: MediaQuery.of(context) + // .size + // .width * + // 0.6, // Adjust width as needed + // child: Text( + // userEmail ?? 'Loading...', + // style: TextStyle( + // fontSize: 12, + // color: isDarkTheme + // ? Color(0xFFAAAAAA) + // : null, + // fontFamily: context.translate( + // 'Roboto', + // 'NotoKufi', + // ), + // ), + // // softWrap: true, + // overflow: TextOverflow.ellipsis, + // maxLines: 1, + // ), + // ), + // ), + // ], + // ], + // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ), DrawerHeader( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Row( + child: LayoutBuilder( + builder: (context, constraints) { + final width = constraints.maxWidth; + final avatarSize = + width < 600 ? 50.0 : 60.0; // adjust for iPad/tablet + final spacing = width < 600 ? 8.0 : 12.0; + + return Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - SizedBox( - width: mywidth / 8, - child: Image( - image: AssetImage('assets/logos/fcsc.png'), + Row( + children: [ + SizedBox( + width: + avatarSize, // fixed size instead of mywidth / 8 + child: isDarkTheme + ? Image.asset('assets/logos/fcscDark.png') + : Image.asset('assets/logos/fcsc.png'), + ), + ], + ), + Divider(thickness: 1, color: Colors.grey), + InkWell( + onTap: () { + if (userId != 'guest') + context.go('/editProfile'); + }, + child: Row( + children: [ + ClipOval( + child: _avatarUrl.isNotEmpty + ? Image.network( + _avatarUrl, + fit: BoxFit.cover, + width: avatarSize, + height: avatarSize, + ) + : Image.asset( + 'assets/edit_profile/profile.jpg', + fit: BoxFit.cover, + width: avatarSize, + height: avatarSize, + ), + ), + SizedBox(width: spacing), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + userName ?? + (userId == "guest" + ? 'Guest User' + : 'Loading...'), + style: TextStyle( + color: isDarkTheme + ? Color(0xFFAAAAAA) + : null, + ), + ), + if (userId != "guest") + Tooltip( + message: userEmail ?? 'Loading...', + child: Text( + userEmail ?? 'Loading...', + style: TextStyle( + fontSize: 12, + color: isDarkTheme + ? Color(0xFFAAAAAA) + : null, + fontFamily: context.translate( + 'Roboto', 'NotoKufi'), + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + ], + ), + ), + ], ), ), ], - ), - Divider(thickness: 1, color: Colors.grey), - InkWell( - onTap: () { - if (userId != 'guest') context.go('/editProfile'); - }, - child: Row( - children: [ - SizedBox( - width: mywidth / 8, - height: mywidth / 8, - child: ClipOval( - child: _avatarUrl.isNotEmpty - ? Image( - image: NetworkImage(_avatarUrl), - fit: BoxFit.cover, - width: double.infinity, - height: double.infinity, - ) - : Image( - image: AssetImage( - 'assets/edit_profile/profile.jpg', - ), - fit: BoxFit.cover, - width: double.infinity, - height: double.infinity, - ), - ), - //child: Image(image: AssetImage('assets/edit_profile/profile.png')) - ), - SizedBox( - width: mywidth / 20, - ), - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // // Text(userId ?? 'Loading user...'), // Display userId here - // // Text('Mohammad@fcsc.com') - // if (userId == "guest") ...[ - // Text(userName ?? 'Guest User'), - // ] else ...[ - // Text(userName ?? 'Loading...'), - // Tooltip( - // message: userEmail ?? 'Loading...', - // child: Text( - // userEmail ?? 'Loading...', - // style: TextStyle(fontSize: 12), - // softWrap: true, - // maxLines: 1, - // overflow: TextOverflow.ellipsis, - // ), - // ), - // - // ] - // ], - // ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (userId == "guest") ...[ - Text( - userName ?? 'Guest User', - style: TextStyle( - color: isDarkTheme - ? Color(0xFFAAAAAA) - : null, - ), - ), - ] else ...[ - Text( - userName ?? 'Loading...', - style: TextStyle( - color: isDarkTheme - ? Color(0xFFAAAAAA) - : null, - ), - ), - Tooltip( - message: userEmail ?? - 'Loading...', // Shows full email on hover - child: SizedBox( - width: MediaQuery.of(context) - .size - .width * - 0.6, // Adjust width as needed - child: Text( - userEmail ?? 'Loading...', - style: TextStyle( - fontSize: 12, - color: isDarkTheme - ? Color(0xFFAAAAAA) - : null, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - ), - // softWrap: true, - overflow: TextOverflow.ellipsis, - maxLines: 1, - ), - ), - ), - ], - ], - ), - ), - ], - ), - ), - ], + ); + }, ), ), + if (userId != 'guest') ListTile( leading: Icon(Icons.notifications_none,