效果图:

Flutter 通过 GridView 实现网格布局

 

 实现代码:

import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Row'),
        ),
        body: GridView.count(
          crossAxisCount: 3,
          children: <Widget>[
            Container(
              child: Text('第一块'),
              color: Colors.red,
            ),
            Text('第二块'),
            Text('第三块'),
          ],
        )
      ),
    );
  }
}

相关文章:

  • 2022-12-23
  • 2022-03-08
  • 2022-02-28
  • 2021-06-15
  • 2021-06-09
  • 2021-11-11
  • 2022-01-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-07-14
  • 2022-12-23
相关资源
相似解决方案