Implementation
@override
void registerWidgets() {
registerWidget("Screen", (_) => const SizedBox(),
baseType: null,
abstract: true,
properties: {"routeName": Types.string, "state": Types.json},
widgets: {"body": EditorWidgetType.rootWidget()},
actions: {"onEnter": EditorActionType.action()});
registerWidget("RootWidget", (_) => const SizedBox(),
baseType: null,
abstract: true,
properties: {"template": const EditorPropertyType("KTemplate")});
registerWidget("PreferredSizeWidget", (_) => const SizedBox(),
baseType: null,
abstract: true,
properties: {
"template": const EditorPropertyType("KTemplate"),
"heroTag": Types.string,
"safeArea": Types.bool,
"buildCondition": Types.kCondition
});
registerWidget("Widget", (_) => const SizedBox(),
baseType: null,
abstract: true,
properties: {
"template": const EditorPropertyType("KTemplate"),
"decorator": const EditorPropertyType("Decorator"),
"wrapExpanded": Types.bool,
"visible": Types.bool,
"margin": Types.edgeInsets,
"heroTag": Types.string,
"safeArea": Types.safeArea,
"buildCondition": Types.kCondition
});
final componentProperties = {
"component": const EditorPropertyType("KComponent"),
// "state": Types.json,
};
registerWidget("PreferredSizeComponent", buildComponent,
baseType: EditorWidget.preferredSizeWidget,
properties: componentProperties);
registerWidget("WidgetComponent", buildComponent,
properties: componentProperties);
registerWidget("material", buildMaterial,
baseType: EditorWidget.rootWidget,
properties: {
"type": Types.materialType,
"shape": Types.shapeBorder,
"borderRadius": Types.intArray,
"elevation": Types.double,
"color": Types.color,
"shadowColor": Types.color
},
widgets: {
"child": EditorWidgetType.widget()
},
tags: [
"structure & navigation"
]);
registerWidget("scaffold", buildScaffold,
baseType: EditorWidget.rootWidget,
properties: {
"tabController": Types.tabController,
"backgroundColor": Types.color,
"extendBody": Types.bool,
"extendBodyBehindAppBar": Types.bool,
"resizeToAvoidBottomInset": Types.bool,
"floatingActionButtonLocation": Types.floatingActionButtonLocation
},
widgets: {
"appBar": EditorWidgetType.preferredSizeWidget(),
"drawer": EditorWidgetType.widget(),
"navigationRail": EditorWidgetType("navigationRail"),
"body": EditorWidgetType.widget(),
"bottomSheet": EditorWidgetType.widget(),
"bottomNavigationBar": EditorWidgetType.widget(),
"floatingActionButton": EditorWidgetType.widget(),
"persistentFooterButtons": EditorWidgetType.widget(isArray: true)
},
tags: [
"common",
"structure & navigation"
]);
registerWidget("sliverScaffold", buildSliverScaffold,
baseType: EditorWidget.rootWidget,
properties: {
"tabController": Types.tabController,
"backgroundColor": Types.color,
"shrinkWrap": Types.bool,
"reverse": Types.bool,
"scrollDirection": Types.axis,
"extendBody": Types.bool,
"extendBodyBehindAppBar": Types.bool,
"floatingActionButtonLocation": Types.floatingActionButtonLocation,
"keyboardDismissBehavior": Types.keyboardDismissBehavior
},
widgets: {
"appBar": EditorWidgetType("sliverAppBar"),
"drawer": EditorWidgetType.widget(),
"children": EditorWidgetType.widget(isArray: true),
"bottomSheet": EditorWidgetType.widget(),
"bottomNavigationBar": EditorWidgetType.widget(),
"floatingActionButton": EditorWidgetType.widget(),
"persistentFooterButtons": EditorWidgetType.widget(isArray: true)
},
tags: [
"sliver",
"structure & navigation"
]);
registerWidget("appBar", buildAppBar,
baseType: EditorWidget.preferredSizeWidget,
properties: {
"title": Types.string,
"centerTitle": Types.bool,
"leadingIcon": Types.appBarLeadingIcon,
"foregroundColor": Types.color,
"backgroundColor": Types.color,
"surfaceTintColor": Types.color,
"systemUiOverlayStyle":
const EditorPropertyListType(["light", "dark"]),
"shadowColor": Types.color,
"elevation": Types.double,
"scrolledUnderElevation": Types.double,
"toolbarHeight": Types.int,
"toolbarOpacity": Types.double,
"bottomOpacity": Types.double,
"automaticallyImplyLeading": Types.bool
},
widgets: {
"leading": EditorWidgetType.widget(),
"titleWidget": EditorWidgetType.widget(),
"actions": EditorWidgetType.widget(isArray: true),
"bottom": EditorWidgetType.preferredSizeWidget()
},
tags: [
"common",
"structure & navigation"
]);
registerWidget("sliverAppBar", buildSliverAppBar,
baseType: "",
properties: {
"title": Types.string,
"centerTitle": Types.bool,
"titlePadding": Types.edgeInsets,
"leadingIcon": Types.appBarLeadingIcon,
"backgroundColor": Types.color,
"foregroundColor": Types.color,
"systemUiOverlayStyle":
const EditorPropertyListType(["light", "dark"]),
"elevation": Types.double,
"scrolledUnderElevation": Types.double,
"collapsedHeight": Types.int,
"expandedHeight": Types.int,
"expandedTitleScale": Types.double,
"collapseMode": Types.collapseMode,
"stretchMode": Types.stretchMode,
"floating": Types.bool,
"pinned": Types.bool,
"snap": Types.bool,
"stretch": Types.bool
},
actions: {
"onStretchTrigger": EditorActionType.action()
},
widgets: {
"leading": EditorWidgetType.widget(),
"titleWidget": EditorWidgetType.widget(),
"background": EditorWidgetType.widget(),
"actions": EditorWidgetType.widget(isArray: true),
"bottom": EditorWidgetType.preferredSizeWidget()
},
tags: [
"sliver",
"structure & navigation"
]);
registerWidget("PreferredSize", buildPreferredSize,
baseType: EditorWidget.preferredSizeWidget,
properties: {"size": Types.size},
widgets: {"child": EditorWidgetType.widget()});
registerWidget("navigationRail", (params) => buildNavigationRail(params),
properties: {
"selectedIndex": Types.int,
"useIndicator": Types.bool,
"indicatorColor": Types.color,
"backgroundColor": Types.color,
"minWidth": Types.double,
"minExtendedWidth": Types.double,
"labelType": Types.navigationRailLabelType,
"selectedLabelTextStyle": Types.textStyle,
"selectedIconTheme": Types.iconThemeData,
"unselectedLabelTextStyle": Types.textStyle,
"unselectedIconTheme": Types.iconThemeData,
"groupAlignment": Types.double,
"elevation": Types.double,
"extended": Types.bool,
},
widgets: {
"destinations":
EditorWidgetType("NavigationRailDestination", isArray: true),
"leading": EditorWidgetType.widget(),
"trailing": EditorWidgetType.widget(),
"toggle": EditorWidgetType.widget()
},
tags: [
"structure & navigation"
]);
registerWidget("NavigationRailDestination", (_) => const SizedBox(),
abstract: true,
baseType: null,
properties: {
"label": Types.string,
"iconCode": Types.int,
"selectedIconCode": Types.int,
"padding": Types.edgeInsets,
"buildCondition": Types.kCondition
},
tags: [
"structure & navigation"
]);
registerWidget("ActionDestination", (_) => const SizedBox(),
baseType: "NavigationRailDestination",
actions: {"onTap": EditorActionType.action()});
registerWidget("ScreenDestination", (_) => const SizedBox(),
baseType: "NavigationRailDestination",
properties: {"screen": Types.screen});
registerWidget("drawer", buildDrawer, properties: {
"backgroundColor": Types.color,
"elevation": Types.double,
"shape": Types.shapeBorder
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"structure & navigation"
]);
registerWidget("drawerHeader", buildDrawerHeader, properties: {
"padding": Types.edgeInsets,
"decoration": Types.boxDecoration
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"structure & navigation"
]);
registerWidget("userDrawerHeader", buildUserDrawerHeader, properties: {
"accountName": Types.string,
"accountEmail": Types.string,
"accountPicture": Types.string,
"accountPictureSize": Types.double,
"decoration": Types.boxDecoration,
"arrowColor": Types.color
}, actions: {
"onTap": EditorActionType.action()
}, widgets: {
"accountNameWidget": EditorWidgetType.widget(),
"accountEmailWidget": EditorWidgetType.widget(),
"accountPictureWidget": EditorWidgetType.widget()
}, tags: [
"structure & navigation"
]);
registerWidget("bottomAppBar", buildBottomAppBar, properties: {
"color": Types.color,
"elevation": Types.int,
"notchMargin": Types.int,
"shape": Types.notchedShape
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"structure & navigation"
]);
registerWidget("bottomNavigationBar", buildBottomNavigationBar,
properties: {
"startIndex": Types.int,
"type": const EditorPropertyListType(["fixed", "shifting"]),
"layout":
const EditorPropertyListType(["centered", "linear", "spread"]),
"elevation": Types.int,
"backgroundColor": Types.color,
"iconSize": Types.double,
"selectedFontSize": Types.double,
"selectedItemColor": Types.color,
"unselectedFontSize": Types.double,
"unselectedItemColor": Types.color
},
widgets: {
"children": EditorWidgetType("bottomNavigationBarItem", isArray: true)
},
tags: [
"structure & navigation"
]);
registerWidget("bottomNavigationBarItem", (_) => const SizedBox(),
baseType: "",
properties: {
"iconCode": Types.int,
"activeIconCode": Types.int,
"label": Types.string,
"tooltip": Types.string,
"backgroundColor": Types.color
},
actions: {
"onTap": EditorActionType.action()
},
widgets: {
"icon": EditorWidgetType.widget(),
"activeIcon": EditorWidgetType.widget()
},
tags: [
"structure & navigation"
]);
registerWidget("sizedBox", buildSizedBox,
properties: {"width": Types.int, "height": Types.int},
tags: ["layout", "decoration", "common"]);
registerWidget("center", buildCenter,
properties: {"widthFactor": Types.double, "heightFactor": Types.int},
widgets: {"child": EditorWidgetType.widget()},
tags: ["layout"]);
registerWidget("container", buildContainer, properties: {
"width": Types.int,
"height": Types.int,
"padding": Types.edgeInsets,
"alignment": Types.alignment,
"constraints": Types.boxConstraints,
"decoration": Types.boxDecoration
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"layout",
"decoration"
]);
registerWidget("AnimatedContainer", buildAnimatedContainer, properties: {
"width": Types.int,
"height": Types.int,
"padding": Types.edgeInsets,
"alignment": Types.alignment,
"constraints": Types.boxConstraints,
"decoration": Types.boxDecoration,
"duration": Types.int,
"curve": Types.curve,
}, actions: {
"onEnd": EditorActionType.action(),
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"animation",
"layout",
"decoration"
]);
registerWidget("card", buildCard, properties: {
"color": Types.color,
"surfaceTintColor": Types.color,
"shadowColor": Types.color,
"elevation": Types.double,
"shape": Types.shapeBorder,
"margin": Types.edgeInsets
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"decoration",
"common"
]);
registerWidget("stack", buildStack,
properties: {"alignment": Types.alignment},
widgets: {"children": EditorWidgetType.widget(isArray: true)},
tags: ["layout"]);
registerWidget("Positioned", buildPositioned, properties: {
"left": Types.double,
"top": Types.double,
"right": Types.double,
"bottom": Types.double,
"width": Types.double,
"height": Types.double
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"layout"
]);
registerWidget("AnimatedPositioned", buildAnimatedPositioned, properties: {
"left": Types.double,
"top": Types.double,
"right": Types.double,
"bottom": Types.double,
"width": Types.double,
"height": Types.double,
"duration": Types.int,
"curve": Types.curve
}, actions: {
"onEnd": EditorActionType.action()
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"animation",
"layout"
]);
final rowProperties = EditorWidget(properties: {
"verticalDirection": Types.verticalDirection,
"crossAxisAlignment": Types.crossAxisAlignment,
"mainAxisAlignment": Types.mainAxisAlignment,
"mainAxisSize": Types.mainAxisSize
}, widgets: {
"children": EditorWidgetType.widget(isArray: true)
});
registerWidget("row", buildRow,
properties: rowProperties.properties,
actions: rowProperties.actions,
widgets: rowProperties.widgets,
tags: ["common", "layout"]);
registerWidget("column", buildColumn,
properties: rowProperties.properties,
actions: rowProperties.actions,
widgets: rowProperties.widgets,
tags: ["common", "layout"]);
registerWidget("wrap", buildWrap, properties: {
"direction": Types.axis,
"alignment": Types.mainAxisAlignment,
"spacing": Types.double,
"runAlignment": Types.mainAxisAlignment,
"runSpacing": Types.double,
"verticalDirection": Types.verticalDirection,
"crossAxisAlignment":
const EditorPropertyListType(["start", "center", "end"])
}, widgets: {
"children": EditorWidgetType.widget(isArray: true)
}, tags: [
"layout"
]);
registerWidget("SingleChildScrollView", buildSingleChildScrollView,
properties: {
"padding": Types.edgeInsets,
"reverse": Types.bool,
"scrollDirection": Types.axis,
"keyboardDismissBehavior": Types.keyboardDismissBehavior
},
widgets: {
"child": EditorWidgetType.widget()
},
tags: [
"common",
"scrolling"
]);
registerWidget("scrollView", buildScrollView, properties: {
"padding": Types.edgeInsets,
"reverse": Types.bool,
"scrollDirection": Types.axis,
"keyboardDismissBehavior": Types.keyboardDismissBehavior
}, widgets: {
"children": EditorWidgetType.widget(isArray: true)
}, tags: [
"scrolling"
]);
final blocListProps = {
"loadingIndicator": Types.loadingIndicator,
"noEntriesMessage": Types.string,
"noEntriesStyle": Types.textStyle
};
final blocListActions = {
"loadPage": EditorActionType.listAction(),
"onSelect": EditorActionType.action(),
};
final blocListWidgets = {
"child": EditorWidgetType.widget(),
"noEntriesWidget": EditorWidgetType.widget(),
};
final listViewProps = {
"padding": Types.edgeInsets,
"shrinkWrap": Types.bool,
"reverse": Types.bool,
"scrollDirection": Types.axis,
"primary": Types.bool,
"keyboardDismissBehavior": Types.keyboardDismissBehavior
};
registerWidget("listView", buildListView,
properties: {...listViewProps, ...blocListProps},
actions: blocListActions,
widgets: {...blocListWidgets, "separator": EditorWidgetType.widget()},
tags: ["common", "data list"]);
registerWidget("staticListView", buildStaticListView,
properties: listViewProps,
widgets: {"children": EditorWidgetType.widget(isArray: true)},
tags: ["layout", "scrolling"]);
final gridViewProps = {
"crossAxisCount": Types.int,
"mainAxisSpacing": Types.double,
"crossAxisSpacing": Types.double,
"childAspectRatio": Types.double,
"scrollDirection": Types.axis,
"reverse": Types.bool,
"shrinkWrap": Types.bool,
"padding": Types.edgeInsets,
"primary": Types.bool,
"keyboardDismissBehavior": Types.keyboardDismissBehavior
};
registerWidget("gridView", buildGridView,
properties: {
...gridViewProps,
...blocListProps,
},
actions: blocListActions,
widgets: blocListWidgets,
tags: ["data list"]);
registerWidget("staticGridView", buildStaticGridView,
properties: gridViewProps,
widgets: {"children": EditorWidgetType.widget(isArray: true)},
tags: ["layout", "scrolling"]);
final pageViewProps = {
"initialPage": Types.int,
"viewportFraction": Types.double,
"pageSnapping": Types.bool,
"padEnds": Types.bool,
"scrollDirection": Types.axis,
"reverse": Types.bool,
"keepPage": Types.bool,
};
registerWidget("pageView", buildPageView,
properties: {...pageViewProps, ...blocListProps},
actions: {
...blocListActions,
"onPageChanged": EditorActionType.action()
},
widgets: blocListWidgets,
tags: ["data list"]);
registerWidget("staticPageView", buildStaticPageView,
properties: pageViewProps,
widgets: {"children": EditorWidgetType.widget(isArray: true)},
actions: {"onPageChanged": EditorActionType.action()},
tags: ["layout", "scrolling"]);
registerWidget("tableView", buildTable, properties: {
"border": Types.tableBorder,
"verticalAlignment": Types.tableVerticalAlignment,
"rowDecoration": Types.boxDecoration,
"rowOddDecoration": Types.boxDecoration,
"shrinkWrap": Types.bool
}, actions: {
"loadPage": EditorActionType.listAction(),
"onSelect": EditorActionType.action()
}, widgets: {
"children": EditorWidgetType.widget(isArray: true),
"noEntriesWidget": EditorWidgetType.widget()
}, tags: [
"data list"
]);
registerWidget("dataTableView", buildDataTable, properties: {
"alias": Types.string,
"selectionType": const EditorPropertyListType(["single", "multiple"]),
"sortable": Types.bool,
"border": Types.tableBorder,
"decoration": Types.boxDecoration,
"dividerThickness": Types.double,
"columnSpacing": Types.double,
"checkboxHorizontalMargin": Types.double,
"horizontalMargin": Types.double,
"showBottomBorder": Types.bool,
"headingRowColor": Types.color,
"headingRowHeight": Types.double,
"headingTextStyle": Types.textStyle,
"dataRowColor": Types.color,
"dataRowHeight": Types.double,
"dataTextStyle": Types.textStyle,
"rowColor": Types.color,
"rowOddColor": Types.color,
"shrinkWrap": Types.bool
}, actions: {
"loadPage": EditorActionType.listAction(),
"onSelect": EditorActionType.action()
}, widgets: {
"columns": EditorWidgetType.widget(isArray: true),
"children": EditorWidgetType.widget(isArray: true),
"noEntriesWidget": EditorWidgetType.widget()
}, tags: [
"data list"
]);
registerWidget("tabView", buildTabView, properties: {
"padding": Types.edgeInsets,
"indicator": Types.boxDecoration,
"indicatorColor": Types.color,
"indicatorPadding": Types.edgeInsets,
"indicatorSize": Types.tabBarIndicatorSize,
"indicatorWeight": Types.double,
"initialIndex": Types.int,
"isScrollable": Types.bool,
"labelColor": Types.color,
"labelPadding": Types.edgeInsets,
"labelStyle": Types.textStyle,
"unselectedLabelColor": Types.color,
"unselectedLabelStyle": Types.textStyle,
"dividerHeight": Types.double,
"dividerColor": Types.color,
"overlayColor": Types.color,
"verticalDirection": Types.verticalDirection,
"crossAxisAlignment": Types.crossAxisAlignment,
"mainAxisAlignment": Types.mainAxisAlignment,
"mainAxisSize": Types.mainAxisSize
}, widgets: {
"tabs": EditorWidgetType.widget(isArray: true),
"children": EditorWidgetType.widget(isArray: true)
}, tags: [
"structure & navigation"
]);
registerWidget("tabBar", buildTabBar,
baseType: EditorWidget.preferredSizeWidget,
properties: {
"padding": Types.edgeInsets,
"indicator": Types.boxDecoration,
"indicatorColor": Types.color,
"indicatorPadding": Types.edgeInsets,
"indicatorSize": Types.tabBarIndicatorSize,
"indicatorWeight": Types.double,
"isScrollable": Types.bool,
"labelColor": Types.color,
"labelPadding": Types.edgeInsets,
"labelStyle": Types.textStyle,
"unselectedLabelColor": Types.color,
"unselectedLabelStyle": Types.textStyle,
"dividerHeight": Types.double,
"dividerColor": Types.color,
"overlayColor": Types.color
},
widgets: {
"tabs": EditorWidgetType.widget(isArray: true)
},
tags: [
"structure & navigation"
]);
registerWidget("tabBarView", buildTabBarView,
widgets: {"children": EditorWidgetType.widget(isArray: true)},
tags: ["structure & navigation"]);
registerWidget("listTile", buildListTile, properties: {
"iconCode": Types.int,
"value": Types.string,
"subValue": Types.string,
"enabled": Types.bool,
"listTileStyle": const EditorPropertyListType(["drawer", "list"]),
"contentPadding": Types.edgeInsets,
"horizontalTitleGap": Types.double,
"shape": Types.shapeBorder,
"iconColor": Types.color,
"textColor": Types.color,
"tileColor": Types.color,
"focusColor": Types.color,
"hoverColor": Types.color
}, actions: {
"onTap": EditorActionType.action()
}, widgets: {
"leading": EditorWidgetType.widget(),
"title": EditorWidgetType.widget(),
"subtitle": EditorWidgetType.widget(),
"trailing": EditorWidgetType.widget()
}, tags: [
"layout",
"action"
]);
registerWidget("expanded", buildExpanded,
properties: {"flex": Types.int},
widgets: {"child": EditorWidgetType.widget()},
tags: ["layout"]);
registerWidget("inkWell", buildInkWell, properties: {
"borderRadius": Types.intArray,
"customBorder": Types.shapeBorder,
"overlayColor": Types.color,
"highlightColor": Types.color,
"splashColor": Types.color,
"hoverColor": Types.color,
"focusColor": Types.color,
}, actions: {
"onTap": EditorActionType.action(),
"onLongPress": EditorActionType.action(),
"onDoubleTap": EditorActionType.action(),
"onTapDown": EditorActionType.action(),
"onTapUp": EditorActionType.action(),
}, widgets: {
"child": EditorWidgetType.widget(),
}, tags: [
"action"
]);
registerWidget("richText", buildRichText, properties: {
"textAlign": Types.textAlign,
"maxLines": Types.int,
"softWrap": Types.bool,
"overflow": Types.textOverflow
}, widgets: {
"children": EditorWidgetType("TextSpan", isArray: true)
}, tags: [
"text"
]);
registerWidget("TextSpan", (_) => const SizedBox(),
baseType: "",
properties: {
"value": Types.string,
"style": Types.textStyle
},
actions: {
"onTap": EditorActionType.action(),
},
tags: [
"text"
]);
registerWidget("text", buildText, properties: {
"alias": Types.string,
"value": Types.string,
"format": Types.kFormatter,
"maxLines": Types.int,
"semanticsLabel": Types.string,
"softWrap": Types.bool,
"overflow": Types.textOverflow,
"style": Types.textStyle,
"textAlign": Types.textAlign
}, tags: [
"common",
"text"
]);
final textFormFieldProperties = EditorWidget(properties: {
"value": Types.string,
"alias": Types.string,
"obscureText": Types.bool,
"enabled": Types.bool,
"autocorrect": Types.bool,
"keyboardType": Types.textInputType,
"textInputAction": Types.textInputAction,
"minLines": Types.int,
"maxLines": Types.int,
"required": Types.bool,
"minLength": Types.int,
"maxLength": Types.int,
"requiredMessage": Types.string,
"minLengthMessage": Types.string,
"maxLengthMessage": Types.string,
"regex": Types.string,
"regexMessage": Types.string,
"textAlign": Types.textAlign,
"textAlignVertical": Types.textAlignVertical,
"style": Types.textStyle,
"disabledStyle": Types.textStyle,
"readOnly": Types.bool,
"autofocus": Types.bool,
"enableSuggestions": Types.bool,
"expands": Types.bool,
"toolbarOptions": Types.toolbarOptions,
"textCapitalization": Types.textCapitalization,
"decoration": Types.inputDecoration,
"inputFormatters": Types.textInputFormatter,
"onChangedDebounce": Types.int,
}, actions: {
"onChanged": EditorActionType.action(),
"onFieldSubmitted": EditorActionType.action(),
}, widgets: {
"icon": EditorWidgetType.widget(),
"label": EditorWidgetType.widget(),
"prefix": EditorWidgetType.widget(),
"prefixIcon": EditorWidgetType.widget(),
"suffix": EditorWidgetType.widget(),
"suffixIcon": EditorWidgetType.widget(),
});
//registerWidget("textField", buildTextFormField, textFormFieldProperties);
registerWidget("textFormField", buildTextFormField,
properties: textFormFieldProperties.properties,
widgets: textFormFieldProperties.widgets,
actions: textFormFieldProperties.actions,
tags: ["common", "input"]);
registerWidget("datePicker", buildDatePicker,
baseType: "textFormField",
properties: {
"value": Types.string,
"firstDate": Types.string,
"lastDate": Types.string,
"mode": const EditorPropertyListType(["dateTime", "date", "time"]),
"label": Types.string,
},
tags: [
"input"
]);
registerWidget("select", buildSelect,
baseType: "textFormField",
properties: {
"valueKey": Types.string,
"textKey": Types.string,
"dialogTitle": Types.string,
"dialogMaxWidth": Types.int,
"dialogMaxHeight": Types.int,
},
actions: {
"loadValue": EditorActionType.listAction(),
"loadData": EditorActionType.listAction(),
},
widgets: {
"dialogHeader": EditorWidgetType.widget(),
"dialogList": EditorWidgetType.widget(),
"dialogListTile": EditorWidgetType.widget(),
},
tags: [
"input",
"data list"
]);
final boolInputProperties = EditorWidget(properties: {
"value": Types.bool,
"alias": Types.string,
"enabled": Types.bool,
"required": Types.bool,
"requiredMessage": Types.string,
"contentPadding": Types.edgeInsets,
"activeColor": Types.color,
"hoverColor": Types.color,
"title": Types.string,
"subtitle": Types.string,
"shape": Types.shapeBorder,
"direction": const EditorPropertyListType(["leading", "trailing"])
}, actions: {
"onChanged": EditorActionType.action()
}, widgets: {
"titleWidget": EditorWidgetType.widget(),
"subtitleWidget": EditorWidgetType.widget(),
"secondary": EditorWidgetType.widget(),
});
registerWidget("checkbox", buildCheckbox,
properties: {
"checkColor": Types.color,
"triState": Types.bool,
}..addAll(boolInputProperties.properties!),
actions: boolInputProperties.actions,
widgets: boolInputProperties.widgets,
tags: ["input"]);
registerWidget("switch", buildSwitch,
properties: {
"activeTrackColor": Types.color,
"inactiveThumbColor": Types.color,
"inactiveTrackColor": Types.color,
}..addAll(boolInputProperties.properties!),
actions: boolInputProperties.actions,
widgets: boolInputProperties.widgets,
tags: ["input"]);
registerWidget("slider", buildSlider, properties: {
"alias": Types.string,
"value": Types.double,
"min": Types.double,
"max": Types.double,
"divisions": Types.int,
"thumbColor": Types.color,
"activeColor": Types.color,
"inactiveColor": Types.color,
"secondaryTrackValue": Types.double,
"secondaryActiveColor": Types.color,
"label": Types.string,
"enabled": Types.bool
}, actions: {
"onChanged": EditorActionType.action()
}, tags: [
"input"
]);
final buttonProperties = EditorWidget(properties: {
"text": Types.string,
"style": Types.buttonStyle,
}, actions: {
"onPressed": EditorActionType.action()
}, widgets: {
"child": EditorWidgetType.widget()
});
registerWidget("textButton", buildTextButton,
properties: buttonProperties.properties,
actions: buttonProperties.actions,
widgets: buttonProperties.widgets,
tags: ["button", "action"]);
registerWidget("elevatedButton", buildElevatedButton,
properties: buttonProperties.properties,
actions: buttonProperties.actions,
widgets: buttonProperties.widgets,
tags: ["common", "button", "action"]);
registerWidget("outlinedButton", buildOutlinedButton,
properties: buttonProperties.properties,
actions: buttonProperties.actions,
widgets: buttonProperties.widgets,
tags: ["button", "action"]);
registerWidget("iconButton", buildIconButton, properties: {
"iconCode": Types.int,
"iconSize": Types.double,
"tooltip": Types.string,
"color": Types.color,
"focusColor": Types.color,
"hoverColor": Types.color,
"splashColor": Types.color,
"highlightColor": Types.color,
"disabledColor": Types.color,
"padding": Types.edgeInsets,
"alignment": Types.alignment,
"style": Types.buttonStyle,
"constraints": Types.boxConstraints,
}, actions: {
"onPressed": EditorActionType.action()
}, widgets: {
"icon": EditorWidgetType.widget()
}, tags: [
"button",
"action"
]);
registerWidget("floatingActionButton", buildFloatingActionButton,
properties: {
"iconCode": Types.int,
"tooltip": Types.string,
"mini": Types.bool,
"shape": Types.shapeBorder,
"backgroundColor": Types.color,
"foregroundColor": Types.color,
"hoverColor": Types.color,
"splashColor": Types.color,
"focusColor": Types.color,
"elevation": Types.double,
"focusElevation": Types.double,
"highlightElevation": Types.double,
"hoverElevation": Types.double,
"disabledElevation": Types.double,
},
actions: {
"onPressed": EditorActionType.action()
},
widgets: {
"child": EditorWidgetType.widget()
},
tags: [
"button",
"action"
]);
registerWidget("dropdownButton", buildDropdownButton, properties: {
"value": Types.string,
"values": Types.json,
"nameKey": Types.string,
"valueKey": Types.string,
"alias": Types.string,
"required": Types.bool,
"enabled": Types.bool,
"style": Types.textStyle,
"disabledStyle": Types.textStyle,
"focusColor": Types.color,
"dropdownColor": Types.color,
"iconEnabledColor": Types.color,
"iconDisabledColor": Types.color,
"elevation": Types.int,
"itemHeight": Types.double,
"alignment": Types.alignment,
"decoration": Types.inputDecoration,
"iconSize": Types.double,
"menuMaxHeight": Types.double
}, actions: {
"onChanged": EditorActionType.action()
}, widgets: {
"hint": EditorWidgetType.widget(),
"icon": EditorWidgetType.widget(),
"label": EditorWidgetType.widget(),
"prefix": EditorWidgetType.widget(),
"suffix": EditorWidgetType.widget()
}, tags: [
"button"
]);
registerWidget("popupMenuButton", buildPopupMenuButton, properties: {
"values": Types.json,
"nameKey": Types.string,
"valueKey": Types.string,
"alias": Types.string,
"color": Types.color,
"tooltip": Types.string,
"shape": Types.shapeBorder,
"padding": Types.edgeInsets,
"enabled": Types.bool,
"offset": Types.doubleArray,
"elevation": Types.double,
"iconSize": Types.double
}, actions: {
"onSelected": EditorActionType.action()
}, widgets: {
"icon": EditorWidgetType.widget(),
"child": EditorWidgetType.widget()
}, tags: [
"button"
]);
registerWidget("Hero", buildHero,
properties: {"tag": Types.string},
widgets: {"child": EditorWidgetType.widget()},
tags: ["animation"]);
registerWidget("icon", buildIcon, properties: {
"iconCode": Types.int,
"color": Types.color,
"size": Types.double,
"semanticLabel": Types.string
}, tags: [
"asset",
"common",
"decoration"
]);
registerWidget("image", buildImage, properties: {
"value": Types.string,
"alias": Types.string,
"color": Types.color,
"width": Types.double,
"height": Types.double,
"alignment": Types.alignment,
"fit": Types.boxFit,
"provider": Types.imageProvider,
}, widgets: {
"fallback": EditorWidgetType.widget()
}, tags: [
"asset",
"common",
"decoration"
]);
registerWidget("circleAvatar", buildCircleAvatar, properties: {
"foregroundValue": Types.string,
"foregroundProvider": Types.imageProvider,
"backgroundValue": Types.string,
"backgroundProvider": Types.imageProvider,
"foregroundColor": Types.color,
"backgroundColor": Types.color,
"radius": Types.double
}, widgets: {
"child": EditorWidgetType.widget()
}, tags: [
"asset"
]);
registerWidget("CircularProgressIndicator", buildCircularProgressIndicator,
properties: {
"color": Types.color,
"strokeWidth": Types.double,
"strokeAlign": Types.double
},
actions: {
"doWork": EditorActionType.action()
});
registerWidget("Badge", buildBadge, properties: {
"label": Types.string,
"alignment": Types.alignment,
"padding": Types.edgeInsets,
"textStyle": Types.textStyle,
"textColor": Types.color,
"backgroundColor": Types.color,
"isLabelVisible": Types.kCondition,
}, widgets: {
"label": EditorWidgetType.widget(),
"child": EditorWidgetType.widget()
});
registerWidget("BlocBuilder", buildBlocBuilder, properties: {
"type": const EditorPropertyListType(["local", "global"]),
}, widgets: {
"child": EditorWidgetType.widget(),
"states": EditorWidgetType("BuildState", isArray: true),
});
registerWidget("BuildState", (_) => const SizedBox(),
baseType: null,
properties: {"state": Types.string},
widgets: {"child": EditorWidgetType.widget()});
registerWidget("BlocConsumer", buildBlocBuilder, properties: {
"type": const EditorPropertyListType(["local", "global"]),
}, widgets: {
"child": EditorWidgetType.widget(),
"states": EditorWidgetType("BlocBuilderState", isArray: true),
});
registerWidget("BlocBuilderState", (_) => const SizedBox(),
abstract: true,
baseType: null,
properties: {"state": Types.string},
actions: {"listener": EditorActionType.action()});
registerWidget("StateBuilder", (_) => const SizedBox(),
baseType: "BlocBuilderState",
widgets: {"child": EditorWidgetType.widget()});
registerWidget("StateListener", (_) => const SizedBox(),
baseType: "BlocBuilderState");
}