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 {
String? complaintId;
String? createdBy;
String? complaintTypeName;
String? technicianName;
String? complaintCategoryName;
String? openStatus;
String? createdDate;
......@@ -246,6 +247,7 @@ class ComplaintList {
{this.complaintId,
this.createdBy,
this.complaintTypeName,
this.technicianName,
this.complaintCategoryName,
this.openStatus,
this.createdDate});
......@@ -254,6 +256,7 @@ class ComplaintList {
complaintId = json['complaint_id'];
createdBy = json['created_by'];
complaintTypeName = json['complaint_type_name'];
technicianName = json['technician_name'];
complaintCategoryName = json['complaint_category_name'];
openStatus = json['open_status'];
createdDate = json['created_date'];
......@@ -264,6 +267,7 @@ class ComplaintList {
data['complaint_id'] = this.complaintId;
data['created_by'] = this.createdBy;
data['complaint_type_name'] = this.complaintTypeName;
data['technician_name'] = this.technicianName;
data['complaint_category_name'] = this.complaintCategoryName;
data['open_status'] = this.openStatus;
data['created_date'] = this.createdDate;
......
......@@ -19,6 +19,8 @@ import '../Utils/app_colors.dart';
import 'HomeScreenNotifier.dart';
class Generatordetailsprovider extends ChangeNotifier {
bool _showMoreDetails = false;
bool _submitLoading = false;
bool _showMoreScheduleDetails = false;
bool _showMoreScheduleList = false;
......@@ -31,7 +33,10 @@ class Generatordetailsprovider extends ChangeNotifier {
QRViewController? _qrViewController;
TextEditingController engNoController = TextEditingController();
FocusNode engineNoFocusNode = FocusNode();
List<C_List> _complaintList = [];
List<ComplaintList> _complaintList = [];
List<C_List> _complaintListOther = [];
String? _genID = "-";
String? _genHashID = "-";
String? _aname = "-";
......@@ -119,7 +124,9 @@ class Generatordetailsprovider extends ChangeNotifier {
bool get showMoreScheduleDetails => _showMoreScheduleDetails;
bool get showMoreScheduleList => _showMoreScheduleList;
bool get showMoreDetails => _showMoreDetails;
List<C_List> get complaintListOther => _complaintListOther;
List<ComplaintTypeList> get complaintTypeDropdown => _complaintTypeDropdown;
List<ComplaintCategoryList> get complaintCategorydropdown =>
......@@ -151,7 +158,7 @@ class Generatordetailsprovider extends ChangeNotifier {
String? get selectedDescriptionId => _selectedDescriptionId;
List<C_List> get complaintList => _complaintList;
List<ComplaintList> get complaintsList => _complaintList;
String? get genID => _genID;
......@@ -222,6 +229,11 @@ class Generatordetailsprovider extends ChangeNotifier {
notifyListeners();
}
set showMoreDetails(bool value) {
_showMoreDetails = value;
notifyListeners();
}
set showMoreScheduleDetails(bool value) {
_showMoreScheduleDetails = value;
notifyListeners();
......@@ -556,6 +568,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_complaintTypeDropdown = data.complaintTypeList ?? [];
_complaintCategorydropdown = data.complaintCategoryList ?? [];
_complaintDescriptionDropdown = data.complaintDescriptionList ?? [];
_complaintList = data.complaintList ?? [];
if (_selectedComplaintType != null &&
!_complaintTypeDropdown.contains(_selectedComplaintType)) {
_selectedComplaintType = null;
......@@ -579,7 +592,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_selectedDescriptionId = "";
}
notifyListeners();
Navigator.pop(context);
// Navigator.pop(context);
if (from == "Generator Details") {
this._qrViewController!.pauseCamera();
Navigator.pushAndRemoveUntil(
......@@ -592,7 +605,7 @@ class Generatordetailsprovider extends ChangeNotifier {
),
),
(Route<dynamic> route) {
return route.settings.arguments == 'Gentrackerdashboard';
return route.settings.name == 'MyHomePage';
},
);
} else if (from == "Register Complaint") {
......@@ -658,6 +671,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_complaintTypeDropdown = data.complaintTypeList ?? [];
_complaintCategorydropdown = data.complaintCategoryList ?? [];
_complaintDescriptionDropdown = data.complaintDescriptionList ?? [];
_complaintList = data.complaintList ?? [];
if (_selectedComplaintType != null &&
!_complaintTypeDropdown.contains(_selectedComplaintType)) {
_selectedComplaintType = null;
......@@ -721,7 +735,7 @@ class Generatordetailsprovider extends ChangeNotifier {
if (data != null) {
if (data.sessionExists == 1) {
if (data.error == 0) {
_complaintList = data.list!;
_complaintListOther = data.list??[];
notifyListeners();
_isLoading = false;
} else {
......@@ -1000,6 +1014,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_isLoading = true;
_submitLoading = false;
notifyListeners();
sessionDoesNotExist(context);
// SharedpreferencesService().clearPreferences();
// toast(context, "Your Session expired, Please Login Again!");
// Navigator.push(
......
......@@ -84,7 +84,9 @@ class UpdatePasswordProvider with ChangeNotifier {
toast(context, data.message);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => MyHomePage()),
MaterialPageRoute(builder: (context) => MyHomePage(),
settings: RouteSettings(name: "MyHomePage")
),
);
} else {
toast(context, data.message);
......@@ -94,7 +96,8 @@ class UpdatePasswordProvider with ChangeNotifier {
SharedpreferencesService().clearPreferences();
Navigator.push(
context,
MaterialPageRoute(builder: (context) => LoginScreen()),
MaterialPageRoute(builder: (context) => LoginScreen(),
settings: RouteSettings(name:"LoginScreen" )),
);
}
}
......
......@@ -195,7 +195,8 @@ set isLoading(bool value){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => MyHomePage()),
MaterialPageRoute(builder: (context) => MyHomePage(),
settings: RouteSettings(name: "MyHomePage")),
);
notifyListeners();
} else if (data.error == 1) {
......
......@@ -98,19 +98,22 @@ class SplashVersionNotifier extends ChangeNotifier {
if (data.updatePasswordRequired == 0) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => MyHomePage()),
MaterialPageRoute(builder: (context) => MyHomePage(),
settings: RouteSettings(name: "MyHomePage")),
);
} else if (data.updatePasswordRequired == 1) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => UpdatePassword()),
MaterialPageRoute(builder: (context) => UpdatePassword(),
settings: RouteSettings(name: "UpdatePassword")),
);
}
} else {
print("goes here");
Navigator.push(
context,
MaterialPageRoute(builder: (context) => LoginScreen()),
MaterialPageRoute(builder: (context) => LoginScreen(),
settings: RouteSettings(name: "LoginScreen")),
);
// toast(context,
// "Your Session has been expired, Please Login Again");
......
......@@ -9,6 +9,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:generp/Utils/commonWidgets.dart';
import '../Utils/commonServices.dart';
import 'genTracker/ScanEnterGeneratorIDScreen.dart';
import 'notifierExports.dart';
import 'screensExports.dart';
import 'package:geolocator/geolocator.dart';
......@@ -1269,18 +1270,30 @@ class _MyHomePageState extends State<MyHomePage> {
var res;
switch (coreFilteredItems[ci]['name']) {
case "Gen Tracker":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Gentrackerdashboard(),
settings: RouteSettings(
arguments:
'Gentrackerdashboard',
),
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Gentrackerdashboard(),
// settings: RouteSettings(
// arguments:
// 'Gentrackerdashboard',
// ),
// ),
// );
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Scanentergeneratoridscreen(
from: "Generator Details",
),
);
settings: RouteSettings(
name: 'Scanentergeneratoridscreen'
)
),
);
break;
case "Service":
res = await Navigator.push(
......
......@@ -83,11 +83,11 @@ class _ComplainthistoryState extends State<Complainthistory> {
child: SingleChildScrollView(
child: Column(
children: [
if (provider.complaintList.isNotEmpty) ...[
if (provider.complaintListOther.isNotEmpty) ...[
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: provider.complaintList.length,
itemCount: provider.complaintListOther.length,
itemBuilder: (context, l) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -95,7 +95,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
Padding(
padding: const EdgeInsets.only(left: 8.0,top: 5.0),
child: Text(
"${provider.complaintList[l].compRegdate}",
"${provider.complaintListOther[l].compRegdate}",
style: TextStyle(
fontSize:14,
color: Color(0xFF818181)),
......@@ -121,10 +121,10 @@ class _ComplainthistoryState extends State<Complainthistory> {
];
final values = [
provider.complaintList[l].techName,
provider.complaintList[l].compType,
provider.complaintList[l].compStatus,
provider.complaintList[l].createdBy,
provider.complaintListOther[l].techName,
provider.complaintListOther[l].compType,
provider.complaintListOther[l].compStatus,
provider.complaintListOther[l].createdBy,
];
return Container(
padding: EdgeInsets.symmetric(
......
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/GeneratorDetailsProvider.dart';
......@@ -93,7 +94,1489 @@ class _GeneratordetailsState extends State<Generatordetails> {
default:
connection = 'Offline';
}
return connection=="Online"?Consumer2<Generatordetailsprovider, HomescreenNotifier>(
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)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return
Consumer2<Generatordetailsprovider, HomescreenNotifier>(
builder: (context, provider, Homeprovider, child) {
print("cojomdspofjfm: ${provider.complaintsList.length}");
var sendwidget = SizedBox(width: 0);
return WillPopScope(
onWillPop: () async {
return onBackPressed(context);
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2New(
context,
"Generator Details",
provider.resetForm,
sendwidget,
0xFFFFFFFF
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Card(
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 2),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
),
elevation: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 5,
),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(
vertical: 3,
horizontal: 0,
),
child: Row(
children: [
SvgPicture.asset(
"assets/svg/crm/lead_details_ic.svg",
),
SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${provider.aname}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
),
),
Text(
"${provider.cname}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
],
),
),
],
),
),
],
),
),
Visibility(
visible:
provider.showMoreDetails
? true
: false,
child: Container(
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
margin: EdgeInsets.symmetric(
vertical: 0,
horizontal: 10,
),
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"Customer 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,
),
),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(4, (j) {
final textheads = [
"Mobile Number",
"Contact Person Number",
"Mail ID",
"Location",
];
final textSubheads = [
provider.mob1 ?? "-",
provider.mob2 ?? "-",
provider.mail ?? "-",
"View",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
children: [
Expanded(
flex: 1,
child: SizedBox(
child: Text(
textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
),
SizedBox(width: 5),
if (textSubheads[j] == "View") ...[
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.only(
right: 10.0,
),
child: InkWell(
onTap: () async {
if (widget.genLocation !=
null) {
provider.genLocationLatLngs =
widget.genLocation
?.split(",")
.toString();
} else {
provider.genLocationLatLngs =
provider.genLocation
?.split(",")
.toString();
}
var uri = Uri.parse(
"google.navigation:q=${provider.genLocationLatLngs![0]},${provider.genLocationLatLngs![1]}&mode=d",
);
if (Platform.isIOS) {
uri = Uri.parse(
"maps://?q=${provider.genLocationLatLngs![0]},${provider.genLocationLatLngs![1]}&z=10&daddr=${provider.genLocationLatLngs![0]},${provider.genLocationLatLngs![1]}&dirflg=d",
);
}
if (await canLaunch(
uri.toString(),
)) {
await launch(uri.toString());
} else {
throw 'Could not launch ${uri.toString()}';
}
},
child: Text(
textSubheads[j],
maxLines: 2,
textAlign:TextAlign.right,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
color: AppColors.app_blue,
decoration:
TextDecoration.underline,
decorationColor:
AppColors.app_blue,
),
),
),
),
),
] else ...[
Expanded(
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';
}
},
child: SizedBox(
child: Text(
textSubheads[j] == ""
? "-"
: textSubheads[j],
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign:TextAlign.right,
style: TextStyle(
fontSize: 14,
fontFamily:"JakartaRegular",
color:
textheads[j] ==
"Mobile Number"
? AppColors.app_blue
: Color(0xFF818181),
decorationColor:
textheads[j] ==
"Mobile Number"
? AppColors.app_blue
: null,
decoration:
textheads[j] ==
"Mobile Number"
? TextDecoration
.underline
: null,
),
),
),
),
),
],
],
),
);
}),
),
Container(
padding: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"Generator 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,
),
),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(6, (j) {
final textheads = [
"Product Name",
"Gen Hash ID",
"Engine Number",
"Engine Model",
"Address",
"Date Of Supply",
];
final textSubheads = [
"${provider.spname}",
"${provider.genHashID}",
"${provider.engineNo}",
"${provider.emodel}",
"${provider.address}",
"${provider.dateOfEngineSale}",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
textheads[j].toString(),
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaRegular",
),
),
),
SizedBox(width: 5),
Expanded(
flex: 2,
child: SizedBox(
child: Text(
textSubheads[j] == ""
? "-"
: textSubheads[j],
maxLines: 2,
textAlign:TextAlign.right,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily: "JakartaRegular"
),
),
),
),
],
),
);
}),
),
],
),
),
),
InkResponse(
onTap: () async {
provider.showMoreDetails =
!provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails
? "Hide Details"
: "View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
Transform.flip(
flipY:
provider.showMoreDetails
? true
: false,
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
color: AppColors.app_blue,
),
),
],
),
),
),
],
),
),
if (provider.contactsList.isNotEmpty) ...[
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Text(
"Customer Contact Details",
style: TextStyle(
color: Color(0xFF818181),
fontFamily: "JakartaMedium",
),
),
),
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: provider.contactsList.length,
itemBuilder: (context, l) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(vertical: 5),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/crm/contact_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: Text(
provider
.contactsList[l]
.name==""?"-": provider
.contactsList[l]
.name ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors
.semi_black,
),
),
),
Expanded(
flex: 2,
child: InkResponse(
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 ?? "-",
style: TextStyle(
height: 1,
decorationColor:
AppColors
.grey_thick,
decoration:
TextDecoration
.underline,
decorationStyle:
TextDecorationStyle
.dotted,
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors
.semi_black,
),
),
),
),
],
),
Text(
provider.contactsList[l].mail ?? "-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.grey_semi,
),
),
],
),
),
),
],
),
),
),
],
);
},
),
],
if (provider.scheduleList.isNotEmpty) ...[
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Text(
"Schedule Details",
style: TextStyle(
color: Color(0xFF818181),
fontFamily: "JakartaMedium",
),
),
),
SizedBox(
width: double.infinity,
height: 300,
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
shrinkWrap: true,
scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
itemCount: provider.scheduleList.length,
itemBuilder: (context, lp) {
return Container(
height: 300,
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/followup_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
.scheduleList[lp]
.complaintCategory ??
"-",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize:
14,
color:
AppColors
.semi_black,
),
),
Text(
provider
.scheduleList[lp]
.dueDate ??
"-",
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.scheduleList[lp].status ?? "-"}",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize:
14,
color: Color(
0xFF586000,
),
),
),
),
),
],
),
],
),
),
),
],
),
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 Type",
"Complaint ID",
"Service Schedule ID"
];
final subHeads = [
provider
.scheduleList[lp]
.complaintType ??
"-",
provider
.scheduleList[lp]
.complaintId ??
"-",
provider
.scheduleList[lp]
.serviceScheduleId ??
"-",
];
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,
),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"Remarks",
style: TextStyle(
fontSize: 14,
fontFamily:
"JakartaSemiBold",
),
),
),
Expanded(
flex: 7,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor:
AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
...List.generate(2, (j) {
final heads = [
"Complaint Description",
"Feedback Status",
];
final subHeads = [
provider.scheduleList[lp].complaintDescription ??
"-",
provider.scheduleList[lp].feedbackStatus ??
"-",
];
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,
subHeads[j] == ""
? "-"
: subHeads[j],
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
),
),
),
],
),
);
}),
],
),
);
},
),
),
],
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",
),
),
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,
),
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: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => TagLocationScreen(
genHashID: provider.genHashID,
),
),
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
// width: Med1iaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFE6F6FF)
),
child: SvgPicture.asset(
"assets/svg/gent_tag_loc.svg",
width: 20,
),
),
SizedBox(width: 10),
Expanded(
flex:4,
child: Text(
"Tag Location",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
SizedBox(width: 10),
],
),
),
),
InkWell(
onTap: () {
provider.TagGeneratorCheckAPIFunction(
Homeprovider,
context,
provider.genHashID,
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
// width: Med1iaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFE6F6FF)
),
child: SvgPicture.asset(
"assets/svg/gent_tag_den.svg",
width: 20,
),
),
SizedBox(width: 10),
Expanded(
flex:4,
child: Text(
"Tag Generator",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
SizedBox(width: 10),
],
),
),
),
InkWell(
onTap: () {
provider.LoadgeneratorDetailsApifunction(
Homeprovider,
context,
"Register Complaint",
provider.genHashID,
"2",
);
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Scanentergeneratoridscreen(
// from: "Register Complaint",
// ),
// ),
// );
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
// width: Med1iaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
child: Row(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFE6F6FF)
),
child: SvgPicture.asset(
"assets/svg/gent_reg_comp.svg",
width: 20,
),
),
SizedBox(width: 10),
Expanded(
flex:4,
child: Text(
"Register Complaint",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
SizedBox(width: 10),
],
),
),
),
SizedBox(height: 75),
],
),
),
),
// floatingActionButton: Align(
// alignment: Alignment.bottomCenter,
// child: InkWell(
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Complainthistory(genHashID: provider.genHashID),
// ),
// );
// },
// child: Container(
// alignment: Alignment.bottomCenter,
// height: 45,
// width: MediaQuery.of(context).size.width,
// margin: EdgeInsets.symmetric(horizontal: 10),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
// child: Center(
// child: Text(
// "Complaint History",
// textAlign: TextAlign.center,
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 15,
// color: Colors.white,
// ),
// ),
// ),
// ),
// ),
// ),
// floatingActionButtonLocation:
// FloatingActionButtonLocation.centerFloat,
),
),
);
},
);
}
Widget _scaffold1(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return
Consumer2<Generatordetailsprovider, HomescreenNotifier>(
builder: (context, provider, Homeprovider, child) {
var sendwidget = SizedBox(width: 0);
return WillPopScope(
......@@ -775,6 +2258,63 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
),
),
InkWell(
onTap: () {
provider.TagGeneratorCheckAPIFunction(
Homeprovider,
context,
provider.genHashID,
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
// width: Med1iaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SvgPicture.asset(
"assets/svg/gent_tag_loc.svg",
width: 20,
),
SizedBox(width: 10),
Expanded(
flex:4,
child: Text(
"Tag Generator",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 15,
decoration: TextDecoration.underline,
decorationColor: AppColors.app_blue,
color: AppColors.app_blue,
),
),
),
SizedBox(width: 10),
SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
],
),
),
),
InkWell(
onTap: () {
provider.LoadgeneratorDetailsApifunction(
......@@ -891,7 +2431,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
);
},
):NoNetwork(context);
);
}
}
......@@ -909,7 +2449,11 @@ class _TagLocationScreenState extends State<TagLocationScreen> {
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {});
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Generatordetailsprovider>(context,listen: false);
provider.showMoreDetails = false;
});
}
@override
......
......@@ -74,97 +74,113 @@ class _ScanentergeneratoridscreenState
default:
connection = 'Offline';
}
return connection == "Online"
? Consumer<Generatordetailsprovider>(
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () async {
Provider.of<Generatordetailsprovider>(
context,
listen: false,
).resetForm();
return onBackPressed(context);
},
child: SafeArea(
top: false,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "${widget.from}"),
body: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
Spacer(),
SizedBox(
height: 250,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
child: QRView(
key: provider.scannerKey,
onQRViewCreated: (p0) {
provider.onQRViewCreated(
p0,
provider.title,
context,
);
},
formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue,
borderRadius: 20,
borderLength: 60,
borderWidth: 10,
cutOutSize: 250.0,
),
),
),
SizedBox(height: 25),
Text(
"Scan QR",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
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,
),
Widget _scaffold(BuildContext context) {
return Consumer<Generatordetailsprovider>(
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbarNew(context, "${widget.from}", 0xFFFFFFFF),
body: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
Spacer(),
SizedBox(
height: 250,
child: QRView(
key: provider.scannerKey,
onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, provider.title, context);
},
formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue,
borderRadius: 20,
borderLength: 60,
borderWidth: 10,
cutOutSize: 250.0,
),
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: 25),
Text(
"Scan QR",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
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) {
......@@ -242,7 +258,7 @@ class _ScanentergeneratoridscreenState
15,
0,
),
child: TextField(
child: TextFormField(
controller: genIDcontroller,
keyboardType: TextInputType.text,
......@@ -255,6 +271,17 @@ class _ScanentergeneratoridscreenState
// Handle onTapOutside
FocusScope.of(context).unfocus();
},
onFieldSubmitted: (value) {
provider.submitLoading = true;
provider.LoadgeneratorDetailsApifunction(
homeProvider,
context,
widget.from,
genIDcontroller.text,
"1",
);
genIDcontroller.clear();
},
decoration: InputDecoration(
isDense: true,
hintStyle: TextStyle(
......@@ -275,50 +302,51 @@ class _ScanentergeneratoridscreenState
provider.submitLoading
? null
: () async {
switch (widget.from) {
case "Generator Details":
provider.submitLoading = true;
provider.LoadgeneratorDetailsApifunction(
homeProvider,
context,
widget.from,
genIDcontroller.text,
"1",
);
genIDcontroller.clear();
break;
// case "Register Complaint":
// provider.LoadgeneratorDetailsApifunction(
// homeProvider,
// context,
// widget.from,
// genIDcontroller.text,
// "2"
// );
// break;
// case "Tag Location":
// provider.TagLocationAPIFunction(homeProvider, context, genIDcontroller.text);
// break;
case "Tag Generator":
provider.submitLoading = false;
provider.TagGeneratorCheckAPIFunction(
homeProvider,
context,
genIDcontroller.text,
);
// final data = await ApiCalling.TagGeneratorCheckAPI(homeProvider.empId, homeProvider.session, genIDcontroller.text);
// if(data!=null){
// if(data.error==0){
// provider.showTagGeneratorBottomSheet(context, genIDcontroller.text);
// }else{
// toast(context, data.message);
// }
// }
break;
default:
break;
}
provider.submitLoading = true;
provider.LoadgeneratorDetailsApifunction(
homeProvider,
context,
widget.from,
genIDcontroller.text,
"1",
);
genIDcontroller.clear();
// switch (widget.from) {
// case "Generator Details":
//
// break;
// // case "Register Complaint":
// // provider.LoadgeneratorDetailsApifunction(
// // homeProvider,
// // context,
// // widget.from,
// // genIDcontroller.text,
// // "2"
// // );
// // break;
// // case "Tag Location":
// // provider.TagLocationAPIFunction(homeProvider, context, genIDcontroller.text);
// // break;
// // case "Tag Generator":
// // provider.submitLoading = false;
// // provider.TagGeneratorCheckAPIFunction(
// // homeProvider,
// // context,
// // genIDcontroller.text,
// // );
// // // final data = await ApiCalling.TagGeneratorCheckAPI(homeProvider.empId, homeProvider.session, genIDcontroller.text);
// // // if(data!=null){
// // // if(data.error==0){
// // // provider.showTagGeneratorBottomSheet(context, genIDcontroller.text);
// // // }else{
// // // toast(context, data.message);
// // // }
// // // }
// //
// // break;
// default:
// break;
// }
},
child: Container(
alignment: Alignment.center,
......
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/screens/finance/FileViewer.dart';
import 'package:generp/screens/notifierExports.dart';
import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/commonWidgets.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class GeneratorPartDetailsScreen extends StatefulWidget {
......@@ -43,6 +47,7 @@ class _GeneratorPartDetailsScreenState
initialiseFunction(context, homeProvider);
});
}
@override
void dispose() {
// TODO: implement dispose
......@@ -76,8 +81,33 @@ class _GeneratorPartDetailsScreenState
default:
connection = 'Offline';
}
return connection=="Online"?
Consumer2<InventoryProvider, HomescreenNotifier>(
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () async {
Provider.of<Editproductlistprovider>(
context,
listen: false,
).resetForm();
Provider.of<crmLeadDetailsProvider>(
context,
listen: false,
).resetAll();
return onBackPressed(context);
},
child: SafeArea(
top: false,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
return Consumer2<InventoryProvider, HomescreenNotifier>(
builder: (context, provider, homeProvider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
......@@ -87,231 +117,220 @@ class _GeneratorPartDetailsScreenState
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 15, bottom: 15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
appBar: appbarNew(context, "Inventory", 0xFFFFFFFF),
body: SingleChildScrollView(
child: Column(
children: [
Card(
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 2),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
child: Column(
children: [
Container(
padding: EdgeInsets.only(
left: 10,
right: 10,
top: 15,
),
child: Row(
children: [
Expanded(
child: Text(
"${provider.partData.prodName}",
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaMedium",
),
),
),
],
),
),
elevation: 2,
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
RichText(
text: TextSpan(
children: [
TextSpan(
text:
"${provider.partData.remainingQuantity}",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 30,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${provider.partData.remainingQuantity}",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 20,
height: 1,
fontFamily: "JakartaMedium",
),
),
Row(
children: [
Expanded(
flex: 8,
child: Text(
"Remaining Quantity",
style: TextStyle(
color: AppColors.semi_black,
fontSize: 14,
height: 1,
fontFamily:
"JakartaRegular",
),
],
),
),
),
Text(
"Remaining Quantity",
style: TextStyle(
color: Color(0xFF818181),
Spacer(),
Expanded(
child: Container(
height: 40,
width: 40,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
),
child: SvgPicture.asset(
"assets/svg/service/inventory_det_ic.svg",
fit: BoxFit.scaleDown,
),
),
),
),
],
),
],
),
],
),
),
],
),
),
],
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 15,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkResponse(
onTap: () {
_showStockIssueBottomSheet(
context,
),
SizedBox(
height: 60,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkResponse(
onTap: () {
_showStockIssueBottomSheet(
context,
"Issue",
);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/svg/service/stock_issue_ic.svg",
),
SizedBox(width: 10),
Text(
"Issue",
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Color(0xFFFFEFEF),
border: Border.all(
style: TextStyle(
color: Color(0xFFED3424),
width: 0.5,
),
borderRadius: BorderRadius.circular(
12,
),
),
child: Center(
child: Text(
"- Issue",
style: TextStyle(
color: Color(0xFFED3424),
),
),
),
),
],
),
),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap: () {
_showStockIssueBottomSheet(
context,
),
SvgPicture.asset(
"assets/svg/crm/vertical_line_ic.svg",
),
Expanded(
child: InkResponse(
onTap: () {
_showStockIssueBottomSheet(
context,
"Recieve",
);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/svg/service/stock_recieve_ic.svg",
),
SizedBox(width: 10),
Text(
"Recieve",
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Color(0xFFE7FFE5),
border: Border.all(
style: TextStyle(
color: Color(0xFF0D9C00),
width: 0.5,
),
borderRadius: BorderRadius.circular(
12,
),
),
child: Center(
child: Text(
"+ Recieve",
style: TextStyle(
color: Color(0xFF0D9C00),
),
),
),
),
],
),
),
],
),
),
],
),
],
),
),
],
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Product Details",
style: TextStyle(
color: Color(0xFF818181),
fontFamily: "JakartaMedium",
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: List.generate(2, (index) {
final headings = [
"Product Name",
// "Product ID",
"Project",
];
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (provider.partData.imageDirFilePath!
.trim()
.isNotEmpty) ...[
ClipRRect(
borderRadius: BorderRadius.circular(16),
child: CachedNetworkImage(
height: 100,
imageUrl: provider.partData.imageDirFilePath!,
fit: BoxFit.cover,
),
),
],
...List.generate(2, (index) {
final values = [
provider.partData.prodName,
// provider.partData.id,
provider.partData.project,
];
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
vertical: 3,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
Expanded(
flex: 2,
child: Text(
"${values[index]}",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF818181),
color:
index == 0
? AppColors.semi_black
: AppColors.grey_semi,
fontSize: 14,
fontFamily:
index == 0
? "JakartaMedium"
: "JakartaRegular",
),
),
),
......@@ -319,251 +338,744 @@ class _GeneratorPartDetailsScreenState
),
);
}),
),
],
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Vendor Details",
style: TextStyle(
fontFamily: "JakartaMedium",
color: Color(0xFF818181),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.only(left: 10,top: 10),
child: Text(
"Product Details",
style: TextStyle(
color: AppColors.grey_thick,
fontFamily: "JakartaMedium",
fontSize: 14
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: List.generate(2, (index) {
final headings = ["Vendor 1", "Vendor 2"];
),
final values = [
provider.partData.vendor1,
provider.partData.vendor2,
];
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
Container(
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
margin: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"Vendor Details",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
Expanded(
flex: 2,
child: Text(
"${values[index]}",
style: TextStyle(
color: Color(0xFF818181),
),
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
Column(
children: List.generate(2, (j) {
final headings = ["Vendor 1", "Vendor 2"];
final values = [
provider.partData.vendor1 ?? "-",
provider.partData.vendor2 ?? "-",
];
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
values[j] == "" ? "-" : values[j],
textAlign:TextAlign.right,
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily: "JakartaRegular",
),
),
),
],
),
);
}),
),
Container(
padding: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"Other 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,
),
),
],
),
),
Column(
children: List.generate(3, (j) {
final headings = ["Sub Group", "Units", "MSL"];
final values = [
provider.partData.subGroup ?? "-",
provider.partData.units ?? "-",
provider.partData.msl ?? "-",
];
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
values[j] == "" ? "-" : values[j],
textAlign:TextAlign.right,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaRegular",
color: AppColors.grey_semi,
),
),
),
],
),
);
}),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
margin: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"Description",
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,
),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Other Details",
style: TextStyle(
fontFamily: "JakartaMedium",
color: Color(0xFF818181),
Expanded(
child: Text(
provider.partData.prodDesc == ""
? "-"
: provider.partData.prodDesc ?? "-",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily: "JakartaRegular"
),
),
),
],
),
),
),
],
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: List.generate(5, (index) {
final headings = [
"Sub Group",
"Units",
"MSL",
"Description",
"Image",
];
),
final values = [
provider.partData.subGroup,
provider.partData.units,
provider.partData.msl,
provider.partData.prodDesc,
"View",
];
if(index==4&&provider
.partData
.imageDirFilePath==""){
return SizedBox.shrink();
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
SizedBox(height: 150),
],
),
),
),
),
),
);
},
);
}
Widget _scaffold1(BuildContext context) {
return Consumer2<InventoryProvider, HomescreenNotifier>(
builder: (context, provider, homeProvider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: RefreshIndicator.adaptive(
onRefresh: () async {
initialiseFunction(context, homeProvider);
},
child: SafeArea(
top: false,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbarNew(context, "Gen Inventory", 0xFFFFFFFF),
body: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 15, bottom: 15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Container(
padding: EdgeInsets.only(
left: 10,
right: 10,
top: 15,
),
child: Row(
children: [
Expanded(
child: Text(
"${provider.partData.prodName}",
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaMedium",
),
),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
RichText(
text: TextSpan(
children: [
TextSpan(
text:
"${provider.partData.remainingQuantity}",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 30,
),
),
],
),
),
Text(
"Remaining Quantity",
style: TextStyle(
color: AppColors.grey_semi,
),
),
],
),
),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 15,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkResponse(
onTap: () {
_showStockIssueBottomSheet(
context,
"Issue",
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
borderRadius: BorderRadius.circular(
12,
),
),
child: Center(
child: Text(
"- Issue",
style: TextStyle(
color: Color(0xFFED3424),
),
),
),
),
),
if (values[index] == "View") ...[
Expanded(
flex: 2,
child: InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Fileviewer(
fileName:
provider
.partData
.imageViewFileName!,
fileUrl:
provider
.partData
.imageDirFilePath!,
),
),
);
},
),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap: () {
_showStockIssueBottomSheet(
context,
"Recieve",
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
borderRadius: BorderRadius.circular(
12,
),
),
child: Center(
child: Text(
"${values[index]}",
"+ Recieve",
style: TextStyle(
color: AppColors.app_blue,
decoration:
TextDecoration.underline,
decorationColor:
AppColors.app_blue,
color: Color(0xFF0D9C00),
),
),
),
),
] else ...[
Expanded(
flex: 2,
),
),
],
),
),
],
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Product Details",
style: TextStyle(
color: AppColors.grey_semi,
fontFamily: "JakartaMedium",
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: List.generate(2, (index) {
final headings = [
"Product Name",
// "Product ID",
"Project",
];
final values = [
provider.partData.prodName,
// provider.partData.id,
provider.partData.project,
];
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
Expanded(
flex: 2,
child: Text(
"${values[index]}",
style: TextStyle(
color: AppColors.grey_semi,
),
),
),
],
),
);
}),
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Vendor Details",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.grey_semi,
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: List.generate(2, (index) {
final headings = ["Vendor 1", "Vendor 2"];
final values = [
provider.partData.vendor1,
provider.partData.vendor2,
];
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
Expanded(
flex: 2,
child: Text(
"${values[index]}",
style: TextStyle(
color: AppColors.grey_semi,
),
),
),
],
),
);
}),
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Other Details",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.grey_semi,
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: List.generate(5, (index) {
final headings = [
"Sub Group",
"Units",
"MSL",
"Description",
"Image",
];
final values = [
provider.partData.subGroup,
provider.partData.units,
provider.partData.msl,
provider.partData.prodDesc,
"View",
];
if (index == 4 &&
provider.partData.imageDirFilePath == "") {
return SizedBox.shrink();
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
if (values[index] == "View") ...[
Expanded(
flex: 2,
child: InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Fileviewer(
fileName:
provider
.partData
.imageViewFileName!,
fileUrl:
provider
.partData
.imageDirFilePath!,
),
),
);
},
child: Text(
"${values[index]}",
style: TextStyle(
color: Color(0xFF818181),
color: AppColors.app_blue,
decoration:
TextDecoration.underline,
decorationColor: AppColors.app_blue,
),
),
),
],
),
] else ...[
Expanded(
flex: 2,
child: Text(
"${values[index]}",
style: TextStyle(
color: AppColors.grey_semi,
),
),
),
],
),
);
}),
),
],
),
);
}),
),
),
// Container(
// alignment: Alignment.topLeft,
// padding: EdgeInsets.symmetric(horizontal: 10),
// child: Text(
// "Description",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// color: Color(0xFF818181),
// ),
// ),
// ),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
// ),
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// child: Row(
// children: [
// Expanded(
// child: SizedBox(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text(
// "Description",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// ),
// ),
// Text(
//
// style: TextStyle(
// color: Color(0xFF818181),
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// ),
SizedBox(height: 150),
],
),
// Container(
// alignment: Alignment.topLeft,
// padding: EdgeInsets.symmetric(horizontal: 10),
// child: Text(
// "Description",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// color: AppColors.grey_semi,
// ),
// ),
// ),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
// ),
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// child: Row(
// children: [
// Expanded(
// child: SizedBox(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text(
// "Description",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// ),
// ),
// Text(
//
// style: TextStyle(
// color: AppColors.grey_semi,
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// ),
SizedBox(height: 150),
],
),
),
),
......@@ -571,8 +1083,7 @@ class _GeneratorPartDetailsScreenState
),
);
},
):
NoNetwork(context);
);
}
Future<void> _showStockIssueBottomSheet(BuildContext context, type) {
......@@ -635,7 +1146,7 @@ class _GeneratorPartDetailsScreenState
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(20),
borderRadius: BorderRadius.circular(16),
border:
quantityFocusNode.hasFocus
? Border.all(
......@@ -674,7 +1185,7 @@ class _GeneratorPartDetailsScreenState
decoration: InputDecoration(
isDense: true,
hintStyle: TextStyle(
color: Color(0xFF818181),
color: AppColors.grey_semi,
fontSize: 14,
),
......@@ -739,10 +1250,10 @@ class _GeneratorPartDetailsScreenState
decoration: InputDecoration(
isDense: true,
hintStyle: TextStyle(
color: Color(0xFF818181),
color: AppColors.grey_semi,
fontSize: 14,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
hintText: 'Enter Description',
......
......@@ -81,7 +81,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
return Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
appBar: appbarNew(context, "Gen Inventory",0xFFFFFFFF),
body: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
......
......@@ -30,7 +30,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Accounts"),
appBar: appbarNew(context, "Accounts",0xFFFFFFFF),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
decoration: BoxDecoration(color: Colors.white),
......@@ -50,26 +50,26 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
height: 48,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
// color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
border:
searchFocusNode.hasFocus
? Border.all(
color: AppColors.app_blue,
width: 0.5,
)
: null,
// border:
// searchFocusNode.hasFocus
// ? Border.all(
// color: AppColors.app_blue,
// width: 0.5,
// )
// : null,
),
// alignment: Alignment.center,
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Padding(
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 15, 0),
padding: const EdgeInsets.fromLTRB(5.0, 0.0, 15, 0),
child: TextField(
controller: _searchController,
keyboardType: TextInputType.text,
focusNode: searchFocusNode,
textCapitalization: TextCapitalization.characters,
autofocus: true,
style: TextStyle(fontSize: 14),
onChanged: (value) {
if (value.length >= 3) {
......@@ -81,16 +81,51 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
FocusScope.of(context).unfocus();
},
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(
fontWeight: FontWeight.w400,
color: Color(0xFF818181),
color: Color(0xFFB4BEC0),
fontSize: 14,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
hintText: 'Enter Account Name',
enabled: true,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide.none,
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> {
shrinkWrap: true,
itemBuilder: (context, index) {
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) {
return InkWell(
onTap: () {
......@@ -142,49 +231,65 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
width:
MediaQuery.of(context).size.width *
0.9,
padding: EdgeInsets.fromLTRB(0, 5, 0, 10),
child: Row(
children: [
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius:
BorderRadius.circular(8),
),
child: SvgPicture.asset(
width: 30,
height: 30,
"assets/svg/se_block_head.svg",
),
),
),
SizedBox(width: 10),
Expanded(
flex: 5,
child: Text(
"${accountList![index].accountName}",
textAlign: TextAlign.start,
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColors.semi_black,
),
),
// padding: EdgeInsets.fromLTRB(0, 5, 0, 10),
// child: Row(
// children: [
// Expanded(
// flex: 1,
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// decoration: BoxDecoration(
// color: Color(0xFFE6F6FF),
// borderRadius:
// BorderRadius.circular(8),
// ),
// child: SvgPicture.asset(
// width: 30,
// height: 30,
// "assets/svg/se_block_head.svg",
// ),
// ),
// ),
// SizedBox(width: 10),
// Expanded(
// flex: 5,
// child: Text(
// "${accountList![index].accountName}",
// textAlign: TextAlign.start,
// maxLines: 3,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// 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(
flex: 1,
child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
title:RichText(text: TextSpan(
children: textSpans,
style: TextStyle(
color: AppColors.semi_black,
fontSize: 14, // Highlight color
fontFamily: "JakartaMedium",
),
)),
trailing: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
],
),
)
),
),
);
......
......@@ -31,6 +31,46 @@ class _MonthlycollectionState extends State<Monthlycollection> {
});
}
Color getDecorationColor(value) {
var color = AppColors.approved_bg_color;
switch (value) {
case 'Pending Approval':
return AppColors.requested_bg_color;
case 'Approved':
return AppColors.approved_bg_color;
case 'Rejected':
return AppColors.rejected_bg_color;
}
return color;
}
Color getTextColor(value) {
var color = AppColors.approved_text_color;
switch (value) {
case 'Pending Approval':
return AppColors.requested_text_color;
case 'Approved':
return AppColors.approved_text_color;
case 'Rejected':
return AppColors.rejected_text_color;
}
return color;
}
// Pending Approval', 'Approved', 'Rejected
getText(value) {
var text = "A";
switch (value) {
case 'Approved':
return "A";
case 'Pending Approval':
return "PA";
case 'Rejected':
return "R";
}
return text;
}
@override
Widget build(BuildContext context) {
return Consumer<Paymentcollectionprovider>(
......@@ -41,203 +81,295 @@ class _MonthlycollectionState extends State<Monthlycollection> {
context,
MaterialPageRoute(builder: (context) => Accountsuggestions()),
);
if(res==true){
if (res == true) {
provider.PaymentCollectionAPI(context);
}
},
child: SvgPicture.asset(
"assets/svg/add_account.svg",
width: 20,
color: Color(0xFF2D2D2D),
height: 20,
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: Text(
"Add Payment",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
// child: SvgPicture.asset(
// "assets/svg/add_account.svg",
// width: 20,
// color: Color(0xFF2D2D2D),
// height: 20,
// ),
);
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2(context, "Payment Collection",provider.resetAll, sendWidget),
body: provider.paymenCollectionList.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: provider.paymenCollectionList.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
margin: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset(
width: 30,
height: 30,
"assets/svg/se_block_head.svg",
),
),
),
SizedBox(width: 10),
appBar: appbar2(
context,
"Payment Collection",
provider.resetAll,
SizedBox.shrink(),
),
body:
provider.paymenCollectionList.isNotEmpty
? Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: provider.paymenCollectionList.length,
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${provider.paymenCollectionList[index].accountName}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium"
),
),
Text(
"₹${provider.paymenCollectionList[index].amount}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: AppColors.app_blue),
),
// Text("Gen Pvt. Ltd"),
],
),
),
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
Container(
height: 35,
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Color(0xFFE3FFE0),
borderRadius: BorderRadius.circular(8),
),
child: Center(
child: Text(
"${provider.paymenCollectionList[index].approvalStatus}",
style: TextStyle(
fontSize: 13,
color: Color(0xFF0D9C00)),
),
),
margin: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
),
SizedBox(height: 5),
...List.generate(2, (j) {
final textheads = ["ID", "Generator Type"];
final textSubheads = [
provider.paymenCollectionList[index].paymentRefNo,
provider.paymenCollectionList[index].paymentMode,
];
return Container(
padding: EdgeInsets.symmetric(vertical: 3),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Expanded(
// flex: 1,
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// decoration: BoxDecoration(
// color: Color(0xFFE6F6FF),
// shape: BoxShape.circle
// ),
// child: SvgPicture.asset(
// width: 30,
// height: 30,
// "assets/svg/se_block_head.svg",
// ),
// ),
// ),
Expanded(
flex: 1,
child: Text(textheads[j].toString(),style: TextStyle(
fontFamily: "JakartaMedium"
),),
child: Container(
height: 45,
padding: EdgeInsets.symmetric(
horizontal: 10,
),
decoration: BoxDecoration(
color: getDecorationColor(
provider
.paymenCollectionList[index]
.approvalStatus,
),
shape: BoxShape.circle,
),
child: Center(
child: Text(
"${getText(provider.paymenCollectionList[index].approvalStatus)}",
style: TextStyle(
fontSize: 16,
fontFamily: "JakartaMedium",
color: getTextColor(
provider
.paymenCollectionList[index]
.approvalStatus,
),
),
),
),
),
),
SizedBox(width: 5),
SizedBox(width: 10),
Expanded(
flex: 2,
child: Text(
textSubheads[j].toString(),
style: TextStyle(
color: Color(0xFF818181),
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${provider.paymenCollectionList[index].accountName}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
Text(
"${provider.paymenCollectionList[index].paymentMode}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColors.grey_semi,
fontSize: 14,
fontFamily: "JakartaRegular",
),
),
// Text("Gen Pvt. Ltd"),
],
),
),
),
Container(
height: 35,
padding: EdgeInsets.symmetric(
horizontal: 10,
),
child: Center(
child: Text(
"₹${provider.paymenCollectionList[index].amount}",
style: TextStyle(
fontSize: 13,
color: getTextColor(
provider
.paymenCollectionList[index]
.approvalStatus,
),
),
),
),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
],
),
);
}),
SizedBox(height: 10),
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => WebErpScreen(
erp_url:
provider
.paymenCollectionList[index]
.paymentProofFilePath ??
"",
),
),
);
},
child: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"View Attachment",
style: TextStyle(color: AppColors.app_blue,fontFamily: "JakartaMedium"),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Divider(
// thickness: 0.5,
// color: Color(0xFFD7D7D7),
// ),
// ),
// SizedBox(height: 5),
// ...List.generate(2, (j) {
// final textheads = ["ID", "Generator Type"];
// final textSubheads = [
// provider
// .paymenCollectionList[index]
// .paymentRefNo,
// provider
// .paymenCollectionList[index]
// .paymentMode,
// ];
// return Container(
// padding: EdgeInsets.symmetric(
// vertical: 3,
// ),
// child: Column(
// children: [
// Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Expanded(
// flex: 1,
// child: Text(
// textheads[j].toString(),
// style: TextStyle(
// fontFamily: "JakartaMedium",
// ),
// ),
// ),
// SizedBox(width: 5),
// Expanded(
// flex: 2,
// child: Text(
// textSubheads[j].toString(),
// style: TextStyle(
// color: Color(0xFF818181),
// ),
// ),
// ),
// ],
// ),
// ],
// ),
// );
// }),
SizedBox(height: 10),
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => WebErpScreen(
erp_url:
provider
.paymenCollectionList[index]
.paymentProofFilePath ??
"",
),
),
);
},
child: SizedBox(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"View Attachment",
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaMedium",
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
SizedBox(width: 5),
SvgPicture.asset("assets/svg/next_button.svg"),
],
),
),
),
],
),
);
},
),
):Emptywidget(context)
);
},
),
)
: Emptywidget(context),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: sendWidget,
),
),
);
......
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/PCWalletProvider.dart';
......@@ -8,6 +9,7 @@ import 'package:provider/provider.dart';
import '../../Models/PaymentCollectionWalletResponse.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonServices.dart';
class Pcwallet extends StatefulWidget {
const Pcwallet({super.key});
......@@ -17,8 +19,15 @@ class Pcwallet extends StatefulWidget {
}
class _PcwalletState extends State<Pcwallet> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override
void initState() {
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
......@@ -27,8 +36,42 @@ class _PcwalletState extends State<Pcwallet> {
});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Pcwalletprovider>(
builder: (context, provider, child) {
final groupedData = provider.groupByDate(provider.historyList);
......@@ -39,70 +82,411 @@ class _PcwalletState extends State<Pcwallet> {
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: AppBar(
automaticallyImplyLeading: false,
elevation: 2.0,
title: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
///Container(
// padding: EdgeInsets.symmetric(horizontal: 10),
// height: 40,
// decoration: BoxDecoration(
// color: Color(0xFFF2FAFF),
// borderRadius: BorderRadius.circular(16),
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// 'assets/svg/pc_wallet.svg',
// height: 30,
// ),
// SizedBox(width: 5),
// Text(
// "${provider.totlDetails.balanceAmount??"0.00"}",
// style: TextStyle(fontSize: 14),
// ),
// ],
// ),
// ),
appBar: appbarNew(context, "P.C. Wallet", 0xFFFFFFFF),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
InkResponse(
onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset(
"assets/svg/app_bar_back.svg",
height: 25,
),
),
InkResponse(
onTap: () => Navigator.pop(context,true),
child: Text(
"P.C. Wallet",
style: TextStyle(
fontSize: 16,
height: 1.1,
fontFamily: "JakartaSemiBold",
color: AppColors.semi_black,
),
),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 40,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration(
color: Color(0xFFF2FAFF),
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
child: Column(
children: [
SvgPicture.asset(
'assets/svg/pc_wallet.svg',
height: 30,
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Color(0xFFEDF7FF),
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"₹${provider.totlDetails.balanceAmount ?? "-"}",
style: TextStyle(
fontSize: 20,
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
),
],
),
Container(
padding: EdgeInsets.only(top: 5),
child: Text(
"Balance Amount",
maxLines: 1,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaRegular",
color: AppColors.semi_black,
),
),
),
],
),
),
SizedBox(width: 5),
Text(
"${provider.totlDetails.balanceAmount??"0.00"}",
style: TextStyle(fontSize: 14),
Row(
children: [
...List.generate(2, (jj) {
final texts = ["Credited", "Debited"];
final heads = [
provider.totlDetails.creditAmount ?? "-",
provider.totlDetails.debitAmount ?? "-",
];
final svgs = [
"assets/svg/finance/cred_debit_ic.svg",
"assets/svg/finance/deb_credit_ic.svg",
];
return Expanded(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color:
texts[jj] == "Debited"
? Color(0xFFFFEFEF)
: Color(0xFFE7FFE5),
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"₹${heads[jj] ?? "-"}",
maxLines: 2,
style: TextStyle(
fontSize: 20,
color:
texts[jj] == "Debited"
? Color(0xFFEF3739)
: Color(0xFF0D9C00),
fontFamily: "JakartaMedium",
),
),
Container(
padding: EdgeInsets.only(top: 5),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
texts[jj] ?? "-",
maxLines: 1,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaRegular",
color: AppColors.semi_black,
),
),
),
Expanded(
flex: 1,
child: SvgPicture.asset(svgs[jj]),
),
],
),
),
],
),
),
);
}),
],
),
SizedBox(height: 5,)
],
),
),
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: provider.historyList.length,
itemBuilder: (context, index) {
double running_balance = 0;
int currentIndex = provider.historyList.indexOf(
provider.historyList[index],
);
String part1 =
provider.historyList[index].description!.split(' (').first;
RegExp regExp = RegExp(r'\(([^)]+)\)');
String? part2 = regExp
.firstMatch(provider.historyList[index].description!)
?.group(1);
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
// margin: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: SizedBox(
child:
provider.historyList[index].transactionType ==
"Debit"
? SvgPicture.asset(
"assets/svg/finance/debited_filled_ic.svg",
height: 45,
width: 45,
fit: BoxFit.contain,
)
: SvgPicture.asset(
"assets/svg/finance/credited_filled_ic.svg",
height: 45,
width: 45,
fit: BoxFit.contain,
),
),
),
SizedBox(width: 10),
Expanded(
flex: 8,
child: SizedBox(
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Expanded(
// flex: 5,
// child: SizedBox(
// child: Text(
// provider
// .historyList[index]
// .description ??
// "-",
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontFamily: "JakartaRegular",
// fontSize: 14,
// ),
// ),
// ),
// ),
Expanded(
flex:5,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(part1,
maxLines: 2,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14
),),
if(part2!=null)
Text(
"${part2}",
maxLines: 2,
style: TextStyle(
color: AppColors.grey_semi,
fontSize: 14
),
),
],
),
),
),
Spacer(),
Expanded(
flex: 3,
child: SizedBox(
child: RichText(
maxLines: 1,
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis,
text: TextSpan(
children: [
TextSpan(
text:
provider
.historyList[index]
.transactionType ==
"Debit"
? "-"
: "+",
style: TextStyle(
color:
provider
.historyList[index]
.transactionType ==
"Debit"
? Color(0xFFEF3739)
: Color(0xFF0D9C00),
fontSize: 14,
fontFamily:
"JakartaRegular",
),
),
TextSpan(
text:
"₹${provider.historyList[index].transactionType == "Debit" ? "${provider.historyList[index].amount}" : "${provider.historyList[index].amount}"}",
style: TextStyle(
color: provider
.historyList[index]
.transactionType ==
"Debit"
? Color(0xFFEF3739)
: Color(0xFF0D9C00),
fontSize: 14,
fontFamily:
"JakartaRegular",
),
),
],
),
),
),
),
],
),
SizedBox(height: 7,),
Row(
children: [
Expanded(
flex: 5,
child: SizedBox(
child: Text(
provider
.historyList[index]
.datetime ??
"-",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
color: AppColors.grey_semi,
fontSize: 12,
),
),
),
),
],
),
],
),
),
),
],
),
);
},
),
],
),
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30), // Adjust the radius as needed
),
),
),
),
),
);
},
);
}
Widget _scaffold1(BuildContext context) {
return Consumer<Pcwalletprovider>(
builder: (context, provider, child) {
final groupedData = provider.groupByDate(provider.historyList);
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
///Container(
// padding: EdgeInsets.symmetric(horizontal: 10),
// height: 40,
// decoration: BoxDecoration(
// color: Color(0xFFF2FAFF),
// borderRadius: BorderRadius.circular(16),
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// 'assets/svg/pc_wallet.svg',
// height: 30,
// ),
// SizedBox(width: 5),
// Text(
// "${provider.totlDetails.balanceAmount??"0.00"}",
// style: TextStyle(fontSize: 14),
// ),
// ],
// ),
// ),
appBar: appbarNew(context, "P.C. Wallet", 0xFFFFFFFF),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
decoration: BoxDecoration(
......@@ -320,6 +704,7 @@ class _PcwalletState extends State<Pcwallet> {
);
},
),
],
),
),
......
......@@ -73,7 +73,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Payment Details"),
appBar: appbarNew(context, "Payment Details",0xFFFFFFFF),
backgroundColor: AppColors.scaffold_bg_color,
body: SingleChildScrollView(
child: RefreshIndicator.adaptive(
......
......@@ -339,6 +339,17 @@ class _SplashState extends State<Splash> {
@override
void 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();
precacheImage(splashImage.image, context);
}
......
......@@ -524,7 +524,7 @@ class ApiCalling {
};
final res = await post(data, genTrackerGeneratorDetailsUrl, {});
if (res != null) {
debugPrint("gen details: ${res.body}");
debugPrint("gen details222: ${jsonDecode(res.body)['complaint_list']}");
return loadGeneratorDetailsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -786,8 +786,9 @@ class ApiCalling {
'gen_id': (gen_id).toString(),
};
final res = await post(data, technicianGeneratorDetailsUrl, {});
if (res != null) {
debugPrint(res.body);
print("genderrails:${jsonDecode(res!.body)}");
return loadGeneratorDetailsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......
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