-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGridViewWidget.dart
54 lines (52 loc) · 1.55 KB
/
GridViewWidget.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/common/CommonShowModel.dart';
///author: yang yi
///email: yangyirunning@163.com
class GridViewWidget extends StatefulWidget {
@override
GridViewState createState() {
// TODO: implement createState
return GridViewState();
}
}
class GridViewState extends State<GridViewWidget> {
@override
Widget build(BuildContext context) {
// TODO: implement build
final arg = ModalRoute.of(context).settings.arguments;
return Scaffold(
appBar: getAppBar(arg),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
alignment: Alignment.center,
child: Text(
"GridView + SliverGridDelegateWithFixedCrossAxisCount",
style: TextStyle(
fontSize: 30,
fontFamily: "HanyiSentySuciTablet",
color: Colors.blue),
),
),
Expanded(
child: Scrollbar(
child: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 1.5, //宽高比
mainAxisSpacing: 5,
crossAxisSpacing: 5,
),
shrinkWrap: true,
padding: EdgeInsets.all(10),
children: getLimitListWidget(20),
),
),
)
],
),
);
}
}