Merge pull request #39 from WDI-Ideas/jayeshjain25

faq screen
This commit is contained in:
Jayesh jain
2024-06-12 12:39:20 +05:30
committed by GitHub
9 changed files with 197 additions and 11 deletions

View File

@@ -23,7 +23,10 @@ class RouteName {
//choose country
static const String chooseCountryScreen = 'chooseCountryScreen';
//
//Faq
static const String faqScreen = 'faqScreen';
//Main Screen
static const String mainScreen = 'mainScreen';
//Portfolio details

View File

@@ -18,6 +18,7 @@ import 'package:tanami_app/features/changePassword/presentation/pages/change_pas
import 'package:tanami_app/features/contactAdmin/presentation/pages/contact_admin_screen.dart';
import 'package:tanami_app/features/countrySelection/presentation/pages/choose_country_screen.dart';
import 'package:tanami_app/features/deleteAccount/presentation/pages/delete_account_screen.dart';
import 'package:tanami_app/features/faq/presentation/pages/faq_screen.dart';
import 'package:tanami_app/features/forgotPassword/presentation/pages/restore_password_screen.dart';
import 'package:tanami_app/features/languageChange/presentation/pages/language_change_screen.dart';
import 'package:tanami_app/features/otpVerification/presentation/pages/otp_screen.dart';
@@ -262,6 +263,13 @@ final goRouter = GoRouter(
return const NoInternet();
},
),
GoRoute(
name: RouteName.faqScreen,
path: RouteName.faqScreen,
builder: (context, state) {
return const FAQScreen();
},
),
],
),
],

View File

@@ -46,7 +46,9 @@ class SupportSettingsSection extends StatelessWidget {
),
const Gap(8),
SettingsListItem(
onTapFunc: () {},
onTapFunc: () {
goRouter.pushNamed(RouteName.faqScreen);
},
icon: AppImages.faqIcon,
title: AppText.faqText,
trailing: "",

View File

@@ -0,0 +1,162 @@
import 'package:expansion_tile_group/expansion_tile_group.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import '../../../../shared/components/appbar_widget.dart';
class FAQScreen extends StatefulWidget {
const FAQScreen({super.key});
@override
State<FAQScreen> createState() => _AccountappState();
}
class _AccountappState extends State<FAQScreen> {
int selectedTile = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const AppBarWidget(
height: 75,
titleTxt: AppText.faqText,
),
backgroundColor: AppColor.plainWhite,
body: SafeArea(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 16.w, top: 23.h),
child: Text(
"Frequently Asked Questions:",
style: GoogleFonts.dmSans(
fontSize: 18.sp,
color: AppColor.charcoalColor,
fontWeight: FontWeight.w600),
),
),
Gap(17.h),
Container(
margin: const EdgeInsets.only(
bottom: 50,
top: 15,
),
height: 1.sh,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: ExpansionTileGroup(
spaceBetweenItem: 23,
toggleType: ToggleType.expandOnlyCurrent,
children: List.generate(
faList.length,
(index) => ExpansionTileItem(
isHasBottomBorder: true,
isHasLeftBorder: true,
isHasRightBorder: true,
boxShadow: [
BoxShadow(
color: AppColor.plainBlack.withOpacity(0.15),
spreadRadius: 2,
blurRadius: 10,
offset: const Offset(
0, 3), // changes position of shadow
),
],
isHasTopBorder: true,
collapsedBackgroundColor:
AppColor.portfolioCardBgColor,
borderRadius: BorderRadius.circular(10),
onExpansionChanged: (bool expanding) {
if (expanding) {
setState(() {
selectedTile = index;
});
} else {
setState(() {
selectedTile = -1;
});
}
},
backgroundColor: AppColor.portfolioCardBgColor,
childrenPadding: EdgeInsets.only(
left: 0.w,
right: 0.w,
bottom: 8.h,
top: 10.h),
initiallyExpanded: index == selectedTile,
isHasTrailing: false,
title: Text(
faList[index]['title']!,
maxLines: 3,
style: GoogleFonts.dmSans(
fontSize: 16.sp,
color: AppColor.otpTextColor,
fontWeight: FontWeight.w600),
),
children: <Widget>[
Container(
margin:
const EdgeInsets.symmetric(horizontal: 5),
width: 1.sw,
// height: 109.h,
decoration: BoxDecoration(
color: AppColor.plainWhite,
borderRadius: BorderRadius.circular(10.r),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 12.w, vertical: 10.h),
child: Text(
faList[index]['answer']!,
style: GoogleFonts.dmSans(
fontSize: 16.sp,
color: AppColor.investPaymentTextColor,
),
),
),
)
],
))),
),
),
],
),
)),
);
}
}
List<Map<String, String>> faList = [
{
"title": "What is fractional property investment?",
"answer":
"Fractional property investment allows multiple investors to own a fraction of a property. This means you can invest in real estate without needing to purchase an entire property. Instead, you buy a share of the property, and your investment is proportionate to the amount you invest.",
},
{
"title": "How does the app work?",
"answer":
"Our app simplifies the process of fractional property investment. Users can browse available properties, view detailed information and investment opportunities, and purchase shares in properties directly through the app. The app also provides tools to manage investments, track performance, and receive updates on property management."
},
{
"title": "Is fractional property investment safe?",
"answer":
"While all investments carry risk, fractional property investment can be a safer option due to diversification. By investing in multiple properties, you can spread risk and reduce the impact of any single propertys performance on your overall investment."
},
{
"title": "What kind of properties can I invest in?",
"answer":
"The app offers a variety of properties, including residential, commercial, and mixed-use properties. Each listing provides detailed information about the property, including location, projected returns, and investment terms."
},
{
"title": "Is there a minimum investment amount?",
"answer":
"Yes, each property listing will specify the minimum investment amount required. This amount varies depending on the property and the terms of the investment."
}
];

