feat: Update image picker section to use dynamic primary color for icons and buttons

This commit is contained in:
Vaibhav Surve 2025-11-03 17:07:15 +05:30
parent c78c14e409
commit 4d3a42e851
2 changed files with 9 additions and 7 deletions

View File

@ -291,6 +291,7 @@ class _ReportActionBottomSheetState extends State<ReportActionBottomSheet>
onUploadTap: () => controller.pickImages(fromCamera: false), onUploadTap: () => controller.pickImages(fromCamera: false),
onRemoveImage: (index) => controller.removeImageAt(index), onRemoveImage: (index) => controller.removeImageAt(index),
isProcessing: controller.isPickingImage.value, isProcessing: controller.isPickingImage.value,
primaryColor: contentTheme.primary,
onPreviewImage: (index) => showDialog( onPreviewImage: (index) => showDialog(
context: context, context: context,
builder: (_) => ImageViewerDialog( builder: (_) => ImageViewerDialog(
@ -389,7 +390,7 @@ class _ReportActionBottomSheetState extends State<ReportActionBottomSheet>
fontWeight: 600, fontWeight: 600,
), ),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Colors.indigo, backgroundColor: contentTheme.primary,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)), borderRadius: BorderRadius.circular(12)),
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),

View File

@ -100,6 +100,7 @@ Widget buildImagePickerSection({
required void Function(int index) onRemoveImage, required void Function(int index) onRemoveImage,
required void Function(int initialIndex) onPreviewImage, required void Function(int initialIndex) onPreviewImage,
required bool isProcessing, // New: show loader while image is being processed required bool isProcessing, // New: show loader while image is being processed
required Color primaryColor,
}) { }) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -203,10 +204,10 @@ Widget buildImagePickerSection({
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Icon(Icons.camera_alt, Icon(Icons.camera_alt,
size: 16, color: Colors.blueAccent), size: 16, color: primaryColor),
MySpacing.width(6), MySpacing.width(6),
MyText.bodySmall('Capture', color: Colors.blueAccent), MyText.bodySmall('Capture', color: primaryColor),
], ],
), ),
), ),
@ -219,10 +220,10 @@ Widget buildImagePickerSection({
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Icon(Icons.upload_file, Icon(Icons.upload_file,
size: 16, color: Colors.blueAccent), size: 16, color: primaryColor),
MySpacing.width(6), MySpacing.width(6),
MyText.bodySmall('Upload', color: Colors.blueAccent), MyText.bodySmall('Upload', color: primaryColor),
], ],
), ),
), ),