Files
CityCards_Customer_Flutter/lib/postcard/widgets/message_card_widget.dart
vishal-kaklotar-wdi 1ca940e5cf worked on bu fix
2025-11-19 11:26:23 +05:30

176 lines
6.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
class MessageCardWidget extends StatelessWidget {
final String message;
final String? selectedFont;
MessageCardWidget({super.key, required this.message, this.selectedFont});
@override
Widget build(BuildContext context) {
return Container(
constraints: BoxConstraints(minHeight: 227.h),
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.r),
gradient: const LinearGradient(
colors: [
Color(0xFFF5E9D7), // top-left shade
Color(0xFFE7D3B8), // bottom-right shade
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
boxShadow: [
BoxShadow(
color: Color(0xFFA08264).withOpacity(0.15),
blurRadius: 6,
spreadRadius: 0,
offset: Offset(-0.5, -0.5),
),
],
),
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.r),
gradient: RadialGradient(
center: const Alignment(-0.6, -0.6),
radius: 1.2,
colors: [Color(0xFFBEA078).withOpacity(0.15), Colors.transparent],
),
),
// ---------- IMPORTANT: IntrinsicHeight ensures children get bounded height ----------
child: IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, // stretch so children fill height
children: [
// ---------------- LEFT SECTION ---------------- //
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
// SpaceBetween ensures top content stays top and CityCards.co stays bottom
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Top group
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
"assets/logo/logo_city_cards.png",
height: 22.h,
),
SizedBox(height: 4.h),
Text(
"POSTCARD",
style: TextStyle(
fontSize: 6.sp,
letterSpacing: 0.93,
fontWeight: FontWeight.w600,
color: Color(0xFF000000).withOpacity(0.4),
),
),
SizedBox(height: 7.h),
Text(
"MESSAGE PREVIEW",
style: TextStyle(
fontSize: 5.sp,
letterSpacing: 0.93,
color: Color(0xFF000000).withOpacity(0.6),
),
),
SizedBox(height: 4.h),
Text(
message,
style: TextStyle(
fontFamily: selectedFont,
fontSize: 12.sp,
height: 1.6,
color: Color(0xFF0A0D13).withOpacity(0.8),
),
),
],
),
// Bottom text — will stay at the bottom of the left column
Text(
"CityCards.co",
style: TextStyle(fontSize: 12.sp, color: Color(0xFFF95F62)),
),
],
),
),
// ---------------- DIVIDER (middle) ---------------- //
Container(
width: 3.86.w,
height: double.infinity, // will match IntrinsicHeight-bounded Row height
margin: EdgeInsets.only(right: 10.w,top:24.h,bottom: 24.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color(0xFF000000).withOpacity(0),
Color(0xFF65543F).withOpacity(0.4),
Color(0xFF65543F).withOpacity(0.6),
Color(0xFF65543F).withOpacity(0.8),
Color(0xFF65543F).withOpacity(0.6),
Color(0xFF65543F).withOpacity(0.4),
Color(0xFF000000).withOpacity(0),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
),
// ---------------- RIGHT SECTION ---------------- //
Align(
alignment: Alignment.center,
child: Container(
padding: EdgeInsets.all(7),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.r),
border: Border.all(
color: Color(0xFF000000).withOpacity(0.12),
width: 1,
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"ADDRESS",
style: TextStyle(
fontSize: 5.sp,
fontWeight: FontWeight.w500,
letterSpacing: 0.93,
color: Color(0xFF000000).withOpacity(0.6),
),
),
Text(
"121 Saint Denis Street,\n"
"Louisiana,\n"
"United States of America",
style: TextStyle(
fontFamily: selectedFont,
fontSize: 8.sp,
height: 1.7.h,
),
textAlign: TextAlign.center,
),
],
),
),
),
],
),
),
);
}
}