pull/1/head
张萌 3 years ago
commit de56df4531

@ -152,7 +152,7 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
), ),
), ),
bottomNavi: BottomButton( bottomNavi: BottomButton(
child: '立即报名'.text.size(32.sp).bold.make(), child: btnText,
onPressed: !canTap onPressed: !canTap
? null ? null
: () async { : () async {
@ -166,6 +166,16 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
); );
} }
Widget get btnText{
if (_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) {
return '报名截止'.text.size(32.sp).bold.make();
}else if(_model!.isRegistration==1){
return '已报名'.text.size(32.sp).bold.make();
}else{
return '立即报名'.text.size(32.sp).bold.make();
}
}
bool get canTap { bool get canTap {
if ((_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) ||_model!.isRegistration==1) { if ((_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) ||_model!.isRegistration==1) {
return false; return false;

@ -174,6 +174,13 @@ class _ChatCardState extends State<ChatCard> {
super.initState(); super.initState();
} }
@override
void didUpdateWidget(covariant ChatCard oldWidget) {
_isLiked = widget.model.isLike;
_likeNum = widget.model.likes;
super.didUpdateWidget(oldWidget);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DecoratedBox( return DecoratedBox(

@ -12,4 +12,5 @@ class UserTool {
Provider.of<AppProvider>(Get.context!, listen: false); Provider.of<AppProvider>(Get.context!, listen: false);
static DataProvider get dataProvider => static DataProvider get dataProvider =>
Provider.of<DataProvider>(Get.context!, listen: false); Provider.of<DataProvider>(Get.context!, listen: false);
UserTool();
} }

Loading…
Cancel
Save