6

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 enter image description here

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.

Abdullah
  • 935
  • 9
  • 18

1 Answers1

18

use Directionality widget

Directionality(
          textDirection: TextDirection.rtl,
          child: productGrid()
Raouf Rahiche
  • 28,948
  • 10
  • 85
  • 77
  • 2
    Thank you for your help, it works perfectly. Could you please explain how do the text direction works for filling direction of grid – Abdullah Mar 11 '19 at 17:43