| 1 | import 'package:flutter/material.dart'; |
| 2 | |
| 3 | class TrailButton extends StatelessWidget { |
| 4 | TrailButton({required this.caption, required this.onPressed, this.textColor}); |
| 5 | |
| 6 | final String caption; |
| 7 | final VoidCallback onPressed; |
| 8 | final Color? textColor; |
| 9 | |
| 10 | @override |
| 11 | Widget build(BuildContext context) { |
| 12 | return ButtonTheme( |
| 13 | minWidth: double.minPositive, |
| 14 | highlightColor: Colors.transparent, |
| 15 | splashColor: Colors.transparent, |
| 16 | child: TextButton( |
| 17 | // FIX-ME: ignored padding |
| 18 | //padding: EdgeInsets.all(0), |
| 19 | child: Text( |
| 20 | caption, |
| 21 | style: Theme.of(context).textTheme.bodyMedium!.copyWith( |
| 22 | fontWeight: FontWeight.w600, |
| 23 | color: textColor ?? Theme.of(context).colorScheme.primary, |
| 24 | height: 1.8, |
| 25 | ), |
| 26 | ), |
| 27 | onPressed: onPressed, |
| 28 | ), |
| 29 | ); |
| 30 | } |
| 31 | } |