onufitness_mobile/lib/screens/echoboard/widget/social_user_profile_shimmer.dart
2026-01-13 11:36:24 +05:30

152 lines
4.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';
// Profile shimmer effect
Widget socialProfileShimmer() {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Column(
children: [
Row(
children: [
// Profile image placeholder
Container(
width: 60.r,
height: 60.r,
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
),
SizedBox(width: 20.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Name placeholder
Container(width: 150.w, height: 20.h, color: Colors.white),
SizedBox(height: 8.h),
// Stats placeholder
Container(width: 180.w, height: 15.h, color: Colors.white),
SizedBox(height: 8.h),
// Location placeholder
Container(width: 100.w, height: 15.h, color: Colors.white),
],
),
],
),
SizedBox(height: 15.h),
// Bio placeholder
Container(width: double.infinity, height: 40.h, color: Colors.white),
SizedBox(height: 15.h),
// Buttons placeholder
Row(
children: [
Container(width: 120.w, height: 40.h, color: Colors.white),
SizedBox(width: 15.w),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: List.generate(
4,
(index) => Padding(
padding: EdgeInsets.only(right: 10.w),
child: Container(
width: 40.r,
height: 40.r,
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
),
),
),
),
),
],
),
],
),
),
);
}
// Recent activity shimmer effect
Widget recentActivityShimmer() {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: List.generate(
3,
(index) => Padding(
padding: EdgeInsets.all(15.sp),
child: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
width: 300.w,
height: 250.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15.r),
),
),
),
),
),
),
);
}
Widget ratingsShimmer() {
return Padding(
padding: EdgeInsets.all(16.sp),
child: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// Rating Number
Container(width: 120.w, height: 60.h, color: Colors.white),
SizedBox(height: 8.h),
// Stars
Container(width: 180.w, height: 30.h, color: Colors.white),
SizedBox(height: 8.h),
// Total reviews
Container(width: 100.w, height: 20.h, color: Colors.white),
],
),
),
);
}
Widget reviewsShimmer() {
return Padding(
padding: EdgeInsets.all(16.sp),
child: Column(
children: List.generate(
3,
(index) => Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Container(
width: double.infinity,
height: 120.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.r),
),
),
),
),
),
),
);
}