TButton constructor

const TButton({
  1. Key? key,
  2. TWidgetTheme? baseTheme,
  3. TButtonTheme? theme,
  4. TButtonShape? shape,
  5. TButtonType? type,
  6. TButtonSize? size,
  7. Color? color,
  8. bool loading = false,
  9. String loadingText = 'Loading...',
  10. IconData? icon,
  11. String? imageUrl,
  12. String? text,
  13. String? tooltip,
  14. VoidCallback? onTap,
  15. dynamic onPressed(
    1. TButtonPressOptions
    )?,
  16. bool active = false,
  17. IconData? activeIcon,
  18. Color? activeColor,
  19. Widget? child,
  20. ValueChanged<bool>? onChanged,
  21. 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.');