问题
I am trying to fill Grid view data from right to left, as the application is in arabic and everything is RTL.
Here is what I want
I am using Stream builder to populate data and the following Gridview widget
Widget productGrid(List<Product> products) => GridView.count(
crossAxisCount: 3,
reverse: true,
controller: _scrollController,
padding: EdgeInsets.all(4.0),
childAspectRatio: 8.0 / 14,
children: products
.map(
(product) => MyBookList(item: product),
)
.toList(),
);
Is there any way I can reverse the item filling direction Horizontally , like the reverse
param made filling vertically bottom to top.
Thank you.
回答1:
use Directionality
widget
Directionality(
textDirection: TextDirection.rtl,
child: productGrid()
来源:https://stackoverflow.com/questions/55090930/how-to-fill-data-right-to-left-in-flutter-gridview