recommended_today_page.dart 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import 'package:bbyyy/my_tools/my_colors.dart';
  2. import 'package:bbyyy/my_tools/my_views.dart';
  3. import 'package:flutter/cupertino.dart';
  4. import 'package:flutter/material.dart';
  5. class RecommendedTodayPage extends StatefulWidget {
  6. @override
  7. _RecommendedTodayPageState createState() => _RecommendedTodayPageState();
  8. }
  9. class _RecommendedTodayPageState extends State<RecommendedTodayPage> {
  10. @override
  11. Widget build(BuildContext context) {
  12. return Scaffold(
  13. body: Column(
  14. children: [
  15. MyViews().myAppBar('梆梆今日折扣', context, []),
  16. Expanded(
  17. child: GridView.builder(
  18. padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
  19. gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  20. crossAxisCount: 2,
  21. childAspectRatio:
  22. 164/261,
  23. crossAxisSpacing: 16,
  24. mainAxisSpacing: 16),
  25. itemBuilder: (c, index) {
  26. return Container(
  27. decoration: BoxDecoration(
  28. boxShadow: [
  29. BoxShadow(
  30. color: MyColors.c7FE1E1E1,
  31. blurRadius: 5.0,
  32. ),
  33. ],
  34. color: Colors.white,
  35. borderRadius: BorderRadius.circular(4),
  36. ),
  37. child: Column(
  38. children: [
  39. Padding(
  40. padding: const EdgeInsets.all(6.0),
  41. child: Row(
  42. children: [
  43. ClipRRect(
  44. child: MyViews().netImg('path', 20, 20),
  45. borderRadius: BorderRadius.circular(10),
  46. ),
  47. Container(
  48. child: Text(
  49. 'name',
  50. style: TextStyle(
  51. color: MyColors.c999999, fontSize: 10),
  52. ),
  53. margin: EdgeInsets.only(left: 5),
  54. ),
  55. ],
  56. ),
  57. ),
  58. Container(
  59. height: 1,
  60. color: MyColors.cF0F0F0,
  61. ),
  62. MyViews().netImg(
  63. 'path',
  64. (MediaQuery.of(context).size.width - 48) / 2,
  65. (MediaQuery.of(context).size.width - 48) / 2,
  66. placeholder: 'images/svg/goodsDefImg.svg'),
  67. Container(
  68. height: 1,
  69. color: MyColors.cF0F0F0,
  70. ),
  71. Padding(
  72. padding: const EdgeInsets.only(top: 6.0,left: 6,right: 6),
  73. child: Text(
  74. '8.9元充10元话费',
  75. style: TextStyle(color: MyColors.c333333, fontSize: 12),
  76. ),
  77. ),
  78. Padding(
  79. padding: const EdgeInsets.only(bottom: 6.0,left: 6,right: 6),
  80. child: Row(
  81. children: [
  82. Text(
  83. '¥8.90',
  84. style: TextStyle(
  85. color: MyColors.cFF4233,
  86. fontSize: 15,
  87. fontWeight: FontWeight.bold),
  88. ),
  89. Container(
  90. decoration: BoxDecoration(
  91. border:
  92. Border.all(color: MyColors.cFF4233, width: 1),
  93. borderRadius: BorderRadius.circular(10),
  94. ),
  95. height: 20,width: 50,
  96. child: Text('详情',style: TextStyle(color: MyColors.cFF4233,fontSize: 12),),
  97. alignment: Alignment.center,
  98. )
  99. ],mainAxisAlignment: MainAxisAlignment.spaceBetween,
  100. ),
  101. )
  102. ],
  103. crossAxisAlignment: CrossAxisAlignment.start,
  104. ),
  105. );
  106. },
  107. itemCount: 20,
  108. ),
  109. ),
  110. ],
  111. ),
  112. );
  113. }
  114. }