Skip to content

Commit

Permalink
changed UI of help and FAQ sections
Browse files Browse the repository at this point in the history
  • Loading branch information
jaivsh committed Jul 22, 2023
1 parent c7ca343 commit 745d272
Show file tree
Hide file tree
Showing 3 changed files with 224 additions and 95 deletions.
121 changes: 82 additions & 39 deletions lib/screens/contact_us_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';

import '../models/users.dart';
import '../services/user_info_services.dart';

class ContactUsScreen extends StatefulWidget {
@override
Expand All @@ -11,45 +16,83 @@ class _ContactUsScreenState extends State<ContactUsScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Contact Us'),
),
body: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'Ask a Question',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 16.0),
Text(question),
SizedBox(height: 8.0),
TextFormField(
onChanged: (value) {
setState(() {
question = value;
});
},
decoration: InputDecoration(
labelText: 'Your Question',
border: OutlineInputBorder(),
),
maxLines: 3,
),
SizedBox(height: 16.0),
ElevatedButton(
child: Text('Send'),
onPressed: () {
// Send the question to your support team
// Implement your logic here
},
),
],
appBar: AppBar(elevation: 0,backgroundColor: Colors.transparent,

centerTitle: true,),
backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8),

body: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
child: Consumer<UserInfoServices>(
builder: (context, userInfo, _) {
Users _user;
if (userInfo.hasData) _user = userInfo.user!;
return Stack(
alignment: Alignment.center,
children: [
Column(
children: [
SizedBox(height: 30,),
Text(
"Contact Us",
style: TextStyle(
color: Colors.white,
fontSize: 30.0,
fontWeight: FontWeight.bold,
),),
SizedBox(height: 0.12 * MediaQuery.of(context).size.height),
Container(
margin: EdgeInsets.fromLTRB(15, 15, 15, 60),
padding: EdgeInsets.all(30),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(40),
topRight: Radius.circular(40),
),
),
width: double.infinity,
child:

SizedBox(height: MediaQuery.of(context).size.height ,width: MediaQuery.of(context).size.width,child:Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'Ask a Question',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
color: Colors.white
),
),
SizedBox(height: 16.0),
Text(question, style: TextStyle(color: Colors.white),),
SizedBox(height: 8.0),
TextFormField(
onChanged: (value) {
setState(() {
question = value;
});
},
decoration: InputDecoration(
labelText: 'Your Question',
border: OutlineInputBorder(),
labelStyle: TextStyle(color: Theme.of(context).primaryColorDark)

),
maxLines: 3,
),
SizedBox(height: 16.0),
ElevatedButton(
child: Text('Send'),
onPressed: () {
DateTime now = DateTime.now();
String formattedDate = DateFormat('kk:mm:ss \n EEE d MMM').format(now);
// Send the question to your support team
// Implement your logic here
},
),])))])]);
},
),
),
);
Expand Down
100 changes: 72 additions & 28 deletions lib/screens/faqs_screen.dart
Original file line number Diff line number Diff line change
@@ -1,35 +1,77 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../models/users.dart';
import '../services/user_info_services.dart';

class FAQScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('FAQ'),
),
body: ListView(
children: <Widget>[
FAQItem(
question: 'How to edit profile?',
answer: 'To edit your profile, go to the "Profile" screen and tap on the edit button. Make the necessary changes and save them.',
),
FAQItem(
question: 'How to add an assignment?',
answer: 'You can directly add an assignment from the home screen. Tap on the "+" button, enter the assignment details, and save it.',
),
FAQItem(
question: 'Can I edit or delete a reminder?',
answer: 'Yes, you can edit or delete a reminder. Tap on the reminder item to edit its details or swipe left and tap on the "Delete" button.',
),
FAQItem(
question: 'How do I change the app settings?',
answer: 'To change the app settings, go to the "Settings" screen accessible from the app drawer menu. Here, you can customize various preferences.',
),
FAQItem(
question: 'How to contact us?',
answer: 'If you need to contact us, go to the "Help" screen and tap on the "Contact" option. Fill in the required details and send us a message.',
),
],
appBar: AppBar(elevation: 0,backgroundColor: Colors.transparent,

centerTitle: true,),
backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8),

