Form constructor

const Form({
  1. Key? key,
  2. required Widget child,
  3. bool? canPop,
  4. @Deprecated('Use onPopInvokedWithResult instead. ' 'This feature was deprecated after v3.22.0-12.0.pre.') PopInvokedCallback? onPopInvoked,
  5. PopInvokedWithResultCallback<Object?>? onPopInvokedWithResult,
  6. @Deprecated('Use canPop and/or onPopInvokedWithResult instead. ' 'This feature was deprecated after v3.12.0-1.0.pre.') WillPopCallback? onWillPop,
  7. VoidCallback? onChanged,
  8. AutovalidateMode? autovalidateMode,
})

Creates a container for form fields.

Implementation

const Form({
  super.key,
  required this.child,
  this.canPop,
  @Deprecated(
    'Use onPopInvokedWithResult instead. '
    'This feature was deprecated after v3.22.0-12.0.pre.',
  )
  this.onPopInvoked,
  this.onPopInvokedWithResult,
  @Deprecated(
    'Use canPop and/or onPopInvokedWithResult instead. '
    'This feature was deprecated after v3.12.0-1.0.pre.',
  )
  this.onWillPop,
  this.onChanged,
  AutovalidateMode? autovalidateMode,
}) : autovalidateMode = autovalidateMode ?? AutovalidateMode.disabled,
     assert(onPopInvokedWithResult == null || onPopInvoked == null, 'onPopInvoked is deprecated; use onPopInvokedWithResult'),
     assert(((onPopInvokedWithResult ?? onPopInvoked ?? canPop) == null) || onWillPop == null, 'onWillPop is deprecated; use canPop and/or onPopInvokedWithResult.');