Last active
July 12, 2017 22:29
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new SingleChildScrollView( | |
child: new Container( | |
margin: const EdgeInsets.all(16.0), | |
child: new Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
mainAxisSize: MainAxisSize.min, | |
children: <Widget>[ | |
new Expanded(child: new LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints){ | |
return new Container( | |
constraints: new BoxConstraints.tightFor(width: constraints.maxWidth, height: constraints.maxWidth), | |
padding: const EdgeInsets.all(2.0), | |
child: new FoodTile(name:"hallo",onPressed: (bool state){}), | |
); | |
})), | |
new Expanded(child: new LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints){ | |
return new Container( | |
constraints: new BoxConstraints.tightFor(width: constraints.maxWidth, height: constraints.maxWidth), | |
padding: const EdgeInsets.all(2.0), | |
child: new FoodTile(name:"hallo 2",onPressed: (bool state){}), | |
); | |
})), | |
new Expanded(child: new LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints){ | |
return new Container( | |
constraints: new BoxConstraints.tightFor(width: constraints.maxWidth, height: constraints.maxWidth), | |
padding: const EdgeInsets.all(2.0), | |
child: new FoodTile(name:"hallo 3",onPressed: (bool state){}), | |
); | |
})), | |
], | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return SingleChildScrollView( | |
child: Container( | |
margin: EdgeInsets.all(16.0), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
Expanded(child: LayoutBuilder(builder: (_, constraints) => | |
Container( | |
constraints: BoxConstraints.tightFor(width: constraints.maxWidth, height: constraints.maxWidth), | |
padding: EdgeInsets.all(2.0), | |
child: FoodTile(name:"hallo", onPressed: (_){}), | |
); | |
)), | |
Expanded(child: LayoutBuilder(builder: (_, constraints) => | |
Container( | |
constraints: BoxConstraints.tightFor(width: constraints.maxWidth, height: constraints.maxWidth), | |
padding: EdgeInsets.all(2.0), | |
child: FoodTile(name:"hallo 2", onPressed: (_){}), | |
); | |
)), | |
Expanded(child: LayoutBuilder(builder: (_, constraints) => | |
Container( | |
constraints: BoxConstraints.tightFor(width: constraints.maxWidth, height: constraints.maxWidth), | |
padding: EdgeInsets.all(2.0), | |
child: FoodTile(name:"hallo 3", onPressed: (_){}), | |
); | |
)), | |
], | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget expandedContainer(Widget child) { | |
return Expanded( | |
child: LayoutBuilder( | |
builder: (_, constraints) { | |
return Container( | |
constraints: BoxConstraints.tightFor(width: constraints.maxWidth, height: constraints.maxWidth), | |
padding: EdgeInsets.all(2.0), | |
child: child), | |
); | |
}, | |
), | |
); | |
} | |
return SingleChildScrollView( | |
child: Container( | |
margin: EdgeInsets.all(16.0), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
expandedContainer(FoodTile(name:"hallo", onPressed: (_){})), | |
expandedContainer(FoodTile(name:"hallo 2", onPressed: (_){})), | |
expandedContainer(FoodTile(name:"hallo 3", onPressed: (_){})), | |
], | |
), |
yjbanov
commented
Jul 12, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment