From bf7f7eca48b22e3e2f7b58768113ab8bc543d3aa Mon Sep 17 00:00:00 2001 From: Moe Date: Mon, 23 May 2022 02:23:07 +0700 Subject: [PATCH] Add FAQ page --- lib/components/faq_body.dart | 192 +++++++++++++++++++++++++++++++++++ lib/screens/faq.dart | 25 +++++ lib/screens/products.dart | 11 ++ 3 files changed, 228 insertions(+) create mode 100644 lib/components/faq_body.dart create mode 100644 lib/screens/faq.dart diff --git a/lib/components/faq_body.dart b/lib/components/faq_body.dart new file mode 100644 index 0000000..c5eb1a1 --- /dev/null +++ b/lib/components/faq_body.dart @@ -0,0 +1,192 @@ +import 'package:flutter/material.dart'; + +class FAQBody extends StatefulWidget { + const FAQBody({Key? key}) : super(key: key); + + @override + State createState() => _FAQBodyState(); +} + +class _FAQBodyState extends State { + @override + Widget build(BuildContext context) { + return Container( + decoration: const BoxDecoration(color: Colors.transparent), + child: ListView( + scrollDirection: Axis.vertical, + shrinkWrap: true, + children: [ + const SizedBox(height: 20,), + Container( + padding: const EdgeInsets.only(bottom: 20), + margin: const EdgeInsets.only(left: 15, right: 15), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: const ExpansionTile( + backgroundColor: Color(0xff212226), + collapsedBackgroundColor: Color.fromARGB(255, 18, 19, 19), + textColor: Color.fromARGB(255, 252, 252, 252), + collapsedTextColor: Color.fromARGB(255, 252, 252, 252), + title: Text('Do you ship to my country?'), + children: [ + ListTile( + textColor: Colors.white, + title: Text( + 'We ship to nearly 200 countries worldwide.'), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.only(bottom: 20), + margin: const EdgeInsets.only(left: 15, right: 15), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: const ExpansionTile( + backgroundColor: Color(0xff212226), + collapsedBackgroundColor: Color.fromARGB(255, 18, 19, 19), + textColor: Color.fromARGB(255, 252, 252, 252), + collapsedTextColor: Color.fromARGB(255, 252, 252, 252), + title: Text('How long does shipping take? When will I receive my order?'), + children: [ + ListTile( + textColor: Colors.white, + title: Text( + 'Please note, we require 1-5 days to process orders. We strive to ship all items on-time, however, in rare cases, it can take longer than 3 months. Any orders not received within 8 weeks automatically qualify for a full-refund or reship free of charge! 🌟'), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.only(bottom: 20), + margin: const EdgeInsets.only(left: 15, right: 15), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: const ExpansionTile( + backgroundColor: Color(0xff212226), + collapsedBackgroundColor: Color.fromARGB(255, 18, 19, 19), + textColor: Color.fromARGB(255, 252, 252, 252), + collapsedTextColor: Color.fromARGB(255, 252, 252, 252), + title: Text('My order has been dispatched, can I track it?'), + children: [ + ListTile( + textColor: Colors.white, + title: Text( + 'Once your order has been shipped, you’ll receive a tracking number via email. Note, it can take up to 7 days for shipping activity to update.'), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.only(bottom: 20), + margin: const EdgeInsets.only(left: 15, right: 15), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: const ExpansionTile( + backgroundColor: Color(0xff212226), + collapsedBackgroundColor: Color.fromARGB(255, 18, 19, 19), + textColor: Color.fromARGB(255, 252, 252, 252), + collapsedTextColor: Color.fromARGB(255, 252, 252, 252), + title: Text('Do you offer a guarantee? Can I return my items?'), + children: [ + ListTile( + textColor: Colors.white, + title: Text( + 'Of course. We offer an extended 30 day guarantee! ☑️'), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.only(bottom: 20), + margin: const EdgeInsets.only(left: 15, right: 15), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: const ExpansionTile( + backgroundColor: Color(0xff212226), + collapsedBackgroundColor: Color.fromARGB(255, 18, 19, 19), + textColor: Color.fromARGB(255, 252, 252, 252), + collapsedTextColor: Color.fromARGB(255, 252, 252, 252), + title: Text('Can I change or cancel my order?'), + children: [ + ListTile( + textColor: Colors.white, + title: Text( + 'Sure! You can cancel, or change your order within 24 hours of confirmation.'), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.only(bottom: 20), + margin: const EdgeInsets.only(left: 15, right: 15), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: const ExpansionTile( + backgroundColor: Color(0xff212226), + collapsedBackgroundColor: Color.fromARGB(255, 18, 19, 19), + textColor: Color.fromARGB(255, 252, 252, 252), + collapsedTextColor: Color.fromARGB(255, 252, 252, 252), + title: Text('What methods of payment do you take?'), + children: [ + ListTile( + textColor: Colors.white, + title: Text( + 'We accept ALL major bank methods.'), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.only(bottom: 20), + margin: const EdgeInsets.only(left: 15, right: 15), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: const ExpansionTile( + backgroundColor: Color(0xff212226), + collapsedBackgroundColor: Color.fromARGB(255, 18, 19, 19), + textColor: Color.fromARGB(255, 252, 252, 252), + collapsedTextColor: Color.fromARGB(255, 252, 252, 252), + title: Text('Do you offer promotional or affiliate opportunities?'), + children: [ + ListTile( + textColor: Colors.white, + title: Text( + 'We do and we’d love to hear from you! 👋'), + ) + ], + ), + ), + ), + Container( + padding: const EdgeInsets.only(bottom: 20), + margin: const EdgeInsets.only(left: 15, right: 15), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: const ExpansionTile( + backgroundColor: Color(0xff212226), + collapsedBackgroundColor: Color.fromARGB(255, 18, 19, 19), + textColor: Color.fromARGB(255, 252, 252, 252), + collapsedTextColor: Color.fromARGB(255, 252, 252, 252), + title: Text('Do I need to pay import duties?'), + children: [ + ListTile( + textColor: Colors.white, + title: Text( + 'Some packages may be subject to import duties depending on the country of receipt.'), + ) + ], + ), + ), + ) + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/faq.dart b/lib/screens/faq.dart new file mode 100644 index 0000000..dee9940 --- /dev/null +++ b/lib/screens/faq.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; + +import 'package:nekoya_flutter/components/faq_body.dart'; + +class FAQ extends StatefulWidget { + const FAQ({Key? key}) : super(key: key); + + @override + State createState() => _FAQState(); +} + +class _FAQState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xff1b1c1e), + appBar: AppBar( + title: const Text('FAQ'), + centerTitle: true, + backgroundColor: const Color(0xff212226), + ), + body: const FAQBody() + ); + } +} \ No newline at end of file diff --git a/lib/screens/products.dart b/lib/screens/products.dart index 013e5ed..8b37fec 100644 --- a/lib/screens/products.dart +++ b/lib/screens/products.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:nekoya_flutter/api/api.dart'; import 'package:nekoya_flutter/components/product_box.dart'; import 'package:nekoya_flutter/components/product_detail.dart'; +import 'package:nekoya_flutter/screens/faq.dart'; import 'package:nekoya_flutter/utils/utils.dart' show kMobileBreakpoint, kTabletBreakpoint, kDesktopBreakPoint; class Products extends StatefulWidget { @@ -22,6 +23,16 @@ class _ProductsState extends State { centerTitle: true, backgroundColor: const Color(0xff212226), automaticallyImplyLeading: false, + actions: [ + IconButton( + icon: const Icon(Icons.question_mark), + onPressed: () { + Navigator.push(context, MaterialPageRoute( + builder: (context) => const FAQ() + )); + }, + ) + ], ), body: LayoutBuilder( builder: (context, dimension) {