✨ Calculate number of columns depending on screen size
This commit is contained in:
@ -12,7 +12,7 @@ class _MixingTabState extends State<MixingTab> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
double screenWidth = MediaQuery.of(context).size.width;
|
double screenWidth = MediaQuery.of(context).size.width;
|
||||||
int cols = screenWidth > 550 ? 2 : 1;
|
int cols = 1 + (screenWidth ~/ 550);
|
||||||
int cardHeight = 110;
|
int cardHeight = 110;
|
||||||
|
|
||||||
return SizedBox.expand(
|
return SizedBox.expand(
|
||||||
|
Reference in New Issue
Block a user