travel_agent_remarks_access

This commit is contained in:
venbaittech 2025-10-29 12:34:19 +05:30
parent 816d8b1bf1
commit 08ac38a64b
3 changed files with 87 additions and 57 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -578,6 +578,15 @@ class TemplateForexState extends State<TemplateForex> {
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<TemplateForex> {
// 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,9 +959,13 @@ class TemplateForexState extends State<TemplateForex> {
),
),
),
SizedBox(height: 4),
SizedBox(height: 2),
Container(
child: Row(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
// mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
@ -1001,6 +1014,22 @@ class TemplateForexState extends State<TemplateForex> {
),
],
),
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,
),
),
),
],
),
),
],
);

View File

@ -77,13 +77,14 @@ class CommentModalState extends State<CommentModal> {
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')) {
// if (role != null && (role == 'Org Admin' || role == 'Travel Admin' || role == )) {
final data = await getRemarks(userId);
setState(() {
@ -93,9 +94,9 @@ class CommentModalState extends State<CommentModal> {
});
print("Remarks -");
print("Remarks - ${jsonEncode(remarksData)}");
} else {
apiService.logout(context);
}
// } else {
// apiService.logout(context);
// }
} catch (e) {
setState(() {
errorMessage = e.toString();