FlutstrapFormGroup constructor

const FlutstrapFormGroup({
  1. Key? key,
  2. required List<Widget> children,
  3. String? label,
  4. String? helperText,
  5. String? validationMessage,
  6. bool showValidation = false,
  7. bool isValid = true,
  8. bool required = false,
  9. FSFormGroupLayout layout = FSFormGroupLayout.vertical,
  10. FSFormGroupSize size = FSFormGroupSize.md,
  11. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start,
  12. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
  13. double spacing = 16.0,
  14. bool showLabel = true,
  15. Widget? customLabel,
  16. FSFormGroupState state = FSFormGroupState.valid,
})

Implementation

const FlutstrapFormGroup({
  super.key,
  required this.children,
  this.label,
  this.helperText,
  this.validationMessage,
  this.showValidation = false,
  this.isValid = true,
  this.required = false,
  this.layout = FSFormGroupLayout.vertical,
  this.size = FSFormGroupSize.md,
  this.crossAxisAlignment = CrossAxisAlignment.start,
  this.mainAxisAlignment = MainAxisAlignment.start,
  this.spacing = 16.0,
  this.showLabel = true,
  this.customLabel,
  this.state = FSFormGroupState.valid,
}) :
      // ✅ FIXED: Only use compile-time constants in constructor
      assert(spacing >= 0, 'Spacing must be non-negative');