123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- import 'package:cs_resources/generated/assets.dart';
- import 'package:cs_resources/generated/l10n.dart';
- import 'package:cs_resources/theme/app_colors_theme.dart';
- import 'package:domain/entity/user_me_entity.dart';
- import 'package:flutter/material.dart';
- import 'package:widgets/ext/ex_widget.dart';
- import 'package:widgets/my_load_image.dart';
- import 'package:widgets/my_text_view.dart';
- class EstateItem extends StatelessWidget {
- final int childIndex; //组内的索引
- final UserMeEstatesAccounts item;
- final VoidCallback deleteAction;
- final VoidCallback itemAction;
- const EstateItem({
- required this.childIndex,
- required this.item,
- required this.deleteAction,
- required this.itemAction,
- });
- @override
- Widget build(BuildContext context) {
- return Stack(
- children: [
- Container(
- width: double.infinity,
- color: context.appColors.whiteBG,
- padding: const EdgeInsets.only(top: 22.5),
- margin: EdgeInsets.only(top: childIndex == 0 ? 0 : 10),
- child: Column(
- children: [
- Row(
- children: [
- MyLoadImage(
- item.avatar,
- width: 65,
- height: 65,
- isCircle: true,
- ).marginOnly(
- right: 17,
- left: 15,
- ),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const SizedBox(height: 22.5),
- //姓名
- MyTextView(
- item.name ?? "-",
- fontSize: 16,
- isFontBold: true,
- textColor: context.appColors.textBlack,
- maxLines: 2,
- ),
- MyTextView(
- item.type == "1" ? S.current.owner : S.current.tenant,
- fontSize: 15,
- isFontRegular: true,
- textColor: context.appColors.textBlack,
- ),
- MyTextView(
- item.unit?.address ?? "-",
- fontSize: 15,
- isFontRegular: true,
- textColor: context.appColors.textBlack,
- ),
- ],
- ).expanded(),
- ],
- ),
- const SizedBox(height: 22.5),
- Divider(
- height: 0.5,
- color: context.appColors.backgroundDark,
- ),
- Center(
- child: MyTextView(
- S.current.remove,
- paddingTop: 16,
- paddingBottom: 16,
- fontSize: 16,
- onClick: deleteAction,
- isFontMedium: true,
- textColor: context.appColors.textPrimary,
- ),
- )
- ],
- ),
- ).onTap(itemAction),
- Visibility(
- visible: item.isDefault == 1,
- child: const MyAssetImage(
- Assets.profileMyEstateDefault,
- width: 76,
- height: 44,
- ),
- ).marginOnly(top: childIndex == 0 ? 0 : 10).alignRight(),
- MyTextView(
- S.current.approved,
- fontSize: 16,
- onClick: deleteAction,
- isFontMedium: true,
- textColor: context.appColors.textGreen,
- ).marginOnly(top: childIndex == 0 ? 46.5 : 56.5, right: 15).alignRight()
- ],
- );
- }
- }
|