-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp_support_screen.dart
More file actions
164 lines (158 loc) · 7.86 KB
/
Copy pathhelp_support_screen.dart
File metadata and controls
164 lines (158 loc) · 7.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import 'package:flutter/material.dart';
import '../theme/app_theme.dart';
class HelpSupportScreen extends StatelessWidget {
const HelpSupportScreen({super.key});
@override
Widget build(BuildContext context) {
final faqs = [
{'q': 'How does AI scheduling work?', 'a': 'Our AI analyzes your tasks, priorities, and deadlines to create an optimized daily schedule that fits your work hours and focus preferences.'},
{'q': 'How do I sync with Google Calendar?', 'a': 'Go to Calendar Sync from the dashboard and enable sync. You\'ll need to authorize with your Google account.'},
{'q': 'Can I reschedule tasks?', 'a': 'Yes! Update or add tasks and tap "Generate Schedule" to get a new AI-optimized schedule.'},
{'q': 'How do habit streaks work?', 'a': 'Complete a habit daily to build streaks. Missing a day resets the streak counter.'},
{'q': 'Is my data secure?', 'a': 'Yes. We use JWT authentication, bcrypt password hashing, and encrypted connections to protect your data.'},
];
final contactFormKey = GlobalKey<FormState>();
final subjectController = TextEditingController();
final messageController = TextEditingController();
return Scaffold(
appBar: AppBar(title: const Text('Help & Support')),
body: Container(
decoration: const BoxDecoration(gradient: AppTheme.splashGradient),
child: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Header
Container(
width: double.infinity,
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [AppTheme.primary.withValues(alpha: 0.1), AppTheme.accent.withValues(alpha: 0.05)],
),
borderRadius: BorderRadius.circular(20),
border: Border.all(color: AppTheme.primary.withValues(alpha: 0.15)),
),
child: Column(
children: [
Container(
width: 60, height: 60,
decoration: BoxDecoration(
gradient: AppTheme.primaryGradient,
borderRadius: BorderRadius.circular(18),
),
child: const Icon(Icons.support_agent_rounded, color: Colors.white, size: 32),
),
const SizedBox(height: 16),
const Text('How can we help?',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: AppTheme.textPrimary)),
const SizedBox(height: 6),
const Text('Find answers or contact us',
style: TextStyle(color: AppTheme.textSecondary, fontSize: 14)),
],
),
),
const SizedBox(height: 24),
// FAQ
const Text('Frequently Asked Questions',
style: TextStyle(color: AppTheme.textPrimary, fontSize: 18, fontWeight: FontWeight.w700)),
const SizedBox(height: 12),
...faqs.map((faq) => Container(
margin: const EdgeInsets.only(bottom: 10),
decoration: AppTheme.glassDecoration,
child: Theme(
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
child: ExpansionTile(
tilePadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
childrenPadding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
leading: const Icon(Icons.help_outline_rounded, color: AppTheme.primary, size: 20),
title: Text(faq['q']!,
style: const TextStyle(color: AppTheme.textPrimary, fontSize: 14, fontWeight: FontWeight.w600)),
iconColor: AppTheme.textSecondary,
collapsedIconColor: AppTheme.textSecondary,
children: [
Text(faq['a']!, style: const TextStyle(color: AppTheme.textSecondary, fontSize: 13, height: 1.5)),
],
),
),
)),
const SizedBox(height: 24),
// Contact Form
const Text('Contact Us',
style: TextStyle(color: AppTheme.textPrimary, fontSize: 18, fontWeight: FontWeight.w700)),
const SizedBox(height: 12),
Container(
padding: const EdgeInsets.all(20),
decoration: AppTheme.glassDecoration,
child: Form(
key: contactFormKey,
child: Column(
children: [
TextFormField(
controller: subjectController,
style: const TextStyle(color: AppTheme.textPrimary),
decoration: const InputDecoration(
labelText: 'Subject',
prefixIcon: Icon(Icons.subject_rounded, color: AppTheme.textSecondary),
),
validator: (v) => v == null || v.isEmpty ? 'Enter a subject' : null,
),
const SizedBox(height: 14),
TextFormField(
controller: messageController,
maxLines: 4,
style: const TextStyle(color: AppTheme.textPrimary),
decoration: const InputDecoration(
labelText: 'Message',
alignLabelWithHint: true,
prefixIcon: Padding(
padding: EdgeInsets.only(bottom: 60),
child: Icon(Icons.message_outlined, color: AppTheme.textSecondary),
),
),
validator: (v) => v == null || v.isEmpty ? 'Enter your message' : null,
),
const SizedBox(height: 20),
SizedBox(
width: double.infinity,
height: 50,
child: Container(
decoration: BoxDecoration(
gradient: AppTheme.primaryGradient,
borderRadius: BorderRadius.circular(14),
),
child: ElevatedButton.icon(
onPressed: () {
if (contactFormKey.currentState!.validate()) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Message sent! We\'ll get back to you soon.'),
backgroundColor: AppTheme.success,
),
);
subjectController.clear();
messageController.clear();
}
},
icon: const Icon(Icons.send_rounded, size: 18),
label: const Text('Send Message', style: TextStyle(fontWeight: FontWeight.w600)),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
),
),
),
),
],
),
),
),
const SizedBox(height: 20),
],
),
),
),
);
}
}