"lib/screens/old/prospectDetailsOld.dart" did not exist on "379460f61ffc95a8d89543ece92008927378d443"
Commit 7210793a authored by Sai Srinivas's avatar Sai Srinivas
Browse files

17-09

parent 185e0896
...@@ -1079,7 +1079,7 @@ class _VisitdetailsState extends State<Visitdetails> { ...@@ -1079,7 +1079,7 @@ class _VisitdetailsState extends State<Visitdetails> {
?.split(",") ?.split(",")
.toString(); .toString();
var uri = Uri.parse( var uri = Uri.parse(
"google.navigation:q=${loc![0]},${loc![1]}&mode=d", "google.navigation:q=${loc![0]},${loc[1]}&mode=d",
); );
if (await canLaunch(uri.toString())) { if (await canLaunch(uri.toString())) {
await launch(uri.toString()); await launch(uri.toString());
......
...@@ -41,7 +41,7 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> { ...@@ -41,7 +41,7 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> {
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
...@@ -51,20 +51,22 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> { ...@@ -51,20 +51,22 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> {
child: Column( child: Column(
children: [ children: [
Spacer(), Spacer(),
Container( SizedBox(
height: 250, height: 250,
child: QRView( child: QRView(
key: provider.scannerKey, key: provider.scannerKey,
onQRViewCreated: (p0) { onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, "pendingComplaints", context); provider.onQRViewCreated(
p0,
"pendingComplaints",
context,
);
}, },
formatsAllowed: [BarcodeFormat.qrcode], formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back, cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape( overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue, borderColor: AppColors.app_blue,
borderRadius: 20, borderRadius: 20,
borderLength: 60, borderLength: 60,
...@@ -156,7 +158,7 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> { ...@@ -156,7 +158,7 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> {
), ),
), ),
), ),
SizedBox(height: 5,), SizedBox(height: 5),
Container( Container(
height: 48, height: 48,
alignment: Alignment.center, alignment: Alignment.center,
...@@ -184,7 +186,8 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> { ...@@ -184,7 +186,8 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> {
controller: partIDcontroller, controller: partIDcontroller,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
focusNode: partIDfocusNode, focusNode: partIDfocusNode,
textCapitalization: TextCapitalization.characters, textCapitalization:
TextCapitalization.characters,
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
onChanged: (value) {}, onChanged: (value) {},
...@@ -206,7 +209,7 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> { ...@@ -206,7 +209,7 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> {
), ),
), ),
), ),
SizedBox(height: 15,), SizedBox(height: 15),
InkWell( InkWell(
onTap: () { onTap: () {
provider.LoadgeneratorComplaintHistoryApifunction( provider.LoadgeneratorComplaintHistoryApifunction(
...@@ -215,7 +218,6 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> { ...@@ -215,7 +218,6 @@ class _ScancomplaintdetailsState extends State<Scancomplaintdetails> {
"pendingComplaints", "pendingComplaints",
partIDcontroller.text, partIDcontroller.text,
); );
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
......
...@@ -216,7 +216,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -216,7 +216,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
]; ];
return InkResponse( return InkResponse(
onTap: () { onTap: () {
var route; StatefulWidget route;
switch (index) { switch (index) {
case 0: case 0:
route = Monthlycollection(); route = Monthlycollection();
...@@ -270,7 +270,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -270,7 +270,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
Padding( Padding(
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: Text( child: Text(
"${numbers[index].toString()}", numbers[index].toString(),
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
color: Color(textColorCodes[index]), color: Color(textColorCodes[index]),
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
...@@ -9,6 +8,7 @@ import 'package:provider/provider.dart'; ...@@ -9,6 +8,7 @@ import 'package:provider/provider.dart';
import '../Notifiers/splashVersionNotifier.dart'; import '../Notifiers/splashVersionNotifier.dart';
import '../Utils/commonServices.dart'; import '../Utils/commonServices.dart';
class Splash extends StatefulWidget { class Splash extends StatefulWidget {
const Splash({super.key}); const Splash({super.key});
...@@ -201,7 +201,6 @@ class Splash extends StatefulWidget { ...@@ -201,7 +201,6 @@ class Splash extends StatefulWidget {
// } // }
// } // }
class _SplashState extends State<Splash> { class _SplashState extends State<Splash> {
late Image splashImage; late Image splashImage;
Map _source = {ConnectivityResult.mobile: true}; Map _source = {ConnectivityResult.mobile: true};
...@@ -213,7 +212,6 @@ class _SplashState extends State<Splash> { ...@@ -213,7 +212,6 @@ class _SplashState extends State<Splash> {
super.initState(); super.initState();
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
splashImage = Image.asset("assets/images/ic_splash.jpg"); splashImage = Image.asset("assets/images/ic_splash.jpg");
...@@ -228,7 +226,7 @@ class _SplashState extends State<Splash> { ...@@ -228,7 +226,7 @@ class _SplashState extends State<Splash> {
if (connection == 'Online') { if (connection == 'Online') {
print("camer here"); print("camer here");
spalshProvider.handleVersionCheck(context); spalshProvider.handleVersionCheck(context);
}else{ } else {
spalshProvider.handleVersionCheck(context); spalshProvider.handleVersionCheck(context);
} }
}); });
......
...@@ -29,7 +29,7 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -29,7 +29,7 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
var earnings_filter = ""; var earnings_filter = "";
var earnings_filter_from_date = ""; var earnings_filter_from_date = "";
var earnings_filter_to_date = ""; var earnings_filter_to_date = "";
int _currentIndex = 0; final int _currentIndex = 0;
final List<String> Filteritems = [ final List<String> Filteritems = [
'Today', 'Today',
...@@ -76,8 +76,11 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -76,8 +76,11 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
case 'Past 7 days': case 'Past 7 days':
DateTime startOfPast7Days = now.subtract(Duration(days: 6)); DateTime startOfPast7Days = now.subtract(Duration(days: 6));
return DateTimeRange( return DateTimeRange(
start: DateTime(startOfPast7Days.year, startOfPast7Days.month, start: DateTime(
startOfPast7Days.day), startOfPast7Days.year,
startOfPast7Days.month,
startOfPast7Days.day,
),
end: DateTime(now.year, now.month, now.day), end: DateTime(now.year, now.month, now.day),
); );
case 'Custom': case 'Custom':
...@@ -87,7 +90,7 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -87,7 +90,7 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
} }
} }
// Function to show custom date range picker // Function to show custom date range picker
Future<DateTimeRange?> showCustomDateRangePicker(BuildContext context) async { Future<DateTimeRange?> showCustomDateRangePicker(BuildContext context) async {
return await showDateRangePicker( return await showDateRangePicker(
context: context, context: context,
...@@ -96,12 +99,12 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -96,12 +99,12 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
); );
} }
// Function to format date for display as YYYY-MM-DD // Function to format date for display as YYYY-MM-DD
String formatDate(DateTime date) { String formatDate(DateTime date) {
return "${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}"; return "${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}";
} }
// Example usage for displaying the selected date range // Example usage for displaying the selected date range
String getFormattedDateRange() { String getFormattedDateRange() {
if (selectedDateRange != null) { if (selectedDateRange != null) {
return '${formatDate(selectedDateRange!.start)} - ${formatDate(selectedDateRange!.end)}'; return '${formatDate(selectedDateRange!.start)} - ${formatDate(selectedDateRange!.end)}';
...@@ -116,9 +119,9 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -116,9 +119,9 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
super.initState(); super.initState();
} }
void _prepareChartData() { void _prepareChartData() {
chartData = [] chartData =
[]
.map((earning) { .map((earning) {
// Convert rawDate or date to DateTime // Convert rawDate or date to DateTime
DateTime? dateTime; DateTime? dateTime;
...@@ -149,12 +152,9 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -149,12 +152,9 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
super.dispose(); super.dispose();
} }
List<_ChartData> chartData = []; List<_ChartData> chartData = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
double screenHeight = MediaQuery.of(context).size.height; double screenHeight = MediaQuery.of(context).size.height;
return Scaffold( return Scaffold(
...@@ -164,7 +164,7 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -164,7 +164,7 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: Column( child: Column(
children: [ children: [
Container( SizedBox(
width: screenWidth, width: screenWidth,
height: screenHeight * 0.28, height: screenHeight * 0.28,
child: GridView.builder( child: GridView.builder(
...@@ -186,27 +186,32 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -186,27 +186,32 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
"Total Orders Shipped", "Total Orders Shipped",
]; ];
List<String> labelsTexts = [ List<String> labelsTexts = [
"${totalEarned}", "$totalEarned",
"${totalOrders}", "$totalOrders",
"${totalClicks}", "$totalClicks",
"${totalordersShipped}", "$totalordersShipped",
]; ];
return Container( return Container(
padding: padding: EdgeInsets.symmetric(
EdgeInsets.symmetric(vertical: 5, horizontal: 10), vertical: 5,
horizontal: 10,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: (index == 0) color:
(index == 0)
? Color(0xFF382560) ? Color(0xFF382560)
: Color(0xFFD7E0FF), : Color(0xFFD7E0FF),
borderRadius: BorderRadius.circular(14)), borderRadius: BorderRadius.circular(14),
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Text( Text(
"${labelsTexts[index]}", labelsTexts[index],
style: TextStyle( style: TextStyle(
color: (index == 0) color:
(index == 0)
? Colors.white ? Colors.white
: Color(0xFF382560), : Color(0xFF382560),
fontFamily: "Inter", fontFamily: "Inter",
...@@ -215,16 +220,17 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -215,16 +220,17 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
), ),
), ),
Text( Text(
"${labels[index]}", labels[index],
style: TextStyle( style: TextStyle(
color: (index == 0) color:
(index == 0)
? Colors.white ? Colors.white
: Color(0xFF566CB8), : Color(0xFF566CB8),
fontFamily: "Inter", fontFamily: "Inter",
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 12, fontSize: 12,
), ),
) ),
], ],
), ),
); );
...@@ -239,12 +245,15 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -239,12 +245,15 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
width: screenWidth, width: screenWidth,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(12)), borderRadius: BorderRadius.circular(12),
),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: padding: EdgeInsets.symmetric(
EdgeInsets.symmetric(vertical: 0, horizontal: 10), vertical: 0,
horizontal: 10,
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
...@@ -280,7 +289,8 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -280,7 +289,8 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
), ),
], ],
), ),
items: Filteritems2.map( items:
Filteritems2.map(
(String item) => DropdownMenuItem<String>( (String item) => DropdownMenuItem<String>(
value: item, value: item,
child: Text( child: Text(
...@@ -293,7 +303,8 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -293,7 +303,8 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
), ),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
)).toList(), ),
).toList(),
value: selectedValue2, value: selectedValue2,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
...@@ -305,7 +316,8 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -305,7 +316,8 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
if (value == 'Custom') { if (value == 'Custom') {
selectedDateRange = selectedDateRange =
await showCustomDateRangePicker( await showCustomDateRangePicker(
context); context,
);
} else { } else {
selectedDateRange = getDateRange(value!); selectedDateRange = getDateRange(value!);
} }
...@@ -318,11 +330,11 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -318,11 +330,11 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
if (selectedDateRange != null) { if (selectedDateRange != null) {
// Extracting the 'from' and 'to' dates directly from DateTimeRange // Extracting the 'from' and 'to' dates directly from DateTimeRange
var fromRange = formatDate( var fromRange = formatDate(
selectedDateRange! selectedDateRange!.start,
.start); // Format start date ); // Format start date
var toRange = formatDate( var toRange = formatDate(
selectedDateRange! selectedDateRange!.end,
.end); // Format end date ); // Format end date
// print('From range: $fromRange'); // Output: From range: 2024-09-21 // print('From range: $fromRange'); // Output: From range: 2024-09-21
// print('To range: $toRange'); // Output: To range: 2024-09-21 // print('To range: $toRange'); // Output: To range: 2024-09-21
...@@ -336,12 +348,12 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -336,12 +348,12 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
height: 40, height: 40,
width: 160, width: 160,
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 14, right: 14), left: 14,
right: 14,
),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
border: Border.all( border: Border.all(color: Colors.black26),
color: Colors.black26,
),
color: Color(0xFF382560), color: Color(0xFF382560),
), ),
elevation: 0, elevation: 0,
...@@ -363,9 +375,10 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -363,9 +375,10 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
offset: const Offset(0, 0), offset: const Offset(0, 0),
scrollbarTheme: ScrollbarThemeData( scrollbarTheme: ScrollbarThemeData(
radius: const Radius.circular(40), radius: const Radius.circular(40),
thickness: MaterialStateProperty.all(0), thickness: WidgetStateProperty.all(0),
thumbVisibility: thumbVisibility: WidgetStateProperty.all(
MaterialStateProperty.all(true), true,
),
), ),
), ),
menuItemStyleData: const MenuItemStyleData( menuItemStyleData: const MenuItemStyleData(
...@@ -373,24 +386,20 @@ class _AffiliatedashboardState extends State<Affiliatedashboard> ...@@ -373,24 +386,20 @@ class _AffiliatedashboardState extends State<Affiliatedashboard>
padding: EdgeInsets.only(left: 14, right: 14), padding: EdgeInsets.only(left: 14, right: 14),
), ),
), ),
) ),
], ],
), ),
), ),
], ],
), ),
), ),
], ],
], ],
), ),
), ),
), ),
); );
} }
} }
class _ChartData { class _ChartData {
......
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