feat: Implement agent network management and refactor app navigation with a new AppShell component.
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:real_estate_mobile/core/constants/app_colors.dart';
|
||||
import 'package:real_estate_mobile/core/network/api_client.dart';
|
||||
import 'package:real_estate_mobile/core/widgets/s3_image.dart';
|
||||
import 'package:real_estate_mobile/features/auth/presentation/providers/auth_provider.dart';
|
||||
import 'package:real_estate_mobile/features/home/presentation/widgets/home_header.dart';
|
||||
|
||||
// ── Data models (matching web CMS types) ──
|
||||
|
||||
@@ -305,56 +302,44 @@ class AboutScreen extends ConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final state = ref.watch(_aboutProvider);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
bottom: false,
|
||||
child: Column(
|
||||
children: [
|
||||
const HomeHeader(),
|
||||
Expanded(
|
||||
child: state.isLoading
|
||||
? const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.accentOrange,
|
||||
),
|
||||
)
|
||||
: SingleChildScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 18),
|
||||
_buildHeroTitle(state.hero.headline),
|
||||
const SizedBox(height: 16),
|
||||
_buildHeroSubtitle(state.hero.description),
|
||||
const SizedBox(height: 24),
|
||||
_buildBannerImage(state.hero.bannerImageUrl),
|
||||
const SizedBox(height: 10),
|
||||
_buildBannerCaption(state.hero.bannerOverlayText),
|
||||
const SizedBox(height: 16),
|
||||
_buildStatsRow(state.stats),
|
||||
const SizedBox(height: 32),
|
||||
_buildSectionTitle(state.featuresBadge),
|
||||
const SizedBox(height: 12),
|
||||
_buildWhyChooseUsSubtitle(),
|
||||
const SizedBox(height: 24),
|
||||
...state.features.map((f) => Padding(
|
||||
padding: const EdgeInsets.only(bottom: 15),
|
||||
child: _buildFeatureCard(f),
|
||||
)),
|
||||
const SizedBox(height: 25),
|
||||
_buildTeamSection(context, ref, state),
|
||||
const SizedBox(height: 40),
|
||||
_buildCtaSection(context, state.cta),
|
||||
const SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (state.isLoading) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.accentOrange,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return SingleChildScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 18),
|
||||
_buildHeroTitle(state.hero.headline),
|
||||
const SizedBox(height: 16),
|
||||
_buildHeroSubtitle(state.hero.description),
|
||||
const SizedBox(height: 24),
|
||||
_buildBannerImage(state.hero.bannerImageUrl),
|
||||
const SizedBox(height: 10),
|
||||
_buildBannerCaption(state.hero.bannerOverlayText),
|
||||
const SizedBox(height: 16),
|
||||
_buildStatsRow(state.stats),
|
||||
const SizedBox(height: 32),
|
||||
_buildSectionTitle(state.featuresBadge),
|
||||
const SizedBox(height: 12),
|
||||
_buildWhyChooseUsSubtitle(),
|
||||
const SizedBox(height: 24),
|
||||
...state.features.map((f) => Padding(
|
||||
padding: const EdgeInsets.only(bottom: 15),
|
||||
child: _buildFeatureCard(f),
|
||||
)),
|
||||
const SizedBox(height: 25),
|
||||
_buildTeamSection(context, ref, state),
|
||||
const SizedBox(height: 40),
|
||||
_buildCtaSection(context, state.cta),
|
||||
const SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: _buildBottomNavBar(context, ref),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -854,105 +839,6 @@ class AboutScreen extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
// -- Bottom Navigation Bar --
|
||||
Widget _buildBottomNavBar(BuildContext context, WidgetRef ref) {
|
||||
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(
|
||||
context: context,
|
||||
ref: ref,
|
||||
svgPath: 'assets/icons/nav_home_icon.svg',
|
||||
fallbackIcon: Icons.home,
|
||||
isSelected: false,
|
||||
onTap: () => context.go('/home'),
|
||||
),
|
||||
_buildNavItem(
|
||||
context: context,
|
||||
ref: ref,
|
||||
svgPath: 'assets/icons/nav_list_icon.svg',
|
||||
fallbackIcon: Icons.list,
|
||||
isSelected: false,
|
||||
onTap: () => context.push('/agents/search'),
|
||||
),
|
||||
_buildNavItem(
|
||||
context: context,
|
||||
ref: ref,
|
||||
svgPath: 'assets/icons/nav_messages_icon.svg',
|
||||
fallbackIcon: Icons.chat_bubble,
|
||||
isSelected: false,
|
||||
onTap: () {
|
||||
final authState = ref.read(authProvider);
|
||||
if (authState.status != AuthStatus.authenticated) {
|
||||
context.push('/login');
|
||||
return;
|
||||
}
|
||||
context.go('/messages');
|
||||
},
|
||||
),
|
||||
_buildNavItem(
|
||||
context: context,
|
||||
ref: ref,
|
||||
svgPath: 'assets/icons/nav_profile_icon.svg',
|
||||
fallbackIcon: Icons.person_outline,
|
||||
isSelected: false,
|
||||
onTap: () {
|
||||
final authState = ref.read(authProvider);
|
||||
if (authState.status != AuthStatus.authenticated) {
|
||||
context.push('/login');
|
||||
return;
|
||||
}
|
||||
context.push('/profile');
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNavItem({
|
||||
required BuildContext context,
|
||||
required WidgetRef ref,
|
||||
required String svgPath,
|
||||
required IconData fallbackIcon,
|
||||
required bool isSelected,
|
||||
required VoidCallback onTap,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _TeamMemberPlaceholder extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user