formio library
Entry point for the flutter_formio package.
Flutter widgets for rendering Form.io forms with full feature parity. This package provides UI components and relies on formio_api for business logic.
Example usage:
import 'package:formio/formio.dart';
void main() {
// Initialize JS evaluator for calculations
JavaScriptEvaluator.setEvaluator(FlutterJsEvaluator());
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: FormRenderer(
form: myForm,
onSubmit: (data) => print('Submitted: $data'),
),
),
);
}
}
Classes
- ActionModel
- ActionService
- AddressComponent
- AlertComponent
- ApiClient
- ApiEndpoints
- AppConstants
- AuthService
- ButtonComponent
- CalculationEvaluator
- CaptchaComponent
- CheckboxComponent
- ColumnsComponent
- ComponentFactory
- ComponentModel
- ConditionalEvaluator
- ContainerComponent
- ContentComponent
- CurrencyComponent
- CustomComponent
- DataGridComponent
- DataMapComponent
- DataSourceComponent
- DataSourceService
- Service for handling DataSource component data fetching.
- DataTableComponent
- DateComponent
- DateTimeComponent
- DayComponent
- DefaultFormioLocale
- Default English implementation of FormioLocale.
- DefaultFormioLocalizations
- Default English implementation of FormioLocalizations.
- DrawingPoint
- DynamicWizardComponent
- EditGridComponent
- EmailComponent
- FieldSetComponent
- FileComponent
- FileData
- FlutterJsEvaluator
- Flutter implementation of JsEvaluator using flutter_js package.
- FormComponent
- FormioComponentBuildContext
- Configuration for building a Form.io component widget.
- FormioComponentBuilder
- Base interface for all Form.io component builders.
- FormioLocale
- Abstract class that defines all localizable strings for Form.io components.
- FormioLocalizations
- Abstract class that defines all localizable strings for Form.io components.
- FormioUtils
- A set of utility functions used throughout the Form.io API integration.
- FormioValidators
- FormModel
- FormRenderer
- FormService
- FunctionComponentBuilder
- A function-based implementation of FormioComponentBuilder.
- HiddenComponent
- HtmlElementComponent
- InterpolationUtils
- Utility for interpolating Form.io style {{data.key}} patterns.
- JavaScriptEvaluator
- Global JavaScript evaluator singleton.
- JsEvaluator
- Abstract interface for evaluating JavaScript code.
- NestedFormComponent
- NoOpJsEvaluator
- A no-op JavaScript evaluator that always returns null.
- NumberComponent
- PanelComponent
- PasswordComponent
- PhoneNumberComponent
- RadioComponent
- ReviewPageComponent
- RoleModel
- SelectBoxesComponent
- SelectComponent
- SignatureComponent
- SketchpadComponent
- SubmissionModel
- SubmissionService
- SurveyComponent
- TableComponent
- TabsComponent
- TagpadComponent
- TagsComponent
- TemplateParser
- TextFieldComponent
- TimeComponent
- UnknownComponent
- UrlComponent
- UserModel
- UserService
- WellComponent
- WizardConfig
Enums
- ButtonAction
- Defines the type of action the button performs.
Typedefs
- CustomComponentBuilder = Widget Function(ComponentModel component, dynamic value, ValueChanged onChanged)
-
DataSourceCallback
= Future Function({dynamic body, Map<
String, String> ? headers, required String method, required String url}) - Callback for fetching data from external sources (APIs, databases, etc.)
-
DatePickerCallback
= Future<
DateTime?> Function({required DateTime firstDate, required DateTime initialDate, required DateTime lastDate}) - Callback for custom date picker implementations.
-
DateTimePickerCallback
= Future<
DateTime?> Function({required DateTime firstDate, required DateTime initialDateTime, required DateTime lastDate}) - Callback for custom date-time picker implementations.
-
FilePickerCallback
= Future<
List< Function({required bool allowMultiple, List<FileData> ?>String> ? allowedExtensions}) - Callback type for custom file picker implementations.
-
OnFileChanged
= void Function(List<
FileData> files) - Callback invoked when file value changes.
-
OnFormChanged
= void Function(Map<
String, dynamic> data) - OnFormSubmitFailed = void Function(String error)
-
OnFormSubmitted
= void Function(Map<
String, dynamic> data) -
TimePickerCallback
= Future<
TimeOfDay?> Function({required TimeOfDay initialTime}) - Callback for custom time picker implementations.
Exceptions / Errors
- ApiException
- Base class for all custom API-related errors.
- AuthException
- Raised for general authentication/token-related issues.
- ComponentFormatException
- Raised when a specific component is malformed or unsupported.
- FormParseException
- Raised when a form schema cannot be parsed or converted properly.
- JsEvaluationException
- Exception thrown when JavaScript evaluation fails.
- SubmissionException
- Raised when submission fails due to invalid payload or response.