123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import 'dart:ui' as ui;
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
-
- import 'package:farmer_client/widgets/LinearGradientText.dart';
-
- import '../../../models/entities/CardInfo.dart';
-
- Widget summary({required CardInfo item, required String km}) {
- return Column(
- children: [
- _title(item: item),
- SizedBox(
- height: 20.w,
- ),
- _desc(item: item, km: km),
- SizedBox(
- height: 20.w,
- ),
- _detail(item: item),
- SizedBox(
- height: 20.w,
- ),
- ],
- );
- }
-
- Widget _title({required CardInfo item}) {
- return Row(
- children: [
- Expanded(
- child: Text(item.name.toString(),
- style: TextStyle(
- color: const Color(0xFF222222),
- fontSize: 18.sp,
- fontWeight: FontWeight.bold,
- )),
- flex: 1),
- Container(
- width: 100.w,
- alignment: Alignment.centerRight,
- child: LinearGradientText(
- colors: const <Color>[
- Color(0xFFFA7878),
- Color(0xFFB61515),
- ],
- child: RichText(
- text: TextSpan(children: <InlineSpan>[
- TextSpan(
- text: ((item.price ?? 0) / 100).toString(),
- style: TextStyle(
- fontSize: 22.sp,
- fontWeight: FontWeight.bold,
- )),
- TextSpan(
- text: "元/",
- style: TextStyle(
- fontSize: 22.sp,
- fontWeight: FontWeight.bold,
- )),
- TextSpan(
- text: "亩",
- style: TextStyle(
- fontSize: 12.sp,
- fontWeight: FontWeight.bold,
- )),
- ]),
- ),
- ),
- )
- ],
- );
- }
-
- Widget _desc({required CardInfo item, required String km}) {
- return Row(
- children: [
- Icon(
- Icons.location_on_outlined,
- size: 16.sp,
- ),
- Expanded(
- flex: 1,
- child: Text(
- "距离当前位置$km >>",
- style: TextStyle(color: const Color(0xFF222222), fontSize: 15.sp),
- ),
- ),
- ],
- );
- }
-
- Widget _detail({required CardInfo item}) {
- return Container(
- alignment: Alignment.centerLeft,
- child: Text(
- item.orgName.toString(),
- style: TextStyle(color: const Color(0xFF222222), fontSize: 15.sp),
- ),
- );
- }
|