diff --git a/lib/core/routes/route_name.dart b/lib/core/routes/route_name.dart index ad420dd..5706b60 100644 --- a/lib/core/routes/route_name.dart +++ b/lib/core/routes/route_name.dart @@ -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 diff --git a/lib/core/routes/routes.dart b/lib/core/routes/routes.dart index 7d78ddc..1719663 100644 --- a/lib/core/routes/routes.dart +++ b/lib/core/routes/routes.dart @@ -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(); + }, + ), ], ), ], diff --git a/lib/features/MainScreens/Settings/presentation/widgets/support_settings_section.dart b/lib/features/MainScreens/Settings/presentation/widgets/support_settings_section.dart index 630e9ac..a35d346 100644 --- a/lib/features/MainScreens/Settings/presentation/widgets/support_settings_section.dart +++ b/lib/features/MainScreens/Settings/presentation/widgets/support_settings_section.dart @@ -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: "", diff --git a/lib/features/faq/presentation/pages/faq_screen.dart b/lib/features/faq/presentation/pages/faq_screen.dart new file mode 100644 index 0000000..c4841bf --- /dev/null +++ b/lib/features/faq/presentation/pages/faq_screen.dart @@ -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 createState() => _AccountappState(); +} + +class _AccountappState extends State { + 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: [ + 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> 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 property’s 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." + } +]; diff --git a/lib/main.dart b/lib/main.dart index 6ad18d9..3d38233 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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 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, diff --git a/lib/shared/components/appbar_widget.dart b/lib/shared/components/appbar_widget.dart index b2a3669..43d854e 100644 --- a/lib/shared/components/appbar_widget.dart +++ b/lib/shared/components/appbar_widget.dart @@ -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), diff --git a/lib/shared/components/error_widget.dart b/lib/shared/components/error_widget.dart index c7b5bae..96eaf38 100644 --- a/lib/shared/components/error_widget.dart +++ b/lib/shared/components/error_widget.dart @@ -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( diff --git a/pubspec.lock b/pubspec.lock index c56e58d..4b6897f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index 27c6ded..5afce41 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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