Resolves #291 some padding issues

This commit is contained in:
Yegor Vialov
2019-02-16 19:59:39 +02:00
parent e006c4e403
commit 62b1af30e0
4 changed files with 24 additions and 16 deletions

View File

@ -7,6 +7,7 @@ class ModeSwitchWidget extends StatelessWidget {
final double captionFontSize;
final bool value;
final bool expanded;
final EdgeInsets padding;
ModeSwitchWidget({
Key key,
@ -14,19 +15,23 @@ class ModeSwitchWidget extends StatelessWidget {
@required this.onChange,
this.captionFontSize,
this.value,
this.expanded: true
this.expanded: true,
this.padding: const EdgeInsets.only(left: Sizes.leftWidgetPadding, right: Sizes.rightWidgetPadding)
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: <Widget>[
_buildCaption(),
Switch(
onChanged: (value) => onChange(value),
value: value ?? false,
)
],
return Padding(
padding: this.padding,
child: Row(
children: <Widget>[
_buildCaption(),
Switch(
onChanged: (value) => onChange(value),
value: value ?? false,
)
],
)
);
}