Line data Source code
1 : part of apptive_grid_form_widgets; 2 : 3 : /// Button for a Form Action used inside a [ApptiveGridForm] 4 : class ActionButton extends StatelessWidget { 5 : /// Creates an Action Button 6 : /// 7 : /// This uses a RaisedButton. 8 3 : const ActionButton({ 9 : Key? key, 10 : required this.action, 11 : this.child, 12 : required this.onPressed, 13 3 : }) : super(key: key); 14 : 15 : /// The action the Button represents 16 : final FormAction action; 17 : 18 : /// The child Widget displayed in the Button 19 : final Widget? child; 20 : 21 : /// Called when the button is pressed 22 : /// 23 : /// Will pass the [action] back 24 : final void Function(FormAction) onPressed; 25 : 26 3 : @override 27 : Widget build(BuildContext context) { 28 3 : return Center( 29 3 : child: ElevatedButton( 30 9 : onPressed: () => onPressed(action), 31 3 : child: child, 32 : ), 33 : ); 34 : } 35 : }