TButton constructor
const
TButton({
- Key? key,
- TWidgetTheme? baseTheme,
- TButtonTheme? theme,
- TButtonShape? shape,
- TButtonType? type,
- TButtonSize? size,
- Color? color,
- bool loading = false,
- String loadingText = 'Loading...',
- IconData? icon,
- String? imageUrl,
- String? text,
- String? tooltip,
- VoidCallback? onTap,
- dynamic onPressed()?,
- bool active = false,
- IconData? activeIcon,
- Color? activeColor,
- Widget? child,
- ValueChanged<
bool> ? onChanged, - Duration duration = const Duration(milliseconds: 400),
Implementation
const TButton({
super.key,
this.baseTheme,
this.theme,
this.shape,
this.type,
this.size,
this.color,
this.loading = false,
this.loadingText = 'Loading...',
this.icon,
this.imageUrl,
this.text,
this.tooltip,
this.onTap,
this.onPressed,
this.active = false,
this.activeIcon,
this.activeColor,
this.child,
this.onChanged,
this.duration = const Duration(milliseconds: 400),
}) : assert(
theme == null || (baseTheme == null && type == null && size == null && shape == null && color == null),
'If theme is provided, baseTheme, type, shape, color and size must be null.',
),
assert(baseTheme == null || (type == null && color == null && activeColor == null),
'If baseTheme is provided, type, color and activeColor must be null.'),
assert(imageUrl == null || icon == null, 'Provide either `imageUrl` or `icon`, but not both.');