import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:wow_english/common/extension/string_extension.dart'; import 'package:wow_english/common/widgets/ow_image_widget.dart'; import 'package:wow_english/models/follow_read_entity.dart'; class RepeatAfterItem extends StatelessWidget { const RepeatAfterItem({super.key, this.tapEvent, this.entity}); final FollowReadEntity? entity; final Function()? tapEvent; @override Widget build(BuildContext context) { return Padding( padding: EdgeInsets.symmetric( horizontal: 10.w ), child: GestureDetector( onTap: (){ ///todo 暂时注释调,测试用 if (entity != null) { if (!entity!.lock!) { tapEvent?.call(); } } }, child: Stack( children: [ _modelInfoWidget(context), _lockWidget() ], ), ), ); } Widget _modelInfoWidget(BuildContext context) { return Container( width: 162.w, height: 235.h, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( 'gendubeij'.assetPng ), fit: BoxFit.fill ) ), padding: EdgeInsets.symmetric(horizontal: 11.w,vertical: 13.h), alignment: Alignment.center, child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ OwImageWidget( name:entity?.coverUrl??'', height: 100.h, width: 140.w, fit: BoxFit.fitWidth, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Image.asset( (entity?.star??0) >= 1 ? 'star_light'.assetPng:'star_dark'.assetPng, width: 23.w, height: 21.h, ), Image.asset( (entity?.star??0) >= 2 ? 'star_light'.assetPng:'star_dark'.assetPng, width: 23.w, height: 21.h, ), Image.asset( (entity?.star??0) >= 3 ? 'star_light'.assetPng:'star_dark'.assetPng, width: 23.w, height: 21.h, ), Image.asset( (entity?.star??0) >= 4 ? 'star_light'.assetPng:'star_dark'.assetPng, width: 23.w, height: 21.h, ), Image.asset( (entity?.star??0) >= 5 ? 'star_light'.assetPng:'star_dark'.assetPng, width: 23.w, height: 21.h, ), ], ), Container( height: 35.h, width: double.infinity, decoration: BoxDecoration( color: const Color(0xFFFFCC00), borderRadius: BorderRadius.circular(5.r), border: Border.all( width: 1.0, color: const Color(0xFF333333), ), ), alignment: Alignment.center, child: Text( entity?.title??'', style: TextStyle( fontSize: 16.sp, color: const Color(0xFF333333) ), ), ) ], ), ); } Widget _lockWidget() { return Visibility( visible: entity?.lock??false, child: Container( width: 162.w, height: 235.h, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( 'gendubeij_mengban'.assetPng ), fit: BoxFit.fill ) ), alignment: Alignment.center, child: Image.asset( 'iv_lock'.assetPng, height: 36.h, width: 41.w, ), ), ); } }