// 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, }); String text; Color? textColor; Color? textStrokeColor; Color? backColor; double? textStrokeWidth; double? textSize; 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: WidgetStateProperty.all( backColor ?? Colors.transparent, ), shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), ), ), child: Stack( alignment: Alignment.center, 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, ), ), ), ], ), ); } }