order_grid.dart 903 B

1234567891011121314151617181920212223242526
  1. import 'package:flutter/material.dart';
  2. class OrderGrid extends StatelessWidget {
  3. final _icons = [Icons.payment, Icons.timer, Icons.airport_shuttle, Icons.textsms];
  4. final _titles = ['待付款', '待发货', '待收货', '待评价'];
  5. @override
  6. Widget build(BuildContext context) {
  7. return SizedBox(
  8. height: MediaQuery.of(context).size.width / 4,
  9. child: GridView.count(
  10. crossAxisCount: _icons.length,
  11. children: List.generate(
  12. _icons.length,
  13. (index) => InkWell(
  14. child: Column(
  15. mainAxisAlignment: MainAxisAlignment.center,
  16. children: <Widget>[Icon(_icons[index]), Padding(padding: const EdgeInsets.all(4.0), child: Text(_titles[index]))],
  17. ),
  18. onTap: () {},
  19. )),
  20. physics: NeverScrollableScrollPhysics(),
  21. ),
  22. );
  23. }
  24. }