Line data Source code
1 : import 'package:basf_flutter_components/basf_flutter_components.dart'; 2 : import 'package:flutter/material.dart'; 3 : 4 : /// {@template basf_otulined_button} 5 : /// A BasfButton with outline 6 : /// {@endtemplate} 7 : class BasfOutlinedButton extends BasfButton { 8 : /// {@macro basf_otulined_button} 9 1 : const BasfOutlinedButton({ 10 : super.key, 11 : super.text, 12 : super.leadingIcon, 13 : super.trailingIcon, 14 : super.iconSize, 15 : super.child, 16 : super.onPressed, 17 : super.onLongPress, 18 : super.style, 19 : super.size, 20 : super.expanded, 21 : }); 22 : 23 1 : @override 24 1 : State<BasfOutlinedButton> createState() => _BasfOutlinedButtonState(); 25 : } 26 : 27 : class _BasfOutlinedButtonState extends State<BasfOutlinedButton> { 28 1 : @override 29 : Widget build(BuildContext context) { 30 1 : return Align( 31 2 : alignment: widget.alignment!, 32 1 : child: _button(context), 33 : ); 34 : } 35 : 36 1 : Widget _button(BuildContext context) { 37 1 : return OutlinedButton( 38 2 : onPressed: widget.onPressed, 39 2 : onLongPress: widget.onLongPress, 40 2 : style: widget.getStyleWithAdjustments( 41 : context: context, 42 : buttonType: ButtonType.outlined, 43 : ), 44 2 : child: widget.child != null 45 0 : ? widget.buttonChildContent() 46 2 : : widget.buttonStandardContent(), 47 : ); 48 : } 49 : }