Form

Overview

Forms are used for submitting data so be as concise as possible when designing. Keep it short. Think about each field and what value the data will provide. What do you gain by collecting this information?

Widget API

Example

CForm(
  type: CFormType.blank,
  action: CButton(
    label: 'Action Button',
    onTap: () {},
    icon: Icon(CIcons.add, size: 16),
    ),
    children: [
      CTextField(label: 'Label', description: 'Description'),
      const SizedBox(height: 16),
      CTextField(
        label: 'Label',
        description: 'Description',
        validator: (value) {
          return CValidationResult(
            kind: CValidationKind.error,
            message: 'Your input is incorrect',
          );
        },
      ),
    ],
);

Last updated