feat: Implement notifications feature, enhance profile settings with new sections, and integrate Firebase configurations for multiple environments.

This commit is contained in:
pradeepkumar
2026-03-08 21:48:56 +05:30
parent 0362d7cfe0
commit 744b7b7ca8
24 changed files with 3413 additions and 557 deletions

View File

@@ -17,6 +17,7 @@ import 'package:real_estate_mobile/features/contact/presentation/screens/contact
import 'package:real_estate_mobile/features/about/presentation/screens/about_screen.dart';
import 'package:real_estate_mobile/features/agents/presentation/screens/agent_network_screen.dart';
import 'package:real_estate_mobile/features/profile/presentation/screens/profile_settings_screen.dart';
import 'package:real_estate_mobile/features/notifications/presentation/screens/notifications_screen.dart';
final routerProvider = Provider<GoRouter>((ref) {
final authRefreshNotifier = _AuthRefreshNotifier();
@@ -78,52 +79,100 @@ final routerProvider = Provider<GoRouter>((ref) {
routes: [
GoRoute(
path: '/home',
builder: (context, state) => const _HomeRouteWrapper(),
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: const _HomeRouteWrapper(),
transitionsBuilder: _fadeTransition,
),
),
GoRoute(
path: '/agents/search',
builder: (context, state) {
pageBuilder: (context, state) {
final query = state.uri.queryParameters['q'];
return AgentSearchScreen(initialQuery: query);
return CustomTransitionPage(
key: state.pageKey,
child: AgentSearchScreen(initialQuery: query),
transitionsBuilder: _fadeTransition,
);
},
),
GoRoute(
path: '/agents/detail/:id',
builder: (context, state) {
pageBuilder: (context, state) {
final id = state.pathParameters['id']!;
return AgentDetailScreen(agentId: id);
return CustomTransitionPage(
key: state.pageKey,
child: AgentDetailScreen(agentId: id),
transitionsBuilder: _fadeTransition,
);
},
),
GoRoute(
path: '/messages',
builder: (context, state) => const ConversationsScreen(),
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: const ConversationsScreen(),
transitionsBuilder: _fadeTransition,
),
),
GoRoute(
path: '/messages/chat/:id',
builder: (context, state) {
pageBuilder: (context, state) {
final id = state.pathParameters['id']!;
return ChatScreen(conversationId: id);
return CustomTransitionPage(
key: state.pageKey,
child: ChatScreen(conversationId: id),
transitionsBuilder: _fadeTransition,
);
},
),
GoRoute(
path: '/faq',
builder: (context, state) => const FaqScreen(),
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: const FaqScreen(),
transitionsBuilder: _fadeTransition,
),
),
GoRoute(
path: '/contact',
builder: (context, state) => const ContactScreen(),
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: const ContactScreen(),
transitionsBuilder: _fadeTransition,
),
),
GoRoute(
path: '/about',
builder: (context, state) => const AboutScreen(),
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: const AboutScreen(),
transitionsBuilder: _fadeTransition,
),
),
GoRoute(
path: '/agent/network',
builder: (context, state) => const AgentNetworkScreen(),
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: const AgentNetworkScreen(),
transitionsBuilder: _fadeTransition,
),
),
GoRoute(
path: '/profile',
builder: (context, state) => const ProfileSettingsScreen(),
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: const ProfileSettingsScreen(),
transitionsBuilder: _fadeTransition,
),
),
GoRoute(
path: '/notifications',
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: const NotificationsScreen(),
transitionsBuilder: _fadeTransition,
),
),
],
),
@@ -159,6 +208,19 @@ class _HomeRouteWrapper extends ConsumerWidget {
}
}
/// Smooth fade transition for tab-to-tab navigation.
Widget _fadeTransition(
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) {
return FadeTransition(
opacity: CurveTween(curve: Curves.easeInOut).animate(animation),
child: child,
);
}
/// Notifier that triggers GoRouter refresh when auth state changes.
class _AuthRefreshNotifier extends ChangeNotifier {
void notify() {