update mobile design
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:real_estate_mobile/core/constants/app_colors.dart';
|
||||
import 'package:real_estate_mobile/features/home/presentation/widgets/features_section.dart';
|
||||
import 'package:real_estate_mobile/features/home/presentation/widgets/hero_section.dart';
|
||||
@@ -7,44 +8,153 @@ import 'package:real_estate_mobile/features/home/presentation/widgets/testimonia
|
||||
import 'package:real_estate_mobile/features/home/presentation/widgets/top_professionals_section.dart';
|
||||
import 'package:real_estate_mobile/features/home/presentation/widgets/trust_stats_section.dart';
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
class HomeScreen extends StatefulWidget {
|
||||
const HomeScreen({super.key});
|
||||
|
||||
@override
|
||||
State<HomeScreen> createState() => _HomeScreenState();
|
||||
}
|
||||
|
||||
class _HomeScreenState extends State<HomeScreen> {
|
||||
int _selectedIndex = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
// Header
|
||||
SafeArea(
|
||||
bottom: false,
|
||||
child: const HomeHeader(),
|
||||
body: _buildBody(),
|
||||
bottomNavigationBar: _buildBottomNavBar(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody() {
|
||||
// Only Home tab (index 0) has content for now
|
||||
switch (_selectedIndex) {
|
||||
case 0:
|
||||
return _buildHomeContent();
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
default:
|
||||
return Center(
|
||||
child: Text(
|
||||
['Home', 'Listings', 'Messages', 'Profile'][_selectedIndex],
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Fractul',
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.primaryDark,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Hero Section with Search
|
||||
const HeroSection(),
|
||||
const SizedBox(height: 40),
|
||||
Widget _buildHomeContent() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
// Header
|
||||
SafeArea(
|
||||
bottom: false,
|
||||
child: const HomeHeader(),
|
||||
),
|
||||
|
||||
// Features Section
|
||||
const FeaturesSection(),
|
||||
const SizedBox(height: 40),
|
||||
// Hero Section with Search
|
||||
const HeroSection(),
|
||||
const SizedBox(height: 40),
|
||||
|
||||
// Top Professionals Section
|
||||
const TopProfessionalsSection(),
|
||||
const SizedBox(height: 40),
|
||||
// Features Section
|
||||
const FeaturesSection(),
|
||||
const SizedBox(height: 40),
|
||||
|
||||
// Trust & Stats Section
|
||||
const TrustStatsSection(),
|
||||
const SizedBox(height: 40),
|
||||
// Top Professionals Section
|
||||
const TopProfessionalsSection(),
|
||||
const SizedBox(height: 40),
|
||||
|
||||
// Testimonials Section
|
||||
const TestimonialsSection(),
|
||||
const SizedBox(height: 40),
|
||||
// Trust & Stats Section
|
||||
const TrustStatsSection(),
|
||||
const SizedBox(height: 40),
|
||||
|
||||
// Footer
|
||||
_buildFooter(),
|
||||
],
|
||||
// Testimonials Section
|
||||
const TestimonialsSection(),
|
||||
const SizedBox(height: 40),
|
||||
|
||||
// Footer
|
||||
_buildFooter(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// ── Bottom Navigation Bar (matches Figma node 49:6485) ──
|
||||
Widget _buildBottomNavBar() {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border(
|
||||
top: BorderSide(color: Color(0xFFE8E8E8), width: 1),
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
_buildNavItem(
|
||||
index: 0,
|
||||
svgPath: 'assets/icons/nav_home_icon.svg',
|
||||
fallbackIcon: Icons.home,
|
||||
),
|
||||
_buildNavItem(
|
||||
index: 1,
|
||||
svgPath: 'assets/icons/nav_list_icon.svg',
|
||||
fallbackIcon: Icons.list,
|
||||
),
|
||||
_buildNavItem(
|
||||
index: 2,
|
||||
svgPath: 'assets/icons/nav_messages_icon.svg',
|
||||
fallbackIcon: Icons.chat_bubble,
|
||||
),
|
||||
_buildNavItem(
|
||||
index: 3,
|
||||
svgPath: 'assets/icons/nav_profile_icon.svg',
|
||||
fallbackIcon: Icons.person_outline,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNavItem({
|
||||
required int index,
|
||||
required String svgPath,
|
||||
required IconData fallbackIcon,
|
||||
}) {
|
||||
final isSelected = _selectedIndex == index;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() => _selectedIndex = index);
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: SvgPicture.asset(
|
||||
svgPath,
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: isSelected
|
||||
? const ColorFilter.mode(AppColors.primaryDark, BlendMode.srcIn)
|
||||
: const ColorFilter.mode(AppColors.accentOrange, BlendMode.srcIn),
|
||||
placeholderBuilder: (_) => Icon(
|
||||
fallbackIcon,
|
||||
size: 24,
|
||||
color: isSelected ? AppColors.primaryDark : AppColors.accentOrange,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user