1070 lines
37 KiB
Dart
1070 lines
37 KiB
Dart
import 'package:flutter/material.dart';
|
||
|
||
void main() => runApp(const MyApp());
|
||
|
||
class MyApp extends StatelessWidget {
|
||
const MyApp({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return MaterialApp(
|
||
title: 'Dailykart',
|
||
debugShowCheckedModeBanner: false,
|
||
theme: ThemeData(
|
||
fontFamily: 'Roboto',
|
||
useMaterial3: false,
|
||
),
|
||
home: const DailykartHomePage(),
|
||
);
|
||
}
|
||
}
|
||
|
||
class DailykartHomePage extends StatelessWidget {
|
||
const DailykartHomePage({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
final screenWidth = MediaQuery.of(context).size.width;
|
||
final isSmallScreen = screenWidth < 600;
|
||
|
||
return Scaffold(
|
||
backgroundColor: Colors.white,
|
||
body: SafeArea(
|
||
child: Column(
|
||
children: [
|
||
// Custom Header/AppBar
|
||
_buildHeader(isSmallScreen),
|
||
|
||
// Scrollable Content
|
||
Expanded(
|
||
child: SingleChildScrollView(
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
// Banner 1: Organic Vegetables with overlay
|
||
_buildBannerWithOverlay(isSmallScreen),
|
||
|
||
// Two Product Banners (Side by Side)
|
||
Padding(
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 16 : 20,
|
||
vertical: isSmallScreen ? 20 : 30,
|
||
),
|
||
child: Row(
|
||
children: [
|
||
// Left Banner: Green Vegetable
|
||
Expanded(
|
||
child: _buildProductBanner(
|
||
imageUrl: 'https://uat.dailykart.net/assets/img/home/Banner.webp',
|
||
title: 'Green Vegetable',
|
||
subtitle: '100% ORGANIC',
|
||
description: 'Healthy Nutrition',
|
||
isSmallScreen: isSmallScreen,
|
||
),
|
||
),
|
||
SizedBox(width: isSmallScreen ? 12 : 20),
|
||
// Right Banner: Spinach
|
||
Expanded(
|
||
child: _buildProductBanner(
|
||
imageUrl: 'https://uat.dailykart.net/assets/img/home/banner%202.webp',
|
||
title: 'Fresh herbs',
|
||
subtitle: 'SPINACH',
|
||
description: 'Healthy Food',
|
||
isSmallScreen: isSmallScreen,
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
|
||
// About Us Section (Responsive)
|
||
_buildAboutUsSection(isSmallScreen),
|
||
|
||
// Our Promise Section (Now Mobile-Optimized)
|
||
_buildOurPromiseSection(isSmallScreen),
|
||
|
||
// New Products Section (One at a time with arrows)
|
||
_buildProductCarousel(isSmallScreen),
|
||
|
||
// Final Banner
|
||
//_buildSimpleBanner('https://uat.dailykart.net/assets/img/home/banner%201.webp'),
|
||
|
||
// ✅ Footer Section — Now Integrated
|
||
_buildFooter(isSmallScreen),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
);
|
||
}
|
||
|
||
// ✅ Responsive About Us Section
|
||
Widget _buildAboutUsSection(bool isSmallScreen) {
|
||
return Container(
|
||
color: Colors.white,
|
||
width: double.infinity,
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 16 : 100,
|
||
vertical: isSmallScreen ? 40 : 80,
|
||
),
|
||
child: Center(
|
||
child: ConstrainedBox(
|
||
constraints: const BoxConstraints(maxWidth: 1400),
|
||
child: isSmallScreen
|
||
? _buildMobileAboutUs()
|
||
: _buildDesktopAboutUs(),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
|
||
// Mobile: Image on top, text below
|
||
Widget _buildMobileAboutUs() {
|
||
return Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Container(
|
||
height: 300,
|
||
decoration: BoxDecoration(
|
||
borderRadius: BorderRadius.circular(8),
|
||
boxShadow: [
|
||
BoxShadow(
|
||
color: Colors.black.withOpacity(0.1),
|
||
blurRadius: 10,
|
||
offset: const Offset(0, 4),
|
||
),
|
||
],
|
||
),
|
||
child: ClipRRect(
|
||
borderRadius: BorderRadius.circular(8),
|
||
child: Image.network(
|
||
'https://uat.dailykart.net/assets/img/home/aabout60.webp',
|
||
fit: BoxFit.cover,
|
||
loadingBuilder: (context, child, loadingProgress) {
|
||
if (loadingProgress == null) return child;
|
||
return const Center(child: CircularProgressIndicator());
|
||
},
|
||
errorBuilder: (context, error, stackTrace) {
|
||
return const Center(child: Icon(Icons.image));
|
||
},
|
||
),
|
||
),
|
||
),
|
||
const SizedBox(height: 24),
|
||
const Text(
|
||
'About Us',
|
||
style: TextStyle(
|
||
fontSize: 28,
|
||
fontWeight: FontWeight.bold,
|
||
color: Color(0xFF0D190D),
|
||
),
|
||
),
|
||
const SizedBox(height: 16),
|
||
const Text(
|
||
'Welcome to Dailykart — your trusted home for organic and natural products. We believe in simple, healthy living and offer items that are good for you and gentle on the Earth. What began as a small dream is now a growing effort to bring fresh, honest products to families everywhere. We work closely with local farmers and partners to ensure quality, care, and sustainability in everything we do.',
|
||
style: TextStyle(
|
||
fontSize: 15,
|
||
height: 1.6,
|
||
color: Color(0xFF424242),
|
||
),
|
||
),
|
||
const SizedBox(height: 16),
|
||
const Text(
|
||
'At Dailykart, we\'re committed to:',
|
||
style: TextStyle(
|
||
fontSize: 16,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.black,
|
||
),
|
||
),
|
||
const SizedBox(height: 12),
|
||
const Text(
|
||
'At Dailykart, we’re more than just a store — we’re a community that cares about your health and the planet. Every product is carefully chosen to be natural, safe, and kind to the Earth. We believe small steps lead to big change, and we’re here to make organic living easier for you.',
|
||
style: TextStyle(
|
||
fontSize: 15,
|
||
height: 1.6,
|
||
color: Color(0xFF424242),
|
||
),
|
||
),
|
||
const SizedBox(height: 12),
|
||
const Text(
|
||
'Thank you for being part of our journey. Let’s grow a greener, healthier future — together.',
|
||
style: TextStyle(
|
||
fontSize: 15,
|
||
height: 1.6,
|
||
color: Color(0xFF424242),
|
||
),
|
||
),
|
||
const SizedBox(height: 24),
|
||
OutlinedButton(
|
||
onPressed: () {},
|
||
style: OutlinedButton.styleFrom(
|
||
foregroundColor: const Color(0xFF66BB6A),
|
||
side: const BorderSide(color: Color(0xFF66BB6A), width: 1.5),
|
||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||
shape: RoundedRectangleBorder(
|
||
borderRadius: BorderRadius.circular(25),
|
||
),
|
||
),
|
||
child: const Text(
|
||
'More Information →',
|
||
style: TextStyle(
|
||
fontWeight: FontWeight.w600,
|
||
fontSize: 14,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
);
|
||
}
|
||
|
||
// Desktop: Side-by-side layout
|
||
Widget _buildDesktopAboutUs() {
|
||
return Row(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Container(
|
||
width: 500,
|
||
height: 500,
|
||
decoration: BoxDecoration(
|
||
borderRadius: BorderRadius.circular(8),
|
||
boxShadow: [
|
||
BoxShadow(
|
||
color: Colors.black.withOpacity(0.1),
|
||
blurRadius: 10,
|
||
offset: const Offset(0, 4),
|
||
),
|
||
],
|
||
),
|
||
child: ClipRRect(
|
||
borderRadius: BorderRadius.circular(8),
|
||
child: Image.network(
|
||
'https://uat.dailykart.net/assets/img/home/aabout60.webp',
|
||
fit: BoxFit.cover,
|
||
loadingBuilder: (context, child, loadingProgress) {
|
||
if (loadingProgress == null) return child;
|
||
return const Center(child: CircularProgressIndicator());
|
||
},
|
||
errorBuilder: (context, error, stackTrace) {
|
||
return const Center(child: Icon(Icons.image));
|
||
},
|
||
),
|
||
),
|
||
),
|
||
const SizedBox(width: 50),
|
||
Expanded(
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
const Text(
|
||
'About Us',
|
||
style: TextStyle(
|
||
fontSize: 32,
|
||
fontWeight: FontWeight.bold,
|
||
color: Color(0xFF0D190D),
|
||
letterSpacing: -0.5,
|
||
),
|
||
),
|
||
const SizedBox(height: 24),
|
||
const Text(
|
||
'Welcome to Dailykart — your trusted home for organic and natural products. We believe in simple, healthy living and offer items that are good for you and gentle on the Earth. What began as a small dream is now a growing effort to bring fresh, honest products to families everywhere. We work closely with local farmers and partners to ensure quality, care, and sustainability in everything we do.',
|
||
style: TextStyle(
|
||
fontSize: 15,
|
||
height: 1.8,
|
||
color: Color(0xFF424242),
|
||
letterSpacing: 0.2,
|
||
),
|
||
),
|
||
const SizedBox(height: 24),
|
||
const Text(
|
||
'At Dailykart, we\'re committed to:',
|
||
style: TextStyle(
|
||
fontSize: 15.5,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.black,
|
||
letterSpacing: 0.2,
|
||
),
|
||
),
|
||
const SizedBox(height: 16),
|
||
const Text(
|
||
'At Dailykart, we\'re more than just a store — we\'re a community that cares about your health and the planet. Every product is carefully chosen to be natural, safe, and kind to the Earth. We believe small steps lead to big change, and we\'re here to make organic living easier for you.',
|
||
style: TextStyle(
|
||
fontSize: 15,
|
||
height: 1.8,
|
||
color: Color(0xFF424242),
|
||
letterSpacing: 0.2,
|
||
),
|
||
),
|
||
const SizedBox(height: 16),
|
||
const Text(
|
||
'Thank you for being part of our journey. Let\'s grow a greener, healthier future '
|
||
'— together.',
|
||
style: TextStyle(
|
||
fontSize: 15,
|
||
height: 1.8,
|
||
color: Color(0xFF424242),
|
||
letterSpacing: 0.2,
|
||
),
|
||
),
|
||
const SizedBox(height: 28),
|
||
OutlinedButton(
|
||
onPressed: () {},
|
||
style: OutlinedButton.styleFrom(
|
||
foregroundColor: const Color(0xFF66BB6A),
|
||
side: const BorderSide(color: Color(0xFF66BB6A), width: 1.5),
|
||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||
shape: RoundedRectangleBorder(
|
||
borderRadius: BorderRadius.circular(25),
|
||
),
|
||
),
|
||
child: const Text(
|
||
'More Information →',
|
||
style: TextStyle(
|
||
fontWeight: FontWeight.w600,
|
||
fontSize: 14,
|
||
letterSpacing: 0.3,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
],
|
||
);
|
||
}
|
||
|
||
// ✅ FIXED: Mobile-Optimized "Our Promise"
|
||
Widget _buildOurPromiseSection(bool isSmallScreen) {
|
||
return Container(
|
||
height: isSmallScreen ? 350 : 400,
|
||
width: double.infinity,
|
||
decoration: BoxDecoration(
|
||
image: DecorationImage(
|
||
image: NetworkImage('https://uat.dailykart.net/assets/img/home/banner%201.webp'),
|
||
fit: BoxFit.cover,
|
||
),
|
||
),
|
||
child: Padding(
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 20 : 80,
|
||
vertical: isSmallScreen ? 40 : 60,
|
||
),
|
||
child: isSmallScreen
|
||
? Column(
|
||
mainAxisAlignment: MainAxisAlignment.center,
|
||
children: [
|
||
Text(
|
||
'Our Promise',
|
||
textAlign: TextAlign.center,
|
||
style: TextStyle(
|
||
fontSize: 32,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.black87,
|
||
),
|
||
),
|
||
SizedBox(height: isSmallScreen ? 16 : 24),
|
||
Text(
|
||
'We take pride in exporting our exceptional selection to countries around the world. Let us be your trusted partner in a healthier, happier you! Join us on a journey to savor the finest nature has to offer, one delicious, organic bite at a time. Together, let\'s make the world a better place!',
|
||
textAlign: TextAlign.center,
|
||
style: TextStyle(
|
||
fontSize: 15,
|
||
height: 1.6,
|
||
color: Colors.black87,
|
||
),
|
||
),
|
||
SizedBox(height: isSmallScreen ? 24 : 32),
|
||
ElevatedButton(
|
||
onPressed: () {},
|
||
style: ElevatedButton.styleFrom(
|
||
backgroundColor: Colors.black,
|
||
foregroundColor: Colors.white,
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: 28,
|
||
vertical: 14,
|
||
),
|
||
shape: RoundedRectangleBorder(
|
||
borderRadius: BorderRadius.circular(30),
|
||
),
|
||
),
|
||
child: Text(
|
||
'SHOP NOW',
|
||
style: TextStyle(
|
||
fontSize: 15,
|
||
fontWeight: FontWeight.w600,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
)
|
||
: Row(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Expanded(
|
||
flex: 5,
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Text(
|
||
'Our Promise',
|
||
style: TextStyle(
|
||
fontSize: 48,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.black87,
|
||
),
|
||
),
|
||
SizedBox(height: 24),
|
||
Text(
|
||
'We take pride in exporting our exceptional selection to countries around the world. Let us be your trusted partner in a healthier, happier you! Join us on a journey to savor the finest nature has to offer, one delicious, organic bite at a time. Together, let\'s make the world a better place!',
|
||
style: TextStyle(
|
||
fontSize: 16,
|
||
height: 2.6,
|
||
color: Colors.black87,
|
||
),
|
||
),
|
||
SizedBox(height: 32),
|
||
ElevatedButton(
|
||
onPressed: () {},
|
||
style: ElevatedButton.styleFrom(
|
||
backgroundColor: Colors.black,
|
||
foregroundColor: Colors.white,
|
||
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
|
||
shape: RoundedRectangleBorder(
|
||
borderRadius: BorderRadius.circular(30),
|
||
),
|
||
),
|
||
child: const Text(
|
||
'SHOP NOW',
|
||
style: TextStyle(
|
||
fontSize: 16,
|
||
fontWeight: FontWeight.w600,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
Expanded(flex: 5, child: Container()),
|
||
],
|
||
),
|
||
),
|
||
);
|
||
}
|
||
|
||
// ✅ FIXED: New Products - One at a time with arrows
|
||
Widget _buildProductCarousel(bool isSmallScreen) {
|
||
final List<String> productImages = [
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-white-raddish1.jpg',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-capsicum1.jpg',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-pome-granet.jpg',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-red-cabbage1.jpg',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-knol-knol1.jpg',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-sweet-pumpkin1.png',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-green-zucchini1.jpg',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-muskmelon.png',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-Mosambi1.jpg',
|
||
'https://uat.dailykart.net/assets/img/prodct/zero-artificial-tomato-round1.jpg',
|
||
];
|
||
|
||
final PageController _pageController = PageController(viewportFraction: 0.8);
|
||
int _currentPage = 0;
|
||
|
||
return Padding(
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 20 : 80,
|
||
vertical: isSmallScreen ? 40 : 60,
|
||
),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Row(
|
||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
children: [
|
||
Text(
|
||
'New Products',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 26 : 32,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.black87,
|
||
),
|
||
),
|
||
OutlinedButton(
|
||
onPressed: () {},
|
||
style: OutlinedButton.styleFrom(
|
||
foregroundColor: Colors.green[400],
|
||
side: BorderSide(color: Colors.green[400]!),
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 16 : 20,
|
||
vertical: isSmallScreen ? 8 : 10,
|
||
),
|
||
shape: RoundedRectangleBorder(
|
||
borderRadius: BorderRadius.circular(20),
|
||
),
|
||
),
|
||
child: Text(
|
||
'More Products →',
|
||
style: TextStyle(
|
||
fontWeight: FontWeight.w600,
|
||
fontSize: isSmallScreen ? 13 : 14,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
SizedBox(height: isSmallScreen ? 20 : 30),
|
||
SizedBox(
|
||
height: isSmallScreen ? 250 : 300,
|
||
child: Stack(
|
||
children: [
|
||
PageView.builder(
|
||
controller: _pageController,
|
||
itemCount: productImages.length,
|
||
onPageChanged: (index) {
|
||
_currentPage = index;
|
||
},
|
||
itemBuilder: (context, index) {
|
||
return _buildProductCard(
|
||
productImages[index],
|
||
isSmallScreen,
|
||
);
|
||
},
|
||
),
|
||
// Left Arrow
|
||
if (_currentPage > 0)
|
||
Positioned(
|
||
top: isSmallScreen ? 100 : 110,
|
||
left: 0,
|
||
child: IconButton(
|
||
onPressed: () {
|
||
_pageController.previousPage(
|
||
duration: const Duration(milliseconds: 300),
|
||
curve: Curves.easeInOut,
|
||
);
|
||
},
|
||
icon: const Icon(Icons.arrow_back_ios, color: Colors.grey),
|
||
padding: const EdgeInsets.all(8),
|
||
splashRadius: 20,
|
||
),
|
||
),
|
||
// Right Arrow
|
||
if (_currentPage < productImages.length - 1)
|
||
Positioned(
|
||
top: isSmallScreen ? 100 : 110,
|
||
right: 0,
|
||
child: IconButton(
|
||
onPressed: () {
|
||
_pageController.nextPage(
|
||
duration: const Duration(milliseconds: 300),
|
||
curve: Curves.easeInOut,
|
||
);
|
||
},
|
||
icon: const Icon(Icons.arrow_forward_ios, color: Colors.grey),
|
||
padding: const EdgeInsets.all(8),
|
||
splashRadius: 20,
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildProductCard(String imageUrl, bool isSmallScreen) {
|
||
return Container(
|
||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||
decoration: BoxDecoration(
|
||
borderRadius: BorderRadius.circular(8),
|
||
color: Colors.white,
|
||
boxShadow: [
|
||
BoxShadow(
|
||
color: Colors.black.withOpacity(0.05),
|
||
blurRadius: 4,
|
||
offset: const Offset(0, 2),
|
||
),
|
||
],
|
||
),
|
||
child: Column(
|
||
children: [
|
||
ClipRRect(
|
||
borderRadius: BorderRadius.vertical(top: Radius.circular(8)),
|
||
child: Image.network(
|
||
imageUrl,
|
||
fit: BoxFit.cover,
|
||
height: isSmallScreen ? 160 : 200,
|
||
loadingBuilder: (context, child, loadingProgress) {
|
||
if (loadingProgress == null) return child;
|
||
return const Center(child: CircularProgressIndicator());
|
||
},
|
||
errorBuilder: (context, error, stackTrace) {
|
||
return const Center(child: Icon(Icons.image));
|
||
},
|
||
),
|
||
),
|
||
Padding(
|
||
padding: const EdgeInsets.all(12),
|
||
child: Text(
|
||
_getProductName(imageUrl),
|
||
textAlign: TextAlign.center,
|
||
style: const TextStyle(
|
||
fontSize: 15,
|
||
fontWeight: FontWeight.w500,
|
||
color: Colors.black87,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
String _getProductName(String imageUrl) {
|
||
if (imageUrl.contains('white-raddish')) return 'White Radish';
|
||
if (imageUrl.contains('capsicum')) return 'Capsicum';
|
||
if (imageUrl.contains('pome-granet')) return 'Fresh Pomegranate';
|
||
if (imageUrl.contains('red-cabbage')) return 'Cabbage vegetables';
|
||
if (imageUrl.contains('knol-knol')) return 'Knol Knol';
|
||
if (imageUrl.contains('sweet-pumpkin')) return 'Sweet Pumpkin';
|
||
if (imageUrl.contains('green-zucchini')) return 'Green Zucchini';
|
||
if (imageUrl.contains('muskmelon')) return 'Muskmelon';
|
||
if (imageUrl.contains('Mosambi')) return 'Mosambi';
|
||
if (imageUrl.contains('tomato-round')) return 'Tomato Round';
|
||
return 'Product';
|
||
}
|
||
|
||
Widget _buildHeader(bool isSmallScreen) {
|
||
return Container(
|
||
color: Colors.white,
|
||
child: Column(
|
||
children: [
|
||
Container(
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 16 : 20,
|
||
vertical: isSmallScreen ? 12 : 15,
|
||
),
|
||
decoration: BoxDecoration(
|
||
color: Colors.white,
|
||
boxShadow: [
|
||
BoxShadow(
|
||
color: Colors.black.withOpacity(0.05),
|
||
blurRadius: 2,
|
||
offset: const Offset(0, 2),
|
||
),
|
||
],
|
||
),
|
||
child: Row(
|
||
children: [
|
||
Image.network(
|
||
'https://uat.dailykart.net/assets/img/logo/logo2.png',
|
||
height: isSmallScreen ? 60 : 80,
|
||
errorBuilder: (context, error, stackTrace) {
|
||
return Text(
|
||
'Dailykart',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 20 : 24,
|
||
fontWeight: FontWeight.bold,
|
||
color: const Color(0xFF2E7D32),
|
||
),
|
||
);
|
||
},
|
||
),
|
||
const Spacer(),
|
||
_buildNavItem('HOME', true, isSmallScreen),
|
||
SizedBox(width: isSmallScreen ? 16 : 30),
|
||
_buildNavItem('SHOP', false, isSmallScreen),
|
||
SizedBox(width: isSmallScreen ? 16 : 30),
|
||
_buildNavItem('ABOUT US', false, isSmallScreen),
|
||
SizedBox(width: isSmallScreen ? 16 : 30),
|
||
_buildNavItem('B2B', false, isSmallScreen),
|
||
SizedBox(width: isSmallScreen ? 16 : 30),
|
||
_buildNavItem('CONTACT US', false, isSmallScreen),
|
||
],
|
||
),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildNavItem(String text, bool isActive, bool isSmallScreen) {
|
||
return Text(
|
||
text,
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 12 : 14,
|
||
fontWeight: FontWeight.w600,
|
||
color: isActive ? const Color(0xFF2E7D32) : const Color(0xFF424242),
|
||
letterSpacing: 0.5,
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildBannerWithOverlay(bool isSmallScreen) {
|
||
return Container(
|
||
height: isSmallScreen ? 700 : 900,
|
||
width: double.infinity,
|
||
decoration: BoxDecoration(
|
||
image: DecorationImage(
|
||
image: NetworkImage('https://uat.dailykart.net/assets/img/home/Banner.webp'),
|
||
fit: BoxFit.cover,
|
||
),
|
||
),
|
||
child: Stack(
|
||
children: [
|
||
Positioned(
|
||
left: isSmallScreen ? 20 : 300,
|
||
top: isSmallScreen ? 150 : 300,
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Text(
|
||
'100% HEALTHY & AFFORDABLE',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 14 : 16,
|
||
fontWeight: FontWeight.w600,
|
||
color: const Color(0xFF2E7D32),
|
||
letterSpacing: 1.2,
|
||
),
|
||
),
|
||
SizedBox(height: isSmallScreen ? 12 : 20),
|
||
Text(
|
||
'ORGANIC',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 50 : 72,
|
||
fontWeight: FontWeight.bold,
|
||
color: const Color(0xFF1B5E20),
|
||
height: 1.1,
|
||
letterSpacing: -1,
|
||
),
|
||
),
|
||
Text(
|
||
'VEGETABLES',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 50 : 72,
|
||
fontWeight: FontWeight.bold,
|
||
color: const Color(0xFF1B5E20),
|
||
height: 1.1,
|
||
letterSpacing: -1,
|
||
),
|
||
),
|
||
SizedBox(height: isSmallScreen ? 12 : 20),
|
||
Text(
|
||
'Small Changes Big Difference',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 18 : 24,
|
||
fontWeight: FontWeight.w400,
|
||
color: const Color(0xFF424242),
|
||
),
|
||
),
|
||
SizedBox(height: isSmallScreen ? 24 : 40),
|
||
ElevatedButton(
|
||
onPressed: () {},
|
||
style: ElevatedButton.styleFrom(
|
||
backgroundColor: const Color(0xFF212121),
|
||
foregroundColor: Colors.white,
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 16 : 20,
|
||
vertical: isSmallScreen ? 12 : 18,
|
||
),
|
||
shape: RoundedRectangleBorder(
|
||
borderRadius: BorderRadius.circular(30),
|
||
),
|
||
elevation: 0,
|
||
),
|
||
child: Text(
|
||
'SHOP NOW',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 14 : 16,
|
||
fontWeight: FontWeight.w600,
|
||
letterSpacing: 1,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildProductBanner({
|
||
required String imageUrl,
|
||
required String title,
|
||
required String subtitle,
|
||
required String description,
|
||
required bool isSmallScreen,
|
||
}) {
|
||
return Container(
|
||
height: isSmallScreen ? 220 : 300,
|
||
decoration: BoxDecoration(
|
||
borderRadius: BorderRadius.circular(12),
|
||
color: Colors.white,
|
||
boxShadow: [
|
||
BoxShadow(
|
||
color: Colors.black.withOpacity(0.05),
|
||
blurRadius: 8,
|
||
offset: const Offset(0, 4),
|
||
),
|
||
],
|
||
),
|
||
child: Stack(
|
||
children: [
|
||
Positioned.fill(
|
||
child: ClipRRect(
|
||
borderRadius: BorderRadius.circular(12),
|
||
child: Image.network(
|
||
imageUrl,
|
||
fit: BoxFit.cover,
|
||
loadingBuilder: (context, child, loadingProgress) {
|
||
if (loadingProgress == null) return child;
|
||
return const Center(child: CircularProgressIndicator());
|
||
},
|
||
errorBuilder: (context, error, stackTrace) {
|
||
return const Center(child: Icon(Icons.error));
|
||
},
|
||
),
|
||
),
|
||
),
|
||
Positioned(
|
||
top: isSmallScreen ? 12 : 20,
|
||
left: isSmallScreen ? 12 : 20,
|
||
right: isSmallScreen ? 12 : 20,
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Text(
|
||
title,
|
||
style: const TextStyle(
|
||
fontSize: 16,
|
||
fontWeight: FontWeight.w600,
|
||
color: Color(0xFF66BB6A),
|
||
),
|
||
),
|
||
SizedBox(height: isSmallScreen ? 4 : 8),
|
||
Text(
|
||
subtitle,
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 22 : 32,
|
||
fontWeight: FontWeight.bold,
|
||
color: const Color(0xFF212121),
|
||
),
|
||
),
|
||
SizedBox(height: isSmallScreen ? 4 : 8),
|
||
Text(
|
||
description,
|
||
style: const TextStyle(
|
||
fontSize: 16,
|
||
color: Color(0xFF66BB6A),
|
||
),
|
||
),
|
||
SizedBox(height: isSmallScreen ? 12 : 20),
|
||
OutlinedButton(
|
||
onPressed: () {},
|
||
style: OutlinedButton.styleFrom(
|
||
foregroundColor: Colors.black,
|
||
side: const BorderSide(color: Colors.black),
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 14 : 20,
|
||
vertical: isSmallScreen ? 6 : 10,
|
||
),
|
||
shape: RoundedRectangleBorder(
|
||
borderRadius: BorderRadius.circular(20),
|
||
),
|
||
),
|
||
child: const Text(
|
||
'BUY NOW',
|
||
style: TextStyle(fontWeight: FontWeight.w600),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildSimpleBanner(String url) {
|
||
return Container(
|
||
width: double.infinity,
|
||
height: 450,
|
||
color: Colors.white,
|
||
child: Image.network(
|
||
url,
|
||
fit: BoxFit.cover,
|
||
loadingBuilder: (context, child, loadingProgress) {
|
||
if (loadingProgress == null) return child;
|
||
return Center(
|
||
child: CircularProgressIndicator(
|
||
value: loadingProgress.expectedTotalBytes != null
|
||
? loadingProgress.cumulativeBytesLoaded /
|
||
loadingProgress.expectedTotalBytes!
|
||
: null,
|
||
color: const Color(0xFF66BB6A),
|
||
),
|
||
);
|
||
},
|
||
errorBuilder: (context, error, stackTrace) {
|
||
return const Center(
|
||
child: Column(
|
||
mainAxisAlignment: MainAxisAlignment.center,
|
||
children: [
|
||
Icon(Icons.error_outline, color: Colors.grey, size: 48),
|
||
SizedBox(height: 8),
|
||
Text('Failed to load image', style: TextStyle(color: Colors.grey)),
|
||
],
|
||
),
|
||
);
|
||
},
|
||
),
|
||
);
|
||
}
|
||
|
||
// ✅ NEW: Responsive Footer Section
|
||
Widget _buildFooter(bool isSmallScreen) {
|
||
return Container(
|
||
color: const Color(0xFF333333), // Dark gray background
|
||
padding: EdgeInsets.symmetric(
|
||
horizontal: isSmallScreen ? 20 : 80,
|
||
vertical: isSmallScreen ? 30 : 40,
|
||
),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
// Logo
|
||
Image.network(
|
||
'https://uat.dailykart.net/assets/img/logo/logo2.png',
|
||
height: isSmallScreen ? 60 : 80,
|
||
errorBuilder: (context, error, stackTrace) {
|
||
return const Text(
|
||
'Dailykart',
|
||
style: TextStyle(
|
||
fontSize: 24,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.white,
|
||
),
|
||
);
|
||
},
|
||
),
|
||
const SizedBox(height: 20),
|
||
|
||
// Tagline
|
||
Text(
|
||
'We\'re more than just a distributor; we\'re passionate purveyors of premium organic products, driven by the belief that "Food is medicine, and medicine is food."',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 14 : 16,
|
||
color: Colors.white,
|
||
height: 1.6,
|
||
),
|
||
),
|
||
const SizedBox(height: 30),
|
||
|
||
// Quick Links
|
||
const Text(
|
||
'QUICK LINKS',
|
||
style: TextStyle(
|
||
fontSize: 16,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.white,
|
||
),
|
||
),
|
||
const SizedBox(height: 10),
|
||
Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
_buildFooterLink('Home', isSmallScreen),
|
||
_buildFooterLink('About Us', isSmallScreen),
|
||
_buildFooterLink('Shop', isSmallScreen),
|
||
_buildFooterLink('B2B', isSmallScreen),
|
||
_buildFooterLink('Contact Us', isSmallScreen),
|
||
],
|
||
),
|
||
const SizedBox(height: 20),
|
||
|
||
// Contact Info
|
||
const Text(
|
||
'CONTACT INFO',
|
||
style: TextStyle(
|
||
fontSize: 16,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.white,
|
||
),
|
||
),
|
||
const SizedBox(height: 10),
|
||
Row(
|
||
children: [
|
||
const Icon(Icons.home, color: Colors.white, size: 18),
|
||
const SizedBox(width: 8),
|
||
Text(
|
||
'Bengaluru Karnataka - 562130',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 14 : 16,
|
||
color: Colors.white,
|
||
),
|
||
),
|
||
],
|
||
),
|
||
const SizedBox(height: 8),
|
||
Row(
|
||
children: [
|
||
const Icon(Icons.email, color: Colors.white, size: 18),
|
||
const SizedBox(width: 8),
|
||
Text(
|
||
'sales@dailykart.com',
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 14 : 16,
|
||
color: Colors.white,
|
||
),
|
||
),
|
||
],
|
||
),
|
||
const SizedBox(height: 30),
|
||
|
||
// Copyright — ✅ CORRECTED: Each Text is a separate widget
|
||
Row(
|
||
children: [
|
||
const Text(
|
||
'Copyright © ',
|
||
style: TextStyle(
|
||
fontSize: 14,
|
||
color: Colors.white,
|
||
),
|
||
),
|
||
Text(
|
||
'Opsmonsters',
|
||
style: TextStyle(
|
||
fontSize: 14,
|
||
color: const Color(0xFF66BB6A),
|
||
fontWeight: FontWeight.bold,
|
||
),
|
||
),
|
||
const Text(
|
||
'. All Rights Reserved',
|
||
style: TextStyle(
|
||
fontSize: 14,
|
||
color: Colors.white,
|
||
),
|
||
),
|
||
],
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildFooterLink(String label, bool isSmallScreen) {
|
||
return Padding(
|
||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||
child: Text(
|
||
label,
|
||
style: TextStyle(
|
||
fontSize: isSmallScreen ? 14 : 16,
|
||
color: Colors.white70,
|
||
),
|
||
),
|
||
);
|
||
}
|
||
} |