import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import '../provider/shop_provider.dart'; class ServiceCenterDetailsScreen extends StatelessWidget { @override Widget build(BuildContext context) { final shop = Provider.of(context).shop; if (shop == null) { return Scaffold( body: Center(child: CircularProgressIndicator()), ); } return Scaffold( backgroundColor: Color(0xFFEAF5FF), body: SafeArea( child: Container( decoration: BoxDecoration( gradient: LinearGradient( colors: [Color.fromRGBO(208, 235, 255, 1), Colors.white], begin: Alignment.topCenter, end: Alignment.bottomCenter, ), ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ // AppBar with back icon and title Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), child: Row( children: [ GestureDetector( onTap: () => Navigator.pop(context), child: Icon(Icons.arrow_back_ios, color: Colors.black), ), SizedBox(width: 25), Expanded( child: Padding( padding: const EdgeInsets.only(top: 15.0), child: Text( 'SERVICE CENTER DETAILS', textAlign: TextAlign.center, style: GoogleFonts.inter( fontSize: 32, color: Color.fromRGBO(25, 25, 112, 0.87), fontWeight: FontWeight.w600, ), ), ), ), SizedBox(width: 24), ], ), ), // Main content Expanded( child: SingleChildScrollView( child: Center( child: Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 10), padding: EdgeInsets.all(8), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(16), boxShadow: [ BoxShadow( color: Colors.black12, blurRadius: 10, offset: Offset(0, 4), ), ], ), child: Column( children: [ ClipRRect( borderRadius: BorderRadius.circular(12), child: Image.asset( "assets/images/shop_image.jpg", height: 230, width: double.infinity, fit: BoxFit.cover, errorBuilder: (context, error, stackTrace) => Icon(Icons.broken_image, size: 100), ), ), SizedBox(height: 16), Text( shop.shopName, style: GoogleFonts.inter( fontSize: 24, color: Colors.black, fontWeight: FontWeight.w600, ), ), SizedBox(height: 16), InfoRow( icon: "assets/icon/location_icon.png", text: shop.address ?? 'Address not available', ), InfoRow( icon: "assets/icon/contact_icon.png", text: shop.mobile, ), InfoRow( icon: "assets/icon/Message_icon.png", text: shop.email, ), ], ), ), ), ), ), ], ), ), ), ); } } class InfoRow extends StatelessWidget { final String icon; final String text; const InfoRow({ required this.icon, required this.text, }); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 15), child: Center( child: Row( children: [ ImageIcon(AssetImage(icon)), SizedBox(width: 10), Expanded( child: Text( text, style: GoogleFonts.inter( fontSize: 14, color: Colors.black, fontWeight: FontWeight.w400, ), ), ), ], ), ), ); } }