Skip to content

Commit 8293f72

Browse files
committed
flex button
1 parent c74d0f1 commit 8293f72

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

‎lib/widget/GSYFlexButton.dart‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ class GSYFlexButton extends StatelessWidget {
1818

1919
@override
2020
Widget build(BuildContext context) {
21-
return new Row(children: <Widget>[
22-
new Expanded(
23-
child: new RaisedButton(
24-
padding: new EdgeInsets.only(left: 20.0, top: 10.0, right: 20.0, bottom: 10.0),
25-
textColor: textColor,
26-
color: color,
27-
child: new Text(text, style: new TextStyle(fontSize: 20.0)),
28-
onPressed: () {
29-
if (this.onPress != null) {
30-
this.onPress();
31-
}
32-
}))
33-
]);
21+
return new RaisedButton(
22+
padding: new EdgeInsets.only(left: 20.0, top: 10.0, right: 20.0, bottom: 10.0),
23+
textColor: textColor,
24+
color: color,
25+
child: new Flex(
26+
mainAxisAlignment: MainAxisAlignment.center,
27+
direction: Axis.horizontal,
28+
children: <Widget>[new Text(text, style: new TextStyle(fontSize: 20.0))],
29+
),
30+
onPressed: () {
31+
if (this.onPress != null) {
32+
this.onPress();
33+
}
34+
});
3435
}
3536
}

0 commit comments

Comments
 (0)