I really don not understand what wrong and how to fix it
I want to show 2 buttons on the screen in row
I have stateless widget MainPage:
class MainPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Person(),
History()
],
),
);
}
}
And I have 2 buttons: Person and History There is classes Person and History:
class Person extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: RaisedButton(
child: Container(
width: 100,
height: 100,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Person"),
Icon(Icons.person)
],
),
),
),
),
);
}
}
class History extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: RaisedButton(
child: Container(
width: 100,
height: 100,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("History"),
Icon(Icons.history)
],
),
),
),
),
);
}
}
But I get an error: A RenderFlex overflowed by Infinity pixels on the right. Where am I wrong?