custom_drawe_changes

This commit is contained in:
venbaittech 2025-10-17 15:31:50 +05:30
parent 26cf708671
commit dc48fa6c00
2 changed files with 190 additions and 121 deletions

BIN
assets/logos/fcscDark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -1137,106 +1137,177 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
Expanded( Expanded(
child: ListView( child: ListView(
children: [ 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( DrawerHeader(
child: Column( 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, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Row( Row(
children: [ children: [
SizedBox( SizedBox(
width: mywidth / 8, width:
child: Image( avatarSize, // fixed size instead of mywidth / 8
image: AssetImage('assets/logos/fcsc.png'), child: isDarkTheme
), ? Image.asset('assets/logos/fcscDark.png')
: Image.asset('assets/logos/fcsc.png'),
), ),
], ],
), ),
Divider(thickness: 1, color: Colors.grey), Divider(thickness: 1, color: Colors.grey),
InkWell( InkWell(
onTap: () { onTap: () {
if (userId != 'guest') context.go('/editProfile'); if (userId != 'guest')
context.go('/editProfile');
}, },
child: Row( child: Row(
children: [ children: [
SizedBox( ClipOval(
width: mywidth / 8,
height: mywidth / 8,
child: ClipOval(
child: _avatarUrl.isNotEmpty child: _avatarUrl.isNotEmpty
? Image( ? Image.network(
image: NetworkImage(_avatarUrl), _avatarUrl,
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: avatarSize,
height: double.infinity, height: avatarSize,
) )
: Image( : Image.asset(
image: AssetImage(
'assets/edit_profile/profile.jpg', 'assets/edit_profile/profile.jpg',
),
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: avatarSize,
height: double.infinity, height: avatarSize,
), ),
), ),
//child: Image(image: AssetImage('assets/edit_profile/profile.png')) SizedBox(width: spacing),
),
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( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
if (userId == "guest") ...[
Text( Text(
userName ?? 'Guest User', userName ??
style: TextStyle( (userId == "guest"
color: isDarkTheme ? 'Guest User'
? Color(0xFFAAAAAA) : 'Loading...'),
: null,
),
),
] else ...[
Text(
userName ?? 'Loading...',
style: TextStyle( style: TextStyle(
color: isDarkTheme color: isDarkTheme
? Color(0xFFAAAAAA) ? Color(0xFFAAAAAA)
: null, : null,
), ),
), ),
if (userId != "guest")
Tooltip( Tooltip(
message: userEmail ?? message: userEmail ?? 'Loading...',
'Loading...', // Shows full email on hover
child: SizedBox(
width: MediaQuery.of(context)
.size
.width *
0.6, // Adjust width as needed
child: Text( child: Text(
userEmail ?? 'Loading...', userEmail ?? 'Loading...',
style: TextStyle( style: TextStyle(
@ -1245,17 +1316,12 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
? Color(0xFFAAAAAA) ? Color(0xFFAAAAAA)
: null, : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto', 'NotoKufi'),
'NotoKufi',
), ),
),
// softWrap: true,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
), ),
), ),
),
],
], ],
), ),
), ),
@ -1263,8 +1329,11 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
), ),
), ),
], ],
);
},
), ),
), ),
if (userId != 'guest') if (userId != 'guest')
ListTile( ListTile(
leading: Icon(Icons.notifications_none, leading: Icon(Icons.notifications_none,