flutter grid布局记录

代码如下

GridView.builder(
              physics: const NeverScrollableScrollPhysics(),
              shrinkWrap: true,
              gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
                crossAxisCount: 4,
                crossAxisSpacing: 4.0,
                mainAxisSpacing: 4.0,
                // childAspectRatio: 100 / 120,
                childAspectRatio: 100 / 90,
              ),
              itemCount: menusListCommonUse.length,
              itemBuilder: (c, i) {
                return capabilityItem(menusListCommonUse[i]);
              },
            )

你可能感兴趣的:(flutter)