View File

@@ -7,7 +7,6 @@ import 'core/routes/routes.dart';
import 'core/utils/connectivity/network_connectivity.dart';
import 'features/countrySelection/presentation/bloc/choose_country_bloc.dart';
import 'shared/components/bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
import 'shared/components/error_widget.dart';
/* CREATED BY - JAYESH JAIN
DATE - 24-05-2024
@@ -17,12 +16,12 @@ import 'shared/components/error_widget.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
FlutterError.onError = (FlutterErrorDetails details) {
FlutterError.dumpErrorToConsole(details);
runApp(CustomErrorWidget(
errorMessage: details.toString(),
));
};
// FlutterError.onError = (FlutterErrorDetails details) {
// FlutterError.dumpErrorToConsole(details);
// runApp(CustomErrorWidget(
// errorMessage: details.toString(),
// ));
// };
// Set the preferred orientations of the device.
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,

View File

@@ -37,6 +37,7 @@ class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
preferredSize: Size.fromHeight(height ?? 130),
child: AppBar(
scrolledUnderElevation: 0.0,
backgroundColor: AppColor.plainWhite,
elevation: 0,
centerTitle: centerTitle ?? true,
title: TextWidget().text20W700(titleTxt, clr: AppColor.charcoalColor),

View File

@@ -7,8 +7,8 @@ class CustomErrorWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: Column(
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(

View File

@@ -305,6 +305,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.5"
expansion_tile_group:
dependency: "direct main"
description:
name: expansion_tile_group
sha256: "6918433891481c7d98cbc604d7b4c93509986e8134d52940853301ad6fbff404"
url: "https://pub.dev"
source: hosted
version: "1.2.4"
fake_async:
dependency: transitive
description:

View File

@@ -81,6 +81,9 @@ dependencies:
#Url Launcher
url_launcher: ^6.3.0
#Expansion Tile
expansion_tile_group: ^1.2.4
dev_dependencies:
flutter_test:
sdk: flutter