Line data Source code
1 : import 'package:flutter/widgets.dart'; 2 : 3 : class LabeledForm extends StatelessWidget { 4 : final String label; 5 : final Widget widget; 6 : 7 2 : const LabeledForm({ 8 : Key key, 9 : @required this.label, 10 : @required this.widget, 11 2 : }) : super(key: key); 12 : 13 2 : @override 14 : Widget build(BuildContext context) { 15 2 : return Column( 16 : crossAxisAlignment: CrossAxisAlignment.start, 17 2 : children: [ 18 2 : Padding( 19 : padding: const EdgeInsets.only(bottom: 5.0), 20 2 : child: Text( 21 2 : label, 22 2 : style: TextStyle( 23 : fontSize: 10.0, 24 : fontWeight: FontWeight.bold, 25 : ), 26 : ), 27 : ), 28 2 : this.widget, 29 : ], 30 : ); 31 : } 32 : }