GeneralCard
Este widget envuelve su contenido en un Container con diversas opciones de estilo, como color de fondo, bordes, sombras y márgenes.
Importación
import 'package:togie/widgets/general/general_card.dart';Constructor:
const GeneralCard({ super.key, this.child, this.width, this.height, this.margin, this.padding = const EdgeInsets.all(0), this.onTap, this.onLongPress, this.radius = 16, this.shadow = false, this.backgroundColor, this.borderColor, this.isShimmerLoading = false,});Parámetro del constructor:
| Parámetro | Tipo | Descripción |
|---|---|---|
child | Widget? | Contenido interno de la tarjeta. |
width | double? | Ancho de la tarjeta. |
height | double? | Altura de la tarjeta. |
margin | EdgeInsetsGeometry? | Margen externo de la tarjeta. |
padding | EdgeInsetsGeometry? | Padding interno de la tarjeta. Valor por defecto: EdgeInsets.all(0). |
onTap | void Function()? | Callback que se ejecuta al tocar la tarjeta. |
onLongPress | void Function()? | Callback que se ejecuta al mantener presionada la tarjeta. |
radius | double | Radio de borde de la tarjeta. Valor por defecto: 16. |
shadow | bool | Determina si la tarjeta tiene sombra. Valor por defecto: false. |
backgroundColor | Color? | Color de fondo de la tarjeta. |
borderColor | Color? | Color del borde de la tarjeta. |
isShimmerLoading | bool | Indica si se muestra un efecto shimmer de carga. Valor por defecto: false. |
Ejemplo de uso:
GeneralCard( width: 200, height: 100, margin: EdgeInsets.all(10), padding: EdgeInsets.all(16), backgroundColor: Colors.white, borderColor: Colors.grey, radius: 12, shadow: true, onTap: () { // Acción al tocar la tarjeta }, child: Text("Contenido de la tarjeta"),)