Staggered grid view #279
Unanswered
fadillou157
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
I am a beginner on flutter and I followed a tutorial to create a calculator application but if I try StaggeredGridView.countBuilder with version 0.6.2 it shows me an error I would like to know how to replace this piece of code
return StaggeredGridView.countBuilder(
crossAxisCount: 4,
itemCount: buttons.length,
itemBuilder: (context, index) {
final button = buttons[index];
return MaterialButton(
padding: button.value == '0'
? EdgeInsets.only(right: 100)
:EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(60),
),
),
color: button.bgColor,
onPressed: () {
_onButtonPressed(button.value);
},
child:Text(
button.value,
style: TextStyle(
color: button.fgColor,
fontSize: 35,
),
),
);
},
mainAxisSpacing: 12,
crossAxisSpacing: 12,
staggeredTileBuilder: (index) =>
StaggeredTile.count(buttons[index].value == '0' ? 2: 1, 1),
);
so if you can help me to solve this bug
Beta Was this translation helpful? Give feedback.
All reactions