// ignore_for_file: must_be_immutable import 'package:flutter/material.dart'; class FikoButton1 extends StatelessWidget { FikoButton1({ super.key, required this.text, this.textColor, this.textStrokeColor, this.textStrokeWidth, this.textSize, this.onPressed, this.onLongPress, this.backColor, this.radius, this.edgePadding, this.textAlign, }); String text; Color? textColor; Color? textStrokeColor; Color? backColor; double? textStrokeWidth; double? textSize; double? radius; EdgeInsetsGeometry? edgePadding; TextAlign? textAlign; final VoidCallback? onPressed; final VoidCallback? onLongPress; @override Widget build(BuildContext context) { return TextButton( // icon: const Text("💡"), onLongPress: onLongPress, onPressed: onPressed, style: TextButtonTheme.of(context).style!.copyWith( backgroundColor: backColor != null ? WidgetStateProperty.all( backColor ?? Colors.transparent, ) : null, shape: radius != null ? WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(radius ?? 0.0), ), ) : null, ), child: Padding( padding: this.edgePadding ?? const EdgeInsets.all(0), child: Stack( alignment: Alignment.centerLeft, children: [ Align( alignment: Alignment.center, child: Text( text, textAlign: TextAlign.center, style: TextStyle( // color: Colors.amberAccent, fontSize: textSize ?? 12, fontWeight: FontWeight.bold, foreground: Paint() ..style = PaintingStyle.stroke ..strokeWidth = textStrokeWidth ?? 2 ..color = textStrokeColor ?? Colors.black, ), ), ), Align( alignment: Alignment.center, child: Text( text, textAlign: TextAlign.center, style: TextStyle( color: textColor ?? Colors.amberAccent, fontSize: textSize ?? 12, fontWeight: FontWeight.bold, ), ), ), ], ), ), ); } }