Commit b2b7af29 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

05-08-2025 By Sai Srinivas

Service Inventory and Gen Tracker Modules.
parent 2c3ccbb5
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.1086 2.14788C16.7829 2.45791 17.4493 2.78539 18.0922 3.12492C19.3438 3.7811 20.0909 5.11152 20.1228 6.43291C20.203 9.0777 20.203 11.7221 20.1228 14.3661C20.0909 15.6905 19.3432 17.0149 18.0922 17.6741C16.0328 18.7649 13.7723 19.6968 11.7026 20.4108C10.8659 20.6979 9.95733 20.6979 9.12062 20.4108C7.05095 19.6968 4.78984 18.7643 2.73039 17.6741C1.47944 17.0173 0.732356 15.6875 0.699848 14.3661C0.619582 11.7213 0.619582 9.0769 0.699848 6.43291C0.732356 5.10851 1.47944 3.78411 2.73039 3.12492C4.78984 2.0341 7.05095 1.1022 9.12062 0.38823C9.95733 0.101059 10.8659 0.101059 11.7026 0.38823C12.3227 0.603746 12.9566 0.834914 13.5971 1.08474L16.1086 2.14788Z" fill="url(#paint0_linear_539_4114)"/>
<path d="M16.1086 2.14788C16.7829 2.45791 17.4493 2.78539 18.0922 3.12492C19.3438 3.7811 20.0909 5.11152 20.1228 6.43291C20.203 9.0777 20.203 11.7221 20.1228 14.3661C20.0909 15.6905 19.3432 17.0149 18.0922 17.6741C16.0328 18.7649 13.7723 19.6968 11.7026 20.4108C10.8659 20.6979 9.95733 20.6979 9.12062 20.4108C7.05095 19.6968 4.78984 18.7643 2.73039 17.6741C1.47944 17.0173 0.732356 15.6875 0.699848 14.3661C0.619582 11.7213 0.619582 9.0769 0.699848 6.43291C0.732356 5.10851 1.47944 3.78411 2.73039 3.12492C4.78984 2.0341 7.05095 1.1022 9.12062 0.38823C9.95733 0.101059 10.8659 0.101059 11.7026 0.38823C12.3227 0.603746 12.9566 0.834914 13.5971 1.08474L16.1086 2.14788Z" fill="url(#paint1_linear_539_4114)"/>
<path d="M16.1084 2.14772C13.0742 3.12277 10.0943 4.25916 7.18135 5.55203C6.87898 5.68566 6.61992 5.90107 6.43337 6.17399C6.24681 6.44691 6.14017 6.7665 6.12545 7.09676C6.07668 8.6132 6.06163 10.1814 6.0815 11.7292C6.08318 11.7746 6.07021 11.8195 6.0445 11.857C6.0188 11.8946 5.9817 11.9229 5.93869 11.9378C5.89568 11.9527 5.84903 11.9534 5.80559 11.9398C5.76216 11.9262 5.72424 11.899 5.69742 11.8622C5.36512 11.4372 5.03884 11.0146 4.72158 10.598C4.69809 10.5657 4.66341 10.5434 4.62432 10.5354C4.58524 10.5274 4.54457 10.5343 4.51028 10.5546C4.26306 10.7015 4.02045 10.8464 3.78246 10.9893C3.75058 11.007 3.7145 11.0158 3.67804 11.0148C3.64157 11.0137 3.60606 11.0029 3.57525 10.9833C3.54444 10.9638 3.51947 10.9363 3.50297 10.9038C3.48646 10.8712 3.47903 10.8349 3.48146 10.7985C3.47364 9.25553 3.51216 7.70839 3.59464 6.20881C3.61719 5.88879 3.72336 5.5803 3.90253 5.31418C4.0817 5.04806 4.3276 4.83365 4.61563 4.69237C7.63225 3.20182 10.8511 1.98337 13.5969 1.08398C14.453 1.39206 15.2914 1.74718 16.1084 2.14772Z" fill="url(#paint2_linear_539_4114)"/>
<path d="M15.619 11.4668C14.7132 11.4668 13.8279 11.7354 13.0748 12.2386C12.3217 12.7418 11.7347 13.457 11.3881 14.2937C11.0415 15.1305 10.9508 16.0513 11.1275 16.9396C11.3042 17.8279 11.7404 18.6439 12.3808 19.2843C13.0213 19.9248 13.8372 20.3609 14.7256 20.5376C15.6139 20.7143 16.5347 20.6236 17.3714 20.277C18.2082 19.9304 18.9234 19.3435 19.4266 18.5904C19.9298 17.8373 20.1984 16.9519 20.1984 16.0462C20.1982 14.8317 19.7157 13.667 18.8569 12.8083C17.9982 11.9495 16.8335 11.467 15.619 11.4668Z" fill="url(#paint3_linear_539_4114)"/>
<path d="M18.2094 15.3044L15.4679 18.1862C15.3931 18.2646 15.3032 18.3271 15.2037 18.37C15.1042 18.413 14.9971 18.4354 14.8887 18.436H14.8845C14.7768 18.436 14.6702 18.4144 14.571 18.3724C14.4719 18.3304 14.3821 18.2689 14.3072 18.1916L12.851 16.6914C12.7022 16.5382 12.6205 16.3322 12.6236 16.1187C12.6268 15.9052 12.7146 15.7018 12.8678 15.553C13.021 15.4043 13.227 15.3225 13.4405 15.3257C13.654 15.3289 13.8575 15.4167 14.0062 15.5699L14.8791 16.4693L17.0463 14.1943C17.195 14.046 17.3957 13.9615 17.6057 13.959C17.8157 13.9565 18.0184 14.0362 18.1705 14.1809C18.3226 14.3257 18.4122 14.5242 18.4202 14.734C18.4281 14.9439 18.3538 15.1486 18.213 15.3044H18.2094Z" fill="url(#paint4_linear_539_4114)"/>
<defs>
<linearGradient id="paint0_linear_539_4114" x1="18.0061" y1="17.9943" x2="2.81708" y2="2.80466" gradientUnits="userSpaceOnUse">
<stop stop-color="#FE7838"/>
<stop offset="0.54" stop-color="#FE7636"/>
<stop offset="1" stop-color="#FFAD8A"/>
</linearGradient>
<linearGradient id="paint1_linear_539_4114" x1="0.639245" y1="10.3993" x2="20.183" y2="10.3993" gradientUnits="userSpaceOnUse">
<stop stop-color="#0080DE"/>
<stop offset="0.6" stop-color="#49BCFF"/>
<stop offset="1" stop-color="#61CAFF"/>
</linearGradient>
<linearGradient id="paint2_linear_539_4114" x1="10.7663" y1="7.49047" x2="6.22357" y2="2.94778" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFDDCE"/>
<stop offset="0.57" stop-color="white"/>
<stop offset="1" stop-color="white"/>
</linearGradient>
<linearGradient id="paint3_linear_539_4114" x1="18.8571" y1="19.2844" x2="12.1069" y2="12.5347" gradientUnits="userSpaceOnUse">
<stop stop-color="#13B601"/>
<stop offset="0.52" stop-color="#13B601"/>
<stop offset="1" stop-color="#CBF4B4"/>
</linearGradient>
<linearGradient id="paint4_linear_539_4114" x1="16.8573" y1="16.7938" x2="14.241" y2="14.1769" gradientUnits="userSpaceOnUse">
<stop stop-color="#CBF4B4"/>
<stop offset="0.57" stop-color="white"/>
<stop offset="1" stop-color="white"/>
</linearGradient>
</defs>
</svg>
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.6 0C4.74598 0 0 4.74557 0 10.6C0 16.4544 4.74598 21.2 10.6 21.2C16.454 21.2 21.2 16.454 21.2 10.6C21.2 4.74598 16.454 0 10.6 0ZM15.6135 9.42572C15.7677 9.42572 15.9204 9.45609 16.0628 9.51511C16.2053 9.57412 16.3348 9.66062 16.4438 9.76966C16.5529 9.8787 16.6394 10.0082 16.6984 10.1506C16.7574 10.2931 16.7878 10.4458 16.7878 10.6C16.7878 10.7542 16.7574 10.9069 16.6984 11.0494C16.6394 11.1918 16.5529 11.3213 16.4438 11.4303C16.3348 11.5394 16.2053 11.6259 16.0628 11.6849C15.9204 11.7439 15.7677 11.7743 15.6135 11.7743H5.58653C5.27509 11.7743 4.97641 11.6506 4.75619 11.4303C4.53597 11.2101 4.41225 10.9114 4.41225 10.6C4.41225 10.2886 4.53597 9.98988 4.75619 9.76966C4.97641 9.54944 5.27509 9.42572 5.58653 9.42572H15.6135Z" fill="url(#paint0_linear_541_4121)"/>
<defs>
<linearGradient id="paint0_linear_541_4121" x1="0" y1="10.6" x2="21.2" y2="10.6" gradientUnits="userSpaceOnUse">
<stop stop-color="#CC3232"/>
<stop offset="0.6" stop-color="#EF5A5A"/>
<stop offset="1" stop-color="#F47E67"/>
</linearGradient>
</defs>
</svg>
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.5984 0C4.74527 0 0 4.74485 0 10.5984C0 16.4519 4.74527 21.1968 10.5984 21.1968C16.4515 21.1968 21.1968 16.4515 21.1968 10.5984C21.1968 4.74527 16.4515 0 10.5984 0ZM16.7852 10.5984C16.7852 10.7526 16.7548 10.9053 16.6958 11.0477C16.6368 11.1902 16.5504 11.3196 16.4413 11.4286C16.3323 11.5376 16.2029 11.6241 16.0604 11.6831C15.918 11.7421 15.7653 11.7725 15.6111 11.7725H11.7725V15.6111C11.7725 15.9225 11.6488 16.2211 11.4286 16.4413C11.2084 16.6615 10.9098 16.7852 10.5984 16.7852C10.287 16.7852 9.98837 16.6615 9.76818 16.4413C9.548 16.2211 9.4243 15.9225 9.4243 15.6111V11.7725H5.58569C5.2743 11.7725 4.97566 11.6488 4.75547 11.4286C4.53528 11.2084 4.41158 10.9098 4.41158 10.5984C4.41158 10.287 4.53528 9.98837 4.75547 9.76818C4.97566 9.548 5.2743 9.4243 5.58569 9.4243H9.4243V5.58569C9.4243 5.2743 9.548 4.97566 9.76818 4.75547C9.98837 4.53528 10.287 4.41158 10.5984 4.41158C10.9098 4.41158 11.2084 4.53528 11.4286 4.75547C11.6488 4.97566 11.7725 5.2743 11.7725 5.58569V9.4243H15.6111C15.9225 9.4243 16.2211 9.548 16.4413 9.76818C16.6615 9.98837 16.7852 10.287 16.7852 10.5984Z" fill="url(#paint0_linear_541_4122)"/>
<defs>
<linearGradient id="paint0_linear_541_4122" x1="0" y1="10.5984" x2="21.1968" y2="10.5984" gradientUnits="userSpaceOnUse">
<stop stop-color="#ED6C14"/>
<stop offset="0.6" stop-color="#FF9045"/>
<stop offset="1" stop-color="#FFB54A"/>
</linearGradient>
</defs>
</svg>
...@@ -238,6 +238,7 @@ class ComplaintList { ...@@ -238,6 +238,7 @@ class ComplaintList {
String? complaintId; String? complaintId;
String? createdBy; String? createdBy;
String? complaintTypeName; String? complaintTypeName;
String? technicianName;
String? complaintCategoryName; String? complaintCategoryName;
String? openStatus; String? openStatus;
String? createdDate; String? createdDate;
...@@ -246,6 +247,7 @@ class ComplaintList { ...@@ -246,6 +247,7 @@ class ComplaintList {
{this.complaintId, {this.complaintId,
this.createdBy, this.createdBy,
this.complaintTypeName, this.complaintTypeName,
this.technicianName,
this.complaintCategoryName, this.complaintCategoryName,
this.openStatus, this.openStatus,
this.createdDate}); this.createdDate});
...@@ -254,6 +256,7 @@ class ComplaintList { ...@@ -254,6 +256,7 @@ class ComplaintList {
complaintId = json['complaint_id']; complaintId = json['complaint_id'];
createdBy = json['created_by']; createdBy = json['created_by'];
complaintTypeName = json['complaint_type_name']; complaintTypeName = json['complaint_type_name'];
technicianName = json['technician_name'];
complaintCategoryName = json['complaint_category_name']; complaintCategoryName = json['complaint_category_name'];
openStatus = json['open_status']; openStatus = json['open_status'];
createdDate = json['created_date']; createdDate = json['created_date'];
...@@ -264,6 +267,7 @@ class ComplaintList { ...@@ -264,6 +267,7 @@ class ComplaintList {
data['complaint_id'] = this.complaintId; data['complaint_id'] = this.complaintId;
data['created_by'] = this.createdBy; data['created_by'] = this.createdBy;
data['complaint_type_name'] = this.complaintTypeName; data['complaint_type_name'] = this.complaintTypeName;
data['technician_name'] = this.technicianName;
data['complaint_category_name'] = this.complaintCategoryName; data['complaint_category_name'] = this.complaintCategoryName;
data['open_status'] = this.openStatus; data['open_status'] = this.openStatus;
data['created_date'] = this.createdDate; data['created_date'] = this.createdDate;
......
...@@ -19,6 +19,8 @@ import '../Utils/app_colors.dart'; ...@@ -19,6 +19,8 @@ import '../Utils/app_colors.dart';
import 'HomeScreenNotifier.dart'; import 'HomeScreenNotifier.dart';
class Generatordetailsprovider extends ChangeNotifier { class Generatordetailsprovider extends ChangeNotifier {
bool _showMoreDetails = false;
bool _submitLoading = false; bool _submitLoading = false;
bool _showMoreScheduleDetails = false; bool _showMoreScheduleDetails = false;
bool _showMoreScheduleList = false; bool _showMoreScheduleList = false;
...@@ -31,7 +33,10 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -31,7 +33,10 @@ class Generatordetailsprovider extends ChangeNotifier {
QRViewController? _qrViewController; QRViewController? _qrViewController;
TextEditingController engNoController = TextEditingController(); TextEditingController engNoController = TextEditingController();
FocusNode engineNoFocusNode = FocusNode(); FocusNode engineNoFocusNode = FocusNode();
List<C_List> _complaintList = []; List<ComplaintList> _complaintList = [];
List<C_List> _complaintListOther = [];
String? _genID = "-"; String? _genID = "-";
String? _genHashID = "-"; String? _genHashID = "-";
String? _aname = "-"; String? _aname = "-";
...@@ -119,7 +124,9 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -119,7 +124,9 @@ class Generatordetailsprovider extends ChangeNotifier {
bool get showMoreScheduleDetails => _showMoreScheduleDetails; bool get showMoreScheduleDetails => _showMoreScheduleDetails;
bool get showMoreScheduleList => _showMoreScheduleList; bool get showMoreScheduleList => _showMoreScheduleList;
bool get showMoreDetails => _showMoreDetails;
List<C_List> get complaintListOther => _complaintListOther;
List<ComplaintTypeList> get complaintTypeDropdown => _complaintTypeDropdown; List<ComplaintTypeList> get complaintTypeDropdown => _complaintTypeDropdown;
List<ComplaintCategoryList> get complaintCategorydropdown => List<ComplaintCategoryList> get complaintCategorydropdown =>
...@@ -151,7 +158,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -151,7 +158,7 @@ class Generatordetailsprovider extends ChangeNotifier {
String? get selectedDescriptionId => _selectedDescriptionId; String? get selectedDescriptionId => _selectedDescriptionId;
List<C_List> get complaintList => _complaintList; List<ComplaintList> get complaintsList => _complaintList;
String? get genID => _genID; String? get genID => _genID;
...@@ -222,6 +229,11 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -222,6 +229,11 @@ class Generatordetailsprovider extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
set showMoreDetails(bool value) {
_showMoreDetails = value;
notifyListeners();
}
set showMoreScheduleDetails(bool value) { set showMoreScheduleDetails(bool value) {
_showMoreScheduleDetails = value; _showMoreScheduleDetails = value;
notifyListeners(); notifyListeners();
...@@ -556,6 +568,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -556,6 +568,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_complaintTypeDropdown = data.complaintTypeList ?? []; _complaintTypeDropdown = data.complaintTypeList ?? [];
_complaintCategorydropdown = data.complaintCategoryList ?? []; _complaintCategorydropdown = data.complaintCategoryList ?? [];
_complaintDescriptionDropdown = data.complaintDescriptionList ?? []; _complaintDescriptionDropdown = data.complaintDescriptionList ?? [];
_complaintList = data.complaintList ?? [];
if (_selectedComplaintType != null && if (_selectedComplaintType != null &&
!_complaintTypeDropdown.contains(_selectedComplaintType)) { !_complaintTypeDropdown.contains(_selectedComplaintType)) {
_selectedComplaintType = null; _selectedComplaintType = null;
...@@ -579,7 +592,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -579,7 +592,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_selectedDescriptionId = ""; _selectedDescriptionId = "";
} }
notifyListeners(); notifyListeners();
Navigator.pop(context); // Navigator.pop(context);
if (from == "Generator Details") { if (from == "Generator Details") {
this._qrViewController!.pauseCamera(); this._qrViewController!.pauseCamera();
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
...@@ -592,7 +605,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -592,7 +605,7 @@ class Generatordetailsprovider extends ChangeNotifier {
), ),
), ),
(Route<dynamic> route) { (Route<dynamic> route) {
return route.settings.arguments == 'Gentrackerdashboard'; return route.settings.name == 'MyHomePage';
}, },
); );
} else if (from == "Register Complaint") { } else if (from == "Register Complaint") {
...@@ -658,6 +671,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -658,6 +671,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_complaintTypeDropdown = data.complaintTypeList ?? []; _complaintTypeDropdown = data.complaintTypeList ?? [];
_complaintCategorydropdown = data.complaintCategoryList ?? []; _complaintCategorydropdown = data.complaintCategoryList ?? [];
_complaintDescriptionDropdown = data.complaintDescriptionList ?? []; _complaintDescriptionDropdown = data.complaintDescriptionList ?? [];
_complaintList = data.complaintList ?? [];
if (_selectedComplaintType != null && if (_selectedComplaintType != null &&
!_complaintTypeDropdown.contains(_selectedComplaintType)) { !_complaintTypeDropdown.contains(_selectedComplaintType)) {
_selectedComplaintType = null; _selectedComplaintType = null;
...@@ -721,7 +735,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -721,7 +735,7 @@ class Generatordetailsprovider extends ChangeNotifier {
if (data != null) { if (data != null) {
if (data.sessionExists == 1) { if (data.sessionExists == 1) {
if (data.error == 0) { if (data.error == 0) {
_complaintList = data.list!; _complaintListOther = data.list??[];
notifyListeners(); notifyListeners();
_isLoading = false; _isLoading = false;
} else { } else {
...@@ -1000,6 +1014,7 @@ class Generatordetailsprovider extends ChangeNotifier { ...@@ -1000,6 +1014,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_isLoading = true; _isLoading = true;
_submitLoading = false; _submitLoading = false;
notifyListeners(); notifyListeners();
sessionDoesNotExist(context);
// SharedpreferencesService().clearPreferences(); // SharedpreferencesService().clearPreferences();
// toast(context, "Your Session expired, Please Login Again!"); // toast(context, "Your Session expired, Please Login Again!");
// Navigator.push( // Navigator.push(
......
...@@ -84,7 +84,9 @@ class UpdatePasswordProvider with ChangeNotifier { ...@@ -84,7 +84,9 @@ class UpdatePasswordProvider with ChangeNotifier {
toast(context, data.message); toast(context, data.message);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => MyHomePage()), MaterialPageRoute(builder: (context) => MyHomePage(),
settings: RouteSettings(name: "MyHomePage")
),
); );
} else { } else {
toast(context, data.message); toast(context, data.message);
...@@ -94,7 +96,8 @@ class UpdatePasswordProvider with ChangeNotifier { ...@@ -94,7 +96,8 @@ class UpdatePasswordProvider with ChangeNotifier {
SharedpreferencesService().clearPreferences(); SharedpreferencesService().clearPreferences();
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => LoginScreen()), MaterialPageRoute(builder: (context) => LoginScreen(),
settings: RouteSettings(name:"LoginScreen" )),
); );
} }
} }
......
...@@ -195,7 +195,8 @@ set isLoading(bool value){ ...@@ -195,7 +195,8 @@ set isLoading(bool value){
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => MyHomePage()), MaterialPageRoute(builder: (context) => MyHomePage(),
settings: RouteSettings(name: "MyHomePage")),
); );
notifyListeners(); notifyListeners();
} else if (data.error == 1) { } else if (data.error == 1) {
......
...@@ -98,19 +98,22 @@ class SplashVersionNotifier extends ChangeNotifier { ...@@ -98,19 +98,22 @@ class SplashVersionNotifier extends ChangeNotifier {
if (data.updatePasswordRequired == 0) { if (data.updatePasswordRequired == 0) {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => MyHomePage()), MaterialPageRoute(builder: (context) => MyHomePage(),
settings: RouteSettings(name: "MyHomePage")),
); );
} else if (data.updatePasswordRequired == 1) { } else if (data.updatePasswordRequired == 1) {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => UpdatePassword()), MaterialPageRoute(builder: (context) => UpdatePassword(),
settings: RouteSettings(name: "UpdatePassword")),
); );
} }
} else { } else {
print("goes here"); print("goes here");
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => LoginScreen()), MaterialPageRoute(builder: (context) => LoginScreen(),
settings: RouteSettings(name: "LoginScreen")),
); );
// toast(context, // toast(context,
// "Your Session has been expired, Please Login Again"); // "Your Session has been expired, Please Login Again");
......
...@@ -9,6 +9,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart'; ...@@ -9,6 +9,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import '../Utils/commonServices.dart'; import '../Utils/commonServices.dart';
import 'genTracker/ScanEnterGeneratorIDScreen.dart';
import 'notifierExports.dart'; import 'notifierExports.dart';
import 'screensExports.dart'; import 'screensExports.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
...@@ -1269,18 +1270,30 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -1269,18 +1270,30 @@ class _MyHomePageState extends State<MyHomePage> {
var res; var res;
switch (coreFilteredItems[ci]['name']) { switch (coreFilteredItems[ci]['name']) {
case "Gen Tracker": case "Gen Tracker":
res = await Navigator.push( // res = await Navigator.push(
context, // context,
MaterialPageRoute( // MaterialPageRoute(
builder: // builder:
(context) => // (context) =>
Gentrackerdashboard(), // Gentrackerdashboard(),
settings: RouteSettings( // settings: RouteSettings(
arguments: // arguments:
'Gentrackerdashboard', // 'Gentrackerdashboard',
), // ),
// ),
// );
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Scanentergeneratoridscreen(
from: "Generator Details",
), ),
); settings: RouteSettings(
name: 'Scanentergeneratoridscreen'
)
),
);
break; break;
case "Service": case "Service":
res = await Navigator.push( res = await Navigator.push(
......
...@@ -83,11 +83,11 @@ class _ComplainthistoryState extends State<Complainthistory> { ...@@ -83,11 +83,11 @@ class _ComplainthistoryState extends State<Complainthistory> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
if (provider.complaintList.isNotEmpty) ...[ if (provider.complaintListOther.isNotEmpty) ...[
ListView.builder( ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: provider.complaintList.length, itemCount: provider.complaintListOther.length,
itemBuilder: (context, l) { itemBuilder: (context, l) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -95,7 +95,7 @@ class _ComplainthistoryState extends State<Complainthistory> { ...@@ -95,7 +95,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0,top: 5.0), padding: const EdgeInsets.only(left: 8.0,top: 5.0),
child: Text( child: Text(
"${provider.complaintList[l].compRegdate}", "${provider.complaintListOther[l].compRegdate}",
style: TextStyle( style: TextStyle(
fontSize:14, fontSize:14,
color: Color(0xFF818181)), color: Color(0xFF818181)),
...@@ -121,10 +121,10 @@ class _ComplainthistoryState extends State<Complainthistory> { ...@@ -121,10 +121,10 @@ class _ComplainthistoryState extends State<Complainthistory> {
]; ];
final values = [ final values = [
provider.complaintList[l].techName, provider.complaintListOther[l].techName,
provider.complaintList[l].compType, provider.complaintListOther[l].compType,
provider.complaintList[l].compStatus, provider.complaintListOther[l].compStatus,
provider.complaintList[l].createdBy, provider.complaintListOther[l].createdBy,
]; ];
return Container( return Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
......
...@@ -74,97 +74,113 @@ class _ScanentergeneratoridscreenState ...@@ -74,97 +74,113 @@ class _ScanentergeneratoridscreenState
default: default:
connection = 'Offline'; connection = 'Offline';
} }
return connection == "Online" return (connection == "Online")
? Consumer<Generatordetailsprovider>( ? Platform.isAndroid
builder: (context, provider, child) { ? WillPopScope(
return WillPopScope( onWillPop: () async {
onWillPop: () => onBackPressed(context), Provider.of<Generatordetailsprovider>(
context,
listen: false,
).resetForm();
return onBackPressed(context);
},
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS ? false : true, bottom: true,
child: Scaffold( child: _scaffold(context),
resizeToAvoidBottomInset: true, ),
backgroundColor: AppColors.scaffold_bg_color, )
appBar: appbar(context, "${widget.from}"), : _scaffold(context)
body: Container( : NoNetwork(context);
decoration: BoxDecoration(color: Colors.black), }
child: Column(
children: [
Spacer(),
SizedBox(
height: 250,
child: QRView( Widget _scaffold(BuildContext context) {
key: provider.scannerKey, return Consumer<Generatordetailsprovider>(
onQRViewCreated: (p0) { builder: (context, provider, child) {
provider.onQRViewCreated( return WillPopScope(
p0, onWillPop: () => onBackPressed(context),
provider.title, child: SafeArea(
context, top: false,
); bottom: Platform.isIOS ? false : true,
}, child: Scaffold(
formatsAllowed: [BarcodeFormat.qrcode], resizeToAvoidBottomInset: true,
cameraFacing: CameraFacing.back, backgroundColor: AppColors.scaffold_bg_color,
overlay: QrScannerOverlayShape( appBar: appbarNew(context, "${widget.from}", 0xFFFFFFFF),
borderColor: AppColors.app_blue, body: Container(
borderRadius: 20, decoration: BoxDecoration(color: Colors.black),
borderLength: 60, child: Column(
borderWidth: 10, children: [
cutOutSize: 250.0, Spacer(),
), SizedBox(
), height: 250,
),
SizedBox(height: 25), child: QRView(
Text( key: provider.scannerKey,
"Scan QR", onQRViewCreated: (p0) {
textAlign: TextAlign.center, provider.onQRViewCreated(p0, provider.title, context);
style: TextStyle( },
fontSize: 18, formatsAllowed: [BarcodeFormat.qrcode],
fontFamily: "JakartaMedium", cameraFacing: CameraFacing.back,
color: Colors.white, overlay: QrScannerOverlayShape(
), borderColor: AppColors.app_blue,
), borderRadius: 20,
Text( borderLength: 60,
provider.subTitle, borderWidth: 10,
textAlign: TextAlign.center, cutOutSize: 250.0,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Spacer(),
Text(
"or",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: "JakartaMedium",
color: Colors.white,
),
), ),
InkResponse( ),
onTap: () async { ),
provider.qrViewController!.pauseCamera(); SizedBox(height: 25),
provider.submitLoading = false; Text(
_showgenIdBottomSheet(context); "Scan QR",
}, textAlign: TextAlign.center,
child: Text( style: TextStyle(
"Tap to Enter Gen ID", fontSize: 18,
textAlign: TextAlign.center, fontFamily: "JakartaMedium",
style: TextStyle( color: Colors.white,
fontSize: 18, ),
fontFamily: "JakartaMedium", ),
color: AppColors.app_blue, Text(
), provider.subTitle,
), textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Spacer(),
Text(
"or",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
InkResponse(
onTap: () async {
provider.qrViewController!.pauseCamera();
provider.submitLoading = false;
_showgenIdBottomSheet(context);
},
child: Text(
"Tap to Enter Gen ID",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
), ),
SizedBox(height: 50), ),
],
), ),
), SizedBox(height: 50),
],
), ),
), ),
); ),
}, ),
) );
: NoNetwork(context); },
);
} }
Future<void> _showgenIdBottomSheet(BuildContext context) { Future<void> _showgenIdBottomSheet(BuildContext context) {
...@@ -242,7 +258,7 @@ class _ScanentergeneratoridscreenState ...@@ -242,7 +258,7 @@ class _ScanentergeneratoridscreenState
15, 15,
0, 0,
), ),
child: TextField( child: TextFormField(
controller: genIDcontroller, controller: genIDcontroller,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
...@@ -255,6 +271,17 @@ class _ScanentergeneratoridscreenState ...@@ -255,6 +271,17 @@ class _ScanentergeneratoridscreenState
// Handle onTapOutside // Handle onTapOutside
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
}, },
onFieldSubmitted: (value) {
provider.submitLoading = true;
provider.LoadgeneratorDetailsApifunction(
homeProvider,
context,
widget.from,
genIDcontroller.text,
"1",
);
genIDcontroller.clear();
},
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
hintStyle: TextStyle( hintStyle: TextStyle(
...@@ -275,50 +302,51 @@ class _ScanentergeneratoridscreenState ...@@ -275,50 +302,51 @@ class _ScanentergeneratoridscreenState
provider.submitLoading provider.submitLoading
? null ? null
: () async { : () async {
switch (widget.from) { provider.submitLoading = true;
case "Generator Details": provider.LoadgeneratorDetailsApifunction(
provider.submitLoading = true; homeProvider,
provider.LoadgeneratorDetailsApifunction( context,
homeProvider, widget.from,
context, genIDcontroller.text,
widget.from, "1",
genIDcontroller.text, );
"1", genIDcontroller.clear();
); // switch (widget.from) {
genIDcontroller.clear(); // case "Generator Details":
break; //
// case "Register Complaint": // break;
// provider.LoadgeneratorDetailsApifunction( // // case "Register Complaint":
// homeProvider, // // provider.LoadgeneratorDetailsApifunction(
// context, // // homeProvider,
// widget.from, // // context,
// genIDcontroller.text, // // widget.from,
// "2" // // genIDcontroller.text,
// ); // // "2"
// break; // // );
// case "Tag Location": // // break;
// provider.TagLocationAPIFunction(homeProvider, context, genIDcontroller.text); // // case "Tag Location":
// break; // // provider.TagLocationAPIFunction(homeProvider, context, genIDcontroller.text);
case "Tag Generator": // // break;
provider.submitLoading = false; // // case "Tag Generator":
provider.TagGeneratorCheckAPIFunction( // // provider.submitLoading = false;
homeProvider, // // provider.TagGeneratorCheckAPIFunction(
context, // // homeProvider,
genIDcontroller.text, // // context,
); // // genIDcontroller.text,
// final data = await ApiCalling.TagGeneratorCheckAPI(homeProvider.empId, homeProvider.session, genIDcontroller.text); // // );
// if(data!=null){ // // // final data = await ApiCalling.TagGeneratorCheckAPI(homeProvider.empId, homeProvider.session, genIDcontroller.text);
// if(data.error==0){ // // // if(data!=null){
// provider.showTagGeneratorBottomSheet(context, genIDcontroller.text); // // // if(data.error==0){
// }else{ // // // provider.showTagGeneratorBottomSheet(context, genIDcontroller.text);
// toast(context, data.message); // // // }else{
// } // // // toast(context, data.message);
// } // // // }
// // // }
break; // //
default: // // break;
break; // default:
} // break;
// }
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
......
...@@ -81,7 +81,7 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -81,7 +81,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"), appBar: appbarNew(context, "Gen Inventory",0xFFFFFFFF),
body: Container( body: Container(
decoration: BoxDecoration(color: Colors.black), decoration: BoxDecoration(color: Colors.black),
child: Column( child: Column(
......
...@@ -30,7 +30,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -30,7 +30,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
bottom: Platform.isIOS ? false : true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Accounts"), appBar: appbarNew(context, "Accounts",0xFFFFFFFF),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: Container( body: Container(
decoration: BoxDecoration(color: Colors.white), decoration: BoxDecoration(color: Colors.white),
...@@ -50,26 +50,26 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -50,26 +50,26 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
height: 48, height: 48,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.text_field_color, // color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
border: // border:
searchFocusNode.hasFocus // searchFocusNode.hasFocus
? Border.all( // ? Border.all(
color: AppColors.app_blue, // color: AppColors.app_blue,
width: 0.5, // width: 0.5,
) // )
: null, // : null,
), ),
// alignment: Alignment.center, // alignment: Alignment.center,
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 15, 0), padding: const EdgeInsets.fromLTRB(5.0, 0.0, 15, 0),
child: TextField( child: TextField(
controller: _searchController, controller: _searchController,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
focusNode: searchFocusNode, focusNode: searchFocusNode,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
autofocus: true,
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
onChanged: (value) { onChanged: (value) {
if (value.length >= 3) { if (value.length >= 3) {
...@@ -81,16 +81,51 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -81,16 +81,51 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
}, },
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, filled: true,
fillColor: AppColors.text_field_color,
suffixIconConstraints: BoxConstraints(
minWidth: 25,
maxWidth: 30,
minHeight: 25,
maxHeight: 30,
),
suffixIcon: Container(
padding: EdgeInsets.only(right: 10),
child:_searchController.text.isNotEmpty?
InkResponse(
onTap: () {
_searchController.clear();
provider.accountList.clear();
},
child: SvgPicture.asset(
"assets/svg/crm/clear_search.svg",
),
):
SvgPicture.asset(
"assets/svg/search_ic.svg",
),
),
counterText: "",
hintText: "Enter Account Name",
hintStyle: TextStyle( hintStyle: TextStyle(
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFF818181), color: Color(0xFFB4BEC0),
fontSize: 14, fontSize: 14,
), ),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0), enabled: true,
enabledBorder: InputBorder.none, enabledBorder: OutlineInputBorder(
focusedBorder: InputBorder.none, borderSide: BorderSide.none,
hintText: 'Enter Account Name', borderRadius: BorderRadius.circular(14),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: AppColors.cyan_blue,
),
borderRadius: BorderRadius.circular(14),
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
),
), ),
), ),
), ),
...@@ -116,6 +151,60 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -116,6 +151,60 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
var accountList = provider.accountList; var accountList = provider.accountList;
String accname = provider.accountList[index].accountName ?? "";
RegExp regex =
RegExp(_searchController.text, caseSensitive: false);
Iterable<Match> matches =
regex.allMatches(accname);
List<TextSpan> textSpans = [];
int previousMatchEnd = 0;
for (Match match in matches) {
if (match.start > previousMatchEnd) {
// Add non-matching text before this match
textSpans.add(
TextSpan(
text: accname.substring(
previousMatchEnd, match.start),
style: TextStyle(
color: AppColors.semi_black,
fontSize: 14,
fontFamily: "JakartaMedium",
),
),
);
}
// Add the matching text with highlighting
textSpans.add(
TextSpan(
text: accname.substring(
match.start, match.end),
style: TextStyle(
color: AppColors.app_blue,
fontSize: 14, // Highlight color
fontFamily: "JakartaMedium",
),
),
);
previousMatchEnd = match.end;
}
// Add any remaining non-matching text after the last match
if (previousMatchEnd < accname.length) {
textSpans.add(
TextSpan(
text: accname.substring(previousMatchEnd),
style: TextStyle(
color: AppColors.semi_black,
fontSize: 14,
fontFamily: "JakartaMedium",
),
),
);
}
if (accountList!.length > 0) { if (accountList!.length > 0) {
return InkWell( return InkWell(
onTap: () { onTap: () {
...@@ -142,49 +231,65 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -142,49 +231,65 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
width: width:
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width *
0.9, 0.9,
padding: EdgeInsets.fromLTRB(0, 5, 0, 10), // padding: EdgeInsets.fromLTRB(0, 5, 0, 10),
child: Row( // child: Row(
children: [ // children: [
Expanded( // Expanded(
flex: 1, // flex: 1,
child: Container( // child: Container(
padding: EdgeInsets.symmetric( // padding: EdgeInsets.symmetric(
horizontal: 10, // horizontal: 10,
vertical: 10, // vertical: 10,
), // ),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Color(0xFFE6F6FF), // color: Color(0xFFE6F6FF),
borderRadius: // borderRadius:
BorderRadius.circular(8), // BorderRadius.circular(8),
), // ),
child: SvgPicture.asset( // child: SvgPicture.asset(
width: 30, // width: 30,
height: 30, // height: 30,
"assets/svg/se_block_head.svg", // "assets/svg/se_block_head.svg",
), // ),
), // ),
), // ),
SizedBox(width: 10), // SizedBox(width: 10),
Expanded( // Expanded(
flex: 5, // flex: 5,
child: Text( // child: Text(
"${accountList![index].accountName}", // "${accountList![index].accountName}",
textAlign: TextAlign.start, // textAlign: TextAlign.start,
maxLines: 3, // maxLines: 3,
overflow: TextOverflow.ellipsis, // overflow: TextOverflow.ellipsis,
style: TextStyle( // style: TextStyle(
color: AppColors.semi_black, // color: AppColors.semi_black,
), // ),
), // ),
// ),
// Expanded(
// flex: 1,
// child: SvgPicture.asset(
// "assets/svg/arrow_right_new.svg",
// ),
// ),
// ],
// ),
child: ListTile(
leading: SvgPicture.asset(
"assets/svg/crm/crm_search_list_ic.svg",
), ),
Expanded( title:RichText(text: TextSpan(
flex: 1, children: textSpans,
child: SvgPicture.asset( style: TextStyle(
"assets/svg/arrow_right_new.svg", color: AppColors.semi_black,
fontSize: 14, // Highlight color
fontFamily: "JakartaMedium",
), ),
)),
trailing: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
), ),
], )
),
), ),
), ),
); );
......
This diff is collapsed.
...@@ -73,7 +73,7 @@ class _PaymentdetailsState extends State<Paymentdetails> { ...@@ -73,7 +73,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
bottom: Platform.isIOS ? false : true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Payment Details"), appBar: appbarNew(context, "Payment Details",0xFFFFFFFF),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: SingleChildScrollView( body: SingleChildScrollView(
child: RefreshIndicator.adaptive( child: RefreshIndicator.adaptive(
......
...@@ -339,6 +339,17 @@ class _SplashState extends State<Splash> { ...@@ -339,6 +339,17 @@ class _SplashState extends State<Splash> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
// TODO: implement didChangeDependencies // TODO: implement didChangeDependencies
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
super.didChangeDependencies(); super.didChangeDependencies();
precacheImage(splashImage.image, context); precacheImage(splashImage.image, context);
} }
......
This diff is collapsed.
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