body: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
child: Consumer<UserInfoServices>(
builder: (context, userInfo, _) {
Users _user;
if (userInfo.hasData) _user = userInfo.user!;
return Stack(
alignment: Alignment.center,
children: [
Column(
children: [
SizedBox(height: 30,),
Text(
"FAQs Section",
style: TextStyle(
color: Colors.white,
fontSize: 30.0,
fontWeight: FontWeight.bold,
),),
SizedBox(height: 0.12 * MediaQuery.of(context).size.height),
Container(
margin: EdgeInsets.fromLTRB(15, 15, 15, 60),
padding: EdgeInsets.all(30),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(40),
topRight: Radius.circular(40),
),
),
width: double.infinity,
child:

SizedBox(height: MediaQuery.of(context).size.height ,width: MediaQuery.of(context).size.width,child:ListView(
children: <Widget>[
FAQItem(
question: 'How to edit profile?',
answer: 'To edit your profile, go to the "Profile" screen and tap on the edit button. Make the necessary changes and save them.',
),
FAQItem(
question: 'How to add an assignment?',
answer: 'You can directly add an assignment from the home screen. Tap on the "+" button, enter the assignment details, and save it.',
),
FAQItem(
question: 'Can I edit or delete a reminder?',
answer: 'Yes, you can edit or delete a reminder. Tap on the reminder item to edit its details or swipe left and tap on the "Delete" button.',
),
FAQItem(
question: 'How do I change the app settings?',
answer: 'To change the app settings, go to the "Settings" screen accessible from the app drawer menu. Here, you can customize various preferences.',
),
FAQItem(
question: 'How to contact us?',
answer: 'If you need to contact us, go to the "Help" screen and tap on the "Contact" option. Fill in the required details and send us a message.',
),
],
),))])]);
},
),
),
);
}
Expand All @@ -44,11 +86,13 @@ class FAQItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ExpansionTile(
title: Text(question),
iconColor: Theme.of(context).highlightColor,
collapsedIconColor: Theme.of(context).highlightColor,
title: Text(question,style: TextStyle(color: Theme.of(context).highlightColor),),
children: <Widget>[
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(answer),
child: Text(answer, style: TextStyle(color: Theme.of(context).canvasColor),),
),
],
);
Expand Down
98 changes: 70 additions & 28 deletions lib/screens/help_screen.dart
Original file line number Diff line number Diff line change
@@ -1,42 +1,84 @@

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:settings_ui/settings_ui.dart';
import '../models/users.dart';
import '../services/user_info_services.dart';
import 'contact_us_screen.dart';
import 'app_info_screen.dart';

class HelpScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Help'),
),
body: ListView(
children: [
ListTile(
leading: Icon(Icons.contact_mail),
title: Text('Contact Us'),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ContactUsScreen(),
appBar: AppBar(elevation: 0,backgroundColor: Colors.transparent,

centerTitle: true,),
backgroundColor: Theme.of(context).colorScheme.background.withOpacity(0.8),

body: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
child: Consumer<UserInfoServices>(
builder: (context, userInfo, _) {
Users _user;
if (userInfo.hasData) _user = userInfo.user!;
return Stack(
alignment: Alignment.center,
children: [
Column(
children: [
SizedBox(height: 30,),
Text(
"Help Section",
style: TextStyle(
color: Colors.white,
fontSize: 30.0,
fontWeight: FontWeight.bold,
),),
SizedBox(height: 0.12 * MediaQuery.of(context).size.height),
Container(
margin: EdgeInsets.fromLTRB(15, 15, 15, 60),
padding: EdgeInsets.all(30),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(40),
topRight: Radius.circular(40),
),
),
width: double.infinity,
child:

SizedBox(height: MediaQuery.of(context).size.height ,width: MediaQuery.of(context).size.width,child:ListView(
children: <Widget>[
ListTile(
leading: Icon(Icons.contact_mail, color: Colors.white,),
title: Text('Contact Us', style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ContactUsScreen(),
),
);
},
),
);
},
),
ListTile(
leading: Icon(Icons.info),
title: Text('App Info'),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AppInfoScreen(),
ListTile(
leading: Icon(Icons.info, color: Colors.white,),
title: Text('App Info',style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AppInfoScreen(),
),
);
},
),
);
},
),
],
],
),))])]);
},
),
),
);
}
Expand Down

0 comments on commit 745d272

Please sign in to comment.