tabs static method
TFormField
tabs({
- required List<
TFormTab> tabs, - Axis axis = Axis.horizontal,
- TFormType? formType,
- String? label,
- String? description,
- IconData? icon,
- bool initiallyExpanded = false,
- TTabController? controller,
- dynamic initialValue,
- ValueChanged? onTabChanged,
- double? tabWidth,
- bool scrollable = false,
- bool inline = false,
- bool wrap = false,
- EdgeInsets? tabPadding,
- double tabSpacing = 2,
- double? indicatorWidth,
- Color? selectedColor,
- Color? unselectedColor,
- Color? indicatorColor,
- Color? borderColor,
- Widget tabBuilder(
- BuildContext,
- TTab,
- bool,
- VoidCallback? ,
- double gapX = 16.0,
- double gapY = 26.0,
Creates a sub-form field rendered with tabs using TTabs.
Supports both Axis.horizontal and Axis.vertical tab layouts.
Example:
TFormField.tabs(
tabs: [
TFormTab(
title: 'General',
icon: Icons.info,
input: GeneralForm(),
),
TFormTab(
title: 'Security',
icon: Icons.security,
fields: [
TFormField.text(password, 'Password'),
],
),
],
axis: Axis.horizontal,
)
Implementation
static TFormField<dynamic> tabs({
required List<TFormTab> tabs,
Axis axis = Axis.horizontal,
TFormType? formType,
String? label,
String? description,
IconData? icon,
bool initiallyExpanded = false,
TTabController<dynamic>? controller,
dynamic initialValue,
ValueChanged<dynamic>? onTabChanged,
double? tabWidth,
bool scrollable = false,
bool showNavigationButtons = true,
bool inline = false,
bool wrap = false,
EdgeInsets? tabPadding,
double tabSpacing = 2,
double? indicatorWidth,
Color? selectedColor,
Color? unselectedColor,
Color? indicatorColor,
Color? borderColor,
Widget Function(BuildContext, TTab<dynamic>, bool, VoidCallback?)? tabBuilder,
double gapX = 16.0,
double gapY = 26.0,
Widget? footer,
}) {
return TFormField<dynamic>(
isSubForm: true,
builder: (onValueChanged) => TFormBuilder(
tabs: tabs,
tabAxis: axis,
formType: formType,
label: label,
description: description,
icon: icon,
initiallyExpanded: initiallyExpanded,
tabController: controller,
initialTabValue: initialValue,
onTabChanged: onTabChanged,
tabWidth: tabWidth,
scrollableTabs: scrollable,
showTabNavigationButtons: showNavigationButtons,
tabInline: inline,
tabWrap: wrap,
tabPadding: tabPadding,
tabSpacing: tabSpacing,
tabIndicatorWidth: indicatorWidth,
tabSelectedColor: selectedColor,
tabUnselectedColor: unselectedColor,
tabIndicatorColor: indicatorColor,
tabBorderColor: borderColor,
tabBuilder: tabBuilder,
gapX: gapX,
gapY: gapY,
footer: footer,
onValueChanged: () {
onValueChanged(null);
},
),
);
}