diff --git a/assets/images/login/sign.png b/assets/images/login/sign.png new file mode 100644 index 0000000..1af185b Binary files /dev/null and b/assets/images/login/sign.png differ diff --git a/lib/Screens/myTemplates/templateForex.dart b/lib/Screens/myTemplates/templateForex.dart index 2d38663..22711db 100644 --- a/lib/Screens/myTemplates/templateForex.dart +++ b/lib/Screens/myTemplates/templateForex.dart @@ -578,6 +578,15 @@ class TemplateForexState extends State { if (pickedFile != null && kIsWeb) { try { + final allowedExtensions = ['jpg', 'jpeg', 'png']; + final fileExtension = pickedFile.name.split('.').last.toLowerCase(); + + if (!allowedExtensions.contains(fileExtension)) { + print('❌ Invalid file type. Please select a JPG or PNG image.'); + + return; + } + final bytes = await pickedFile.readAsBytes(); print('✅ Image loaded, size: ${bytes.length} bytes'); setState(() { @@ -796,7 +805,7 @@ class TemplateForexState extends State { // color: Color(0xFF575A74), // ), // ), - const SizedBox(height: 10), + // const SizedBox(height: 10), Container( color: Color(0xFFFFFEF0), width: isDesktop ? MediaQuery.of(context).size.width * 0.8 : null, @@ -950,54 +959,74 @@ class TemplateForexState extends State { ), ), ), - SizedBox(height: 4), + SizedBox(height: 2), Container( - child: Row( - // mainAxisAlignment: MainAxisAlignment.end, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "Upload Signature", - style: GoogleFonts.poppins(fontSize: 11.5), - ), - SizedBox(width: 5), - GestureDetector( - onTap: _pickImage, + Row( + // mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + "Upload Signature", + style: GoogleFonts.poppins(fontSize: 11.5), + ), + SizedBox(width: 5), + GestureDetector( + onTap: _pickImage, - child: - _imageBytes != null - ? ClipOval( - child: Image.memory( - _imageBytes!, - // width: 50, - // height: 50, - width: 50, // Use responsive width - height: 50, - fit: BoxFit.cover, - ), - ) - : selectedOrglogo != null - ? ClipRect( - child: Image.network( - selectedOrglogo!, - width: 50, // Use responsive width - height: 50, - // width: 250, - // height: 55, - fit: BoxFit.contain, - errorBuilder: (context, error, stackTrace) { - return const CircleAvatar( - radius: 20, - backgroundColor: Colors.redAccent, - child: Icon(Icons.error, size: 10), - ); - }, - ), - ) - : const CircleAvatar( - radius: 20, - backgroundColor: Colors.amber, - child: Icon(Icons.add_a_photo, size: 10), - ), + child: + _imageBytes != null + ? ClipOval( + child: Image.memory( + _imageBytes!, + // width: 50, + // height: 50, + width: 50, // Use responsive width + height: 50, + fit: BoxFit.cover, + ), + ) + : selectedOrglogo != null + ? ClipRect( + child: Image.network( + selectedOrglogo!, + width: 50, // Use responsive width + height: 50, + // width: 250, + // height: 55, + fit: BoxFit.contain, + errorBuilder: (context, error, stackTrace) { + return const CircleAvatar( + radius: 20, + backgroundColor: Colors.redAccent, + child: Icon(Icons.error, size: 10), + ); + }, + ), + ) + : const CircleAvatar( + radius: 20, + backgroundColor: Colors.amber, + child: Icon(Icons.add_a_photo, size: 10), + ), + ), + ], + ), + SizedBox( + // width: 200, + child: Text( + "* Allow types jpg, jpeg, png", + // maxLines: 2, + // softWrap: true, + style: GoogleFonts.poppins( + fontSize: 9, + fontWeight: FontWeight.w400, + + color: Colors.grey, + ), + ), ), ], ), diff --git a/lib/utils/travelAgent_remarks.dart b/lib/utils/travelAgent_remarks.dart index 815d615..f05b391 100644 --- a/lib/utils/travelAgent_remarks.dart +++ b/lib/utils/travelAgent_remarks.dart @@ -77,25 +77,26 @@ class CommentModalState extends State { role = await getRoleUser(); print("Role - $role"); + print("RoleuserId - $userId"); userId = int.tryParse(userIdString); if (userId == null) { throw Exception('Invalid user ID format.'); } - if (role != null && (role == 'Org Admin' || role == 'Travel Admin')) { - final data = await getRemarks(userId); + // if (role != null && (role == 'Org Admin' || role == 'Travel Admin' || role == )) { + final data = await getRemarks(userId); - setState(() { - remarksData = data; + setState(() { + remarksData = data; - isLoading = false; - }); - print("Remarks -"); - print("Remarks - ${jsonEncode(remarksData)}"); - } else { - apiService.logout(context); - } + isLoading = false; + }); + print("Remarks -"); + print("Remarks - ${jsonEncode(remarksData)}"); + // } else { + // apiService.logout(context); + // } } catch (e) { setState(() { errorMessage = e.toString();