getPresentationWidgetsFriendCardTemplate function

String getPresentationWidgetsFriendCardTemplate(
  1. String projectName
)

Implementation

String getPresentationWidgetsFriendCardTemplate(String projectName) {
  return '''
import 'package:flutter/material.dart';
import 'package:${projectName}/core/theme/app_colors.dart';
import 'package:${projectName}/core/utils/responsive_size.dart';
import 'package:${projectName}/presentation/widgets/text_widget.dart';
import 'package:${projectName}/presentation/widgets/common_cached_image.dart';

class FriendCard extends StatelessWidget {
  final String name;
  final String location;
  final String distance;
  final int matchPercentage;
  final String imageUrl;
  final VoidCallback? onTap;

  const FriendCard({
    super.key,
    required this.name,
    required this.location,
    required this.distance,
    required this.matchPercentage,
    required this.imageUrl,
    this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        height: 450.sp,
        width: double.infinity,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(24.sp),
          boxShadow: [
            BoxShadow(
              color: AppColors.black.withOpacity(0.1),
              blurRadius: 20,
              offset: const Offset(0, 10),
            ),
          ],
        ),
        child: ClipRRect(
          borderRadius: BorderRadius.circular(24.sp),
          child: Stack(
            fit: StackFit.expand,
            children: [
              // Image
              CommonCachedImage(
                imageUrl: imageUrl,
                fit: BoxFit.cover,
              ),

              // Gradient Overlay
              Positioned.fill(
                child: Container(
                  decoration: BoxDecoration(
                    gradient: LinearGradient(
                      begin: Alignment.topCenter,
                      end: Alignment.bottomCenter,
                      colors: [
                        Colors.transparent,
                        AppColors.black.withOpacity(0.8),
                      ],
                      stops: const [0.6, 1.0],
                    ),
                  ),
                ),
              ),

              // Match Percentage Badge
              Positioned(
                top: 20.sp,
                left: 20.sp,
                child: Container(
                  padding: EdgeInsets.symmetric(horizontal: 12.sp, vertical: 6.sp),
                  decoration: BoxDecoration(
                    color: AppColors.primary,
                    borderRadius: BorderRadius.circular(20.sp),
                  ),
                  child: TextWidget(
                    text: "\$matchPercentage% Match",
                    color: AppColors.white,
                    textSize: 12.sp,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),

              // Bottom Info
              Positioned(
                bottom: 24.sp,
                left: 24.sp,
                right: 24.sp,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    TextWidget(
                      text: name,
                      textSize: 26.sp,
                      fontWeight: FontWeight.bold,
                      color: AppColors.white,
                    ),
                    SizedBox(height: 8.sp),
                    Row(
                      children: [
                        Icon(Icons.location_on_outlined, color: AppColors.white.withOpacity(0.8), size: 16.sp),
                        SizedBox(width: 4.sp),
                        TextWidget(
                          text: "\$location • \$distance",
                          textSize: 14.sp,
                          color: AppColors.white.withOpacity(0.8),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
''';
}