如何在Flutter GridView中从右向左填充数据 [英] How to fill data right to left in Flutter gridview

查看:83
本文介绍了如何在Flutter GridView中从右向左填充数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从右到左填充Grid视图数据,因为该应用程序是阿拉伯语并且所有内容都是RTL.

I am trying to fill Grid view data from right to left, as the application is in arabic and everything is RTL.

这就是我想要的

我正在使用Stream builder填充数据和以下Gridview小部件

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(),
      );

有什么办法可以水平反转项目填充方向,如 reverse 参数使垂直填充从下到上一样.谢谢.

Is there any way I can reverse the item filling direction Horizontally , like the reverse param made filling vertically bottom to top. Thank you.

推荐答案

使用方向性小部件

Directionality(
          textDirection: TextDirection.rtl,
          child: productGrid()

这篇关于如何在Flutter GridView中从右向左填充数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