form_field_row.dart 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import 'package:flutter/material.dart';
  2. import '../../core/theme/app_colors.dart';
  3. class FormFieldRow extends StatelessWidget {
  4. final String label;
  5. final String? value;
  6. final String? hint;
  7. final VoidCallback? onTap;
  8. final bool showArrow;
  9. const FormFieldRow({
  10. super.key,
  11. required this.label,
  12. this.value,
  13. this.hint,
  14. this.onTap,
  15. this.showArrow = true,
  16. });
  17. @override
  18. Widget build(BuildContext context) {
  19. return InkWell(
  20. onTap: onTap,
  21. child: Container(
  22. padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
  23. decoration: const BoxDecoration(
  24. border: Border(
  25. bottom: BorderSide(color: Color(0xFFF9F9F9), width: 0.5),
  26. ),
  27. ),
  28. child: Row(
  29. children: [
  30. SizedBox(
  31. width: 72,
  32. child: Text(
  33. label,
  34. style: const TextStyle(
  35. color: AppColors.textSecondary,
  36. fontSize: 13,
  37. ),
  38. ),
  39. ),
  40. Expanded(
  41. child: Text(
  42. value ?? hint ?? '',
  43. textAlign: TextAlign.right,
  44. style: TextStyle(
  45. color: value != null
  46. ? AppColors.textPrimary
  47. : AppColors.textHint,
  48. fontSize: 13,
  49. ),
  50. ),
  51. ),
  52. if (showArrow) ...[
  53. const SizedBox(width: 4),
  54. const Icon(
  55. Icons.chevron_right,
  56. size: 18,
  57. color: AppColors.textHint,
  58. ),
  59. ],
  60. ],
  61. ),
  62. ),
  63. );
  64. }
  65. }