Control class

Inheritance

Constructors

Control({required String key, required ControlType type, Widget? content, String? description, void onChange(dynamic)?, List<Control>? settings, String? title, dynamic value, TextInputType? keyboardType, FormFieldValidator<String>? validator, bool isRequired = true, Widget? prefixIcon, List<TextInputFormatter>? formatInputs})
Control.checkBox({required String key, String? description, String? title, void onChange(dynamic)?, bool? value, Widget? prefixIcon})
factory
Control.date({required String key, String? title, String? description, void onChange(dynamic)?, DateTime? value, DateTime? min, DateTime? max, Widget? prefixIcon})
factory
Control.dateRange({required String key, String? title, String? description, void onChange(dynamic)?, DateTimeRange? value, DateTime? min, DateTime? max, Widget? prefixIcon})
factory
Control.dropDown({required List<String> items, required String key, String? description, String? title, int? selected, void onChange(dynamic value)?, Widget? prefixIcon})
factory
Control.group({required List<Control> settings, String? title, Widget? prefixIcon})
factory
Control.number({required String key, String? description, String? title, void onChange(dynamic)?, int? value, int? max, int? min, Widget? prefixIcon})
factory
Control.page({required List<Control> controls, required String title, Widget? prefixIcon})
factory
Control.radio({required List<RadioItem<String>> items, required String key, String? description, String? title, String? selected, void onChange(dynamic)?, Widget? prefixIcon})
factory
Control.textField({required String key, String? title, String? description, Widget? content, void onChange(dynamic)?, String? defaultValue, TextInputType? keyboardType, FormFieldValidator<String>? validator, bool isRequired = false, Widget? prefixIcon, List<TextInputFormatter>? formatInputs})
factory
Control.time({required String key, String? title, String? description, void onChange(dynamic)?, TimeOfDay? value, Widget? prefixIcon})
factory
Control.toggle({required String key, String? description, String? title, void onChange(dynamic)?, bool? value, Widget? prefixIcon})
factory

Properties

content Widget?
This is an optional param. You should either set content or other params but not both. If content is not null the content is shown instead of the ControlType.
getter/setter pair
description String?
The description is shown next to the setting
getter/setter pair
formatInputs List<TextInputFormatter>?
Input formatters to limit input.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isRequired bool
Specify if the field is required when shown on registration pages
getter/setter pair
key String
The key is used to store the value in the shared preferences
getter/setter pair
keyboardType TextInputType?
The keyboardType (used for textFields)
getter/setter pair
onChange ↔ (void Function(dynamic)?)
This method is invoked everytime the user changes the setting
getter/setter pair
prefixIcon Widget?
The Widget that is shown on the left side of the input.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings List<Control>?
The settings is a List containing the Controls that are shown grouped together inside a Container. The settings should only be used if the ControlType is Group.
getter/setter pair
title String?
The title is shown above the Control
getter/setter pair
type ControlType
The type is the type of Control. To see all the options see ControlType.
getter/setter pair
validator FormFieldValidator<String>?
Fields can be validated by one or multiple validators with custom error messages. (used for textFields)
getter/setter pair
value ↔ dynamic
The value is the defaultvalue along with the items or options depending on whether the ControlType requires items or options to be given. If the ControlType is a bool the value should also be a bool. If the ControlsType is a DropDown the value should be a MapR containing the int selected and the items in the form of a List with Strings. If the ControlType is a Radio the value should be a Map containing int selected and List options. If the ControlType is range the Map should contain max, min and selected. All three are doubles.
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
change(dynamic value) → void
clear() → void
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
getValue() → dynamic
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited