Commit 8865a7c0ea5e16e1c19e8ee18291493df800558a

Authored by xiaoyu
2 parents c2308a53 35cdb7c5

Merge remote-tracking branch 'origin/master'

lib/pages/shop/home/widgets/product_item.dart
1   -import 'package:cached_network_image/cached_network_image.dart';
2 1 import 'package:flutter/material.dart';
3 2 import 'package:flutter_screenutil/flutter_screenutil.dart';
4 3 import 'package:wow_english/models/product_entity.dart';
... ... @@ -47,44 +46,48 @@ class ProductItem extends StatelessWidget {
47 46 style: TextStyle(
48 47 fontSize: 16.sp, color: const Color(0xFF333333)),
49 48 ),
50   - RichText(
51   - text: TextSpan(children: [
52   - TextSpan(
53   - text: '¥',
  49 + FittedBox(
  50 + fit: BoxFit.scaleDown,
  51 + child: RichText(
  52 + text: TextSpan(children: [
  53 + TextSpan(
  54 + text: '¥',
  55 + style: TextStyle(
  56 + fontSize: 21.sp,
  57 + color: const Color(0xFFF51A1A),
  58 + )),
  59 + TextSpan(
  60 + text: entity?.price?.toString() ?? '',
54 61 style: TextStyle(
55   - fontSize: 21.sp,
  62 + fontSize: 40.sp,
56 63 color: const Color(0xFFF51A1A),
57   - )),
58   - TextSpan(
59   - text: entity?.price?.toString() ?? '',
60   - style: TextStyle(
61   - fontSize: 40.sp,
62   - color: const Color(0xFFF51A1A),
63   - ),
64   - )
65   - ]),
  64 + ),
  65 + )
  66 + ]),
  67 + ),
66 68 ),
67 69 GestureDetector(
68 70 onTap: () {
69 71 onTap();
70 72 },
71 73 child: Container(
72   - decoration: BoxDecoration(
73   - color: const Color(0xFFF5C51F),
74   - borderRadius: BorderRadius.circular(5.r),
75   - border: Border.all(
76   - color: const Color(0xFF333333),
77   - width: 1.0,
78   - )),
79   - padding: EdgeInsets.symmetric(
80   - vertical: 1.h,
81   - horizontal: 26.5.w,
82   - ),
83   - child: Text(
84   - '立即购买',
85   - style: TextStyle(
86   - fontSize: 10.sp, color: const Color(0xFF333333)),
87   - ),
  74 + decoration: BoxDecoration(
  75 + color: const Color(0xFFF5C51F),
  76 + borderRadius: BorderRadius.circular(5.r),
  77 + border: Border.all(
  78 + color: const Color(0xFF333333),
  79 + width: 1.0,
  80 + )),
  81 + padding: EdgeInsets.symmetric(
  82 + vertical: 1.h
  83 + ),
  84 + child: Center(
  85 + child: Text(
  86 + '立即购买',
  87 + style: TextStyle(
  88 + fontSize: 10.sp, color: const Color(0xFF333333)),
  89 + ),
  90 + )
88 91 ),
89 92 )
90 93 ],
... ...