drawer update
This commit is contained in:
parent
9768e4c882
commit
a90782a48b
@ -183,10 +183,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
_isLoading = true; // Start loading
|
||||
});
|
||||
final XFile? pickedFile =
|
||||
await _picker.pickImage(source: ImageSource.gallery);
|
||||
await _picker.pickImage(source: ImageSource.gallery);
|
||||
if (pickedFile != null) {
|
||||
final String fileExtension =
|
||||
pickedFile.path.split('.').last.toLowerCase();
|
||||
pickedFile.path.split('.').last.toLowerCase();
|
||||
if (fileExtension == 'jpg' ||
|
||||
fileExtension == 'jpeg' ||
|
||||
fileExtension == 'png' ||
|
||||
@ -320,7 +320,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
|
||||
// Create a multipart request
|
||||
final uri =
|
||||
Uri.parse('${_pb.baseUrl}/api/collections/users/records/$userID');
|
||||
Uri.parse('${_pb.baseUrl}/api/collections/users/records/$userID');
|
||||
final request = http.MultipartRequest('PATCH', uri);
|
||||
|
||||
// Add other fields
|
||||
@ -531,7 +531,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
backgroundImage: _profileImage != null
|
||||
? FileImage(_profileImage!)
|
||||
: AssetImage("assets/edit_profile/profile.png")
|
||||
as ImageProvider,
|
||||
as ImageProvider,
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: GestureDetector(
|
||||
@ -555,7 +555,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<Color>(Colors.grey),
|
||||
AlwaysStoppedAnimation<Color>(Colors.grey),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -707,7 +707,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
width: 45,
|
||||
padding: EdgeInsets.only(right: 1),
|
||||
alignment:
|
||||
Alignment.center, // Center the icon vertically
|
||||
Alignment.center, // Center the icon vertically
|
||||
child: Icon(
|
||||
Icons.keyboard_arrow_down_sharp,
|
||||
color: _isHoveringDate ? Colors.black : Colors.grey,
|
||||
@ -755,12 +755,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
),
|
||||
icon: Icon(Icons.keyboard_arrow_down_sharp,
|
||||
color:
|
||||
_isHoveringDropdown ? Colors.black : Colors.grey),
|
||||
_isHoveringDropdown ? Colors.black : Colors.grey),
|
||||
items: _countries
|
||||
.map((item) => DropdownMenuItem<String>(
|
||||
value: item,
|
||||
child: Text(item),
|
||||
))
|
||||
value: item,
|
||||
child: Text(item),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
@ -783,7 +783,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
},
|
||||
side: BorderSide(
|
||||
color:
|
||||
showError ? Color(0xFFb22222) : Color(0xFF7296BE),
|
||||
showError ? Color(0xFFb22222) : Color(0xFF7296BE),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
@ -909,7 +909,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
} else {
|
||||
setState(() {
|
||||
showError =
|
||||
!isChecked; // Show error if the checkbox is not checked
|
||||
!isChecked; // Show error if the checkbox is not checked
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -922,7 +922,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center, // Center the content
|
||||
MainAxisAlignment.center, // Center the content
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.save,
|
||||
@ -981,7 +981,7 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
TextSpan(
|
||||
text: "Name",
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.w700), // Bold for "name"
|
||||
TextStyle(fontWeight: FontWeight.w700), // Bold for "name"
|
||||
),
|
||||
TextSpan(
|
||||
text: " or ",
|
||||
|
||||
@ -661,13 +661,27 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
leadingWidth: widget.showBackButton ? mywidth * 0.25 : null,
|
||||
bottom: widget.showDivider
|
||||
? PreferredSize(
|
||||
preferredSize: Size.fromHeight(1), // Height of the line
|
||||
child: Container(
|
||||
color: widget.dividerColor, // Line color
|
||||
height: 1, // Line thickness
|
||||
),
|
||||
)
|
||||
preferredSize: Size.fromHeight(1), // Height of the line
|
||||
child: Container(
|
||||
color: widget.dividerColor, // Line color
|
||||
width: MediaQuery.of(context).size.width, // Ensures full width
|
||||
height: 1, // Line thickness
|
||||
margin: EdgeInsets.zero, // Ensure no extra margins
|
||||
padding: EdgeInsets.zero, // Remove padding if any
|
||||
),
|
||||
)
|
||||
: null,
|
||||
|
||||
// bottom: widget.showDivider
|
||||
// ? PreferredSize(
|
||||
// preferredSize: Size.fromHeight(1), // Height of the line
|
||||
// child: Container(
|
||||
// color: widget.dividerColor,
|
||||
// width: double.infinity,// Line color
|
||||
// height: 1, // Line thickness
|
||||
// ),
|
||||
// )
|
||||
// : null,
|
||||
actions: widget.actions ??
|
||||
[
|
||||
// IconButton(
|
||||
@ -755,7 +769,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
Divider(thickness: 1, color: Colors.grey),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (userId != 'guest') context.go('/editProfile');
|
||||
@ -813,7 +827,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
ListTile(
|
||||
leading: Icon(Icons.notifications_none),
|
||||
title: const Text('Notification'),
|
||||
onTap: () => context.go('/notification'),
|
||||
onTap: () => _navigateTo(context, '/notification'),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.message_outlined),
|
||||
@ -825,7 +839,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
// ),
|
||||
// title: const Text('Feedback'),
|
||||
title: Text(AppLocalizations.of(context)!.feedback_title),
|
||||
onTap: () => context.go('/feedback', extra: userName),
|
||||
onTap: () => _navigateTo(context, '/feedback', extra: userName),
|
||||
),
|
||||
if (role == 'admin')
|
||||
ListTile(
|
||||
@ -840,7 +854,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.manage_user,
|
||||
),
|
||||
onTap: () => context.go('/manageuser'),
|
||||
onTap: () => _navigateTo(context, '/manageuser'),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.bookmarks_outlined),
|
||||
@ -848,7 +862,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.bookmark_title,
|
||||
),
|
||||
onTap: () => context.go('/bookmark'),
|
||||
onTap: () => _navigateTo(context, '/bookmark'),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.menu_book_outlined),
|
||||
@ -860,7 +874,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
// ),
|
||||
// title: const Text('User Guide'),
|
||||
title: Text(AppLocalizations.of(context)!.guide_title),
|
||||
onTap: () => context.go('/user-guide'),
|
||||
onTap: () => _navigateTo(context, '/user-guide'),
|
||||
),
|
||||
if (userId != 'guest')
|
||||
ListTile(
|
||||
@ -1000,6 +1014,11 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
body: widget.body,
|
||||
);
|
||||
}
|
||||
//drawer close code
|
||||
void _navigateTo(BuildContext context, String route, {Object? extra}) {
|
||||
Navigator.pop(context); // Close the drawer
|
||||
context.go(route, extra: extra); // Navigate with extra data
|
||||
}
|
||||
|
||||
int _getSelectedIndex(String route) {
|
||||
switch (route) {
|
||||
|
||||
@ -1002,7 +1002,7 @@ packages:
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
path_provider:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
|
||||
|
||||
@ -25,6 +25,7 @@ dependencies:
|
||||
iconify_design: ^1.0.1
|
||||
marquee: ^2.2.3
|
||||
url_launcher: ^6.3.1
|
||||
path_provider: ^2.1.5
|
||||
# dynamic_layouts:
|
||||
# git:
|
||||
# url: https://github.com/flutter/packages.git
|
||||
|
||||
Loading…
Reference in New Issue
Block a user