#资料
基本
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class GridViewWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Container"),
),
body: GridView.count(
crossAxisCount: 2,
primary: false,
padding: const EdgeInsets.all(20.0),
crossAxisSpacing: 10.0,
children: <Widget>[
Container(
color: Colors.red,
child: const Text('He\'d have you all unravel at the '),
),
Container(
color: Colors.green,
child: const Text('Heed not be rabble'),
),
Container(
color: Colors.blueAccent,
child: const Text('Sound of screams but the'),
),
const Text('Who sscream'),
const Text('Revolution is coming...'),
const Text('Revolution, they...'),
],
),
);
}
}