feat(profile): changed profile bages layout

This commit is contained in:
misha
2025-10-29 04:01:27 +03:00
parent ce0099c385
commit a34cb01c1f

View File

@@ -690,24 +690,47 @@ class _ProfileScreenState extends State<ProfileScreen> {
for (int i = 0; i < state.profile.badges.length; i++) ...[ for (int i = 0; i < state.profile.badges.length; i++) ...[
state.profile.badges[i].image.contains('svg') state.profile.badges[i].image.contains('svg')
? Tooltip( ? Tooltip(
message: state.profile.badges[i].description, preferBelow: true,
showDuration: const Duration(seconds: 5),
richMessage: WidgetSpan(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(state.profile.badges[i].title, style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
const SizedBox(height: 4),
Text(state.profile.badges[i].description, style: TextStyles.textSMedium.copyWith(color: appTheme.gray600)),
],
),
),
triggerMode: TooltipTriggerMode.tap, triggerMode: TooltipTriggerMode.tap,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
textStyle: const TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.w500), textStyle: const TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.w500),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(12),
boxShadow: [BoxShadow(color: Colors.black.withAlpha((255 * 0.2).toInt()), blurRadius: 32)], boxShadow: [BoxShadow(color: Colors.black.withAlpha((255 * 0.2).toInt()), blurRadius: 32)],
), ),
child: SvgPicture.network('${sl<AppConfig>().baseUrl}/storage/${state.profile.badges[i].image}', width: 40, height: 40), child: SvgPicture.network('${sl<AppConfig>().baseUrl}/storage/${state.profile.badges[i].image}', width: 40, height: 40),
) )
: Tooltip( : Tooltip(
message: state.profile.badges[i].description, preferBelow: true,
margin: const EdgeInsets.symmetric(horizontal: 32), showDuration: const Duration(seconds: 5),
richMessage: WidgetSpan(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(state.profile.badges[i].title, style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
const SizedBox(height: 4),
Text(state.profile.badges[i].description, style: TextStyles.textSMedium.copyWith(color: appTheme.gray600)),
],
),
),
triggerMode: TooltipTriggerMode.tap, triggerMode: TooltipTriggerMode.tap,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
textStyle: const TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.w500), textStyle: const TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.w500),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(12),
boxShadow: [BoxShadow(color: Colors.black.withAlpha((255 * 0.2).toInt()), blurRadius: 32)], boxShadow: [BoxShadow(color: Colors.black.withAlpha((255 * 0.2).toInt()), blurRadius: 32)],
), ),
child: CachedNetworkImage(imageUrl: '${sl<AppConfig>().baseUrl}/storage/${state.profile.badges[i].image}', width: 40, height: 40), child: CachedNetworkImage(imageUrl: '${sl<AppConfig>().baseUrl}/storage/${state.profile.badges[i].image}', width: 40, height: 40),
@@ -846,7 +869,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
icon: 'assets/icons/eye.svg', icon: 'assets/icons/eye.svg',
text: 'Посмотреть', text: 'Посмотреть',
onTap: () async { onTap: () async {
context.pushTransparentRoute(rootNavigator: true, PhotoViewScreen(imageUrls: [sl<AppConfig>().baseUrl + state.profile.profilePhotoUrl], index: 0)); context.pushTransparentRoute(
rootNavigator: true,
PhotoViewScreen(imageUrls: [sl<AppConfig>().baseUrl + state.profile.profilePhotoUrl], index: 0),
);
}, },
), ),
if (state.isMyProfile) ...[ if (state.isMyProfile) ...[
@@ -1003,7 +1029,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
onTap: () { onTap: () {
final box = context.findRenderObject() as RenderBox?; final box = context.findRenderObject() as RenderBox?;
SharePlus.instance.share( SharePlus.instance.share(
ShareParams(uri: Uri.parse('${sl<AppConfig>().baseUrl}/ru/profile/${state.profile.slug}'), sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size), ShareParams(
uri: Uri.parse('${sl<AppConfig>().baseUrl}/ru/profile/${state.profile.slug}'),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
),
); );
}, },
), ),