Commit 2ccf19cc authored by Sai Srinivas's avatar Sai Srinivas
Browse files

04-07-2025 By Sai Srinivas

Test cases and Order Module, Crm Module.
parent 4b790bef
import 'dart:async';
import 'dart:io';
import 'dart:math' as math;
import 'package:camera/camera.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/app_colors.dart';
import 'package:permission_handler/permission_handler.dart';
import '../Utils/commonServices.dart';
......@@ -48,12 +51,12 @@ class _CheckOutScreenState extends State<FrontCameraCapture> {
Future<void> _getavailableCameras() async {
try {
_cameras = await availableCameras();
//
final frontCamera = _cameras.firstWhere(
(camera) => camera.lensDirection == CameraLensDirection.front,
);
cam_controller = CameraController(frontCamera, ResolutionPreset.max);
// final frontCamera = CameraLensDirection.front;
cam_controller = CameraController(frontCamera, ResolutionPreset.max,);
await cam_controller.initialize();
......@@ -78,44 +81,57 @@ class _CheckOutScreenState extends State<FrontCameraCapture> {
Size size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
),
// appBar: AppBar(automaticallyImplyLeading: false),
body: SafeArea(
child: isLoading
child:
isLoading
? Center(child: CircularProgressIndicator())
: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
: Row(
children: [
Container(
height: size.height * 0.8,
child: cam_controller.value.isInitialized
? CameraPreview(cam_controller)
: Center(child: Text("Camera not ready")),
),
Container(
height: size.height * 0.1,
padding: EdgeInsets.all(10),
child: Center(
child: TextButton(
style: ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.white70),
overlayColor: MaterialStatePropertyAll(Colors.white70),
),
onPressed: () async {
if (!cam_controller.value.isInitialized) return;
final image = await cam_controller.takePicture();
Expanded(
child: SizedBox(
height: double.infinity,
child:
cam_controller.value.isInitialized
? Transform(
alignment: Alignment.center,
transform: Matrix4.rotationY(math.pi),
child: CameraPreview(
cam_controller,
child: Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
onTap: () async {
if (!cam_controller
.value
.isInitialized)
return;
final image =
await cam_controller
.takePicture();
_image = File(image.path);
Navigator.pop(context, _image);
},
child: Icon(
CupertinoIcons.camera_circle_fill,
size: 50,
color: Colors.black,
child: Container(
height: 100,
width: double.infinity,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.black26
),
child: Center(
child: SvgPicture.asset("assets/svg/check_in_cam.svg",width: 50,height: 50,)
),
),
),
),
),
)
: Center(child: Text("Camera not ready")),
),
),
],
),
),
......
......@@ -13,6 +13,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:location/location.dart' as loc;
import '../Utils/app_colors.dart';
import 'inventory/InventoryScreen.dart';
import 'package:auto_size_text/auto_size_text.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
......@@ -110,41 +111,41 @@ class _MyHomePageState extends State<MyHomePage> {
// Define the original data
final names = [
"Attendance",
"Finance",
// "CRM",
"Orders",
"ERP",
"Gen Tracker",
"Service Engineer",
"Nearby",
"Gen Tracker",
// "Nearby",
"Inventory",
"Whizzdom",
"Common",
"Finance",
// "Orders",
// "CRM",
// "Common",
];
final icons = [
"assets/svg/home_icons_1.svg",
"assets/svg/home_icons_10.svg",
// "assets/svg/home_icons_12.svg",
"assets/svg/home_icons_11.svg",
"assets/svg/home_icons_2.svg",
"assets/svg/home_icons_31.svg",
"assets/svg/home_icons_4.svg",
"assets/svg/home_icons_5.svg",
"assets/svg/home_icons_31.svg",
// "assets/svg/home_icons_5.svg",
"assets/svg/home_icons_6.svg",
"assets/svg/home_icons_81.svg",
"assets/svg/home_icons_9.svg",
"assets/svg/home_icons_10.svg",
// "assets/svg/home_icons_11.svg",
// "assets/svg/home_icons_12.svg",
// "assets/svg/home_icons_9.svg",
];
final requiredRoles = [
"430",
"430",
// "430",
"430",
"431",
"434",
"433",
"433",
"434",
// "433",
"432",
"431",
"430",
"430",
// "430",
// "430",
];
......@@ -275,22 +276,44 @@ class _MyHomePageState extends State<MyHomePage> {
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"${profile.employeeName}",
style: TextStyle(
// Text(
// "${profile.employeeName}",
// maxLines: 1,
// style: TextStyle(
// color: AppColors.app_blue,
// fontFamily: "JakartaSemiBold",
// fontSize: 18,
// ),
// ),
AutoSizeText(
'${profile.employeeName}',
maxFontSize: 18,
minFontSize: 12,
style: TextStyle(fontSize: 18,
color: AppColors.app_blue,
fontFamily: "JakartaSemiBold",
fontSize: 18,
fontFamily: "JakartaRegular"
),
maxLines: 2,
),
Text(
"${profile.designation}",
style: TextStyle(
AutoSizeText(
'(${profile.designation})',
maxFontSize: 14,
minFontSize: 10,
style: TextStyle(fontSize: 14,
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
fontFamily: "JakartaRegular"
),
maxLines: 1,
),
// Text(
// "${profile.designation}",
// maxLines: 1,
// style: TextStyle(
// color: AppColors.semi_black,
// fontFamily: "JakartaRegular",
// fontSize: 14,
// ),
// ),
Text(
"${profile.employeeeID}",
style: TextStyle(
......@@ -369,6 +392,7 @@ class _MyHomePageState extends State<MyHomePage> {
MaterialPageRoute(
builder:
(context) => AttendanceScreen(),
settings: RouteSettings(arguments: 'AttendanceScreen'),
),
);
break;
......@@ -410,6 +434,7 @@ class _MyHomePageState extends State<MyHomePage> {
builder:
(context) =>
Gentrackerdashboard(),
settings: RouteSettings(arguments: 'Gentrackerdashboard'),
),
);
break;
......@@ -471,12 +496,16 @@ class _MyHomePageState extends State<MyHomePage> {
);
break;
case "Finance":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Financedashboard(),
settings: RouteSettings(arguments: 'Financedashboard'),
),
);
break;
case "Orders":
......@@ -494,6 +523,7 @@ class _MyHomePageState extends State<MyHomePage> {
MaterialPageRoute(
builder:
(context) => CrmdashboardScreen(),
settings: RouteSettings(name: 'CrmdashboardScreen')
),
);
default:
......
......@@ -344,7 +344,7 @@ class _LoginScreenState extends State<LoginScreen>
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
hintText: 'Enter Your Email',
hintText: 'Enter Your ID',
),
),
),
......@@ -477,8 +477,9 @@ class _LoginScreenState extends State<LoginScreen>
],
Container(
child: InkWell(
onTap: () {
onTap:loginProv.isLoading?null: () {
// LoginApiFunction();
loginProv.isLoading = true;
loginProv.LoginApiFunction(
context,
email.text,
......@@ -510,7 +511,9 @@ class _LoginScreenState extends State<LoginScreen>
),
),
child: Center(
child: Text(
child:loginProv.isLoading?CircularProgressIndicator.adaptive(
padding: EdgeInsets.all(5),
valueColor: AlwaysStoppedAnimation(Colors.white),): Text(
"Login",
textAlign: TextAlign.center,
style: TextStyle(
......@@ -639,7 +642,9 @@ class _LoginScreenState extends State<LoginScreen>
),
child: InkWell(
onTap: () {
Share.share("${loginProv.deviceId}");
// Share.share("${loginProv.deviceId}");
Share.share("Your device ID is: ${loginProv.deviceId}");
},
child: SvgPicture.asset(
"assets/svg/share_ic.svg",
......
......@@ -86,7 +86,7 @@ class _WebERPIOSState extends State<WebERPIOS> {
return true; // Allow default back button behavior
},
child: Scaffold(
appBar: appbar(context, "Web ERP"),
appBar: appbar(context, "ERP"),
body: SafeArea(
child: Container(
child: Column(
......
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/services.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
......@@ -18,6 +19,8 @@ import 'dart:math';
import 'package:flutter/widgets.dart';
import 'package:url_launcher/url_launcher.dart';
import '../services/api_calling.dart';
// const MAX_PROGRESS = 100;
Future runErpScreenApp() async {
......@@ -29,6 +32,7 @@ Future runErpScreenApp() async {
class WebErpScreen extends StatefulWidget {
final String erp_url;
const WebErpScreen({super.key, required this.erp_url});
@override
......@@ -53,6 +57,7 @@ class _WebErpScreenState extends State<WebErpScreen> {
final GlobalKey webViewKey = GlobalKey();
var dl = DownloadManager();
@override
void initState() {
// loadData();
......@@ -116,7 +121,7 @@ class _WebErpScreenState extends State<WebErpScreen> {
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Web ERP"),
appBar: appbar(context, "ERP"),
body: SafeArea(
child: Container(
child: Column(
......@@ -148,13 +153,16 @@ class _WebErpScreenState extends State<WebErpScreen> {
allowContentAccess: true,
geolocationEnabled: true,
allowFileAccess: true,
databaseEnabled: true, // Enables the WebView database
domStorageEnabled: true, // Enables DOM storage
builtInZoomControls:
true, // Enables the built-in zoom controls
displayZoomControls:
false, // Disables displaying zoom controls
safeBrowsingEnabled: true, // Enables Safe Browsing
databaseEnabled: true,
// Enables the WebView database
domStorageEnabled: true,
// Enables DOM storage
builtInZoomControls: true,
// Enables the built-in zoom controls
displayZoomControls: false,
// Disables displaying zoom controls
safeBrowsingEnabled: true,
// Enables Safe Browsing
clearSessionCache: true,
loadsImagesAutomatically: true,
thirdPartyCookiesEnabled: true,
......@@ -162,9 +170,8 @@ class _WebErpScreenState extends State<WebErpScreen> {
supportMultipleWindows: true,
blockNetworkLoads: false,
networkAvailable: true,
useShouldInterceptRequest:true,
hardwareAcceleration: true
useShouldInterceptRequest: true,
hardwareAcceleration: true,
// Enable camera access
),
......@@ -199,9 +206,22 @@ class _WebErpScreenState extends State<WebErpScreen> {
);
},
keepAlive: InAppWebViewKeepAlive(),
onWebViewCreated: (controller) {
_webViewController = controller;
_controller.complete(controller);
// _webViewController!.addJavaScriptHandler(
// handlerName: 'downloadBlobHandler',
// callback: (args) async {
// String base64Data = args[0];
// String mimeType = args[1];
// String filename = args[2];
//
// // Save the file
// await saveBase64File(base64Data, filename, mimeType);
// },
// );
_webViewController!.addJavaScriptHandler(
handlerName: 'MobileAppJavascriptInterface',
callback: (args) {
......@@ -221,6 +241,7 @@ class _WebErpScreenState extends State<WebErpScreen> {
'',
'application/octet-stream',
'',
// controller,context
);
}
},
......@@ -257,26 +278,36 @@ class _WebErpScreenState extends State<WebErpScreen> {
geolocationEnabled: true,
useOnDownloadStart: true,
allowsLinkPreview: true,
databaseEnabled: true, // Enables the WebView database
databaseEnabled: true,
// Enables the WebView database
clearSessionCache: true,
mediaType: "image/*,application/pdf",
useShouldInterceptRequest:true,
hardwareAcceleration: true
useShouldInterceptRequest: true,
hardwareAcceleration: true,
),
shouldInterceptRequest: (controller, request) async {
final url = request.url.toString();
print('Intercepting request: $url, Headers: ${request.headers}');
print(
'Intercepting request: $url, Headers: ${request.headers}',
);
if (url.endsWith('.pdf')) {
final response = await http.get(Uri.parse(url), headers: {
'Accept': 'application/pdf',
});
if (response.statusCode == 200 && response.headers['content-type']?.contains('application/pdf') == true) {
final response = await http.get(
Uri.parse(url),
headers: {'Accept': 'application/pdf'},
);
if (response.statusCode == 200 &&
response.headers['content-type']?.contains(
'application/pdf',
) ==
true) {
return WebResourceResponse(
contentType: 'application/pdf',
data: response.bodyBytes,
);
} else {
print('Failed to load PDF: Status ${response.statusCode}, Content-Type: ${response.headers['content-type']}');
print(
'Failed to load PDF: Status ${response.statusCode}, Content-Type: ${response.headers['content-type']}',
);
}
}
return null;
......@@ -289,11 +320,19 @@ class _WebErpScreenState extends State<WebErpScreen> {
print("urib scgefes");
print(uri);
print(uri.scheme);
if (uri.toString().contains('file_viewer_n ame.php') && uri.toString().contains('.pdf')) {
final pdfPath = Uri.parse(uri.toString()).queryParameters['file_path'];
if (uri.toString().contains(
'file_viewer_n ame.php',
) &&
uri.toString().contains('.pdf')) {
final pdfPath =
Uri.parse(
uri.toString(),
).queryParameters['file_path'];
if (pdfPath != null) {
final pdfUrl = 'https://erp.gengroup.in/$pdfPath';
await controller.loadUrl(urlRequest: URLRequest(url: WebUri(pdfUrl)));
await controller.loadUrl(
urlRequest: URLRequest(url: WebUri(pdfUrl)),
);
return NavigationActionPolicy.CANCEL;
}
}
......@@ -330,12 +369,14 @@ class _WebErpScreenState extends State<WebErpScreen> {
},
onLoadStop: (controller, url) async {
if (url.toString().contains('file_viewer_name.php') && url.toString().contains('.pdf')) {
if (url.toString().contains('file_viewer_name.php') &&
url.toString().contains('.pdf')) {
final uri = Uri.parse(url.toString());
final pdfPath = uri.queryParameters['file_path'];
if (pdfPath != null) {
final pdfUrl = 'https://erp.gengroup.in/$pdfPath';
await controller.evaluateJavascript(source: '''
await controller.evaluateJavascript(
source: '''
var pdfjsLib = window.pdfjsLib || document.createElement('script');
pdfjsLib.src = 'https://mozilla.github.io/pdf.js/build/pdf.js';
document.head.appendChild(pdfjsLib);
......@@ -357,7 +398,8 @@ class _WebErpScreenState extends State<WebErpScreen> {
console.error('PDF.js error: ' + error);
});
};
''');
''',
);
}
}
pullToRefreshController?.endRefreshing();
......@@ -390,21 +432,33 @@ class _WebErpScreenState extends State<WebErpScreen> {
// .then((data) => {debugPrint(data)});
//
// },
onDownloadStartRequest: (
controller,
downloadStartRequest,
) async {
// String url = downloadStartRequest.url.toString();
//
// // Use url_launcher or another plugin to handle the download externally
// if (await canLaunchUrl(Uri.parse(url))) {
// await launchUrl(
// Uri.parse(url),
// mode: LaunchMode.externalApplication,
// );
// } else {
// print("Could not launch $url");
// }
if (Platform.isAndroid) {
await _handleDownload(
downloadStartRequest.url.toString(),
downloadStartRequest.suggestedFilename!,
downloadStartRequest.mimeType ??
'application/octet-stream',
downloadStartRequest.mimeType!,
downloadStartRequest.suggestedFilename ?? '',
// controller,context
);
}
},
),
if (isLoading) ...[
Container(
......@@ -449,13 +503,150 @@ class _WebErpScreenState extends State<WebErpScreen> {
),
);
}
// Future<void> saveBase64File(String base64Data, String filename, String mimeType) async {
// // Ask for permission
// if (await Permission.storage.request().isGranted) {
// final bytes = base64.decode(base64Data.split(',').last);
// final directory = await getExternalStorageDirectory(); // or getApplicationDocumentsDirectory()
// final path = "${directory!.path}/$filename";
// final file = File(path);
//
// await file.writeAsBytes(bytes);
// print("File saved to: $path");
// } else {
// print("Storage permission denied.");
// }
// }
// Future<void> _handleDownload(
// String url,
// String contentDisposition,
// String mimeType,
// String suggestedFilename,
// InAppWebViewController controller,
// BuildContext context, // Add context for toast
// ) async {
// print("URL: $url");
// print("MimeType: $mimeType");
// print("SuggestedFilename: $suggestedFilename");
// print("ContentDisposition: $contentDisposition");
//
// if (Platform.isAndroid) {
// if (await Permission.notification.request().isGranted) {
// try {
// final userAgent = 'Flutter InAppWebView';
// if (url.startsWith('blob:')) {
// print("Attempting to convert blob URL...");
// final blobContent = await _convertBlobToDataUrl(url, controller);
// if (blobContent != null) {
// print("Blob converted to data URL: ${blobContent.substring(0, 50)}..."); // Log first 50 chars
// await platform.invokeMethod('startDownload', {
// 'url': blobContent,
// 'userAgent': userAgent,
// 'contentDisposition': contentDisposition,
// 'mimeType': mimeType,
// 'suggestedFilename': suggestedFilename,
// 'isBase64': true,
// });
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text("Download started: $suggestedFilename")),
// );
// } else {
// print("Failed to convert blob URL");
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text("Failed to resolve blob URL")),
// );
// }
// } else {
// print("Handling non-blob URL");
// await platform.invokeMethod('startDownload', {
// 'url': url,
// 'userAgent': userAgent,
// 'contentDisposition': contentDisposition,
// 'mimeType': mimeType,
// 'suggestedFilename': suggestedFilename,
// 'isBase64': false,
// });
// }
// } catch (e, stackTrace) {
// print("Download Error: $e");
// print("StackTrace: $stackTrace");
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text("Download failed: $e")),
// );
// }
// } else {
// print("Notification Permission Denied");
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text("Notification Permission Denied")),
// );
// }
// } else if (Platform.isIOS) {
// _handleIOSDownload(url, suggestedFilename);
// }
// }
//
// Future<String?> _convertBlobToDataUrl(String blobUrl, InAppWebViewController controller) async {
// try {
// final result = await controller.evaluateJavascript(
// source: """
// (async function() {
// try {
// const response = await fetch('$blobUrl');
// if (!response.ok) {
// console.error('Fetch failed with status: ' + response.status);
// return null;
// }
// const blob = await response.blob();
// return new Promise((resolve) => {
// const reader = new FileReader();
// reader.onloadend = () => resolve(reader.result);
// reader.onerror = () => resolve(null);
// reader.readAsDataURL(blob);
// });
// } catch (e) {
// console.error('Blob conversion error: ' + e.message);
// return null;
// }
// })();
// """,
// );
// if (result != null && result.toString().startsWith('data:')) {
// print("Blob conversion successful, data URL length: ${result.toString().length}");
// return result.toString();
// } else {
// print("Blob conversion failed, result: $result");
// return null;
// }
// } catch (e, stackTrace) {
// print("Blob conversion error: $e");
// print("StackTrace: $stackTrace");
// return null;
// }
// }
void handleBlobDownload(String blobUrl, String filename) async {
final js = """
(async function() {
const blobUrl = "$blobUrl";
const response = await fetch(blobUrl);
const blob = await response.blob();
const reader = new FileReader();
reader.onloadend = function() {
window.flutter_inappwebview.callHandler('downloadBlobHandler', reader.result, blob.type, "$filename");
};
reader.readAsDataURL(blob);
})();
""";
_webViewController?.evaluateJavascript(source: js);
}
Future<void> _handleDownload(
String url,
String contentDisposition,
String mimeType,
String suggestedFilename,
) async {
print("mimeType4: $mimeType");
print("mimeType4: $suggestedFilename");
// Request notification permission for Android 13+
if (Platform.isIOS) {
_handleIOSDownload(url, suggestedFilename);
......
import 'package:auto_size_text/auto_size_text.dart';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
......@@ -54,7 +55,46 @@ class _AccountledgerState extends State<Accountledger> {
totalDebit += debit;
}
overallBalance = totalDebit - totalCredit;
var headings = [
"Name",
"Address",
"Account Holder Name",
"Account Number",
];
var headings2 = [
"Bank Name",
"Bank Branch Name",
"Bank IFSC Code",
"Bank UPI ID",
"State",
"District",
"Sub Locality"
];
var values = [
provider.acDetails.name,
provider.acDetails.address,
provider.acDetails.bankAccountHolderName,
provider.acDetails.bankAccountNumber,
];
var values2 = [
provider.acDetails.bankName,
provider.acDetails.bankBranchName,
provider.acDetails.bankIfscCode,
provider.acDetails.bankUpiId,
provider.acDetails.state,
provider.acDetails.district,
provider.acDetails.subLocality,
];
var totalHeadings = [...headings];
var totalValues = [...values];
if (provider.showMoreDetails) {
totalHeadings = [...headings, ...headings2];
totalValues = [...values, ...values2];
}
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
......@@ -76,7 +116,7 @@ class _AccountledgerState extends State<Accountledger> {
children: [
SvgPicture.asset("assets/svg/fin_ic.svg",height: 12,),
SizedBox(width: 5,),
Text("${overallBalance.toString()}"??"-",style: TextStyle(
Text("${provider.balanceDetails.balance.toString()}"??"-",style: TextStyle(
fontSize: 12,
),)
],
......@@ -85,11 +125,13 @@ class _AccountledgerState extends State<Accountledger> {
Container(
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
child: InkResponse(
child: GestureDetector(
onTap: () {
print("Tapped");
_showFilterSheet(context);
},
child: SvgPicture.asset("assets/svg/filter_ic.svg", height: 25),
child: SvgPicture.asset("assets/svg/search_ic.svg", height: 25),
),
),
],
......@@ -105,6 +147,14 @@ class _AccountledgerState extends State<Accountledger> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text("${provider.selectedAcVal??""}" +" "+ "Account Ledger List"),
),
if(provider.ledgerList.isEmpty)...[
Emptywidget(context),
]else...[
Container(
decoration: BoxDecoration(
color: Colors.white,
......@@ -129,20 +179,17 @@ class _AccountledgerState extends State<Accountledger> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RichText(
text: TextSpan(
children: [
TextSpan(
text: "₹${totalCredit}",
AutoSizeText(
"${provider.balanceDetails.totalCredit}",
style: TextStyle(
color: Color(0xFFED3424),
fontFamily: "JakartaRegular",
fontSize: 25,
),
),
],
fontSize: 20,
),
minFontSize: 20,
maxFontSize: 25,
),
Text(
"credit",
style: TextStyle(color: Color(0xFF818181)),
......@@ -168,19 +215,15 @@ class _AccountledgerState extends State<Accountledger> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RichText(
text: TextSpan(
children: [
TextSpan(
text: "₹${totalDebit}",
AutoSizeText(
"${provider.balanceDetails.totalDebit}",
style: TextStyle(
color: Color(0xFFED3424),
fontFamily: "JakartaRegular",
fontSize: 25,
),
),
],
fontSize: 20,
),
minFontSize: 20,
maxFontSize: 25,
),
Text(
"debit",
......@@ -193,13 +236,100 @@ class _AccountledgerState extends State<Accountledger> {
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text("${provider.selectedAcVal??""}" +" "+ "Account Ledger List"),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
child: Text(
"Account Details",
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: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
...List.generate(totalHeadings.length, (index) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Text(
"${totalHeadings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
Expanded(
child: Text(
"${totalValues[index]}",
style: TextStyle(
color: Color(0xFF818181),
),
),
),
],
),
);
}),
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?"- Show Less": "+ More Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
],
),
),
if(provider.ledgerList.isEmpty)...[
Emptywidget(context),
]else...[
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
......@@ -352,30 +482,30 @@ class _AccountledgerState extends State<Accountledger> {
thickness: 0.5,
color: Color(0xFFd7d7d7),
),
Row(
children: [
Expanded(
child: Text(
"Balance",
style: TextStyle(
fontSize: 13,
color: Color(0xFF2d2d2d),
),
),
),
Expanded(
child: Text(
textAlign: TextAlign.right,
"₹${running_balance.toString()}" ??
"-",
style: TextStyle(
color: Color(0xFF818181),
fontSize: 13,
),
),
),
],
),
// Row(
// children: [
// Expanded(
// child: Text(
// "Balance",
// style: TextStyle(
// fontSize: 13,
// color: Color(0xFF2d2d2d),
// ),
// ),
// ),
// Expanded(
// child: Text(
// textAlign: TextAlign.right,
// "₹${running_balance.toString()}" ??
// "-",
// style: TextStyle(
// color: Color(0xFF818181),
// fontSize: 13,
// ),
// ),
// ),
// ],
// ),
InkResponse(
onTap: () async {
Navigator.push(
......@@ -457,6 +587,7 @@ class _AccountledgerState extends State<Accountledger> {
child: Consumer<Accountledgerprovider>(
builder: (context, provider, child) {
return Container(
height: MediaQuery.of(context).size.height*0.35,
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
......@@ -532,8 +663,9 @@ class _AccountledgerState extends State<Accountledger> {
provider.selectedAcId
.toString(),
);
Navigator.pop(context);
provider.ledgerlistAPI(context);
Navigator.pop(context);
}
}
},
......
......@@ -335,6 +335,7 @@ class _AccountslistState extends State<Accountslist> {
context,
provider.companyNameController,
"Company Name",
"Enter Company Name",
(p0) {},
TextInputType.text,
false,
......@@ -347,6 +348,7 @@ class _AccountslistState extends State<Accountslist> {
context,
provider.mobileNumberController,
"Mobile Number",
"Enter Mobile Number",
(p0) {},
TextInputType.number,
false,
......
......@@ -11,7 +11,7 @@ import '../../Models/commonModels/commonAccountdetailsResponse.dart';
class Accountslistdetails extends StatefulWidget {
final accountID;
const Accountslistdetails({super.key, this.accountID});
const Accountslistdetails({super.key,required this.accountID});
@override
State<Accountslistdetails> createState() => _AccountslistdetailsState();
......@@ -244,7 +244,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
SizedBox(width: 15),
Expanded(
child: Text(
subHeadings[j] ?? "-",
subHeadings[j]==""?"-": subHeadings[j] ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
......
......@@ -14,7 +14,8 @@ import 'package:generp/Models/commonModels/SubLocationsResponse.dart';
import '../../Models/commonModels/commonAddAccountsViewResponse.dart';
class Addcommonpayment extends StatefulWidget {
const Addcommonpayment({super.key});
final from;
const Addcommonpayment({super.key,required this.from});
@override
State<Addcommonpayment> createState() => _AddcommonpaymentState();
......@@ -158,6 +159,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
textControllerWidget(
context,
provider.nameController,
"Name",
"Enter Name",
(p0) {
provider.updateName(p0);
......@@ -178,6 +180,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
textControllerWidget(
context,
provider.mobileController,
"Mobile Number",
"Enter Mobile",
(p0) {
provider.updateMobile(p0);
......@@ -196,7 +199,22 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
10,
),
errorWidget(context, provider.mobileError),
textControllerWidget(
context,
provider.contactPersonController,
"Contact Person Name",
"Enter Contact Person Name",
provider.updateContactPerson,
TextInputType.text,
false,
null,
focusNodes[12],
focusNodes[13],TextInputAction.next
),
errorWidget(
context,
provider.contactPersonError,
),
],
),
),
......@@ -239,6 +257,24 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
visible: provider.isVisible,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text("State"),
DropdownButtonHideUnderline(
......@@ -593,6 +629,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
textControllerWidget(
context,
provider.addressController,
"Address",
"Enter Address",
provider.updateAddress,
TextInputType.text,
......@@ -604,23 +641,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
),
errorWidget(context, provider.addressError),
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"Bank Details",
style: TextStyle(
......@@ -633,6 +653,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.bankNameController,
"Bank Name",
"Enter Bank Name",
provider.updateBankName,
TextInputType.text,
false,
......@@ -649,6 +670,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.branchNameController,
"Bank Branch",
"Enter Bank Branch",
provider.updateBankBranch,
TextInputType.text,
false,
......@@ -663,6 +685,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.bankIfscCotroller,
"Bank IFSC",
"Enter Bank IFSC",
provider.updateIFSC,
TextInputType.text,
false,
......@@ -678,6 +701,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.bankHolderNameController,
"Bank Holder Name",
"Enter Bank Holder Name",
provider.updateHolder,
TextInputType.text,
false,
......@@ -693,6 +717,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.bankAcNumberController,
"Bank Account Number",
"Enter Bank Account Number",
provider.updateNumber,
TextInputType.number,
false,
......@@ -708,6 +733,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.bankUpiController,
"Bank UPI ID",
"Enter Bank UPI ID",
provider.updateUPI,
TextInputType.text,
false,
......@@ -745,26 +771,13 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
fontFamily: "JakartaMedium",
),
),
textControllerWidget(
context,
provider.contactPersonController,
"Contact Person Name",
provider.updateContactPerson,
TextInputType.text,
false,
null,
focusNodes[12],
focusNodes[13],TextInputAction.next
),
errorWidget(
context,
provider.contactPersonError,
),
textControllerWidget(
context,
provider
.contectPersonDesignationController,
"Contact Person Designation",
"Enter Contact Person Designation",
provider.updateDesignation,
TextInputType.text,
false,
......@@ -780,6 +793,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.contectPersonAltMobController,
"Alternative Mobile Number",
"Enter Alternative Mobile Number",
(p0) {
provider.updateAltMobile(p0);
provider.checkInputsAPI(
......@@ -805,6 +819,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.contectPersonTeleController,
"Telephone Number",
"Enter Telephone Number",
provider.updateTeleMobile,
TextInputType.number,
false,
......@@ -817,6 +832,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
context,
provider.contectPersonMailController,
"Customer Mail ID",
"Enter Customer Mail ID",
provider.updateMail,
TextInputType.text,
false,
......@@ -845,7 +861,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
? null
: () {
provider.submitClickced = true;
provider.submitCommonAccountsAPI(context);
provider.submitCommonAccountsAPI(context,widget.from);
},
child: Container(
height: 45,
......
......@@ -96,7 +96,7 @@ class _CommondashboardState extends State<Commondashboard> {
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Addcommonpayment()),
MaterialPageRoute(builder: (context) => Addcommonpayment(from: "Dashboard",)),
);
},
child: Container(
......
......@@ -36,7 +36,7 @@ Dropdowntheme ddtheme = Dropdowntheme();
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Appointment Details"),
// TextWidget(context, "Appointment Details"),
ListView.builder(
itemCount: quotationDetails.length,
shrinkWrap: true,
......@@ -304,6 +304,7 @@ Dropdowntheme ddtheme = Dropdowntheme();
textControllerWidget(
context,
provider.noteController,
"Note",
"Enter Note",
provider.onChangeNote,
TextInputType.text,
......
......@@ -31,7 +31,7 @@ class _FollowUpDetailsState extends State<FollowUpDetails> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Followup Details"),
// TextWidget(context, "Followup Details"),
ListView.builder(
itemCount: followupDetails.length,
shrinkWrap: true,
......@@ -53,23 +53,17 @@ class _FollowUpDetailsState extends State<FollowUpDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(7, (j) {
...List.generate(4, (j) {
final textheads = [
"Employee Name",
"Date",
"Date and Time",
"Type",
"In Time",
"Out Time",
"Status",
"Feedback",
];
final textSubheads = [
followupDetails[index].ename ?? "-",
followupDetails[index].fdate ?? "-",
"${followupDetails[index].fdate ?? "-"}, ${followupDetails[index].finTime ?? "-"}",
followupDetails[index].ftype ?? "-",
followupDetails[index].finTime ?? "-",
followupDetails[index].foutTime ?? "-",
followupDetails[index].fstatus ?? "-",
followupDetails[index].ffeedback ?? "-",
];
return Container(
......@@ -114,33 +108,7 @@ class _FollowUpDetailsState extends State<FollowUpDetails> {
),
),
),
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
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(14.0),
),
child: Center(
child: Text(
"Followup Details",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontFamily: "JakartaMedium",
),
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
);
},
......
......@@ -49,6 +49,55 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
builder: (context, provider, child) {
var leadDetails = provider.leadDetails;
var headings1 = [
"Account Manager Name",
"Account Created By",
"Address",
"Lead Status",
];
var subHeadings1 = [
provider.accountDetails!.accManager??"-",
provider.accountDetails!.owner??"-",
provider.leadDetails!.address??"-",
provider.leadDetails!.status??"-",
];
var headings2 = [
"State",
"District",
"Sub Locality",
"Source",
"Reference",
"Team",
"Segment",
"Lead Age",
];
var subHeadings2 = [
provider.accountDetails!.state??"-",
provider.accountDetails!.district??"-",
provider.accountDetails!.subLocality??"-",
provider.accountDetails!.source??"-",
provider.accountDetails!.reference??"-",
provider.accountDetails!.team??"-",
provider.accountDetails!.segment??"-",
"${provider.leadDetails!.lage??"-"} days",
];
var totalHeadings = [...headings1];
var totalSubHeadings = [...subHeadings1];
if(provider.showMoreDetails){
totalHeadings = [...headings1,...headings2];
totalSubHeadings = [...subHeadings1,...subHeadings2];
}
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
......@@ -145,7 +194,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(provider.subHeadings.length, (j) {
...List.generate(totalSubHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
......@@ -153,7 +202,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
children: [
Expanded(
child: Text(
provider.Headings[j],
totalHeadings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
......@@ -164,16 +213,16 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
Expanded(
child: InkResponse(
child:
provider.Headings[j] == "Lead Age"
totalHeadings[j] == "Lead Age"
? Tooltip(
triggerMode: TooltipTriggerMode.tap,
message:
"${provider.leadDetails.createdDatetime}",
child: Text(
provider.subHeadings[j] == ""
totalSubHeadings[j] == ""
? "-"
: provider.subHeadings[j],
: totalSubHeadings[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
......@@ -185,9 +234,9 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
)
: Text(
provider.subHeadings[j] == ""
totalSubHeadings[j] == ""
? "-"
: provider.subHeadings[j],
: totalSubHeadings[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
......@@ -199,6 +248,33 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
);
}),
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?"- Show Less": "+ More Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
],
),
),
......@@ -229,21 +305,6 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
return SafeArea(
child: Consumer<crmLeadDetailsProvider>(
builder: (context, provider, child) {
return Container(
margin: EdgeInsets.only(
bottom: 15,
left: 15,
right: 15,
top: 10,
),padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 15),
...List.generate(5, (index) {
final assetnames = [
"crm_appoint_details",
"crm_cont_details",
......@@ -251,6 +312,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
"crm_prod_details",
"crm_quotation_details",
];
final Headingnames = [
"Product Details",
"Contact Details",
......@@ -258,6 +320,23 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
"Appointment Details",
"Quotation Details",
];
return Container(
margin: EdgeInsets.only(
bottom: 15,
left: 15,
right: 15,
top: 10,
),padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 15),
...List.generate(assetnames.length, (index) {
return ListTile(
onTap: () {
switch (index) {
......@@ -309,6 +388,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
builder:
(context) => QuotationDetails(
leadID: provider.leadDetails.id,
mode: widget.mode,
),
),
);
......@@ -328,6 +408,8 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
);
}),
],
),
),
......
......@@ -19,8 +19,14 @@ import '../commonDateRangeFilter.dart';
class Leadlistbymode extends StatefulWidget {
final pageTitleName;
final mode;
final filter;
const Leadlistbymode({super.key, this.pageTitleName, this.mode});
const Leadlistbymode({
super.key,
required this.pageTitleName,
required this.mode,
this.filter,
});
@override
State<Leadlistbymode> createState() => _LeadlistbymodeState();
......@@ -28,6 +34,7 @@ class Leadlistbymode extends StatefulWidget {
class _LeadlistbymodeState extends State<Leadlistbymode> {
Dropdowntheme ddtheme = Dropdowntheme();
@override
void initState() {
// TODO: implement initState
......@@ -35,6 +42,22 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<Leadlistprovider>(context, listen: false);
provider.crmLeadListViewAPIFunction(context, widget.mode);
if (widget.filter != null) {
provider.crmLeadListAPIFunction(
context,
widget.mode,
"",
widget.filter!.status,
widget.filter!.openStatus,
"",
"",
"",
"",
"",
"",
"",
);
} else {
provider.crmLeadListAPIFunction(
context,
widget.mode,
......@@ -49,13 +72,12 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
"",
"",
);
}
});
}
@override
Widget build(BuildContext context) {
return Consumer<Leadlistprovider>(
builder: (context, provider, child) {
final crmLists = provider.crmLeadList;
......@@ -228,7 +250,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
),
Expanded(
child: Text(
subHeadings[j]??"-",
subHeadings[j] ?? "-",
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
......@@ -245,13 +267,14 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
context,
MaterialPageRoute(
builder:
(context) =>
LeadDetailsByMode(
(context) => LeadDetailsByMode(
pageTitleName:
widget
.pageTitleName,
widget.pageTitleName,
mode: widget.mode,
leadId:provider.crmLeadList[index].leadid,
leadId:
provider
.crmLeadList[index]
.leadid,
),
),
);
......@@ -289,8 +312,8 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
),
),
)
:
Emptywidget(context),)
: Emptywidget(context),
),
),
);
},
......@@ -319,7 +342,9 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
right: 15,
top: 10,
),
padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -343,12 +368,13 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
context,
provider.sLeadIDController,
"Lead ID",
"Enter Lead ID",
provider.onChangedLeadId,
TextInputType.text,
false,
null,
),
if(widget.mode!="executive")...[
if (widget.mode != "executive") ...[
TextWidget(context, "Employee"),
DropdownButtonHideUnderline(
child: Row(
......@@ -374,33 +400,46 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
),
)
.toList(),
value:provider.employeesList.contains(provider.selectedEmployees)
value:
provider.employeesList.contains(
provider.selectedEmployees,
)
? provider.selectedEmployees
: null,
// value: provider.selectedEmployees,
onChanged: (Employees? value) {
if (value != null) {
if(provider.employeesList.isNotEmpty){
if (provider
.employeesList
.isNotEmpty) {
provider.selectedEmployees = value;
provider.selectedEmployeeId = value!.id!;
provider.selectedEmployeeValue = value!.name!;
provider.crmLeadListSourceOnReferenceAPIFunction(context, widget.mode, provider.selectedSourceId);
provider.selectedEmployeeId =
value!.id!;
provider.selectedEmployeeValue =
value!.name!;
provider
.crmLeadListSourceOnReferenceAPIFunction(
context,
widget.mode,
provider.selectedSourceId,
);
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
),
),
],
],
TextWidget(context, "Lead Status"),
DropdownButtonHideUnderline(
child: Row(
......@@ -435,8 +474,10 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -477,8 +518,10 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -488,6 +531,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
context,
provider.mobileNumberController,
"Mobile Number",
"Enter Mobile Number",
provider.onChangedMobileNum,
TextInputType.number,
false,
......@@ -497,6 +541,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
context,
provider.companyNameController,
"Company Name",
"Enter Company Name",
provider.onChangedCompanyName,
TextInputType.text,
false,
......@@ -531,20 +576,28 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
value: provider.selectedSources,
onChanged: (Sources? value) {
if (value != null) {
if(provider.sourcesList.isNotEmpty){
if (provider.sourcesList.isNotEmpty) {
provider.selectedSources = value;
provider.selectedSourceId = value!.id!;
provider.selectedSourceValue = value!.name!;
provider.crmLeadListSourceOnReferenceAPIFunction(context, widget.mode, provider.selectedSourceId);
provider.selectedSourceId =
value!.id!;
provider.selectedSourceValue =
value!.name!;
provider
.crmLeadListSourceOnReferenceAPIFunction(
context,
widget.mode,
provider.selectedSourceId,
);
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -579,19 +632,24 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
value: provider.selectedReferences,
onChanged: (References? value) {
if (value != null) {
if(provider.referencesList.isNotEmpty){
if (provider
.referencesList
.isNotEmpty) {
provider.selectedReferences = value;
provider.selectedReferenceId = value!.id!;
provider.selectedReferenceValue = value!.name!;
provider.selectedReferenceId =
value!.id!;
provider.selectedReferenceValue =
value!.name!;
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -626,20 +684,27 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
value: provider.selectedTeams,
onChanged: (Teams? value) {
if (value != null) {
if(provider.teamsList.isNotEmpty){
if (provider.teamsList.isNotEmpty) {
provider.selectedTeams = value;
provider.selectedTeamId = value!.id!;
provider.selectedTeamValue = value!.name!;
provider.crmLeadListSegmentOnTeamAPIFunction(context, widget.mode, provider.selectedTeamId);
provider.selectedTeamValue =
value!.name!;
provider
.crmLeadListSegmentOnTeamAPIFunction(
context,
widget.mode,
provider.selectedTeamId,
);
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -674,19 +739,22 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
value: provider.selectedSegments,
onChanged: (Segments? value) {
if (value != null) {
if(provider.segmentsList.isNotEmpty){
if (provider.segmentsList.isNotEmpty) {
provider.selectedSegments = value;
provider.selectedSegmentId = value!.id!;
provider.selectedSegmentValue = value!.name!;
provider.selectedSegmentId =
value!.id!;
provider.selectedSegmentValue =
value!.name!;
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -721,26 +789,35 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
value: provider.selectedStates,
onChanged: (States? value) {
if (value != null) {
if(provider.statesList.isNotEmpty){
if (provider.statesList.isNotEmpty) {
provider.selectedStates = value;
provider.selectedStateId = value!.id!;
provider.selectedStateValue = value!.name!;
if (provider.districtsList.isNotEmpty) {
provider.selectedStateValue =
value!.name!;
if (provider
.districtsList
.isNotEmpty) {
provider.districtsList.clear();
provider.selectedDistricts = null;
provider.selectedDistrictId = null;
provider.selectedDistrictValue = "";
}
provider.crmLeadListDistrictsOnStateAPIFunction(context, widget.mode, provider.selectedStateId);
provider
.crmLeadListDistrictsOnStateAPIFunction(
context,
widget.mode,
provider.selectedStateId,
);
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -775,29 +852,39 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
value: provider.selectedDistricts,
onChanged: (Districts? value) {
if (value != null) {
if(provider.districtsList.isNotEmpty){
if (provider.districtsList.isNotEmpty) {
provider.selectedDistricts = value;
provider.selectedDistrictId = value!.id!;
provider.selectedDistrictValue = value!.district!;
provider.selectedDistrictId =
value!.id!;
provider.selectedDistrictValue =
value!.district!;
if (provider
.subLocationsList
.isNotEmpty) {
provider.subLocationsList.clear();
provider.selectedSubLocations =
null;
provider.selectedSubLocationId = null;
provider.selectedSubLocationValue = "";
provider.selectedSubLocationId =
null;
provider.selectedSubLocationValue =
"";
}
provider.crmLeadListSubLocOnDistrictAPIFunction(context, widget.mode, provider.selectedDistrictId);
provider
.crmLeadListSubLocOnDistrictAPIFunction(
context,
widget.mode,
provider.selectedDistrictId,
);
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -817,8 +904,9 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
items:
provider.subLocationsList
.map(
(slist) =>
DropdownMenuItem<SubLocations>(
(slist) => DropdownMenuItem<
SubLocations
>(
value: slist,
child: Text(
slist.subLocality!,
......@@ -832,19 +920,24 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
value: provider.selectedSubLocations,
onChanged: (SubLocations? value) {
if (value != null) {
if(provider.subLocationsList.isNotEmpty){
if (provider
.subLocationsList
.isNotEmpty) {
provider.selectedSubLocations = value;
provider.selectedSubLocationId = value!.id!;
provider.selectedSubLocationValue = value!.subLocality!;
provider.selectedSubLocationId =
value!.id!;
provider.selectedSubLocationValue =
value!.subLocality!;
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -853,16 +946,30 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
InkResponse(
onTap: () {
provider.crmLeadListAPIFunction(context, widget.mode, provider.selectedEmployeeId,
provider.selectedLeadStatus, provider.selectedOpenStatus, provider.selectedSourceId, provider.selectedReferenceId,
provider.selectedTeamId, provider.selectedSegmentId, provider.selectedStateId, provider.selectedDistrictId, provider.selectedSubLocationId);
provider.crmLeadListAPIFunction(
context,
widget.mode,
provider.selectedEmployeeId,
provider.selectedLeadStatus,
provider.selectedOpenStatus,
provider.selectedSourceId,
provider.selectedReferenceId,
provider.selectedTeamId,
provider.selectedSegmentId,
provider.selectedStateId,
provider.selectedDistrictId,
provider.selectedSubLocationId,
);
Navigator.pop(context);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
......@@ -876,7 +983,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
),
),
),
)
),
],
),
),
......
......@@ -114,7 +114,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
return StatefulBuilder(
builder: (context, setState) {
return SafeArea(
child: Consumer<Nearbygeneratorsprovider>(
child: Consumer<crmNearbyOpenLeadsProvider>(
builder: (context,provider,child) {
return Container(
margin: EdgeInsets.only(
......@@ -231,31 +231,31 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
onChanged: (value) {
provider.currentValue = value;
provider.debounce(() {
provider.LoadNearbyGeneratorsAPI(context);
provider.LoadNearbyOpenLeadsAPI(context);
}, Duration(milliseconds: 200));
},
),
Slider(
value: provider.currentValue,
max: 100,
divisions: 100,
label: provider.currentValue.toStringAsFixed(2),
inactiveColor: Color(0xFFD7D7D7),
activeColor: AppColors.cyan_blue,
onChanged: (value) {
provider.currentValue = value;
provider.debounce(() {
provider.LoadNearbyOpenLeadsAPI(context);
}, Duration(milliseconds: 200));
},
),
// Slider(
// value: provider.currentValue,
// max: 100,
// divisions: 100,
//
// label: provider.currentValue.toStringAsFixed(2),
// inactiveColor: Color(0xFFD7D7D7),
// activeColor: AppColors.cyan_blue,
// onChanged: (value) {
// provider.currentValue = value;
// provider.debounce(() {
// provider.LoadNearbyGeneratorsAPI(context);
// }, Duration(milliseconds: 200));
// },
// ),
SizedBox(height: 30.0),
Container(
child: InkWell(
onTap: () {
provider.debounce(() {
provider.LoadNearbyGeneratorsAPI(context);
provider.LoadNearbyOpenLeadsAPI(context);
Navigator.pop(context);
}, Duration(milliseconds: 500));
},
......
......@@ -634,6 +634,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
textControllerWidget(
context,
provider.editCompanyNameController,
"Company Name",
"Enter Company Name",
provider.onChangeCompanyName,
TextInputType.text,
......@@ -847,6 +848,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
context,
provider.pincodeController,
"Pincode",
"Enter Pincode",
provider.onChangePincode,
TextInputType.number,
false,
......@@ -856,6 +858,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
textControllerWidget(
context,
provider.addressController,
"Address",
"Enter Address",
provider.onChangeAddress,
TextInputType.text,
......
......@@ -405,6 +405,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
context,
provider.mobileNumberController,
"Mobile Number",
"Enter Mobile Number",
provider.onChangedMobileNum,
TextInputType.number,
false,
......@@ -414,6 +415,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
context,
provider.companyNameController,
"Company Name",
"Enter Company Name",
provider.onChangedCompanyName,
TextInputType.text,
false,
......
......@@ -7,7 +7,8 @@ import '../../Utils/commonWidgets.dart';
class QuotationDetails extends StatefulWidget {
final leadID;
const QuotationDetails({super.key,required this.leadID});
final mode;
const QuotationDetails({super.key,required this.leadID,required this.mode});
@override
State<QuotationDetails> createState() => _QuotationDetailsState();
......@@ -31,7 +32,7 @@ class _QuotationDetailsState extends State<QuotationDetails> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Quotation Details"),
// TextWidget(context, "Quotation Details"),
ListView.builder(
itemCount: quotationDetails.length,
shrinkWrap: true,
......@@ -112,8 +113,7 @@ class _QuotationDetailsState extends State<QuotationDetails> {
);
},
),
SizedBox(height: 75),
SizedBox(height: 150),
],
),
),
......@@ -122,8 +122,8 @@ class _QuotationDetailsState extends State<QuotationDetails> {
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () {
Navigator.push(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
......@@ -131,6 +131,9 @@ class _QuotationDetailsState extends State<QuotationDetails> {
Generatequotationscreen(leadId: widget.leadID),
),
);
if(res==true){
provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode);
}
},
child: Container(
alignment: Alignment.bottomCenter,
......
......@@ -256,6 +256,7 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
child: textControllerWidget(
context,
editProvider.editProductPriceControllers[j],
"Product Price",
"Enter Product Price",
(value) => editProvider.updateTotalAmount(j),
TextInputType.number,
......@@ -273,6 +274,7 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
child: textControllerWidget(
context,
editProvider.editQuantityControllers[j],
"Quantity",
"Enter Quantity",
(value) => editProvider.updateTotalAmount(j),
TextInputType.number,
......@@ -291,6 +293,7 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
context,
editProvider.editTotalAmountControllers[j],
"Total Amount",
"Enter Total Amount",
(_) {},
TextInputType.number,
true,
......
......@@ -33,7 +33,7 @@ class _ContactdetailsState extends State<Contactdetails> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Contact Details"),
// TextWidget(context, "Contact Details"),
ListView.builder(
itemCount: customerDetails.length,
shrinkWrap: true,
......@@ -262,6 +262,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.nameController,
"Name",
"Enter Name",
provider.onChangeName,
TextInputType.number,
......@@ -272,6 +273,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.designationController,
"Designation",
"Enter Designation",
provider.onChangeDesignation,
TextInputType.number,
......@@ -282,6 +284,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.mobileNumberController,
"Mobile Number",
"Enter Mobile Number",
provider.onChangeMobile,
TextInputType.number,
......@@ -292,6 +295,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.alternativeMobileController,
"Alternative Mobile Number",
"Enter Alternative Mobile Number",
provider.onChangeAltMobile,
TextInputType.number,
......@@ -302,6 +306,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.telephoneController,
"Telephone Number",
"Enter Telephone Number",
provider.onChangeTelephone,
TextInputType.number,
......@@ -312,7 +317,8 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.emailController,
"Enter EmailID",
"Email ID",
"Enter Email ID",
provider.onChangeEmailId,
TextInputType.number,
false,
......@@ -402,6 +408,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.editNameController,
"Name",
"Enter Name",
provider.onChangeEditName,
TextInputType.number,
......@@ -412,6 +419,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.editDesignationController,
"Designation",
"Enter Designation",
provider.onChangeEditDesignation,
TextInputType.number,
......@@ -422,6 +430,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.editMobileNumberController,
"Mobile Number",
"Enter Mobile Number",
provider.onChangeEditMobile,
TextInputType.number,
......@@ -433,6 +442,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.editAlternativeMobileController,
"Alternative Mobile Number",
"Enter Alternative Mobile Number",
provider.onChangeEditAltMobile,
TextInputType.number,
......@@ -443,6 +453,7 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.editTelephoneController,
"Telephone Number",
"Enter Telephone Number",
provider.onChangeEditTelephone,
TextInputType.number,
......@@ -454,7 +465,8 @@ class _ContactdetailsState extends State<Contactdetails> {
textControllerWidget(
context,
provider.editEmailController,
"Enter EmailID",
"Email ID",
"Enter Email ID",
provider.onChangeEditEmailId,
TextInputType.number,
false,
......
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