TogieDarkButton
Este widget muestra un botón con tema oscuro. Permite la personalización mediante parámetros como etiqueta, icono, color del icono, tamaño del texto, padding, y opciones de interacción como onPressed y onLongPressed.
Importación
import 'package:togie/widgets/general/togie_dark_button.dart';Constructor:
const TogieDarkButton({ super.key, required this.label, this.icon, this.iconColor, this.isLarge = false, required this.onPressed, this.onLongPressed, this.enabled = true, this.heroTag = "", this.textSize = 16, this.padding = const EdgeInsets.all(20),});Parámetro del constructor:
| Parámetro | Tipo | Descripción |
|---|---|---|
label | String | Texto que se mostrará en el botón. |
icon | IconData? | Icono opcional que se muestra junto al texto. |
iconColor | Color? | Color del icono, en caso de ser proporcionado. |
isLarge | bool | Determina si el botón se expande a todo el ancho disponible. |
onPressed | Function()? | Callback que se ejecuta al presionar el botón. |
onLongPressed | Function()? | Callback que se ejecuta al mantener presionado el botón. |
enabled | bool | Indica si el botón está habilitado o deshabilitado. |
heroTag | Object | Etiqueta utilizada para animaciones Hero. Si está vacía, no se utiliza Hero. |
textSize | double | Tamaño del texto del botón. |
padding | EdgeInsetsGeometry | Espaciado interno del botón. |
Ejemplo de uso:
TogieDarkButton( label: "Aceptar", icon: Icons.check, iconColor: Colors.white, isLarge: true, onPressed: () { // Lógica al presionar el botón }, onLongPressed: () { // Lógica al mantener presionado el botón }, enabled: true, heroTag: "hero-aceptar", textSize: 18, padding: const EdgeInsets.all(20),)