309 lines
8.7 KiB
Dart
309 lines
8.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../Controller/Dashboard/Dashboardcontroller.dart';
|
|
import '../../Controller/Home/Homecontroller.dart';
|
|
import '../../Controller/More/Morecontroller.dart';
|
|
import '../../Globalwidgets/textwidget.dart';
|
|
import '../../Globalwidgets/web_view.dart';
|
|
import '../../Helper/Constants/Colorconstants.dart';
|
|
import 'Notification/Notificationview.dart';
|
|
|
|
class MoreView extends StatelessWidget {
|
|
MoreView({super.key});
|
|
|
|
final MoreController moreController = Get.put(MoreController());
|
|
|
|
final DashboardController dashboardController = Get.put(DashboardController());
|
|
|
|
final HomeController homeController = Get.put(HomeController());
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetBuilder<MoreController>(
|
|
initState: (_){
|
|
moreController.getToken();
|
|
homeController.getTenantId();
|
|
},
|
|
builder: (controller) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.grey.shade200,
|
|
appBar: AppBar(
|
|
leading: Padding(
|
|
padding: const EdgeInsets.only(left: 14),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
TextWidget(
|
|
text: '${dashboardController.tenantInfo?.firstname}',
|
|
fontSize : 18,
|
|
fontWeight: FontWeight.w700,
|
|
maxLines: 1,
|
|
),
|
|
const SizedBox(height: 5,),
|
|
TextWidget(
|
|
text: '+91 ${dashboardController.tenantInfo?.primarycontact}',
|
|
fontSize: 15,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
leadingWidth: double.infinity,
|
|
backgroundColor: ColorConstants.secondaryColor,
|
|
automaticallyImplyLeading: false,
|
|
toolbarHeight: 65,
|
|
|
|
),
|
|
body: SingleChildScrollView(
|
|
child: Column(
|
|
children: [
|
|
const SizedBox(height: 20,),
|
|
MyAccountSegmentUI(moreController: moreController, homeController: homeController,),
|
|
const SizedBox(height: 20,),
|
|
// HelpAndSupport(moreController: moreController, homeController: homeController,),
|
|
// const SizedBox(height: 20,),
|
|
const PrivacyPolicySegment(),
|
|
const SizedBox(height: 20,),
|
|
TextWidget(
|
|
text: 'App Version: ${controller.currentVersion}',
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w700,
|
|
color: ColorConstants.darkGreyColor,
|
|
),
|
|
const SizedBox(height: 50,),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
class MyAccountSegmentUI extends StatelessWidget {
|
|
const MyAccountSegmentUI({
|
|
super.key, required
|
|
this.moreController,
|
|
required this.homeController,
|
|
|
|
});
|
|
|
|
final MoreController moreController;
|
|
|
|
final HomeController homeController;
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
color: Colors.white,
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(left: 15, right: 15),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const SizedBox(height: 10,),
|
|
const TextWidget(
|
|
text: 'My Account',
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 21,
|
|
),
|
|
const SizedBox(
|
|
height: 15,
|
|
),
|
|
CustomListTile(
|
|
leadingIcon: Icons.notifications_active,
|
|
title: 'Notification',
|
|
onTap: () {
|
|
Get.to(() => NotificationView());
|
|
},
|
|
),
|
|
CustomListTile(
|
|
leadingIcon: Icons.qr_code_scanner,
|
|
title: 'Scanner',
|
|
onTap: () {
|
|
homeController.showQRBottomSheet();
|
|
},
|
|
),
|
|
CustomListTile(
|
|
leadingIcon: Icons.logout,
|
|
title: 'Logout',
|
|
onTap: () {
|
|
moreController.confirmLogout(context);
|
|
},
|
|
noNeedDivider: true,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
class HelpAndSupport extends StatelessWidget {
|
|
const HelpAndSupport({
|
|
super.key, required
|
|
this.moreController,
|
|
required this.homeController,
|
|
|
|
});
|
|
|
|
final MoreController moreController;
|
|
|
|
final HomeController homeController;
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
color: Colors.white,
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(left: 15, right: 15),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const SizedBox(height: 10,),
|
|
const TextWidget(
|
|
text: 'Help And Support',
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 21,
|
|
),
|
|
const SizedBox(
|
|
height: 15,
|
|
),
|
|
CustomListTile(
|
|
leadingIcon: Icons.headphones,
|
|
title: 'Create Request',
|
|
onTap: () {
|
|
Get.to(() => NotificationView());
|
|
},
|
|
),
|
|
CustomListTile(
|
|
leadingIcon: Icons.support_agent_outlined,
|
|
title: 'Requested Support',
|
|
noNeedDivider: true,
|
|
onTap: () {
|
|
homeController.showQRBottomSheet();
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
class PrivacyPolicySegment extends StatelessWidget {
|
|
const PrivacyPolicySegment({
|
|
super.key,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
color: Colors.white,
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(left: 15, right: 15),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const SizedBox(height: 10,),
|
|
const TextWidget(
|
|
text: 'Policy and FAQ',
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 21,
|
|
),
|
|
const SizedBox(
|
|
height: 15,
|
|
),
|
|
CustomListTile(
|
|
leadingIcon: Icons.question_answer,
|
|
title: "FAQ's",
|
|
onTap: () {
|
|
Get.to(() => const WebViewApp(
|
|
url: 'https://nearle.in/faq',
|
|
appBarText: "FAQ's",
|
|
));
|
|
},
|
|
),
|
|
CustomListTile(
|
|
leadingIcon: Icons.rule,
|
|
title: "Term's and conditions",
|
|
onTap: () {
|
|
Get.to(() => const WebViewApp(
|
|
url: 'https://nearle.in/terms',
|
|
appBarText: 'Terms and conditions',
|
|
),
|
|
);
|
|
},
|
|
),
|
|
CustomListTile(
|
|
leadingIcon: Icons.privacy_tip,
|
|
title: 'Privacy Policy',
|
|
noNeedDivider: true,
|
|
onTap: () {
|
|
Get.to(() => const WebViewApp(
|
|
url: 'https://nearle.in/privacy',
|
|
appBarText: 'Privacy Policy',
|
|
));
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class CustomListTile extends StatelessWidget {
|
|
final IconData leadingIcon;
|
|
final String title;
|
|
final VoidCallback onTap;
|
|
final bool? noNeedDivider;
|
|
|
|
const CustomListTile({
|
|
super.key,
|
|
required this.leadingIcon,
|
|
required this.title,
|
|
required this.onTap,
|
|
this.noNeedDivider,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
ListTile(
|
|
contentPadding: EdgeInsets.zero,
|
|
visualDensity: const VisualDensity(horizontal: -4), // Decrease space
|
|
leading: CircleAvatar(
|
|
radius: 18,
|
|
backgroundColor: ColorConstants.primaryColor.withOpacity(0.1),
|
|
child: Icon(
|
|
leadingIcon,
|
|
color: ColorConstants.primaryColor,
|
|
size: 20,
|
|
),
|
|
),
|
|
trailing: const Icon(Icons.arrow_forward_ios, size: 17),
|
|
title: TextWidget(
|
|
text: title,
|
|
fontSize: 16,
|
|
// fontWeight: FontWeight.bold,
|
|
),
|
|
onTap: onTap, // Action when the ListTile is tapped
|
|
),
|
|
(noNeedDivider ?? false) ?
|
|
const SizedBox() :
|
|
Divider(
|
|
thickness: 0.5,
|
|
// color: ColorConstants.lightGrey,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |