home_menu.dart 756 B

123456789101112131415161718192021222324252627282930313233
  1. import 'package:flutter/material.dart';
  2. import 'package:shuqi/public.dart';
  3. import 'home_model.dart';
  4. class HomeMenu extends StatelessWidget {
  5. final List<MenuInfo> infos;
  6. HomeMenu(this.infos);
  7. @override
  8. Widget build(BuildContext context) {
  9. return Container(
  10. color: Colors.white,
  11. padding: EdgeInsets.symmetric(vertical: 10),
  12. child: Row(
  13. mainAxisAlignment: MainAxisAlignment.spaceAround,
  14. children: infos.map((info) => menuItem(info)).toList(),
  15. ),
  16. );
  17. }
  18. Widget menuItem(MenuInfo info) {
  19. return Column(
  20. children: <Widget>[
  21. Image.asset(info.icon),
  22. SizedBox(height: 5),
  23. Text(info.title, style: TextStyle(fontSize: 12, color: SQColor.gray)),
  24. ],
  25. );
  26. }
  27. }