floor_part.dart 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_note/routers/application.dart';
  3. import 'package:flutter_note/model/home_page_model.dart';
  4. import 'package:flutter_note/routers/routers.dart';
  5. class FloorTitle extends StatelessWidget {
  6. final String floorPic;
  7. FloorTitle({Key key, @required this.floorPic}) : super(key: key);
  8. @override
  9. Widget build(BuildContext context) {
  10. return SliverToBoxAdapter(
  11. child: Container(
  12. child: Image.network(floorPic),
  13. padding: const EdgeInsets.symmetric(vertical: 12.0)));
  14. }
  15. }
  16. class FloorContent extends StatelessWidget {
  17. final List<Floor> floorContent;
  18. FloorContent({Key key, @required this.floorContent}) : super(key: key);
  19. Widget _goodsImg(Floor floorItem, context) {
  20. return InkWell(
  21. child: Image.network(floorItem.image,
  22. width: MediaQuery.of(context).size.width / 2),
  23. onTap: () => Application.router.navigateTo(
  24. context, Routers.generateDetailsRouterPath(floorItem.goodsId)));
  25. }
  26. Widget _topRow(context) {
  27. return Row(children: <Widget>[
  28. _goodsImg(floorContent[0], context),
  29. Column(children: <Widget>[
  30. _goodsImg(floorContent[1], context),
  31. _goodsImg(floorContent[2], context),
  32. ])
  33. ]);
  34. }
  35. @override
  36. Widget build(BuildContext context) {
  37. return SliverToBoxAdapter(
  38. child: InkWell(
  39. child: Container(
  40. child: Column(children: <Widget>[
  41. _topRow(context),
  42. Row(children: <Widget>[
  43. _goodsImg(floorContent[3], context),
  44. _goodsImg(floorContent[4], context),
  45. ])
  46. ]),
  47. ),
  48. onTap: () {},
  49. ));
  50. }
  51. }