import 'package:fikoyt_ui/ui/themes/fikoyt_button_theme.dart'; import 'package:flutter/material.dart'; class FikoYTImageTextButton extends StatelessWidget { final VoidCallback onPressed; final ImageProvider image; final double imageHeight; final double radius; final Widget text; final FikoYTButtonTheme? tema; const FikoYTImageTextButton({ super.key, required this.onPressed, required this.image, this.imageHeight = 70, this.radius = 10, required this.text, this.tema, }); @override Widget build(BuildContext context) { return Container( width: 150, constraints: BoxConstraints(maxWidth: 150), child: Card( elevation: tema?.elevation ?? Theme.of(context).extension()?.elevation ?? 4, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( radius, ), ), clipBehavior: Clip.hardEdge, child: InkWell( onTap: onPressed, child: Column( mainAxisSize: MainAxisSize.max, children: [ Ink.image( image: image, height: imageHeight, fit: BoxFit.cover, ), SizedBox(height: 6), text, SizedBox(height: 6), ], ), ), ), ); } } class FikoYTEmojicTextButton extends StatelessWidget { final VoidCallback onPressed; final String? emoji; final double imageHeight; final double radius; final Widget text; final FikoYTButtonTheme? tema; const FikoYTEmojicTextButton({ super.key, required this.onPressed, this.emoji, this.imageHeight = 70, this.radius = 10, required this.text, this.tema, }); @override Widget build(BuildContext context) { return Container( width: 150, constraints: BoxConstraints(maxWidth: 150), child: Card( elevation: tema?.elevation ?? Theme.of(context).extension()?.elevation ?? 4, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( radius, ), ), clipBehavior: Clip.hardEdge, child: InkWell( onTap: onPressed, child: Column( mainAxisSize: MainAxisSize.max, children: [ Container( constraints: BoxConstraints(minHeight: imageHeight), height: imageHeight, child: Text( emoji ?? "⚙️", style: TextStyle(fontSize: 64), ), ), SizedBox(height: 6), text, SizedBox(height: 6), ], ), ), ), ); } }