feat: Implement support chat functionality, add 2FA verification screen and routing, and update dependencies.
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
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:url_launcher/url_launcher.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/features/auth/presentation/providers/auth_provider.dart';
|
||||
|
||||
// ── Data models ──
|
||||
|
||||
@@ -329,11 +332,11 @@ class _FaqAccordion extends StatelessWidget {
|
||||
|
||||
// ── Still Need Help section ──
|
||||
|
||||
class _StillNeedHelpSection extends StatelessWidget {
|
||||
class _StillNeedHelpSection extends ConsumerWidget {
|
||||
const _StillNeedHelpSection();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 0),
|
||||
decoration: BoxDecoration(
|
||||
@@ -383,14 +386,32 @@ class _StillNeedHelpSection extends StatelessWidget {
|
||||
_buildSupportButton(
|
||||
icon: Icons.chat_bubble_outline,
|
||||
label: 'Start Live Chat',
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
final authState = ref.read(authProvider);
|
||||
if (authState.status != AuthStatus.authenticated) {
|
||||
context.push('/login');
|
||||
return;
|
||||
}
|
||||
context.push('/support/chat');
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
// Email Support
|
||||
_buildSupportButton(
|
||||
icon: Icons.email_outlined,
|
||||
label: 'Email Support',
|
||||
onTap: () {},
|
||||
onTap: () async {
|
||||
final uri = Uri(
|
||||
scheme: 'mailto',
|
||||
path: 'support@requesn.com',
|
||||
queryParameters: {
|
||||
'subject': 'Support Request',
|
||||
},
|
||||
);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user