DeskRatingField class
ColorField is now a built-in field type!
You can use it directly without any registration:
@DeskModel(
title: 'Theme Settings',
description: 'Customize your theme colors',
)
class ThemeConfig {
@DeskColor(
option: DeskColorOption(showAlpha: true),
)
final String primaryColor;
@DeskColor()
final String accentColor;
const ThemeConfig({
required this.primaryColor,
required this.accentColor,
});
}
Or use it directly in DeskForm:
DeskForm(
fields: [
DeskColorField(
name: 'brandColor',
title: 'Brand Color',
option: DeskColorOption(
showAlpha: true,
presetColors: [
Colors.red,
Colors.blue,
Colors.green,
Colors.amber,
],
),
),
],
)
Example: Creating a completely custom field type (e.g., Rating field)
Constructors
- DeskRatingField({required String name, required String title, DeskRatingOption option = const DeskRatingOption()})
-
const
Properties
- description → String?
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
finalinherited
- option → DeskRatingOption
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String
-
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited