Commit 402026c6 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

05-08-2025 By Sai Srinivas

Service Inventory and Gen Tracker Modules.
parent b2b7af29
......@@ -32,11 +32,9 @@ class Generatordetails extends StatefulWidget {
}
class _GeneratordetailsState extends State<Generatordetails> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override
void initState() {
// TODO: implement initState
......@@ -96,21 +94,21 @@ class _GeneratordetailsState extends State<Generatordetails> {
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () async {
Provider.of<Generatordetailsprovider>(
context,
listen: false,
).resetForm();
return onBackPressed(context);
},
child: SafeArea(
top: false,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
? WillPopScope(
onWillPop: () async {
Provider.of<Generatordetailsprovider>(
context,
listen: false,
).resetForm();
return onBackPressed(context);
},
child: SafeArea(
top: false,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
......@@ -126,11 +124,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
default:
connection = 'Offline';
}
return
Consumer2<Generatordetailsprovider, HomescreenNotifier>(
return Consumer2<Generatordetailsprovider, HomescreenNotifier>(
builder: (context, provider, Homeprovider, child) {
print("cojomdspofjfm: ${provider.complaintsList.length}");
var sendwidget = SizedBox(width: 0);
return WillPopScope(
......@@ -139,7 +134,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2New(
......@@ -147,7 +142,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
"Generator Details",
provider.resetForm,
sendwidget,
0xFFFFFFFF
0xFFFFFFFF,
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
......@@ -156,7 +151,10 @@ class _GeneratordetailsState extends State<Generatordetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Card(
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 2),
margin: EdgeInsets.symmetric(
horizontal: 0,
vertical: 2,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
......@@ -167,10 +165,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 5,
......@@ -193,7 +188,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
Text(
"${provider.aname}",
......@@ -219,16 +214,12 @@ class _GeneratordetailsState extends State<Generatordetails> {
],
),
),
],
),
),
Visibility(
visible:
provider.showMoreDetails
? true
: false,
visible: provider.showMoreDetails ? true : false,
child: Container(
padding: EdgeInsets.symmetric(
vertical: 10,
......@@ -245,7 +236,9 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 4),
padding: EdgeInsets.symmetric(
vertical: 4,
),
child: Row(
children: [
Expanded(
......@@ -273,7 +266,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: List.generate(4, (j) {
final textheads = [
"Mobile Number",
......@@ -300,16 +294,19 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: Text(
textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontFamily:
"JakartaRegular",
fontSize: 14,
),
),
),
),
SizedBox(width: 5),
if (textSubheads[j] == "View") ...[
if (textSubheads[j] ==
"View") ...[
Expanded(
flex: 2,
child: Container(
......@@ -318,7 +315,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
child: InkWell(
onTap: () async {
if (widget.genLocation !=
if (widget
.genLocation !=
null) {
provider.genLocationLatLngs =
widget.genLocation
......@@ -326,7 +324,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
.toString();
} else {
provider.genLocationLatLngs =
provider.genLocation
provider
.genLocation
?.split(",")
.toString();
}
......@@ -342,7 +341,9 @@ class _GeneratordetailsState extends State<Generatordetails> {
if (await canLaunch(
uri.toString(),
)) {
await launch(uri.toString());
await launch(
uri.toString(),
);
} else {
throw 'Could not launch ${uri.toString()}';
}
......@@ -350,15 +351,22 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: Text(
textSubheads[j],
maxLines: 2,
textAlign:TextAlign.right,
overflow: TextOverflow.ellipsis,
textAlign:
TextAlign.right,
overflow:
TextOverflow
.ellipsis,
style: TextStyle(
fontSize: 14,
color: AppColors.app_blue,
color:
AppColors
.app_blue,
decoration:
TextDecoration.underline,
TextDecoration
.underline,
decorationColor:
AppColors.app_blue,
AppColors
.app_blue,
),
),
),
......@@ -369,54 +377,67 @@ class _GeneratordetailsState extends State<Generatordetails> {
flex: 2,
child: InkResponse(
onTap:
textheads[j] != "Mobile Number"
? null
: () async {
final Uri phoneUri = Uri(
scheme: 'tel',
path:
provider.mob1 == ""
? provider.mob2
: provider.mob1,
);
if (await canLaunchUrl(
phoneUri,
)) {
await launchUrl(
phoneUri,
);
} else {
throw 'Could not launch $phoneUri';
}
},
textheads[j] !=
"Mobile Number"
? null
: () async {
final Uri
phoneUri = Uri(
scheme: 'tel',
path:
provider.mob1 ==
""
? provider
.mob2
: provider
.mob1,
);
if (await canLaunchUrl(
phoneUri,
)) {
await launchUrl(
phoneUri,
);
} else {
throw 'Could not launch $phoneUri';
}
},
child: SizedBox(
child: Text(
textSubheads[j] == ""
? "-"
: textSubheads[j],
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign:TextAlign.right,
overflow:
TextOverflow
.ellipsis,
textAlign:
TextAlign.right,
style: TextStyle(
fontSize: 14,
fontFamily:"JakartaRegular",
fontFamily:
"JakartaRegular",
color:
textheads[j] ==
"Mobile Number"
? AppColors.app_blue
: Color(0xFF818181),
textheads[j] ==
"Mobile Number"
? AppColors
.app_blue
: Color(
0xFF818181,
),
decorationColor:
textheads[j] ==
"Mobile Number"
? AppColors.app_blue
: null,
textheads[j] ==
"Mobile Number"
? AppColors
.app_blue
: null,
decoration:
textheads[j] ==
"Mobile Number"
? TextDecoration
.underline
: null,
textheads[j] ==
"Mobile Number"
? TextDecoration
.underline
: null,
),
),
),
......@@ -430,7 +451,9 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
Container(
padding: EdgeInsets.symmetric(vertical: 4),
padding: EdgeInsets.symmetric(
vertical: 4,
),
child: Row(
children: [
Expanded(
......@@ -457,7 +480,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: List.generate(6, (j) {
final textheads = [
"Product Name",
......@@ -481,7 +505,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
horizontal: 0,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
......@@ -489,7 +514,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
textheads[j].toString(),
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaRegular",
fontFamily:
"JakartaRegular",
),
),
),
......@@ -502,12 +528,15 @@ class _GeneratordetailsState extends State<Generatordetails> {
? "-"
: textSubheads[j],
maxLines: 2,
textAlign:TextAlign.right,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.right,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily: "JakartaRegular"
color:
AppColors.grey_semi,
fontFamily:
"JakartaRegular",
),
),
),
......@@ -517,8 +546,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
}),
),
],
),
),
......@@ -526,17 +553,13 @@ class _GeneratordetailsState extends State<Generatordetails> {
InkResponse(
onTap: () async {
provider.showMoreDetails =
!provider.showMoreDetails;
!provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails
......@@ -550,9 +573,9 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
Transform.flip(
flipY:
provider.showMoreDetails
? true
: false,
provider.showMoreDetails
? true
: false,
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
......@@ -564,9 +587,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
),
),
],
),
),
......@@ -593,7 +613,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
......@@ -616,9 +635,9 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
......@@ -633,9 +652,9 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
children: [
Row(
children: [
......@@ -643,50 +662,67 @@ class _GeneratordetailsState extends State<Generatordetails> {
flex: 4,
child: Text(
provider
.contactsList[l]
.name==""?"-": provider
.contactsList[l]
.name ??
"-",
.contactsList[l]
.name ==
""
? "-"
: provider
.contactsList[l]
.name ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
"JakartaMedium",
fontSize: 14,
color:
AppColors
.semi_black,
AppColors
.semi_black,
),
),
),
Expanded(
flex: 2,
child: InkResponse(
onTap:provider.contactsList[l].mob2==""?null: () {
launch(
'tel://${provider.contactsList[l].mob2}',
);
},
onTap:
provider
.contactsList[l]
.mob2 ==
""
? null
: () {
launch(
'tel://${provider.contactsList[l].mob2}',
);
},
child: Text(
textAlign:
TextAlign.right,
provider.contactsList[l].mob2==""?"-": provider.contactsList[l].mob2 ?? "-",
TextAlign.right,
provider
.contactsList[l]
.mob2 ==
""
? "-"
: provider
.contactsList[l]
.mob2 ??
"-",
style: TextStyle(
height: 1,
decorationColor:
AppColors
.grey_thick,
AppColors
.grey_thick,
decoration:
TextDecoration
.underline,
TextDecoration
.underline,
decorationStyle:
TextDecorationStyle
.dotted,
TextDecorationStyle
.dotted,
fontFamily:
"JakartaMedium",
"JakartaMedium",
fontSize: 14,
color:
AppColors
.semi_black,
AppColors
.semi_black,
),
),
),
......@@ -694,13 +730,14 @@ class _GeneratordetailsState extends State<Generatordetails> {
],
),
Text(
provider.contactsList[l].mail ?? "-",
provider
.contactsList[l]
.mail ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontFamily: "JakartaMedium",
fontSize: 14,
color:
AppColors.grey_semi,
color: AppColors.grey_semi,
),
),
],
......@@ -735,7 +772,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
width: double.infinity,
height: 300,
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
shrinkWrap: true,
scrollDirection: Axis.horizontal,
......@@ -747,9 +783,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
itemBuilder: (context, lp) {
return Container(
height: 300,
width:
MediaQuery.of(context).size.width *
0.92,
width: MediaQuery.of(context).size.width * 0.92,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
......@@ -758,17 +792,15 @@ class _GeneratordetailsState extends State<Generatordetails> {
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 5,
),
margin: EdgeInsets.symmetric(horizontal: 5),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
......@@ -783,10 +815,9 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment
.start,
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
children: [
Row(
children: [
......@@ -794,37 +825,35 @@ class _GeneratordetailsState extends State<Generatordetails> {
flex: 4,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
CrossAxisAlignment
.start,
children: [
Text(
provider
.scheduleList[lp]
.complaintCategory ??
.scheduleList[lp]
.complaintCategory ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize:
14,
"JakartaMedium",
fontSize: 14,
color:
AppColors
.semi_black,
AppColors
.semi_black,
),
),
Text(
provider
.scheduleList[lp]
.dueDate ??
.scheduleList[lp]
.dueDate ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize:
14,
"JakartaMedium",
fontSize: 14,
color:
AppColors
.grey_semi,
AppColors
.grey_semi,
),
),
],
......@@ -833,31 +862,28 @@ class _GeneratordetailsState extends State<Generatordetails> {
Expanded(
flex: 3,
child: Container(
decoration:
BoxDecoration(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
8,
),
BorderRadius.circular(
8,
),
color: Color(
0xFFF3FFD5,
),
),
padding:
EdgeInsets.symmetric(
horizontal:
5,
vertical:
10,
),
EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
child: Text(
"${provider.scheduleList[lp].status ?? "-"}",
textAlign: TextAlign.center,
textAlign:
TextAlign.center,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize:
14,
"JakartaMedium",
fontSize: 14,
color: Color(
0xFF586000,
),
......@@ -885,8 +911,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
"Complaint Details",
style: TextStyle(
fontSize: 14,
fontFamily:
"JakartaSemiBold",
fontFamily: "JakartaSemiBold",
),
),
),
......@@ -895,8 +920,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor:
AppColors.grey_semi,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
......@@ -908,20 +932,18 @@ class _GeneratordetailsState extends State<Generatordetails> {
final heads = [
"Complaint Type",
"Complaint ID",
"Service Schedule ID"
"Service Schedule ID",
];
final subHeads = [
provider
.scheduleList[lp]
.complaintType ??
.scheduleList[lp]
.complaintType ??
"-",
provider
.scheduleList[lp]
.complaintId ??
provider.scheduleList[lp].complaintId ??
"-",
provider
.scheduleList[lp]
.serviceScheduleId ??
.scheduleList[lp]
.serviceScheduleId ??
"-",
];
return Container(
......@@ -930,26 +952,22 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
textAlign: TextAlign.left,
heads[j],
style: TextStyle(
fontFamily:
"JakartaRegular",
fontFamily: "JakartaRegular",
fontSize: 14,
color:
AppColors
.semi_black,
color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
textAlign:
TextAlign.right,
textAlign: TextAlign.right,
maxLines: 1,
overflow: TextOverflow.ellipsis,
subHeads[j] == ""
......@@ -977,8 +995,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
"Remarks",
style: TextStyle(
fontSize: 14,
fontFamily:
"JakartaSemiBold",
fontFamily: "JakartaSemiBold",
),
),
),
......@@ -987,8 +1004,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor:
AppColors.grey_semi,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
......@@ -1002,9 +1018,13 @@ class _GeneratordetailsState extends State<Generatordetails> {
"Feedback Status",
];
final subHeads = [
provider.scheduleList[lp].complaintDescription ??
provider
.scheduleList[lp]
.complaintDescription ??
"-",
provider.scheduleList[lp].feedbackStatus ??
provider
.scheduleList[lp]
.feedbackStatus ??
"-",
];
return Container(
......@@ -1013,26 +1033,22 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
textAlign: TextAlign.left,
heads[j],
style: TextStyle(
fontFamily:
"JakartaRegular",
fontFamily: "JakartaRegular",
fontSize: 14,
color:
AppColors
.semi_black,
color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
textAlign:
TextAlign.right,
textAlign: TextAlign.right,
subHeads[j] == ""
? "-"
: subHeads[j],
......@@ -1055,263 +1071,242 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
],
if (provider.complaintsList.isNotEmpty) ...[
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Text(
"Complaint History",
style: TextStyle(
color: Color(0xFF818181),
fontFamily: "JakartaMedium",
),
),
),
SizedBox(
width: double.infinity,
height: 220,
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
shrinkWrap: true,
scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
itemCount: provider.complaintsList.length,
itemBuilder: (context, lp) {
return Container(
height: 220,
width:
MediaQuery.of(context).size.width *
0.92,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 5,
),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/crm/quotation_details_ic.svg",
if (provider.complaintsList.isNotEmpty) ...[
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Text(
"Complaint History",
style: TextStyle(
color: Color(0xFF818181),
fontFamily: "JakartaMedium",
),
),
SizedBox(width: 10),
Expanded(
flex: 6,
child: SizedBox(
child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment
.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Text(
provider
.complaintsList[lp]
.technicianName ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize:
14,
color:
AppColors
.semi_black,
),
),
Text(
provider
.complaintsList[lp]
.complaintTypeName ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize:
14,
color:
AppColors
.grey_semi,
),
),
SizedBox(
width: double.infinity,
height: 220,
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
shrinkWrap: true,
scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
itemCount: provider.complaintsList.length,
itemBuilder: (context, lp) {
return Container(
height: 220,
width: MediaQuery.of(context).size.width * 0.92,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(horizontal: 5),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/crm/quotation_details_ic.svg",
),
),
SizedBox(width: 10),
Expanded(
flex: 6,
child: SizedBox(
child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Text(
provider
.complaintsList[lp]
.technicianName ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors
.semi_black,
),
),
Text(
provider
.complaintsList[lp]
.complaintTypeName ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors
.grey_semi,
),
),
],
),
),
Expanded(
flex: 3,
child: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
8,
),
color: Color(
0xFFF3FFD5,
),
),
padding:
EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
child: Text(
"${provider.complaintsList[lp].openStatus ?? "-"}",
textAlign:
TextAlign.center,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: Color(
0xFF586000,
),
),
),
),
),
],
),
],
),
],
),
),
],
),
Container(
padding: EdgeInsets.symmetric(
vertical: 7.5,
),
Expanded(
flex: 3,
child: Container(
decoration:
BoxDecoration(
borderRadius:
BorderRadius.circular(
8,
),
color: Color(
0xFFF3FFD5,
child: Row(
children: [
Expanded(
flex: 4,
child: Text(
"Complaint Details",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
),
padding:
EdgeInsets.symmetric(
horizontal:
5,
vertical:
10,
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
child: Text(
"${provider.complaintsList[lp].openStatus ?? "-"}",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize:
14,
color: Color(
0xFF586000,
],
),
),
...List.generate(3, (j) {
final heads = [
"Complaint Category",
"Created By",
"Registered Date",
];
final subHeads = [
provider
.complaintsList[lp]
.complaintCategoryName ??
"-",
provider.complaintsList[lp].createdBy ??
"-",
provider
.complaintsList[lp]
.createdDate ??
"-",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 3,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
textAlign: TextAlign.left,
heads[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
),
Expanded(
child: Text(
textAlign: TextAlign.right,
maxLines: 1,
overflow: TextOverflow.ellipsis,
subHeads[j] == ""
? "-"
: subHeads[j],
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
),
),
),
],
),
),
],
),
],
),
),
),
],
),
Container(
padding: EdgeInsets.symmetric(
vertical: 7.5,
),
child: Row(
children: [
Expanded(
flex: 4,
child: Text(
"Complaint Details",
style: TextStyle(
fontSize: 14,
fontFamily:
"JakartaSemiBold",
),
),
),
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor:
AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
...List.generate(3, (j) {
final heads = [
"Complaint Category",
"Created By",
"Registered Date",
];
final subHeads = [
provider
.complaintsList[lp]
.complaintCategoryName ??
"-",
provider
.complaintsList[lp]
.createdBy ??
"-",
provider
.complaintsList[lp]
.createdDate ??
"-",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 3,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
textAlign: TextAlign.left,
heads[j],
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors
.semi_black,
),
),
),
Expanded(
child: Text(
textAlign:
TextAlign.right,
maxLines: 1,
overflow: TextOverflow.ellipsis,
subHeads[j] == ""
? "-"
: subHeads[j],
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
),
);
}),
],
),
),
],
);
},
),
);
}),
],
),
);
},
),
),
],
),
],
InkWell(
onTap: () {
......@@ -1326,7 +1321,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
......@@ -1352,8 +1346,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
height: 40,
width: 40,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFE6F6FF)
shape: BoxShape.circle,
color: Color(0xFFE6F6FF),
),
child: SvgPicture.asset(
"assets/svg/gent_tag_loc.svg",
......@@ -1362,7 +1356,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
SizedBox(width: 10),
Expanded(
flex:4,
flex: 4,
child: Text(
"Tag Location",
style: TextStyle(
......@@ -1373,7 +1367,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
),
SizedBox(width: 10),
],
),
),
......@@ -1387,7 +1380,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
......@@ -1413,8 +1405,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
height: 40,
width: 40,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFE6F6FF)
shape: BoxShape.circle,
color: Color(0xFFE6F6FF),
),
child: SvgPicture.asset(
"assets/svg/gent_tag_den.svg",
......@@ -1423,7 +1415,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
SizedBox(width: 10),
Expanded(
flex:4,
flex: 4,
child: Text(
"Tag Generator",
style: TextStyle(
......@@ -1434,7 +1426,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
),
SizedBox(width: 10),
],
),
),
......@@ -1459,7 +1450,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
// );
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
......@@ -1479,14 +1469,13 @@ class _GeneratordetailsState extends State<Generatordetails> {
// borderRadius: BorderRadius.circular(15.0),
// ),
child: Row(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFE6F6FF)
color: Color(0xFFE6F6FF),
),
child: SvgPicture.asset(
"assets/svg/gent_reg_comp.svg",
......@@ -1495,7 +1484,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
SizedBox(width: 10),
Expanded(
flex:4,
flex: 4,
child: Text(
"Register Complaint",
style: TextStyle(
......@@ -1507,7 +1496,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
SizedBox(width: 10),
],
),
),
......@@ -1562,7 +1550,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
}
Widget _scaffold1(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
......@@ -1575,15 +1562,14 @@ class _GeneratordetailsState extends State<Generatordetails> {
default:
connection = 'Offline';
}
return
Consumer2<Generatordetailsprovider, HomescreenNotifier>(
return Consumer2<Generatordetailsprovider, HomescreenNotifier>(
builder: (context, provider, Homeprovider, child) {
var sendwidget = SizedBox(width: 0);
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
......@@ -1933,7 +1919,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
......@@ -1965,14 +1950,15 @@ class _GeneratordetailsState extends State<Generatordetails> {
vertical: 6,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: SizedBox(
child: Text(
"${headings[jndex]}",
style: TextStyle(
fontSize: 14
fontSize: 14,
),
),
),
......@@ -1980,13 +1966,12 @@ class _GeneratordetailsState extends State<Generatordetails> {
Expanded(
child: SizedBox(
child: Text(
values[jndex]==""?"-": "${values[jndex]}",
values[jndex] == ""
? "-"
: "${values[jndex]}",
style: TextStyle(
fontSize:14,
color: Color(
0xFF818181,
),
fontSize: 14,
color: Color(0xFF818181),
),
),
),
......@@ -2021,19 +2006,20 @@ class _GeneratordetailsState extends State<Generatordetails> {
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: provider.showMoreScheduleList?provider.scheduleList.length:1,
itemCount:
provider.showMoreScheduleList
? provider.scheduleList.length
: 1,
itemBuilder: (context, l) {
final headings1 = [
"Employee Name",
"Schedule Manager Name",
"Due Date",
];
final values1 = [
provider.scheduleList[l].name,
provider.scheduleList[l].scheduleManagerName,
provider.scheduleList[l].dueDate,
];
final headings2 = [
......@@ -2059,23 +2045,16 @@ class _GeneratordetailsState extends State<Generatordetails> {
provider.scheduleList[l].status,
provider.scheduleList[l].feedbackStatus,
];
var headings = [
...headings1
];
var values = [
...values1
];
if(provider.showMoreScheduleDetails){
headings = [...headings1,...headings2];
values = [...values1,...values2];
var headings = [...headings1];
var values = [...values1];
if (provider.showMoreScheduleDetails) {
headings = [...headings1, ...headings2];
values = [...values1, ...values2];
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
......@@ -2087,22 +2066,24 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
child: Column(
children: [
...List.generate(headings.length, (jndex) {
...List.generate(headings.length, (
jndex,
) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 6,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: SizedBox(
child: Text(
"${headings[jndex]}",
style: TextStyle(
fontSize: 14
fontSize: 14,
),
),
),
......@@ -2110,13 +2091,12 @@ class _GeneratordetailsState extends State<Generatordetails> {
Expanded(
child: SizedBox(
child: Text(
values[jndex]==""?"-": "${values[jndex]}",
values[jndex] == ""
? "-"
: "${values[jndex]}",
style: TextStyle(
fontSize:14,
color: Color(
0xFF818181,
),
fontSize: 14,
color: Color(0xFF818181),
),
),
),
......@@ -2127,7 +2107,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
}),
InkResponse(
onTap: () async {
provider.showMoreScheduleDetails = !provider.showMoreScheduleDetails;
provider.showMoreScheduleDetails =
!provider.showMoreScheduleDetails;
},
child: Container(
padding: EdgeInsets.symmetric(
......@@ -2135,19 +2116,20 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
MainAxisAlignment.center,
children: [
Text(
provider.showMoreScheduleDetails?"- Show Less": "+ More Details",
provider.showMoreScheduleDetails
? "- Show Less"
: "+ More Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
......@@ -2159,43 +2141,44 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
},
),
if(provider.scheduleList.length>1)...[
InkResponse(
onTap: () async {
provider.showMoreScheduleList = !provider.showMoreScheduleList;
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
provider.showMoreScheduleList?" Show Less": " Show More",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
if (provider.scheduleList.length > 1) ...[
InkResponse(
onTap: () async {
provider.showMoreScheduleList =
!provider.showMoreScheduleList;
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
provider.showMoreScheduleList
? " Show Less"
: " Show More",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
Transform.rotate(
angle: provider.showMoreScheduleList?180 * 3.14159 / 180:0 * 3.14159 / 180,
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
color: AppColors.app_blue,
width: 25,
Transform.rotate(
angle:
provider.showMoreScheduleList
? 180 * 3.14159 / 180
: 0 * 3.14159 / 180,
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
color: AppColors.app_blue,
width: 25,
),
),
),
],
],
),
),
),
),
]
],
],
InkWell(
onTap: () {
......@@ -2210,7 +2193,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
......@@ -2238,7 +2220,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
SizedBox(width: 10),
Expanded(
flex:4,
flex: 4,
child: Text(
"Tag Location",
style: TextStyle(
......@@ -2267,7 +2249,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
......@@ -2295,7 +2276,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
SizedBox(width: 10),
Expanded(
flex:4,
flex: 4,
child: Text(
"Tag Generator",
style: TextStyle(
......@@ -2335,7 +2316,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
// );
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
......@@ -2355,7 +2335,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
// borderRadius: BorderRadius.circular(15.0),
// ),
child: Row(
children: [
SvgPicture.asset(
"assets/svg/gent_reg_comp.svg",
......@@ -2363,7 +2342,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
SizedBox(width: 10),
Expanded(
flex:4,
flex: 4,
child: Text(
"Register Complaint",
style: TextStyle(
......@@ -2450,9 +2429,11 @@ class _TagLocationScreenState extends State<TagLocationScreen> {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Generatordetailsprovider>(context,listen: false);
final provider = Provider.of<Generatordetailsprovider>(
context,
listen: false,
);
provider.showMoreDetails = false;
});
}
......@@ -2474,7 +2455,7 @@ class _TagLocationScreenState extends State<TagLocationScreen> {
backgroundColor: AppColors.white,
body: SafeArea(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
......@@ -2484,7 +2465,7 @@ class _TagLocationScreenState extends State<TagLocationScreen> {
"Gen ID",
(p0) {},
),
SizedBox(height: 10,),
SizedBox(height: 10),
InkResponse(
onTap: () {
_showAttachmentSheet(context);
......@@ -2528,7 +2509,7 @@ class _TagLocationScreenState extends State<TagLocationScreen> {
),
),
),
SizedBox(width: 10,),
SizedBox(width: 10),
Expanded(
flex: 1,
child: InkResponse(
......@@ -2548,7 +2529,7 @@ class _TagLocationScreenState extends State<TagLocationScreen> {
),
),
],
errorWidget(context, provider.imageError)
errorWidget(context, provider.imageError),
],
),
),
......@@ -2565,7 +2546,7 @@ class _TagLocationScreenState extends State<TagLocationScreen> {
alignment: Alignment.bottomCenter,
height: 45,
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15.0),
......
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