Commit 97403192 authored by Sai Srinivas's avatar Sai Srinivas Committed by Sai Srinivas
Browse files

Icon inserted and few changes

parent 5a62c920
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/serviceAndJobCardListProvier.dart';
import '../../Utility/AppColors.dart';
class serviceListScreen extends StatefulWidget {
final accId;
final sessionId;
final complaintId;
const serviceListScreen({super.key,required this.accId,required this.sessionId,required this.complaintId});
@override
State<serviceListScreen> createState() => _serviceListScreenState();
}
class _serviceListScreenState extends State<serviceListScreen> {
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<ServiceAndJobCardListProvider>(
context,
listen: false,
);
provider.fetchServiceDetailsAPI(widget.accId, widget.sessionId,widget.complaintId);
});
}
@override
Widget build(BuildContext context) {
return Consumer<ServiceAndJobCardListProvider>(
builder: (context, provider, child) {
final isLoading = provider.isLoading;
final error = provider.errorMessage;
final response = provider.allServiceResponse;
final data = response?.allServiceList??[];
List<String> serviceHeadings = [
"Date",
"In/Out Time",
"Running Hrs.",
"FSR File",
"FSR Number",
"Feedback",
];
if (isLoading) {
return const Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: CircularProgressIndicator(color: AppColors.buttonColor),
),
);
}
if (error != null) {
return Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: Text(
error,
style: const TextStyle(color: Colors.red, fontSize: 16),
),
),
);
}
if (data == null) {
return const Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(child: Text("No data found.")),
);
}
return RefreshIndicator.adaptive(
color: AppColors.amountText,
onRefresh: () async {
await Future.delayed(const Duration(milliseconds: 600));
},
child: Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: CustomScrollView(
physics: const BouncingScrollPhysics(),
slivers: [
SliverAppBar(
stretch: true,
pinned: true,
expandedHeight: 75,
backgroundColor: AppColors.backgroundRegular,
elevation: 0,
// Remove shadow
automaticallyImplyLeading: false,
toolbarHeight: 0,
// Remove toolbar space
collapsedHeight: 0,
// Completely collapse to 0 height
flexibleSpace: FlexibleSpaceBar(
stretchModes: const [StretchMode.fadeTitle],
background: Container(
decoration: BoxDecoration(
gradient: AppColors.balanceBarGradientA,
),
child: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 20,
),
child: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkResponse(
onTap: () {
HapticFeedback.selectionClick();
Navigator.pop(context, true);
},
child: SvgPicture.asset(
"assets/svg/appbar_back.svg",
height: 25,
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: InkResponse(
onTap: () {
HapticFeedback.selectionClick();
Navigator.pop(context, true);
},
child: Text(
"Service Details List",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 16,
color: Colors.white,
height: 1.1,
),
),
),
),
],
),
),
),
),
),
),
),
SliverToBoxAdapter(
child: Container(
color: Color(0xFF4076FF),
child: Container(
decoration: const BoxDecoration(
color: AppColors.backgroundRegular,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 4),
ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: data!.length,
itemBuilder: (context, j) {
List<String> serviceSubHeadings = [
data[j].date ?? "-",
data[j].inOrOutTime ?? "-",
data[j].runningHrs ?? "-",
data[j].fsrExt ?? "-",
data[j].fsrNo ?? "-",
data[j].feedback ?? "-",
];
return Container(
margin: const EdgeInsets.all(5),
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
...List.generate(serviceHeadings.length, (
i,
) {
return Padding(
padding: const EdgeInsets.symmetric(
vertical: 3,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
serviceHeadings[i] ?? "-",
style: const TextStyle(
fontSize: 14,
color: AppColors.subtitleText,
),
),
),
Expanded(
child: Text(
serviceSubHeadings[i].isEmpty
? "-"
: serviceSubHeadings[i] ??
"-",
maxLines: 3,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.end,
style: const TextStyle(
fontSize: 14,
color: AppColors.nearDarkText,
),
),
),
],
),
);
}),
SizedBox(
height: 5,
),
Container(
padding: EdgeInsets.symmetric(horizontal: 0,vertical: 15),
decoration: BoxDecoration(
color: Color(0xFFE8F6FF),
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 1,
child: CircleAvatar(
backgroundImage: data[j].profileImg=="https://erp.gengroup.in/"?
AssetImage("assets/images/user_img.png"):
NetworkImage(
data[j].profileImg!,
),
),
),
Expanded(
flex: 2,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${data[j].empName}",
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color:
AppColors.nearDarkText,
fontSize: 14,
),
),
Text(
"${data[j].techRoleName}",
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color:
AppColors.subtitleText,
fontSize: 12,
),
),
],
),
),
),
Expanded(
flex: 2,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(5, (index) {
final serviceId = data[j].id?.toString() ?? data[j].id.toString();
final rating = provider.getRating(serviceId);
final starStates = provider.getStarStates(serviceId);
return InkWell(
onTap: () async {
final newRating = index + 1;
provider.setRating(serviceId, newRating);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text("Submitting rating..."), duration: Duration(seconds: 1)),
);
await provider.updateRatingForTechnician(widget.accId,widget.sessionId,serviceId,newRating);
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 2),
child: Icon(
Icons.star_rate_rounded,
color: starStates[index]
? const Color(0xffFFB703)
: const Color(0xffCECECE),
size: 24,
),
),
);
}),
),
Text(
"Your Rating",
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color:
AppColors.subtitleText,
fontSize: 12,
),
),
],
),
),
),
],
),
),
],
),
);
},
),
],
),
),
),
),
],
),
),
);
},
);
}
}
......@@ -2,11 +2,14 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:gen_service/Models/DashboardResponse.dart';
import 'package:gen_service/Screens/ContactUsScreen.dart';
import 'package:gen_service/Screens/HelpAndComplaintScreens/ComplaintDetailsScreen.dart';
import 'package:gen_service/Screens/HelpAndComplaintScreens/SelectOrderHelpScreen.dart';
import 'package:gen_service/Screens/HelpAndComplaintScreens/ComplaintListScreen.dart';
import 'package:gen_service/Screens/ProfileScreen.dart';
import 'package:gen_service/Screens/TransactionScreens/TransactionListScreen.dart';
import 'package:gen_service/Screens/TransactionScreens/contactMap.dart';
import 'package:provider/provider.dart';
import 'package:razorpay_flutter/razorpay_flutter.dart';
......@@ -15,7 +18,6 @@ import '../Notifiers/DashboardProvider.dart';
import '../Notifiers/PayAmountProvider.dart';
import '../Utility/AppColors.dart';
import '../Utility/CustomSnackbar.dart';
import 'generatorDetailsScreen.dart';
......@@ -35,7 +37,6 @@ class HomeScreen extends StatefulWidget {
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
late Razorpay _razorpay;
bool? isSuccess;
......@@ -50,11 +51,14 @@ class _HomeScreenState extends State<HomeScreen> {
super.initState();
_razorpay = Razorpay();
Future.microtask(() {
final dashboardProvider =
Provider.of<DashboardProvider>(context, listen: false);
final dashboardProvider = Provider.of<DashboardProvider>(
context,
listen: false,
);
dashboardProvider.fetchDashboard(widget.accId, widget.sessionId);
});
}
//_________________________________________________________
void _handlePaymentSuccess(PaymentSuccessResponse response) {
......@@ -63,7 +67,7 @@ class _HomeScreenState extends State<HomeScreen> {
await provider.getPaymentStatus(
sessionId: widget.sessionId,
empId: widget.accId,
razorpayOrderId: response.orderId.toString()
razorpayOrderId: response.orderId.toString(),
);
final data = provider.statusResponse;
// Navigator.push(
......@@ -104,7 +108,6 @@ class _HomeScreenState extends State<HomeScreen> {
Future<void> payAmountFunction(String amount) async {
try {
final provider = Provider.of<PayAmountProvider>(context, listen: false);
await provider.payAmount(
......@@ -149,7 +152,7 @@ class _HomeScreenState extends State<HomeScreen> {
'description': "Bill",
'currency': 'INR',
'method': 'upi',
'prefill': {'contact': widget.mobNumber, 'email': ''}
'prefill': {'contact': widget.mobNumber, 'email': ''},
};
// print(options);
try {
......@@ -178,8 +181,6 @@ class _HomeScreenState extends State<HomeScreen> {
// });
// }
Future<bool> _onWillPop() async {
DateTime now = DateTime.now();
if (currentBackPressTime == null ||
......@@ -188,7 +189,7 @@ class _HomeScreenState extends State<HomeScreen> {
CustomSnackBar.showExit(
context: context,
title: "Exit",
message: 'Press back again to exit'
message: 'Press back again to exit',
);
return false;
}
......@@ -196,7 +197,6 @@ class _HomeScreenState extends State<HomeScreen> {
exit(0);
}
@override
Widget build(BuildContext context) {
final dashboardProvider = Provider.of<DashboardProvider>(context);
......@@ -209,7 +209,7 @@ class _HomeScreenState extends State<HomeScreen> {
return const Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: CircularProgressIndicator(color: AppColors.buttonColor,),
child: CircularProgressIndicator(color: AppColors.buttonColor),
),
);
}
......@@ -218,19 +218,129 @@ class _HomeScreenState extends State<HomeScreen> {
return Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: Text(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Error Icon
Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.1),
shape: BoxShape.circle,
),
child: const Icon(
Icons.error_outline_rounded,
size: 60,
color: Colors.red,
),
),
const SizedBox(height: 24),
// Error Title
const Text(
"Oops! Something went wrong",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.black87,
fontFamily: "Poppins",
),
),
const SizedBox(height: 12),
// Error Message
Text(
error,
style: const TextStyle(color: Colors.red, fontSize: 16),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
height: 1.4,
),
),
const SizedBox(height: 32),
// Retry Button
ElevatedButton.icon(
onPressed: () async {
// Show loading state
setState(() {});
await Future.delayed(const Duration(milliseconds: 300));
// Retry fetching data
final dashboardProvider =
Provider.of<DashboardProvider>(context, listen: false);
await dashboardProvider.fetchDashboard(
widget.accId,
widget.sessionId
);
},
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.buttonColor,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25),
),
elevation: 2,
),
icon: const Icon(Icons.refresh_rounded, size: 20),
label: const Text(
"Try Again",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: "Poppins",
),
),
),
const SizedBox(height: 16),
// Alternative Action
// TextButton(
// onPressed: () {
// // Go back or navigate to home
// Navigator.maybePop(context);
// },
// child: const Text(
// "Go Back",
// style: TextStyle(
// fontSize: 14,
// color: Colors.grey,
// fontFamily: "Poppins",
// ),
// ),
// ),
],
),
),
),
);
}
if (data == null) {
return const Scaffold(
return RefreshIndicator.adaptive(
color: AppColors.amountText,
onRefresh: () async {
await Future.delayed(const Duration(milliseconds: 600));
Provider.of<DashboardProvider>(context, listen: false);
dashboardProvider.fetchDashboard(widget.accId, widget.sessionId);
},
child: const Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: Text("No data found."),
body: Center(child: Text("No data found.")),
),
);
}
......@@ -244,7 +354,12 @@ class _HomeScreenState extends State<HomeScreen> {
Provider.of<DashboardProvider>(context, listen: false);
dashboardProvider.fetchDashboard(widget.accId, widget.sessionId);
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
maintainBottomViewPadding: true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: Color(0xFF4076FF),
body: CustomScrollView(
physics: ClampingScrollPhysics(),
......@@ -255,9 +370,14 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundColor: Color(0xFF4076FF),
onStretchTrigger: () async {
// Refresh data when pulled down
final dashboardProvider =
Provider.of<DashboardProvider>(context, listen: false);
dashboardProvider.fetchDashboard(widget.accId, widget.sessionId);
final dashboardProvider = Provider.of<DashboardProvider>(
context,
listen: false,
);
dashboardProvider.fetchDashboard(
widget.accId,
widget.sessionId,
);
},
stretchTriggerOffset: 300.0,
expandedHeight: 232.0,
......@@ -274,7 +394,8 @@ class _HomeScreenState extends State<HomeScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProfileScreen(
builder:
(context) => ProfileScreen(
accId: widget.accId,
sessionId: widget.sessionId,
),
......@@ -283,11 +404,18 @@ class _HomeScreenState extends State<HomeScreen> {
},
child: Container(
width: double.infinity,
decoration: const BoxDecoration(gradient: AppColors.backgroundGradient),
decoration: const BoxDecoration(
gradient: AppColors.backgroundGradient,
),
child: SafeArea(
bottom: false,
child: Padding(
padding: const EdgeInsets.only(top: 10, bottom: 12, left: 20, right: 20),
padding: const EdgeInsets.only(
top: 10,
bottom: 12,
left: 20,
right: 20,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
......@@ -301,14 +429,20 @@ class _HomeScreenState extends State<HomeScreen> {
shape: BoxShape.circle,
),
clipBehavior: Clip.antiAlias,
child: (data.userProfile?.isNotEmpty == true)
child:
(data.userProfile?.isNotEmpty == true)
? Image.network(
data.userProfile.toString(),
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) =>
CircleAvatar(
errorBuilder:
(
context,
error,
stackTrace,
) => CircleAvatar(
radius: 40,
backgroundColor: const Color(0xFFE0F4FF),
backgroundColor:
const Color(0xFFE0F4FF),
child: SvgPicture.asset(
height: 40,
"assets/svg/person_ic.svg",
......@@ -318,7 +452,9 @@ class _HomeScreenState extends State<HomeScreen> {
)
: CircleAvatar(
radius: 40,
backgroundColor: const Color(0xFFE0F4FF),
backgroundColor: const Color(
0xFFE0F4FF,
),
child: SvgPicture.asset(
height: 40,
"assets/svg/person_ic.svg",
......@@ -349,7 +485,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
)
),
],
),
),
......@@ -400,7 +536,13 @@ class _HomeScreenState extends State<HomeScreen> {
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SelectOrderHelpScreen(accId: widget.accId, sessionId: widget.sessionId))
MaterialPageRoute(
builder:
(context) => SelectOrderHelpScreen(
accId: widget.accId,
sessionId: widget.sessionId,
),
),
);
},
child: Padding(
......@@ -410,30 +552,42 @@ class _HomeScreenState extends State<HomeScreen> {
decoration: BoxDecoration(
color: const Color(0xFFD7F0FF),
borderRadius: BorderRadius.circular(16),
border: Border.all(width: 1.5, color: AppColors.buttonColor),
border: Border.all(
width: 1.5,
color: AppColors.buttonColor,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: const [
Text('Facing Issues?',
Text(
'Facing Issues?',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: AppColors.amountText)),
color: AppColors.amountText,
),
),
Text(
'Raise a ticket to resolve your issues.',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w400,
color: AppColors.subtitleText),
color: AppColors.subtitleText,
),
),
],
),
SvgPicture.asset("assets/svg/requirements.svg",
height: 32, width: 32),
SvgPicture.asset(
"assets/svg/requirements.svg",
height: 32,
width: 32,
),
],
),
),
......@@ -446,12 +600,21 @@ class _HomeScreenState extends State<HomeScreen> {
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ContactUsScreen(accId: widget.accId, sessionId: widget.sessionId))
MaterialPageRoute(
builder:
(context) => ContactMap(
accId: widget.accId,
sessionId: widget.sessionId,
),
),
);
},
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 22),
padding: const EdgeInsets.symmetric(
horizontal: 20,
vertical: 22,
),
decoration: BoxDecoration(
color: AppColors.amountText,
borderRadius: const BorderRadius.only(
......@@ -460,20 +623,25 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(
horizontal: 16,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Get in touch With Us',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.white),
color: Colors.white,
),
),
const SizedBox(height: 4),
Text(
......@@ -481,16 +649,20 @@ class _HomeScreenState extends State<HomeScreen> {
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Color(0xAAFFFFFF)),
color: Color(0xAAFFFFFF),
),
),
],
),
),
const Icon(Icons.arrow_circle_right_sharp,
color: Color(0xFFFFFFFF), size: 30),
const Icon(
Icons.arrow_circle_right_sharp,
color: Color(0xFFFFFFFF),
size: 30,
),
],
),
)
),
),
), // Add bottom padding
],
......@@ -502,6 +674,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
),
),
);
}
......@@ -511,9 +684,7 @@ class _HomeScreenState extends State<HomeScreen> {
if (orders.isEmpty) {
return const Padding(
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 14),
child: Center(
child: Text("No Orders Found"),
),
child: Center(child: Text("No Orders Found")),
);
}
......@@ -532,7 +703,8 @@ class _HomeScreenState extends State<HomeScreen> {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Generatordetailsscreen(
builder:
(context) => Generatordetailsscreen(
accId: widget.accId,
sessionId: widget.sessionId,
genId: order.id,
......@@ -541,15 +713,18 @@ class _HomeScreenState extends State<HomeScreen> {
);
},
child: _buildOrderItem(
assetId: "#${order.hashId ?? ''} | Engine : ${order.engine ?? ''}",
assetId:
"#${order.hashId ?? ''} | Engine : ${order.engine ?? ''}",
description: order.prodName ?? '',
amc: (order.amc?.toString() ?? ''),
warranty: (order.warranty?.toString() ?? ''),
pImage: order.productImage ?? '',
date: order.schedule?.isNotEmpty == true
date:
order.schedule?.isNotEmpty == true
? order.schedule!.first
: null,
serviceText: order.schedule?.isNotEmpty == true
serviceText:
order.schedule?.isNotEmpty == true
? 'Upcoming Service Scheduled'
: null,
),
......@@ -558,8 +733,8 @@ class _HomeScreenState extends State<HomeScreen> {
],
);
}).toList(),
// See All Button
// See All Button
],
),
),
......@@ -617,9 +792,13 @@ class _HomeScreenState extends State<HomeScreen> {
// Status Badge with checkmark for AMC Protected
if (amc == "1" || amc == "2")
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
decoration: BoxDecoration(
gradient: amc == "1"
gradient:
amc == "1"
? AppColors.greenStripGradient
: AppColors.fadeGradient,
borderRadius: BorderRadius.circular(12),
......@@ -632,7 +811,8 @@ class _HomeScreenState extends State<HomeScreen> {
SvgPicture.asset(
"assets/svg/tick_ic.svg",
height: 14,
color: amc == "1"
color:
amc == "1"
? AppColors.greenICBg
: AppColors.subtitleText,
),
......@@ -644,7 +824,8 @@ class _HomeScreenState extends State<HomeScreen> {
fontFamily: "PoppinsBold",
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w700,
color: amc == "1"
color:
amc == "1"
? AppColors.greenICBg
: AppColors.subtitleText,
),
......@@ -656,27 +837,35 @@ class _HomeScreenState extends State<HomeScreen> {
fontFamily: "PoppinsBold",
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w700,
color: amc == "1"
color:
amc == "1"
? AppColors.normalText
: AppColors.subtitleText,
),
),
SizedBox(width: 4,),
SizedBox(width: 4),
if (amc == "2")
const Icon(Icons.info_outline, color: Colors.red, size: 12,)
const Icon(
Icons.info_outline,
color: Colors.red,
size: 12,
),
],
),
],
),
),
if (amc == "1" || amc == "2")
SizedBox(width: 16,),
if (amc == "1" || amc == "2") SizedBox(width: 16),
// for warranty
if (warranty == "1" || warranty == "2")
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
decoration: BoxDecoration(
gradient: warranty == "1"
gradient:
warranty == "1"
? AppColors.yellowStripGradient
: AppColors.fadeGradient,
borderRadius: BorderRadius.circular(12),
......@@ -700,22 +889,26 @@ class _HomeScreenState extends State<HomeScreen> {
fontFamily: "PoppinsBold",
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w700,
color: warranty == "1"
color:
warranty == "1"
? AppColors.normalText
: AppColors.subtitleText,
),
),
SizedBox(width: 6,),
SizedBox(width: 6),
if (warranty == "2")
const Icon(Icons.info_outline, color: Colors.red, size: 12,)
const Icon(
Icons.info_outline,
color: Colors.red,
size: 12,
),
],
),
],
),
),
],
)
),
],
),
),
......@@ -727,14 +920,18 @@ class _HomeScreenState extends State<HomeScreen> {
borderRadius: BorderRadius.circular(12),
),
child: Image.network(
pImage.isNotEmpty ? pImage : "https://erp.gengroup.in/assets/upload/inventory_add_genesis_product_pic/_1761047459_6425.png",
pImage.isNotEmpty
? pImage
: "https://erp.gengroup.in/assets/upload/inventory_add_genesis_product_pic/_1761047459_6425.png",
height: 50,
width: 50,
fit: BoxFit.contain,
errorBuilder: (context, error, stack) =>
Image.asset('assets/images/dashboard_gen.png',
errorBuilder:
(context, error, stack) => Image.asset(
'assets/images/dashboard_gen.png',
height: 40,
width: 40),
width: 40,
),
),
),
],
......@@ -808,7 +1005,14 @@ class _HomeScreenState extends State<HomeScreen> {
InkResponse(
onTap: () {
Navigator.push(
context, MaterialPageRoute(builder: (context) => TransactionListScreen(accId: widget.accId, sessionId: widget.sessionId))
context,
MaterialPageRoute(
builder:
(context) => TransactionListScreen(
accId: widget.accId,
sessionId: widget.sessionId,
),
),
);
},
child: const Text(
......@@ -827,7 +1031,10 @@ class _HomeScreenState extends State<HomeScreen> {
width: double.infinity,
padding: EdgeInsets.all(22),
decoration: BoxDecoration(
gradient: dashboardData.balanceType == 'Pending Balance'? AppColors.balanceCardGradientP : AppColors.balanceCardGradientA,
gradient:
dashboardData.balanceType == 'Pending Balance'
? AppColors.balanceCardGradientP
: AppColors.balanceCardGradientA,
borderRadius: BorderRadius.circular(16),
),
child: Row(
......@@ -863,8 +1070,11 @@ class _HomeScreenState extends State<HomeScreen> {
const SizedBox(height: 4),
Row(
children: [
const Icon(Icons.info_outline,
color: Colors.white, size: 16),
const Icon(
Icons.info_outline,
color: Colors.white,
size: 16,
),
const SizedBox(width: 6),
Text(
dashboardData.balanceType ?? '',
......@@ -896,10 +1106,16 @@ class _HomeScreenState extends State<HomeScreen> {
const SizedBox(height: 10),
if (dashboardData.balanceType == 'Pending Balance')
InkResponse(
onTap: ()=> _openPaymentSheet(context, dashboardData?.balanceAmount!),
onTap:
() => _openPaymentSheet(
context,
dashboardData?.balanceAmount!,
),
child: Container(
padding:
const EdgeInsets.symmetric(horizontal: 23, vertical: 7),
padding: const EdgeInsets.symmetric(
horizontal: 23,
vertical: 7,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
......@@ -927,7 +1143,7 @@ class _HomeScreenState extends State<HomeScreen> {
}
// COMPLAINTS SECTION
Widget _buildComplaintsSection(dashboardData) {
Widget _buildComplaintsSection(DashboardResponse dashboardData) {
final complaints = dashboardData.complaints ?? [];
if (complaints.isEmpty) {
......@@ -962,7 +1178,14 @@ class _HomeScreenState extends State<HomeScreen> {
InkResponse(
onTap: () {
Navigator.push(
context, MaterialPageRoute(builder: (context) => ComplaintListScreen(accId: widget.accId, sessionId: widget.sessionId))
context,
MaterialPageRoute(
builder:
(context) => ComplaintListScreen(
accId: widget.accId,
sessionId: widget.sessionId,
),
),
);
},
child: const Text(
......@@ -978,7 +1201,21 @@ class _HomeScreenState extends State<HomeScreen> {
),
const SizedBox(height: 8),
...complaints.map<Widget>((c) {
return Container(
return InkResponse(
onTap: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => ComplaintDetailsScreen(
accId: widget.accId,
sessionId: widget.sessionId,
complaintId: c.id,
),
),
);
},
child: Container(
margin: const EdgeInsets.only(bottom: 10),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
......@@ -1028,9 +1265,12 @@ class _HomeScreenState extends State<HomeScreen> {
// Status badge
Container(
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 6),
horizontal: 16,
vertical: 6,
),
decoration: BoxDecoration(
color: (c.openStatus?.toLowerCase() == 'open')
color:
(c.openStatus?.toLowerCase() == 'open')
? AppColors.successBG
: AppColors.warningBg2,
borderRadius: BorderRadius.circular(10),
......@@ -1040,7 +1280,8 @@ class _HomeScreenState extends State<HomeScreen> {
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: (c.openStatus?.toLowerCase() == 'open')
color:
(c.openStatus?.toLowerCase() == 'open')
? AppColors.success
: AppColors.warningText,
),
......@@ -1050,6 +1291,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
const SizedBox(height: 12),
const Divider(),
/// 🔹 Product Info Row
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
......@@ -1091,6 +1333,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
],
),
),
);
}).toList(),
],
......@@ -1098,7 +1341,6 @@ class _HomeScreenState extends State<HomeScreen> {
);
}
void _openPaymentSheet(BuildContext context, String totalAmountStr) {
TextEditingController amountController = TextEditingController();
bool isPartPayment = false;
......@@ -1271,7 +1513,8 @@ class _HomeScreenState extends State<HomeScreen> {
width: double.infinity,
child: ElevatedButton(
onPressed: () {
double enteredAmount = isPartPayment
double enteredAmount =
isPartPayment
? double.tryParse(amountController.text) ?? 0
: totalAmount;
......@@ -1341,5 +1584,4 @@ class _HomeScreenState extends State<HomeScreen> {
},
);
}
}
......@@ -316,9 +316,111 @@ class _ProfileScreenState extends State<ProfileScreen> {
return Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: Text(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Error Icon
Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.1),
shape: BoxShape.circle,
),
child: const Icon(
Icons.error_outline_rounded,
size: 60,
color: Colors.red,
),
),
const SizedBox(height: 24),
// Error Title
const Text(
"Oops! Something went wrong",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.black87,
fontFamily: "Poppins",
),
),
const SizedBox(height: 12),
// Error Message
Text(
error,
style: const TextStyle(color: Colors.red, fontSize: 16),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
height: 1.4,
),
),
const SizedBox(height: 32),
// Retry Button
ElevatedButton.icon(
onPressed: () async {
// Show loading state
setState(() {});
await Future.delayed(const Duration(milliseconds: 300));
// Retry fetching data
final dashboardProvider =
await Future.delayed(const Duration(milliseconds: 600));
Provider.of<DashboardProvider>(context, listen: false);
profileProvider.fetchDashboard(widget.accId, widget.sessionId);
},
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.buttonColor,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25),
),
elevation: 2,
),
icon: const Icon(Icons.refresh_rounded, size: 20),
label: const Text(
"Try Again",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: "Poppins",
),
),
),
const SizedBox(height: 16),
// Alternative Action
TextButton(
onPressed: () {
// Go back or navigate to home
Navigator.maybePop(context);
},
child: const Text(
"Go Back",
style: TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
),
),
),
],
),
),
),
);
......
......@@ -372,8 +372,8 @@ class _SplashScreenState extends State<SplashScreen> with SingleTickerProviderSt
height: 170,
width: 170,
child: SvgPicture.asset(
"assets/svg/genesis_logo_2io.svg",
color: Color(0xFF4076FF),
"assets/svg/gen_logo.svg",
color: Color(0xFFFFFFFF),
),
),
),
......
......@@ -271,8 +271,8 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
padding: const EdgeInsets.symmetric(vertical: 2),
child: _buildProductItem(
product.partName.toString(),
product.qty.toString(),
product.price.toString(),
product.qty.toString(),
product.totalPrice.toString()
)
),
......
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../Notifiers/mapProvider.dart';
import '../../Utility/AppColors.dart';
class ContactMap extends StatefulWidget {
final accId;
final sessionId;
const ContactMap({super.key, this.accId, this.sessionId});
@override
State<ContactMap> createState() => _ContactMapState();
}
class _ContactMapState extends State<ContactMap> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<MapProvider>(
context,
listen: false,
);
provider.getLocationPermission(context,widget.accId,widget.sessionId);
provider.nearbyServiceLocations(context,widget.accId,widget.sessionId);
});
}
@override
Widget build(BuildContext context) {
return Consumer<MapProvider>(
builder: (context, provider, child) {
final isLoading = provider.isLoading;
final data = provider.response?.getInTouchList;
if (isLoading) {
return const Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: CircularProgressIndicator(color: AppColors.buttonColor),
),
);
}
if (data == null || data.isEmpty) {
return const Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: Text("No data found."),
),
);
}
return SafeArea(
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.backgroundRegular,
body: CustomScrollView(
slivers: [
SliverAppBar(
leading: Container(),
stretch: true,
backgroundColor: AppColors.backgroundRegular,
onStretchTrigger: () async {
final provider =
Provider.of<MapProvider>(context, listen: false);
provider.nearbyServiceLocations(context,widget.accId, widget.sessionId);
},
stretchTriggerOffset: 300.0,
expandedHeight:
MediaQuery.of(context).size.height*0.5,
flexibleSpace: FlexibleSpaceBar(
stretchModes: const [
StretchMode.zoomBackground,
StretchMode.blurBackground,
],
background: Container(
width: double.infinity,
decoration:
const BoxDecoration(gradient: AppColors.successGradient),
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height*0.5,
child: Stack(
children: [
GoogleMap(
myLocationEnabled: true,
zoomGesturesEnabled: true,
zoomControlsEnabled: true,
gestureRecognizers: {
Factory<OneSequenceGestureRecognizer>(
() => EagerGestureRecognizer(),
),
Factory<PanGestureRecognizer>(
() => PanGestureRecognizer(),
),
Factory<ScaleGestureRecognizer>(
() => ScaleGestureRecognizer(),
),
},
initialCameraPosition: CameraPosition(
target: provider.startLocation,
zoom: 14.0,
),
markers: provider.markers.toSet(),
mapType: MapType.normal,
onMapCreated: (controller) {
provider.mapController = controller;
},
onCameraMove: (position) {
provider.onCameraMove(context, position,widget.accId,widget.sessionId);
},
onTap: (position) {
provider.mapController
?.hideMarkerInfoWindow(
provider.markers.isNotEmpty
? provider.markers.first.markerId
: MarkerId(''),
);
},
),
Container(
height: 75,
decoration: BoxDecoration(
gradient: LinearGradient(colors: [
Color(0xFFFFFFFF),
Color(0xFFFFFFFF),
Color(0xFFFFFFFF).withAlpha(0),
],begin: Alignment.topCenter,end: Alignment.bottomCenter)
),
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 20,
),
child: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkResponse(
onTap: () {
HapticFeedback.selectionClick();
Navigator.pop(context, true);
},
child: SvgPicture.asset(
"assets/svg/appbar_back.svg",
height: 25,
color: AppColors.nearDarkText,
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: InkResponse(
onTap: () {
HapticFeedback.selectionClick();
Navigator.pop(context, true);
},
child: Text(
"Contact Us",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 16,
color: AppColors.nearDarkText,
height: 1.1,
),
),
),
),
],
),
),
),
],
),
),
],
),
),
),
),
SliverToBoxAdapter(
child: Container(
decoration:BoxDecoration(
color: AppColors.backgroundRegular,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 10,
offset: Offset(0, -5),
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 0),
decoration: const BoxDecoration(
color: AppColors.backgroundRegular,
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 20),
/// Build dynamic branch list
for (var item in data)
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: _buildItemRow(
branchName: item.branchName ?? "Unknown Branch",
address: item.address ?? "No address available",
phoneNo: item.telephoneNo ?? "",
lat: item.latitude ?? "",
long: item.longitude ?? "",
),
),
const SizedBox(height: 30),
],
),
),
),
),
),
)
],
)
),
);
},
);
}
Widget _buildItemRow({
required String branchName,
required String address,
required String phoneNo,
required String lat,
required String long,
}) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(22)),
child: Row(
children: [
const SizedBox(width: 14),
Expanded(
flex: 6,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
branchName,
style: const TextStyle(
color: AppColors.normalText,
fontWeight: FontWeight.w600,
fontSize: 14,
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(height: 4),
Text(
address,
maxLines: 4,
style: const TextStyle(
color: AppColors.subtitleText,
fontWeight: FontWeight.w400,
fontSize: 14,
overflow: TextOverflow.ellipsis,
),
),
],
),
),
const SizedBox(width: 8),
Row(
children: [
InkResponse(
onTap: () {
// map lat & long
},
child: Container(
padding: const EdgeInsets.all(1),
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(30)),
child: SvgPicture.asset(
"assets/svg/route_ic.svg",
height: 42,
fit: BoxFit.contain,
),
),
),
const SizedBox(width: 6),
InkResponse(
onTap: () async {
final phone = phoneNo.trim();
if (phone.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: Colors.redAccent,
content: const Text(
"Phone number not available",
style: TextStyle(color: Colors.white),
),
duration: Duration(seconds: 2),
behavior: SnackBarBehavior.floating,
),
);
return;
}
final Uri phoneUri = Uri(scheme: 'tel', path: phone);
try {
if (await canLaunchUrl(phoneUri)) {
await launchUrl(phoneUri);
} else {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: Colors.redAccent,
content: const Text(
"Unable to start the call",
style: TextStyle(color: Colors.white),
),
duration: Duration(seconds: 2),
behavior: SnackBarBehavior.floating,
),
);
}
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: Colors.redAccent,
content: Text(
"Error while trying to call: $e",
style: const TextStyle(color: Colors.white),
),
duration: const Duration(seconds: 2),
behavior: SnackBarBehavior.floating,
),
);
}
},
child: Container(
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
color: const Color(0xFF4CAF50),
borderRadius: BorderRadius.circular(30),
),
child: SvgPicture.asset(
"assets/svg/phone_ic.svg",
height: 16,
color: Colors.white,
fit: BoxFit.contain,
),
),
),
],
),
],
),
);
}
}
......@@ -58,12 +58,12 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
final isLoading = detailsProvider.isLoading;
final error = detailsProvider.errorMessage;
final data = detailsProvider.detailsResponse;
final genDetails = data!.genDetails??GenDetails();
final locDetails = data.locationDetails??LocationDetails();
final quotationsList = data.quotations??[];
final scheduleList = data.schedule ?? [];
final amcQuotationsList = data.amcQuotations??[];
final complaintList = data.complaints??[];
final genDetails = data?.genDetails??GenDetails();
final locDetails = data?.locationDetails??LocationDetails();
final quotationsList = data?.quotations??[];
final scheduleList = data?.schedule ?? [];
final amcQuotationsList = data?.amcQuotations??[];
final complaintList = data?.complaints??[];
List<String> sectionTitles = ["Generator Details", "Location Details"];
List<String> headings1 = [
......@@ -75,19 +75,19 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
"Dispatch Date",
];
List<String> subHeadings1 = [
genDetails!.purchaseDate ?? "-",
genDetails!.altNo ?? "-",
genDetails!.modelName ?? "-",
genDetails!.batterNo ?? "-",
genDetails!.commisDate ?? "-",
genDetails!.dispDate ?? "-",
genDetails?.purchaseDate ?? "-",
genDetails?.altNo ?? "-",
genDetails?.modelName ?? "-",
genDetails?.batterNo ?? "-",
genDetails?.commisDate ?? "-",
genDetails?.dispDate ?? "-",
];
List<String> headings2 = ["District", "State", "Address"];
List<String> subHeadings2 = [
locDetails!.districtName ?? "-",
locDetails!.stateName ?? "-",
locDetails!.address ?? "-",
locDetails?.districtName ?? "-",
locDetails?.stateName ?? "-",
locDetails?.address ?? "-",
];
List<List<String>> headings = [headings1, headings2];
List<List<String>> subHeadings = [subHeadings1, subHeadings2];
......@@ -105,9 +105,116 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
return Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: Text(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Error Icon
Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.1),
shape: BoxShape.circle,
),
child: const Icon(
Icons.error_outline_rounded,
size: 60,
color: Colors.red,
),
),
const SizedBox(height: 24),
// Error Title
const Text(
"Oops! Something went wrong",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.black87,
fontFamily: "Poppins",
),
),
const SizedBox(height: 12),
// Error Message
Text(
error,
style: const TextStyle(color: Colors.red, fontSize: 16),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
height: 1.4,
),
),
const SizedBox(height: 32),
// Retry Button
ElevatedButton.icon(
onPressed: () async {
// Show loading state
setState(() {});
await Future.delayed(const Duration(milliseconds: 300));
// Retry fetching data
final detailsProvider = Provider.of<Generatordetailsprovider>(
context,
listen: false,
);
detailsProvider.fetchGeneratorDetails(
widget.accId,
widget.sessionId,
widget.genId,
);
},
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.buttonColor,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25),
),
elevation: 2,
),
icon: const Icon(Icons.refresh_rounded, size: 20),
label: const Text(
"Try Again",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: "Poppins",
),
),
),
const SizedBox(height: 16),
// Alternative Action
TextButton(
onPressed: () {
// Go back or navigate to home
Navigator.pop(context);
},
child: const Text(
"Go Back",
style: TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
),
),
),
],
),
),
),
);
......
......@@ -59,14 +59,116 @@ class _QuotationListScreenState extends State<QuotationListScreen> {
return Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: Text(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Error Icon
Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.1),
shape: BoxShape.circle,
),
child: const Icon(
Icons.error_outline_rounded,
size: 60,
color: Colors.red,
),
),
const SizedBox(height: 24),
// Error Title
const Text(
"Oops! Something went wrong",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.black87,
fontFamily: "Poppins",
),
),
const SizedBox(height: 12),
// Error Message
Text(
error,
style: const TextStyle(color: Colors.red, fontSize: 16),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
height: 1.4,
),
),
const SizedBox(height: 32),
// Retry Button
ElevatedButton.icon(
onPressed: () async {
// Show loading state
setState(() {});
await Future.delayed(const Duration(milliseconds: 300));
// Retry fetching data
final provider = Provider.of<Generatordetailsprovider>(
context,
listen: false,
);
}
await provider.fetchQuotationList(widget.accId, widget.sessionId, widget.genId);
},
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.buttonColor,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25),
),
elevation: 2,
),
icon: const Icon(Icons.refresh_rounded, size: 20),
label: const Text(
"Try Again",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: "Poppins",
),
),
),
const SizedBox(height: 16),
// Alternative Action
TextButton(
onPressed: () {
// Go back or navigate to home
Navigator.maybePop(context);
},
child: const Text(
"Go Back",
style: TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
),
),
),
],
),
),
),
);
}
if (data == null) {
return const Scaffold(
backgroundColor: AppColors.backgroundRegular,
......
......@@ -59,9 +59,112 @@ class _ScheduleListScreenState extends State<ScheduleListScreen> {
return Scaffold(
backgroundColor: AppColors.backgroundRegular,
body: Center(
child: Text(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Error Icon
Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.1),
shape: BoxShape.circle,
),
child: const Icon(
Icons.error_outline_rounded,
size: 60,
color: Colors.red,
),
),
const SizedBox(height: 24),
// Error Title
const Text(
"Oops! Something went wrong",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.black87,
fontFamily: "Poppins",
),
),
const SizedBox(height: 12),
// Error Message
Text(
error,
style: const TextStyle(color: Colors.red, fontSize: 16),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
height: 1.4,
),
),
const SizedBox(height: 32),
// Retry Button
ElevatedButton.icon(
onPressed: () async {
// Show loading state
setState(() {});
await Future.delayed(const Duration(milliseconds: 300));
// Retry fetching data
final provider = Provider.of<Generatordetailsprovider>(
context,
listen: false,
);
await provider.fetchScheduleList(widget.accId, widget.sessionId,widget.genId);
},
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.buttonColor,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25),
),
elevation: 2,
),
icon: const Icon(Icons.refresh_rounded, size: 20),
label: const Text(
"Try Again",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: "Poppins",
),
),
),
const SizedBox(height: 16),
// Alternative Action
TextButton(
onPressed: () {
// Go back or navigate to home
Navigator.maybePop(context);
},
child: const Text(
"Go Back",
style: TextStyle(
fontSize: 14,
color: Colors.grey,
fontFamily: "Poppins",
),
),
),
],
),
),
),
);
......
......@@ -32,3 +32,8 @@ const addComplaintUrl = "${baseUrl}add_complaint";
const generatorListUrl = "${baseUrl}generator_list";
const complaintDropdownsUrl = "${baseUrl}complaint_dropdowns";
const getInTouchListUrl = "${baseUrl}get_in_touch_list";
const complaintDetailsUrl = "${baseUrl}complaint_details";
const allJobCardsListUrl = "${baseUrl}all_job_card_list";
const allServiceListUrl = "${baseUrl}all_service_list";
const jobCardProductsUrl = "${baseUrl}job_card_products";
const updateTechRatingUrl = "${baseUrl}update_tech_rating";
\ No newline at end of file
......@@ -3,6 +3,9 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:gen_service/Models/GetInTouchListResponse.dart';
import 'package:gen_service/Models/HelpAndComplaintModels/ComplaintListResponse.dart';
import 'package:gen_service/Models/HelpAndComplaintModels/allJobCardListResponse.dart';
import 'package:gen_service/Models/HelpAndComplaintModels/allServiceListResponse.dart';
import 'package:gen_service/Models/HelpAndComplaintModels/jobCardProductsResponse.dart';
import 'package:gen_service/Models/ProfileDataResponse.dart';
import 'package:gen_service/Models/TransactionModels/BillDetailResponse.dart';
import 'package:gen_service/Models/TransactionModels/PaymentDetailResponse.dart';
......@@ -10,11 +13,13 @@ import 'package:gen_service/Models/amcQuotationListResponse.dart';
import 'package:gen_service/Models/complaintListResponse.dart';
import 'package:gen_service/Models/generatorDetailsResponse.dart';
import 'package:gen_service/Models/quotationListResponse.dart';
import 'package:gen_service/Models/ratingResponse.dart';
import 'package:gen_service/Models/scheduleListResponse.dart';
import '../Models/AuthResponse.dart';
import '../Models/CommonResponse.dart';
import '../Models/DashboardResponse.dart';
import '../Models/HelpAndComplaintModels/GeneratorListResponse.dart';
import '../Models/HelpAndComplaintModels/complaintDetailsResponse.dart';
import '../Models/TransactionModels/PayAmountResponse.dart';
import '../Models/TransactionModels/TransactionListResponse.dart';
import '../Models/HelpAndComplaintModels/DropDownsListResponse.dart';
......@@ -152,14 +157,14 @@ class ApiCalling {
static Future<TransactionListResponse?> fetchTransactionListApi(
String accId,
String sessionId,
String pageNumber,
page_number
) async {
debugPrint("###############################Transaction Api calling ");
try {
Map<String, String> data = {
"acc_id": accId,
"session_id": sessionId,
"page_number": pageNumber,
"page_number":page_number
};
final res = await post(data, transactionsUrl, {});
......@@ -605,7 +610,6 @@ class ApiCalling {
String accId,
String sessionId,
) async {
debugPrint("############################### Api calling ");
try {
Map<String, String> data = {
"acc_id": accId,
......@@ -630,7 +634,6 @@ class ApiCalling {
String sessionId,
genID
) async {
debugPrint("############################### Api calling ");
try {
Map<String, String> data = {
"acc_id": accId,
......@@ -651,4 +654,140 @@ class ApiCalling {
}
}
static Future<complaintDetailsResponse?> complaintDetailsAPI(
String accId,
String sessionId,
complaintId
) async {
try {
Map<String, String> data = {
"acc_id": accId,
"session_id": sessionId,
"complaint_id": complaintId,
};
print(data);
final res = await post(data, complaintDetailsUrl, {});
if (res != null) {
print(res.body);
return complaintDetailsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ Complaint API Error: $e");
return null;
}
}
static Future<allJobCardListResponse?> jobCardsListAPI(
String accId,
String sessionId,
complaintId
) async {
try {
Map<String, String> data = {
"acc_id": accId,
"session_id": sessionId,
"complaint_id": complaintId,
};
print(data);
final res = await post(data, allJobCardsListUrl, {});
if (res != null) {
print(res.body);
return allJobCardListResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ Complaint API Error: $e");
return null;
}
}
static Future<allServiceListResponse?> serviceListAPI(
String accId,
String sessionId,
complaintId
) async {
try {
Map<String, String> data = {
"acc_id": accId,
"session_id": sessionId,
"complaint_id": complaintId,
};
print(data);
final res = await post(data, allServiceListUrl, {});
if (res != null) {
print(res.body);
return allServiceListResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ Complaint API Error: $e");
return null;
}
}
static Future<jobCardProductsResponse?> jobCardProductDetailsAPI(
String accId,
String sessionId,
jobCardId
) async {
try {
Map<String, String> data = {
"acc_id": accId,
"session_id": sessionId,
"job_card_id": jobCardId,
};
print(data);
final res = await post(data, jobCardProductsUrl, {});
if (res != null) {
print(res.body);
return jobCardProductsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ Complaint API Error: $e");
return null;
}
}
static Future<ratingResponse?> updateTechRatingAPI(
String accId,
String sessionId,
complaintId,
rating
) async {
try {
Map<String, String> data = {
"acc_id": accId,
"session_id": sessionId,
"complaint_id": complaintId,
"rating":rating.toString()
};
print(data);
final res = await post(data, updateTechRatingUrl, {});
if (res != null) {
print(res.body);
return ratingResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ Complaint API Error: $e");
return null;
}
}
}
import 'package:flutter/material.dart';
import 'package:gen_service/Notifiers/AuthProvider.dart';
import 'package:gen_service/Notifiers/TransactionsProvider.dart';
import 'package:gen_service/Notifiers/mapProvider.dart';
import 'package:gen_service/Notifiers/serviceAndJobCardListProvier.dart';
import 'package:provider/provider.dart';
import 'Notifiers/ContactUsProvider.dart';
......@@ -30,6 +32,9 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider(create: (_) => HelpAndComplaintProvider()),
ChangeNotifierProvider(create: (_) => Generatordetailsprovider()),
ChangeNotifierProvider(create: (_) => ContactUsProvider()),
ChangeNotifierProvider(create: (_) => ServiceAndJobCardListProvider()),
ChangeNotifierProvider(create: (_) => MapProvider()),
ChangeNotifierProvider(create: (_) => PayAmountProvider()),
],
child: Consumer<ThemeProvider>(
......
......@@ -7,6 +7,9 @@ import Foundation
import connectivity_plus
import device_info_plus
import geolocator_apple
import location
import package_info_plus
import path_provider_foundation
import shared_preferences_foundation
import url_launcher_macos
......@@ -14,6 +17,9 @@ import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
......
......@@ -81,6 +81,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.7"
csslib:
dependency: transitive
description:
name: csslib
sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
cupertino_icons:
dependency: "direct main"
description:
......@@ -153,6 +161,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.1"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.dev"
source: hosted
version: "1.1.1"
flutter:
dependency: "direct main"
description: flutter
......@@ -166,6 +182,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.0.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: c2fe1001710127dfa7da89977a08d591398370d099aacdaa6d44da7eb14b8476
url: "https://pub.dev"
source: hosted
version: "2.0.31"
flutter_svg:
dependency: "direct main"
description:
......@@ -192,6 +216,102 @@ packages:
url: "https://pub.dev"
source: hosted
version: "8.2.14"
geoclue:
dependency: transitive
description:
name: geoclue
sha256: c2a998c77474fc57aa00c6baa2928e58f4b267649057a1c76738656e9dbd2a7f
url: "https://pub.dev"
source: hosted
version: "0.1.1"
geocoding:
dependency: "direct main"
description:
name: geocoding
sha256: "606be036287842d779d7ec4e2f6c9435fc29bbbd3c6da6589710f981d8852895"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
geocoding_android:
dependency: transitive
description:
name: geocoding_android
sha256: ba810da90d6633cbb82bbab630e5b4a3b7d23503263c00ae7f1ef0316dcae5b9
url: "https://pub.dev"
source: hosted
version: "4.0.1"
geocoding_ios:
dependency: transitive
description:
name: geocoding_ios
sha256: "18ab1c8369e2b0dcb3a8ccc907319334f35ee8cf4cfef4d9c8e23b13c65cb825"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
geocoding_platform_interface:
dependency: transitive
description:
name: geocoding_platform_interface
sha256: "8c2c8226e5c276594c2e18bfe88b19110ed770aeb7c1ab50ede570be8b92229b"
url: "https://pub.dev"
source: hosted
version: "3.2.0"
geolocator:
dependency: "direct main"
description:
name: geolocator
sha256: "79939537046c9025be47ec645f35c8090ecadb6fe98eba146a0d25e8c1357516"
url: "https://pub.dev"
source: hosted
version: "14.0.2"
geolocator_android:
dependency: transitive
description:
name: geolocator_android
sha256: "179c3cb66dfa674fc9ccbf2be872a02658724d1c067634e2c427cf6df7df901a"
url: "https://pub.dev"
source: hosted
version: "5.0.2"
geolocator_apple:
dependency: transitive
description:
name: geolocator_apple
sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22
url: "https://pub.dev"
source: hosted
version: "2.3.13"
geolocator_linux:
dependency: transitive
description:
name: geolocator_linux
sha256: c4e966f0a7a87e70049eac7a2617f9e16fd4c585a26e4330bdfc3a71e6a721f3
url: "https://pub.dev"
source: hosted
version: "0.2.3"
geolocator_platform_interface:
dependency: transitive
description:
name: geolocator_platform_interface
sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67"
url: "https://pub.dev"
source: hosted
version: "4.2.6"
geolocator_web:
dependency: transitive
description:
name: geolocator_web
sha256: b1ae9bdfd90f861fde8fd4f209c37b953d65e92823cb73c7dee1fa021b06f172
url: "https://pub.dev"
source: hosted
version: "4.1.3"
geolocator_windows:
dependency: transitive
description:
name: geolocator_windows
sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6"
url: "https://pub.dev"
source: hosted
version: "0.2.5"
google_fonts:
dependency: "direct main"
description:
......@@ -200,6 +320,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.3.2"
google_maps:
dependency: transitive
description:
name: google_maps
sha256: "5d410c32112d7c6eb7858d359275b2aa04778eed3e36c745aeae905fb2fa6468"
url: "https://pub.dev"
source: hosted
version: "8.2.0"
google_maps_flutter:
dependency: "direct main"
description:
name: google_maps_flutter
sha256: "819985697596a42e1054b5feb2f407ba1ac92262e02844a40168e742b9f36dca"
url: "https://pub.dev"
source: hosted
version: "2.14.0"
google_maps_flutter_android:
dependency: transitive
description:
name: google_maps_flutter_android
sha256: "7c7ff5b883b27bfdd0d52d91d89faf00858a6c1b33aeca0dc80faca64f389983"
url: "https://pub.dev"
source: hosted
version: "2.18.3"
google_maps_flutter_ios:
dependency: transitive
description:
name: google_maps_flutter_ios
sha256: ca02463b19a9abc7d31fcaf22631d021d647107467f741b917a69fa26659fd75
url: "https://pub.dev"
source: hosted
version: "2.15.5"
google_maps_flutter_platform_interface:
dependency: transitive
description:
name: google_maps_flutter_platform_interface
sha256: f4b9b44f7b12a1f6707ffc79d082738e0b7e194bf728ee61d2b3cdf5fdf16081
url: "https://pub.dev"
source: hosted
version: "2.14.0"
google_maps_flutter_web:
dependency: transitive
description:
name: google_maps_flutter_web
sha256: d416602944e1859f3cbbaa53e34785c223fa0a11eddb34a913c964c5cbb5d8cf
url: "https://pub.dev"
source: hosted
version: "0.5.14+3"
gsettings:
dependency: transitive
description:
name: gsettings
sha256: "1b0ce661f5436d2db1e51f3c4295a49849f03d304003a7ba177d01e3a858249c"
url: "https://pub.dev"
source: hosted
version: "0.2.8"
html:
dependency: transitive
description:
name: html
sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602"
url: "https://pub.dev"
source: hosted
version: "0.15.6"
http:
dependency: "direct main"
description:
......@@ -248,6 +432,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.1.1"
location:
dependency: "direct main"
description:
name: location
sha256: b080053c181c7d152c43dd576eec6436c40e25f326933051c330da563ddd5333
url: "https://pub.dev"
source: hosted
version: "8.0.1"
location_platform_interface:
dependency: transitive
description:
name: location_platform_interface
sha256: ca8700bb3f6b1e8b2afbd86bd78b2280d116c613ca7bfa1d4d7b64eba357d749
url: "https://pub.dev"
source: hosted
version: "6.0.1"
location_web:
dependency: transitive
description:
name: location_web
sha256: b8e3add5efe0d65c5e692b7a135d80a4015c580d3ea646fa71973e97668dd868
url: "https://pub.dev"
source: hosted
version: "6.0.1"
matcher:
dependency: transitive
description:
......@@ -296,6 +504,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.7.0"
package_info_plus:
dependency: transitive
description:
name: package_info_plus
sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968"
url: "https://pub.dev"
source: hosted
version: "8.3.1"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086"
url: "https://pub.dev"
source: hosted
version: "3.2.1"
path:
dependency: transitive
description:
......@@ -360,6 +584,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.0"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
sha256: bc917da36261b00137bbc8896bf1482169cd76f866282368948f032c8c1caae1
url: "https://pub.dev"
source: hosted
version: "12.0.1"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: "1e3bc410ca1bf84662104b100eb126e066cb55791b7451307f9708d4007350e6"
url: "https://pub.dev"
source: hosted
version: "13.0.1"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023
url: "https://pub.dev"
source: hosted
version: "9.4.7"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24"
url: "https://pub.dev"
source: hosted
version: "0.1.3+5"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
url: "https://pub.dev"
source: hosted
version: "4.3.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
url: "https://pub.dev"
source: hosted
version: "0.2.1"
petitparser:
dependency: transitive
description:
......@@ -416,6 +688,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.4.0"
sanitize_html:
dependency: transitive
description:
name: sanitize_html
sha256: "12669c4a913688a26555323fb9cec373d8f9fbe091f2d01c40c723b33caa8989"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
shared_preferences:
dependency: "direct main"
description:
......@@ -501,6 +781,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
stream_transform:
dependency: transitive
description:
name: stream_transform
sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
url: "https://pub.dev"
source: hosted
version: "2.1.1"
string_scanner:
dependency: transitive
description:
......@@ -597,6 +885,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.4"
uuid:
dependency: transitive
description:
name: uuid
sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8
url: "https://pub.dev"
source: hosted
version: "4.5.2"
vector_graphics:
dependency: transitive
description:
......
......@@ -48,6 +48,11 @@ dependencies:
url_launcher: ^6.3.2
path_provider: ^2.1.5
open_filex: ^4.7.0
google_maps_flutter: ^2.14.0
geolocator: ^14.0.2
location: ^8.0.1
permission_handler: ^12.0.1
geocoding: ^4.0.0
razorpay_flutter: ^1.4.0
dev_dependencies:
......
......@@ -7,11 +7,17 @@
#include "generated_plugin_registrant.h"
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <geolocator_windows/geolocator_windows.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
......@@ -4,6 +4,8 @@
list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
geolocator_windows
permission_handler_windows
url_launcher_windows
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment