我的房屋-业主身份显示过期时间

hmxc
张萌 3 years ago
parent b08cd7cce2
commit a8d9176b4c

@ -1,4 +1,5 @@
import 'package:aku_community/models/user/passed_house_list_model.dart'; import 'package:aku_community/models/user/passed_house_list_model.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -151,20 +152,21 @@ class HouseCard extends StatelessWidget {
], ],
).expand(), ).expand(),
// //
isOwner !isOwner
? SizedBox() ? SizedBox()
: Column( : Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'到期时间', '到期时间${_isOverDate(DateUtil.getDateTime(model!.effectiveTimeEnd!)!)}',
style: style:
Theme.of(context).textTheme.subtitle2!.copyWith( Theme.of(context).textTheme.subtitle2!.copyWith(
color: Color(0xFF666666), color: Color(0xFF666666),
), ),
), ),
Text( Text(
_roleName, DateUtil.formatDateStr(model!.effectiveTimeEnd!,
format: 'yyyy-MM-dd'),
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
), ),
], ],
@ -183,7 +185,11 @@ class HouseCard extends StatelessWidget {
); );
} }
_isOverDate(DateTime date) { String _isOverDate(DateTime date) {
return DateTime.now().isAfter(date); if (DateTime.now().isAfter(date)) {
return '已过期';
} else {
return '未过期';
}
} }
} }

Loading…
Cancel
Save