feat(profile): 371 task badge description onTap

This commit is contained in:
mso7nueh
2025-04-25 15:25:48 +03:00
parent 3e0ba5c440
commit 746aab2fae
2 changed files with 47 additions and 13 deletions

View File

@@ -19,18 +19,14 @@ class SubPaginationModel with _$SubPaginationModel {
@freezed
class SubModel with _$SubModel {
const factory SubModel({
required int id,
required String slug,
required String name,
required String city,
required DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me') required bool isEntitySubscribedByMe,
required String email,
@JsonKey(name: 'profile_photo_url') required String profilePhotoUrl,
required String role,
required List<String> roles,
@JsonKey(name: 'is_public_profile') required bool isPublicProfile,
@JsonKey(name: 'created_at') required DateTime createdAt,
@JsonKey(name: 'updated_at') required DateTime updatedAt,
}) = _SubModel;
factory SubModel.fromJson(Map<String, Object?> json) => _$SubModelFromJson(json);

View File

@@ -658,15 +658,53 @@ class _ProfileScreenState extends State<ProfileScreen> {
children: [
for (int i = 0; i < state.profile.badges.length; i++) ...[
state.profile.badges[i].image.contains('svg')
? SvgPicture.network(
'$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
? Tooltip(
message: state.profile.badges[i].description,
triggerMode: TooltipTriggerMode.tap,
textStyle: const TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w500,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha((255 * 0.2).toInt()),
blurRadius: 32,
)
],
),
child: SvgPicture.network(
'$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
),
)
: CachedNetworkImage(
imageUrl: '$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
: Tooltip(
message: state.profile.badges[i].description,
triggerMode: TooltipTriggerMode.tap,
textStyle: const TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w500,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha((255 * 0.2).toInt()),
blurRadius: 32,
)
],
),
child: CachedNetworkImage(
imageUrl: '$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
),
),
i < state.profile.badges.length - 1 ? const SizedBox(width: 8) : const SizedBox.shrink(),
],