Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sai Srinivas
GEN_ERP_2025
Commits
3ad2ea55
Commit
3ad2ea55
authored
Jul 09, 2025
by
Sai Srinivas
Browse files
ios Changes
parent
38d17dba
Changes
24
Hide whitespace changes
Inline
Side-by-side
lib/Notifiers/PaymentDetailsProvider.dart
View file @
3ad2ea55
...
...
@@ -227,7 +227,6 @@ class Paymentdetailsprovider extends ChangeNotifier {
if
(
data
.
error
==
0
)
{
print
(
data
.
paymentCollectionId
);
_CollectionId
=
data
.
paymentCollectionId
??
0
;
notifyListeners
();
}
else
{}
}
else
{
...
...
@@ -427,7 +426,7 @@ class Paymentdetailsprovider extends ChangeNotifier {
email
,
)
async
{
if
(
actName
==
"Generator"
)
{
_saveAgainst
=
"
G
enerator"
;
_saveAgainst
=
"
g
enerator"
;
_genId
=
generatorID
;
}
else
{
_saveAgainst
=
"account"
;
...
...
lib/Notifiers/connectivity/connectivityProvider.dart
deleted
100644 → 0
View file @
38d17dba
import
'dart:io'
;
import
'package:flutter/foundation.dart'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'dart:async'
;
class
Connectivityprovider
extends
ChangeNotifier
{
static
final
Connectivityprovider
_instance
=
Connectivityprovider
.
_
();
static
Connectivityprovider
get
instance
=>
_instance
;
final
Connectivity
_connectivity
=
Connectivity
();
bool
_isOnline
=
false
;
Map
<
ConnectivityResult
,
bool
>
_source
=
{
ConnectivityResult
.
none
:
false
};
Connectivityprovider
.
_
()
{
initialise
();
}
bool
get
isOnline
=>
_isOnline
;
Map
<
ConnectivityResult
,
bool
>
get
source
=>
_source
;
void
initialise
()
async
{
List
<
ConnectivityResult
>
result
=
await
_connectivity
.
checkConnectivity
();
_checkStatus
(
result
.
first
);
_connectivity
.
onConnectivityChanged
.
listen
((
result
)
{
_checkStatus
(
result
.
first
);
});
}
void
_checkStatus
(
ConnectivityResult
result
)
async
{
bool
isOnline
=
false
;
try
{
final
lookupResult
=
await
InternetAddress
.
lookup
(
'example.com'
);
isOnline
=
lookupResult
.
isNotEmpty
&&
lookupResult
[
0
].
rawAddress
.
isNotEmpty
;
}
on
SocketException
catch
(
_
)
{
isOnline
=
false
;
}
_source
=
{
result:
isOnline
};
_isOnline
=
isOnline
;
notifyListeners
();
// Notify all listeners of the change
}
void
dispose
()
{
// No StreamController to close, as we're using ChangeNotifier
}
}
lib/Notifiers/financeProvider/RequestionListProvider.dart
View file @
3ad2ea55
...
...
@@ -483,12 +483,11 @@ class Requestionlistprovider extends ChangeNotifier {
approvalEmployeeID
,
)
async
{
try
{
_submitClicked
=
true
;
notifyListeners
();
if
(!
validateForm
(
context
,
mode
))
{
_submitClicked
=
false
;
return
;
}
_submitClicked
=
true
;
notifyListeners
();
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
...
...
@@ -511,8 +510,8 @@ class Requestionlistprovider extends ChangeNotifier {
bankIfscController
.
text
,
bankAcHolderController
.
text
,
bankUpiController
.
text
,
_image
,
approvalEmployeeID
,
_image
,
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
...
...
@@ -550,11 +549,20 @@ class Requestionlistprovider extends ChangeNotifier {
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
_directPaymentAccounts
=
data
.
paymentAccounts
!;
_directPaymentAccounts
=
[
DirectPaymentAccounts
(
id:
""
,
name:
"Select"
),...
data
.
paymentAccounts
!];
_directPaymentAccounts
=
[
DirectPaymentAccounts
(
id:
""
,
name:
"Select"
),
...
data
.
paymentAccounts
!,
];
_directPaymentModes
=
data
.
paymentModes
!;
_directPaymentModes
=
[
DirectPaymentModes
(
name:
"Select"
,
id:
""
),...
data
.
paymentModes
!];
_directPaymentModes
=
[
DirectPaymentModes
(
name:
"Select"
,
id:
""
),
...
data
.
paymentModes
!,
];
_directAccounts
=
data
.
accounts
!;
_directAccounts
=
[
DirectAccounts
(
id:
""
,
name:
"Select"
),...
data
.
accounts
!];
_directAccounts
=
[
DirectAccounts
(
id:
""
,
name:
"Select"
),
...
data
.
accounts
!,
];
checkdirectPaymentDropDownsSlected
();
notifyListeners
();
...
...
@@ -1058,6 +1066,14 @@ class Requestionlistprovider extends ChangeNotifier {
!
_requestingPurposes
.
contains
(
_selectReqPurpose
))
{
_selectReqPurpose
=
null
;
}
if
(
_selectedApprovalEmployee
!=
null
&&
!
_approvalEmployee
.
contains
(
_selectedApprovalEmployee
))
{
_selectedApprovalEmployee
=
null
;
_selectedApprovalEmployeeID
=
null
;
_selectedApprovalEmployeeValue
=
null
;
}
notifyListeners
();
}
bool
validateForm
(
BuildContext
context
,
String
mode
)
{
...
...
@@ -1156,6 +1172,7 @@ class Requestionlistprovider extends ChangeNotifier {
// isValid = false;_submitClicked = false;
// }
buttonEnabled
=
isValid
;
_submitClicked
=
true
;
notifyListeners
();
return
isValid
;
}
...
...
lib/Notifiers/splashVersionNotifier.dart
View file @
3ad2ea55
...
...
@@ -42,7 +42,7 @@ class SplashVersionNotifier extends ChangeNotifier {
if
(
_packagedetails
.
isEmpty
)
{
await
initPackageInfo
();
}
var
loginProvider
=
Provider
.
of
<
Loginnotifier
>(
context
,
listen:
false
);
var
loginProvider
=
Provider
.
of
<
Loginnotifier
>(
context
,
listen:
false
);
var
loginStatus
=
await
SharedpreferencesService
().
getInt
(
"loginStatus"
);
print
(
"login status:
${loginStatus}
"
);
...
...
@@ -59,7 +59,6 @@ class SplashVersionNotifier extends ChangeNotifier {
}
if
(
Platform
.
isAndroid
&&
currentBuild
<
(
data
.
latestVersionCode
??
0
))
{
print
(
"Update"
);
AppUpdateDialouge
(
context
,
data
.
url
!,
data
.
releaseNotes
!);
}
else
if
(
Platform
.
isIOS
&&
...
...
lib/Utils/GlobalConstants.dart
View file @
3ad2ea55
String
didPushed
=
""
;
String
didPopped
=
""
;
\ No newline at end of file
String
didPopped
=
""
;
var
connection
;
lib/Utils/commonServices.dart
View file @
3ad2ea55
import
'dart:async'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
toast
(
context
,
text
)
{
toast
(
context
,
text
)
{
// OwnToast(context, text, "0");
Fluttertoast
.
showToast
(
msg:
text
,
...
...
@@ -13,4 +16,36 @@ toast(context,text) {
textColor:
Colors
.
white
,
fontSize:
15.0
,
);
}
\ No newline at end of file
}
class
MyConnectivity
{
MyConnectivity
.
_
();
static
final
_instance
=
MyConnectivity
.
_
();
static
MyConnectivity
get
instance
=>
_instance
;
final
_connectivity
=
Connectivity
();
final
_controller
=
StreamController
.
broadcast
();
Stream
get
myStream
=>
_controller
.
stream
;
void
initialise
()
async
{
ConnectivityResult
result
=
(
await
_connectivity
.
checkConnectivity
())
as
ConnectivityResult
;
_checkStatus
(
result
);
_connectivity
.
onConnectivityChanged
.
listen
((
result
)
{
_checkStatus
(
result
as
ConnectivityResult
);
});
}
void
_checkStatus
(
ConnectivityResult
result
)
async
{
bool
isOnline
=
false
;
try
{
final
result
=
await
InternetAddress
.
lookup
(
'example.com'
);
isOnline
=
result
.
isNotEmpty
&&
result
[
0
].
rawAddress
.
isNotEmpty
;
}
on
SocketException
catch
(
_
)
{
isOnline
=
false
;
}
_controller
.
sink
.
add
({
result:
isOnline
});
}
void
disposeStream
()
=>
_controller
.
close
();
}
lib/Utils/commonWidgets.dart
View file @
3ad2ea55
...
...
@@ -141,7 +141,7 @@ Widget textControllerWidget(
height:
hintText
==
"Enter Description"
?
150
:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
readonly
?
Color
(
0xFFD7D7D7
):
AppColors
.
text_field_color
,
color:
readonly
?
Color
(
0xFFD7D7D7
)
:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
...
...
@@ -175,7 +175,7 @@ Widget textControllerWidget(
?
[
FilteringTextInputFormatter
.
digitsOnly
]
:
[],
style:
TextStyle
(
color:
readonly
?
Color
(
0xFF9e9e9e
)
:
AppColors
.
semi_black
color:
readonly
?
Color
(
0xFF9e9e9e
)
:
AppColors
.
semi_black
,
),
decoration:
InputDecoration
(
counterText:
""
,
...
...
@@ -198,12 +198,13 @@ Widget textControllerWidget(
NoNetwork
(
context
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
AppColors
.
scaffold_bg_color
),
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Image
.
asset
(
'assets/images/no_wifi.png'
,
width:
100
,
height:
100
),
//
Image.asset('assets/images/no_wifi.png', width: 100, height: 100),
SizedBox
(
height:
10
),
Center
(
child:
Text
(
...
...
lib/main.dart
View file @
3ad2ea55
...
...
@@ -247,8 +247,7 @@ class MyApp extends StatelessWidget {
tabBarTheme:
const
TabBarThemeData
(),
textSelectionTheme:
TextSelectionThemeData
(
cursorColor:
AppColors
.
app_blue
cursorColor:
AppColors
.
app_blue
,
),
dialogTheme:
const
DialogThemeData
(
shadowColor:
Colors
.
white
,
...
...
@@ -296,7 +295,7 @@ class MyApp extends StatelessWidget {
AppColors
.
grey_semi
.
withOpacity
(
0.6
),
),
),
useMaterial3:
true
useMaterial3:
true
,
// inputDecorationTheme: InputDecorationTheme(
// hintStyle: TextStyle(
// fontWeight: FontWeight.w400,
...
...
lib/screens/AttendanceScreen.dart
View file @
3ad2ea55
...
...
@@ -31,8 +31,25 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
});
}
// return Container(
// // onWillPop: _onBackPressed,
// child: (Platform.isAndroid
// ? WillPopScope(
// onWillPop: onBackPressed,
// child: _scaffold(context),
// )
// : _scaffold(context)))
@override
Widget
build
(
BuildContext
context
)
{
return
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
)
:
_scaffold
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
AttendanceNotifier
>(
builder:
(
context
,
attendance
,
index
)
{
final
timeString
=
...
...
@@ -102,682 +119,599 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
attendance
.
init
(
homeProvider
,
context
);
attendance
.
loadAttendanceDetails
(
homeProvider
,
context
);
},
child:
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Attendance"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
15
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Attendance"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
15
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
15
,
right:
10
,
top:
15
,
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"Check-in"
)),
Expanded
(
child:
Text
(
"Check-out"
)),
],
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
15
,
right:
10
,
top:
15
,
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"Check-in"
)),
Expanded
(
child:
Text
(
"Check-out"
)),
],
),
),
SizedBox
(
child:
Row
(
children:
[
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFF3EDFF
),
borderRadius:
BorderRadius
.
circular
(
16
,
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
formattedTime
,
style:
TextStyle
(
color:
formattedTime
!=
"-"
?
Color
(
0xFF493272
,
)
:
Color
(
0xFFED3424
,
),
fontFamily:
"JakartaRegular"
,
fontSize:
30
,
),
),
TextSpan
(
text:
period
,
style:
TextStyle
(
color:
period
!=
"-"
?
Color
(
0xFF493272
,
)
:
Color
(
0xFFED3424
,
),
fontFamily:
"JakartaRegular"
,
),
),
],
SizedBox
(
child:
Row
(
children:
[
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFF3EDFF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
formattedTime
,
style:
TextStyle
(
color:
formattedTime
!=
"-"
?
Color
(
0xFF493272
)
:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
fontSize:
30
,
),
),
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_in_location']}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
TextSpan
(
text:
period
,
style:
TextStyle
(
color:
period
!=
"-"
?
Color
(
0xFF493272
)
:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
),
),
),
],
),
),
),
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
],
),
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFF3EDFF
)
,
borderRadius:
BorderRadius
.
circular
(
16
,
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_in_location']}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
,
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
formattedTime2
,
style:
TextStyle
(
color:
formattedTime2
!=
"-"
?
Color
(
0xFF493272
,
)
:
Color
(
0xFFED3424
,
),
fontFamily:
"JakartaRegular"
,
fontSize:
30
,
),
),
TextSpan
(
text:
period2
,
style:
TextStyle
(
color:
period2
!=
"-"
?
Color
(
0xFF493272
,
)
:
Color
(
0xFFED3424
,
),
fontFamily:
"JakartaRegular"
,
),
),
],
],
),
),
),
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFF3EDFF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
formattedTime2
,
style:
TextStyle
(
color:
formattedTime2
!=
"-"
?
Color
(
0xFF493272
)
:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
fontSize:
30
,
),
),
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_out_location']}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
TextSpan
(
text:
period2
,
style:
TextStyle
(
color:
period2
!=
"-"
?
Color
(
0xFF493272
)
:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
),
),
)
,
]
,
]
,
)
,
),
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_out_location']}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
]
,
)
,
),
),
],
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Text
(
"Attendance Details"
,
style:
TextStyle
(
fontFamily:
"JakartaSemiBold"
,
fontSize:
14
,
color:
Color
(
0xFF818181
),
],
),
),
],
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Text
(
"Attendance Details"
,
style:
TextStyle
(
fontFamily:
"JakartaSemiBold"
,
fontSize:
14
,
color:
Color
(
0xFF818181
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
GridView
.
builder
(
itemCount:
4
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
20
/
10
,
),
itemBuilder:
(
context
,
index
)
{
final
numbers
=
[
attendance
.
presentDays
,
attendance
.
absentDays
,
attendance
.
holidays
,
attendance
.
latePenalties
,
];
final
names
=
[
"Present Days"
,
"Absent Days"
,
"Holidays"
,
"Late Points"
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFFFEFEF
,
0xFFF3EDFF
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFFFF0000
,
0xFF493272
,
0xFF91481B
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
index
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
GridView
.
builder
(
itemCount:
4
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
20
/
10
,
),
itemBuilder:
(
context
,
index
)
{
final
numbers
=
[
attendance
.
presentDays
,
attendance
.
absentDays
,
attendance
.
holidays
,
attendance
.
latePenalties
,
];
final
names
=
[
"Present Days"
,
"Absent Days"
,
"Holidays"
,
"Late Points"
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFFFEFEF
,
0xFFF3EDFF
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFFFF0000
,
0xFF493272
,
0xFF91481B
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
index
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
numbers
[
index
].
toString
(),
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
index
]),
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
numbers
[
index
].
toString
(),
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
index
]),
),
),
Text
(
names
[
index
],
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
Text
(
names
[
index
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
);
},
),
),
],
),
);
},
),
),
///calendar
Container
(
// padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
16
),
color:
Colors
.
white
,
),
child:
Column
(
children:
[
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
30
,
10
,
30
,
0
,
),
child:
Container
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
SizedBox
(
child:
Row
(
children:
[
GestureDetector
(
onTap:
()
{
attendance
.
setPreviousMonth
(
homeProvider
,
context
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/arrow_left.svg"
,
),
),
Text
(
monthLabel
,
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF2D2D2D
),
),
),
GestureDetector
(
onTap:
()
{
attendance
.
setNextMonth
(
homeProvider
,
context
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
///calendar
Container
(
// padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
16
),
color:
Colors
.
white
,
),
child:
Column
(
children:
[
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
30
,
10
,
30
,
0
),
child:
Container
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
SizedBox
(
child:
Row
(
children:
[
GestureDetector
(
onTap:
()
{
attendance
.
setPreviousMonth
(
homeProvider
,
context
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/arrow_left.svg"
,
),
),
),
InkResponse
(
onTap:
()
{
_showInfoBottomSheet
(
context
);
},
child:
SizedBox
(
width:
20
,
height:
20
,
Text
(
monthLabel
,
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF2D2D2D
),
),
),
GestureDetector
(
onTap:
()
{
attendance
.
setNextMonth
(
homeProvider
,
context
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_info_new.svg"
,
width:
20
,
height:
20
,
"assets/svg/arrow_right_new.svg"
,
),
),
],
),
),
InkResponse
(
onTap:
()
{
_showInfoBottomSheet
(
context
);
},
child:
SizedBox
(
width:
20
,
height:
20
,
child:
SvgPicture
.
asset
(
"assets/svg/ic_info_new.svg"
,
width:
20
,
height:
20
,
),
]
,
)
,
),
)
,
]
,
),
SizedBox
(
height:
5
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
10
,
8
,
0
),
child:
Container
(
child:
Row
(
children:
[
for
(
var
i
=
0
;
i
<
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
,
].
length
;
i
++
)
Expanded
(
child:
Text
(
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
,
][
i
],
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
color:
i
==
0
?
Color
(
0xFFFF0000
)
:
AppColors
.
semi_black
,
),
),
),
),
SizedBox
(
height:
5
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
10
,
8
,
0
),
child:
Container
(
child:
Row
(
children:
[
for
(
var
i
=
0
;
i
<
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
,
].
length
;
i
++
)
Expanded
(
child:
Text
(
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
][
i
],
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
color:
i
==
0
?
Color
(
0xFFFF0000
)
:
AppColors
.
semi_black
,
),
]
,
),
)
,
)
,
),
]
,
),
),
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
10
),
child:
Container
(
child:
GridView
.
builder
(
itemCount:
daysInPeriod
+
startingIndex
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
7
,
crossAxisSpacing:
2
,
mainAxisSpacing:
1
,
childAspectRatio:
(
255
/
245
),
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
,
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
10
),
child:
Container
(
child:
GridView
.
builder
(
itemCount:
daysInPeriod
+
startingIndex
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
7
,
crossAxisSpacing:
2
,
mainAxisSpacing:
1
,
childAspectRatio:
(
255
/
245
),
),
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
if
(
index
<
startingIndex
)
{
return
SizedBox
.
shrink
();
}
final
dayIndex
=
index
-
startingIndex
;
final
currentDateInPeriod
=
startDate
.
add
(
Duration
(
days:
dayIndex
),
);
final
currentDay
=
currentDateInPeriod
.
day
;
final
isFutureDate
=
currentDateInPeriod
.
isAfter
(
currentDate
);
// Find matching date in dateArrayList
Map
<
String
,
dynamic
>?
dateMap
;
try
{
dateMap
=
dateArrayList
[
dayIndex
];
}
catch
(
e
)
{
dateMap
=
{};
}
// Find matching penalty
Map
<
String
,
dynamic
>?
penaltyMap
;
try
{
penaltyMap
=
penalityArrayList
[
dayIndex
];
}
catch
(
e
)
{
penaltyMap
=
{};
}
String
?
dateColor
=
dateMap
.
isNotEmpty
?
dateMap
.
values
.
first
:
null
;
String
?
penaltyKey
=
penaltyMap
.
isNotEmpty
?
penaltyMap
.
keys
.
first
:
null
;
int
?
datePenalty
=
penaltyMap
.
isNotEmpty
?
penaltyMap
.
values
.
first
:
0
;
// Determine if this is the current day
final
isCurrentDay
=
currentDateInPeriod
.
day
==
currentDate
.
day
&&
currentDateInPeriod
.
month
==
currentDate
.
month
&&
currentDateInPeriod
.
year
==
currentDate
.
year
;
return
InkWell
(
onTap:
isFutureDate
?
null
:
()
{
selectedIndex
=
index
;
if
(
penaltyKey
!=
null
)
{
attendance
.
dateWiseAttendance
(
homeProvider
,
penaltyKey
,
context
,
);
}
attendance
.
selectedDate
=
currentDay
.
toString
();
_showAttDetailsBottomSheet
(
context
,
);
},
child:
Card
(
elevation:
0
,
child:
Column
(
children:
[
// Row(
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// Text(
// "($datePenalty)",
// style: TextStyle(
// fontWeight: FontWeight.w400,
// color: Colors.black,
// fontSize: 5
// ),
// ),
// ],
// ),
Center
(
child:
Container
(
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
border:
Border
.
all
(
color:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFF1487C9
,
)
:
Colors
.
transparent
,
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
),
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
if
(
index
<
startingIndex
)
{
return
SizedBox
.
shrink
();
}
final
dayIndex
=
index
-
startingIndex
;
final
currentDateInPeriod
=
startDate
.
add
(
Duration
(
days:
dayIndex
),
);
final
currentDay
=
currentDateInPeriod
.
day
;
final
isFutureDate
=
currentDateInPeriod
.
isAfter
(
currentDate
);
// Find matching date in dateArrayList
Map
<
String
,
dynamic
>?
dateMap
;
try
{
dateMap
=
dateArrayList
[
dayIndex
];
}
catch
(
e
)
{
dateMap
=
{};
}
// Find matching penalty
Map
<
String
,
dynamic
>?
penaltyMap
;
try
{
penaltyMap
=
penalityArrayList
[
dayIndex
];
}
catch
(
e
)
{
penaltyMap
=
{};
}
String
?
dateColor
=
dateMap
.
isNotEmpty
?
dateMap
.
values
.
first
:
null
;
String
?
penaltyKey
=
penaltyMap
.
isNotEmpty
?
penaltyMap
.
keys
.
first
:
null
;
int
?
datePenalty
=
penaltyMap
.
isNotEmpty
?
penaltyMap
.
values
.
first
:
0
;
// Determine if this is the current day
final
isCurrentDay
=
currentDateInPeriod
.
day
==
currentDate
.
day
&&
currentDateInPeriod
.
month
==
currentDate
.
month
&&
currentDateInPeriod
.
year
==
currentDate
.
year
;
return
InkWell
(
onTap:
isFutureDate
?
null
:
()
{
selectedIndex
=
index
;
if
(
penaltyKey
!=
null
)
{
attendance
.
dateWiseAttendance
(
homeProvider
,
penaltyKey
,
context
,
);
}
attendance
.
selectedDate
=
currentDay
.
toString
();
_showAttDetailsBottomSheet
(
context
,
);
},
child:
Card
(
elevation:
0
,
child:
Column
(
children:
[
// Row(
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// Text(
// "($datePenalty)",
// style: TextStyle(
// fontWeight: FontWeight.w400,
// color: Colors.black,
// fontSize: 5
// ),
// ),
// ],
// ),
Center
(
child:
Container
(
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
border:
Border
.
all
(
color:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFF1487C9
)
:
Colors
.
transparent
,
),
color:
isFutureDate
?
Colors
.
transparent
:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFFFFFFFF
)
:
dateColor
==
'g'
?
Color
(
0xFF6B3A02
,
).
withAlpha
(
50
)
:
dateColor
==
'r'
?
Color
(
0xFFFF0000
,
).
withAlpha
(
50
)
:
dateColor
==
'b'
?
Color
(
0xFF493272
,
).
withAlpha
(
50
)
:
dateColor
==
'br'
?
Color
(
0xFFFFE8D0
)
:
dateColor
==
'y'
?
Color
(
0xFFFFF9B2
)
:
Colors
.
transparent
,
),
child:
Center
(
child:
Text
(
currentDay
.
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
color:
isFutureDate
?
Colors
.
transparent
?
AppColors
.
semi_black
:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFF
FFFFFF
)
?
Color
(
0xFF
2D2D2D
)
:
dateColor
==
'g'
?
Color
(
0xFF6B3A02
,
).
withAlpha
(
50
)
?
Color
(
0xFF6B3A02
)
:
dateColor
==
'r'
?
Color
(
0xFFFF0000
,
).
withAlpha
(
50
)
?
Color
(
0xFFFF0000
)
:
dateColor
==
'b'
?
Color
(
0xFF493272
,
).
withAlpha
(
50
)
?
Color
(
0xFF493272
)
:
dateColor
==
'br'
?
Color
(
0xFF
FFE8D0
)
?
Color
(
0xFF
6B3A02
)
:
dateColor
==
'y'
?
Color
(
0xFF
FFF9B2
)
?
Color
(
0xFF
605C00
)
:
Colors
.
transparent
,
),
child:
Center
(
child:
Text
(
currentDay
.
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
color:
isFutureDate
?
AppColors
.
semi_black
:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFF2D2D2D
,
)
:
dateColor
==
'g'
?
Color
(
0xFF6B3A02
,
)
:
dateColor
==
'r'
?
Color
(
0xFFFF0000
,
)
:
dateColor
==
'b'
?
Color
(
0xFF493272
,
)
:
dateColor
==
'br'
?
Color
(
0xFF6B3A02
,
)
:
dateColor
==
'y'
?
Color
(
0xFF605C00
,
)
:
Colors
.
transparent
,
),
),
),
),
),
]
,
)
,
),
)
,
)
;
}
,
)
,
)
,
]
,
)
,
)
,
)
;
}
,
),
]
,
)
,
),
),
SizedBox
(
height:
70
),
],
],
),
),
),
SizedBox
(
height:
70
),
],
),
floatingActionButton:
attendance
.
attendanceStatus
==
0
||
attendance
.
attendanceStatus
==
1
?
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
CheckInOutScreen
(
getAttendanceStatus:
attendance
.
attendanceStatus
,
),
),
);
if
(
res
==
true
)
{
attendance
.
getAttendanceList
(
homeProvider
,
context
,
);
attendance
.
init
(
homeProvider
,
context
);
attendance
.
loadAttendanceDetails
(
homeProvider
,
context
,
);
}
var
f
=
FocusScope
.
of
(
context
);
if
(!
f
.
hasPrimaryFocus
)
{
f
.
unfocus
();
}
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
attendance
.
attendanceStatus
==
0
?
"Check In"
:
"Check Out"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
16
,
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
),
),
floatingActionButton:
attendance
.
attendanceStatus
==
0
||
attendance
.
attendanceStatus
==
1
?
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
CheckInOutScreen
(
getAttendanceStatus:
attendance
.
attendanceStatus
,
),
),
),
);
if
(
res
==
true
)
{
attendance
.
getAttendanceList
(
homeProvider
,
context
);
attendance
.
init
(
homeProvider
,
context
);
attendance
.
loadAttendanceDetails
(
homeProvider
,
context
,
);
}
var
f
=
FocusScope
.
of
(
context
);
if
(!
f
.
hasPrimaryFocus
)
{
f
.
unfocus
();
}
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
attendance
.
attendanceStatus
==
0
?
"Check In"
:
"Check Out"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
16
,
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
),
),
),
)
:
SizedBox
(
height:
0
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
)
,
)
,
),
)
:
SizedBox
(
height:
0
)
,
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
);
},
...
...
lib/screens/WebERPIOS.dart
View file @
3ad2ea55
...
...
@@ -77,205 +77,201 @@ class _WebERPIOSState extends State<WebERPIOS> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
if
(
await
webViewController
!.
canGoBack
())
{
webViewController
!.
goBack
();
return
false
;
// Prevent default back button behavior
}
return
true
;
// Allow default back button behavior
},
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
appBar:
appbar
(
context
,
"ERP"
),
body:
Container
(
child:
Column
(
children:
<
Widget
>[
Expanded
(
child:
Stack
(
children:
[
InAppWebView
(
initialUrlRequest:
URLRequest
(
url:
WebUri
(
widget
.
url
.
toString
()),
),
androidOnGeolocationPermissionsShowPrompt:
(
InAppWebViewController
controller
,
String
origin
,
)
async
{
return
GeolocationPermissionShowPromptResponse
(
origin:
origin
,
allow:
true
,
retain:
true
,
);
},
initialOptions:
InAppWebViewGroupOptions
(
android:
AndroidInAppWebViewOptions
(
useWideViewPort:
true
,
loadWithOverviewMode:
true
,
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
),
ios:
IOSInAppWebViewOptions
(
allowsInlineMediaPlayback:
true
,
allowsLinkPreview:
true
,
allowsBackForwardNavigationGestures:
true
,
),
),
androidOnPermissionRequest:
(
InAppWebViewController
controller
,
String
origin
,
List
<
String
>
resources
,
)
async
{
return
PermissionRequestResponse
(
resources:
resources
,
action:
PermissionRequestResponseAction
.
GRANT
,
);
},
initialSettings:
InAppWebViewSettings
(
javaScriptEnabled:
true
,
allowFileAccess:
true
,
allowContentAccess:
true
,
clearCache:
true
,
blockNetworkLoads:
false
,
networkAvailable:
true
,
useOnLoadResource:
true
,
thirdPartyCookiesEnabled:
true
,
supportZoom:
false
,
geolocationEnabled:
true
,
safeBrowsingEnabled:
false
,
saveFormData:
true
,
allowFileAccessFromFileURLs:
true
,
useWideViewPort:
true
,
databaseEnabled:
true
,
domStorageEnabled:
true
,
allowsBackForwardNavigationGestures:
true
,
allowUniversalAccessFromFileURLs:
true
,
allowsLinkPreview:
true
,
),
onPermissionRequest:
(
controller
,
request
)
async
{
return
PermissionResponse
(
resources:
request
.
resources
,
action:
PermissionResponseAction
.
GRANT
,
);
},
keepAlive:
InAppWebViewKeepAlive
(),
// initialData:
// InAppWebViewInitialData(baseUrl: WebUri(widget.url),data: ),
onWebViewCreated:
(
controller
)
{
webViewController
=
controller
;
_controller
.
complete
(
controller
);
},
pullToRefreshController:
pullToRefreshController
,
shouldOverrideUrlLoading:
(
controller
,
navigationAction
,
)
async
{
var
uri
=
navigationAction
.
request
.
url
!;
print
(
"urib scgefes"
);
print
(
uri
);
print
(
uri
.
scheme
);
if
(
uri
.
scheme
==
"tel"
)
{
// Launch the phone dialer app with the specified phone number
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
return
NavigationActionPolicy
.
CANCEL
;
}
}
else
if
(
uri
.
scheme
==
"mailto"
)
{
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
return
NavigationActionPolicy
.
CANCEL
;
}
}
else
if
(
uri
.
scheme
==
"whatsapp"
)
{
// Launch WhatsApp with the specified chat or phone number
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
return
NavigationActionPolicy
.
CANCEL
;
}
}
// // Check if the URL is trying to access the camera for image upload
// if (uri.scheme == 'camera' && uri.path.contains('/camera/')) {
// // Handle camera image upload here
// // You might want to display a custom UI for image selection or directly trigger the camera
// // You can use platform-specific plugins like image_picker for this purpose
// // Once the image is selected, you can pass it to the web view using JavaScript injection
// if (await canLaunch(uri.toString())) {
// await launch(uri.toString());
// return NavigationActionPolicy.CANCEL;
// }
// }
return
NavigationActionPolicy
.
ALLOW
;
},
return
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
)
:
_scaffold
(
context
);
}
onLoadStart:
(
controller
,
url
)
{
return
setState
(()
{
isLoading
=
true
;
});
},
onLoadStop:
(
controller
,
url
)
{
pullToRefreshController
?.
endRefreshing
();
return
setState
(()
{
isLoading
=
false
;
});
},
onReceivedError:
(
controller
,
request
,
error
)
{
pullToRefreshController
?.
endRefreshing
();
},
onProgressChanged:
(
controller
,
progress
)
{
if
(
progress
==
100
)
{
pullToRefreshController
?.
endRefreshing
();
}
},
Widget
_scaffold
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
appbar
(
context
,
"ERP"
),
body:
Container
(
child:
Column
(
children:
<
Widget
>[
Expanded
(
child:
Stack
(
children:
[
InAppWebView
(
initialUrlRequest:
URLRequest
(
url:
WebUri
(
widget
.
url
.
toString
()),
),
androidOnGeolocationPermissionsShowPrompt:
(
InAppWebViewController
controller
,
String
origin
,
)
async
{
return
GeolocationPermissionShowPromptResponse
(
origin:
origin
,
allow:
true
,
retain:
true
,
);
},
initialOptions:
InAppWebViewGroupOptions
(
android:
AndroidInAppWebViewOptions
(
useWideViewPort:
true
,
loadWithOverviewMode:
true
,
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
),
if
(
isLoading
)
...[
Container
(
color:
Colors
.
white
.
withOpacity
(
0.7
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SpinKitRing
(
ios:
IOSInAppWebViewOptions
(
allowsInlineMediaPlayback:
true
,
allowsLinkPreview:
true
,
allowsBackForwardNavigationGestures:
true
,
),
),
androidOnPermissionRequest:
(
InAppWebViewController
controller
,
String
origin
,
List
<
String
>
resources
,
)
async
{
return
PermissionRequestResponse
(
resources:
resources
,
action:
PermissionRequestResponseAction
.
GRANT
,
);
},
initialSettings:
InAppWebViewSettings
(
javaScriptEnabled:
true
,
allowFileAccess:
true
,
allowContentAccess:
true
,
clearCache:
true
,
blockNetworkLoads:
false
,
networkAvailable:
true
,
useOnLoadResource:
true
,
thirdPartyCookiesEnabled:
true
,
supportZoom:
false
,
geolocationEnabled:
true
,
safeBrowsingEnabled:
false
,
saveFormData:
true
,
allowFileAccessFromFileURLs:
true
,
useWideViewPort:
true
,
databaseEnabled:
true
,
domStorageEnabled:
true
,
allowsBackForwardNavigationGestures:
true
,
allowUniversalAccessFromFileURLs:
true
,
allowsLinkPreview:
true
,
),
onPermissionRequest:
(
controller
,
request
)
async
{
return
PermissionResponse
(
resources:
request
.
resources
,
action:
PermissionResponseAction
.
GRANT
,
);
},
keepAlive:
InAppWebViewKeepAlive
(),
// initialData:
// InAppWebViewInitialData(baseUrl: WebUri(widget.url),data: ),
onWebViewCreated:
(
controller
)
{
webViewController
=
controller
;
_controller
.
complete
(
controller
);
},
pullToRefreshController:
pullToRefreshController
,
shouldOverrideUrlLoading:
(
controller
,
navigationAction
,
)
async
{
var
uri
=
navigationAction
.
request
.
url
!;
print
(
"urib scgefes"
);
print
(
uri
);
print
(
uri
.
scheme
);
if
(
uri
.
scheme
==
"tel"
)
{
// Launch the phone dialer app with the specified phone number
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
return
NavigationActionPolicy
.
CANCEL
;
}
}
else
if
(
uri
.
scheme
==
"mailto"
)
{
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
return
NavigationActionPolicy
.
CANCEL
;
}
}
else
if
(
uri
.
scheme
==
"whatsapp"
)
{
// Launch WhatsApp with the specified chat or phone number
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
return
NavigationActionPolicy
.
CANCEL
;
}
}
// // Check if the URL is trying to access the camera for image upload
// if (uri.scheme == 'camera' && uri.path.contains('/camera/')) {
// // Handle camera image upload here
// // You might want to display a custom UI for image selection or directly trigger the camera
// // You can use platform-specific plugins like image_picker for this purpose
// // Once the image is selected, you can pass it to the web view using JavaScript injection
// if (await canLaunch(uri.toString())) {
// await launch(uri.toString());
// return NavigationActionPolicy.CANCEL;
// }
// }
return
NavigationActionPolicy
.
ALLOW
;
},
onLoadStart:
(
controller
,
url
)
{
return
setState
(()
{
isLoading
=
true
;
});
},
onLoadStop:
(
controller
,
url
)
{
pullToRefreshController
?.
endRefreshing
();
return
setState
(()
{
isLoading
=
false
;
});
},
onReceivedError:
(
controller
,
request
,
error
)
{
pullToRefreshController
?.
endRefreshing
();
},
onProgressChanged:
(
controller
,
progress
)
{
if
(
progress
==
100
)
{
pullToRefreshController
?.
endRefreshing
();
}
},
),
if
(
isLoading
)
...[
Container
(
color:
Colors
.
white
.
withOpacity
(
0.7
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SpinKitRing
(
color:
AppColors
.
app_blue
,
lineWidth:
4
,
// duration: Duration(seconds: 2),
size:
50
,
),
const
SizedBox
(
height:
15
),
SizedBox
(
width:
200
,
child:
Text
(
"Please wait......."
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
decorationThickness:
0
,
fontSize:
15
,
fontWeight:
FontWeight
.
normal
,
color:
AppColors
.
app_blue
,
lineWidth:
4
,
// duration: Duration(seconds: 2),
size:
50
,
),
const
SizedBox
(
height:
15
),
SizedBox
(
width:
200
,
child:
Text
(
"Please wait......."
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
decorationThickness:
0
,
fontSize:
15
,
fontWeight:
FontWeight
.
normal
,
color:
AppColors
.
app_blue
,
),
),
),
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
),
),
),
],
],
),
),
],
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
),
),
],
],
),
),
)
,
]
,
),
),
);
...
...
lib/screens/WebWhizzdomScreen.dart
View file @
3ad2ea55
...
...
@@ -16,13 +16,14 @@ import 'WebERPScreen.dart';
Future
runErpScreenApp2
(
)
async
{
await
FlutterDownloader
.
initialize
(
debug:
true
// optional: set false to disable printing logs to console
debug:
true
,
// optional: set false to disable printing logs to console
);
await
Permission
.
storage
.
request
();
}
class
WebWhizzdomScreen
extends
StatefulWidget
{
final
String
whizzdom_url
;
const
WebWhizzdomScreen
({
super
.
key
,
required
this
.
whizzdom_url
});
const
WebWhizzdomScreen
({
super
.
key
,
required
this
.
whizzdom_url
});
@override
State
<
WebWhizzdomScreen
>
createState
()
=>
_WebWhizzdomScreenState
();
...
...
@@ -30,7 +31,7 @@ class WebWhizzdomScreen extends StatefulWidget {
class
_WebWhizzdomScreenState
extends
State
<
WebWhizzdomScreen
>
{
final
Completer
<
InAppWebViewController
>
_controller
=
Completer
<
InAppWebViewController
>();
Completer
<
InAppWebViewController
>();
var
empId
=
""
;
var
sessionId
=
""
;
bool
isLoading
=
true
;
...
...
@@ -46,20 +47,23 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
@override
void
initState
()
{
// loadData();
pullToRefreshController
=
kIsWeb
?
null
:
PullToRefreshController
(
settings:
pullToRefreshSettings
,
onRefresh:
()
async
{
if
(
defaultTargetPlatform
==
TargetPlatform
.
android
)
{
webViewController
?.
reload
();
}
else
if
(
defaultTargetPlatform
==
TargetPlatform
.
iOS
)
{
webViewController
?.
loadUrl
(
urlRequest:
URLRequest
(
url:
await
webViewController
?.
getUrl
()));
}
},
);
pullToRefreshController
=
kIsWeb
?
null
:
PullToRefreshController
(
settings:
pullToRefreshSettings
,
onRefresh:
()
async
{
if
(
defaultTargetPlatform
==
TargetPlatform
.
android
)
{
webViewController
?.
reload
();
}
else
if
(
defaultTargetPlatform
==
TargetPlatform
.
iOS
)
{
webViewController
?.
loadUrl
(
urlRequest:
URLRequest
(
url:
await
webViewController
?.
getUrl
(),
),
);
}
},
);
// print("URL:${widget.url}");
super
.
initState
();
}
...
...
@@ -68,125 +72,134 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
void
dispose
()
{
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
if
(
await
webViewController
!.
canGoBack
())
{
webViewController
!.
goBack
();
return
false
;
// Prevent default back button behavior
}
return
true
;
// Allow default back button behavior
},
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Whizzdom"
),
body:
Container
(
child:
Column
(
children:
<
Widget
>[
Expanded
(
child:
Stack
(
children:
[
InAppWebView
(
initialUrlRequest:
URLRequest
(
url:
WebUri
(
widget
.
whizzdom_url
),
),
androidOnGeolocationPermissionsShowPrompt:
(
InAppWebViewController
controller
,
String
origin
)
async
{
return
GeolocationPermissionShowPromptResponse
(
origin:
origin
,
allow:
true
,
retain:
true
);
},
initialOptions:
InAppWebViewGroupOptions
(
android:
AndroidInAppWebViewOptions
(
useWideViewPort:
true
,
loadWithOverviewMode:
true
,
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
clearSessionCache:
true
,
),
ios:
IOSInAppWebViewOptions
(
allowsInlineMediaPlayback:
true
,
),
),
return
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
)
:
_scaffold
(
context
);
}
androidOnPermissionRequest:
(
InAppWebViewController
controller
,
String
origin
,
List
<
String
>
resources
)
async
{
return
PermissionRequestResponse
(
resources:
resources
,
action:
PermissionRequestResponseAction
.
GRANT
);
},
onWebViewCreated:
(
controller
)
{
webViewController
=
controller
;
_controller
.
complete
(
controller
);
},
pullToRefreshController:
pullToRefreshController
,
onLoadStart:
(
controller
,
url
)
{
return
setState
(()
{
isLoading
=
true
;
});
},
onLoadStop:
(
controller
,
url
)
{
pullToRefreshController
?.
endRefreshing
();
return
setState
(()
{
isLoading
=
false
;
});
},
onReceivedError:
(
controller
,
request
,
error
)
{
pullToRefreshController
?.
endRefreshing
();
},
onProgressChanged:
(
controller
,
progress
)
{
if
(
progress
==
100
)
{
pullToRefreshController
?.
endRefreshing
();
}
},
Widget
_scaffold
(
BuildContext
context
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Whizzdom"
),
body:
Container
(
child:
Column
(
children:
<
Widget
>[
Expanded
(
child:
Stack
(
children:
[
InAppWebView
(
initialUrlRequest:
URLRequest
(
url:
WebUri
(
widget
.
whizzdom_url
),
),
androidOnGeolocationPermissionsShowPrompt:
(
InAppWebViewController
controller
,
String
origin
,
)
async
{
return
GeolocationPermissionShowPromptResponse
(
origin:
origin
,
allow:
true
,
retain:
true
,
);
},
initialOptions:
InAppWebViewGroupOptions
(
android:
AndroidInAppWebViewOptions
(
useWideViewPort:
true
,
loadWithOverviewMode:
true
,
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
clearSessionCache:
true
,
),
ios:
IOSInAppWebViewOptions
(
allowsInlineMediaPlayback:
true
,
),
),
),
if
(
isLoading
)
...[
Container
(
color:
Colors
.
white
.
withOpacity
(
0.7
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SpinKitRing
(
androidOnPermissionRequest:
(
InAppWebViewController
controller
,
String
origin
,
List
<
String
>
resources
,
)
async
{
return
PermissionRequestResponse
(
resources:
resources
,
action:
PermissionRequestResponseAction
.
GRANT
,
);
},
onWebViewCreated:
(
controller
)
{
webViewController
=
controller
;
_controller
.
complete
(
controller
);
},
pullToRefreshController:
pullToRefreshController
,
onLoadStart:
(
controller
,
url
)
{
return
setState
(()
{
isLoading
=
true
;
});
},
onLoadStop:
(
controller
,
url
)
{
pullToRefreshController
?.
endRefreshing
();
return
setState
(()
{
isLoading
=
false
;
});
},
onReceivedError:
(
controller
,
request
,
error
)
{
pullToRefreshController
?.
endRefreshing
();
},
onProgressChanged:
(
controller
,
progress
)
{
if
(
progress
==
100
)
{
pullToRefreshController
?.
endRefreshing
();
}
},
),
if
(
isLoading
)
...[
Container
(
color:
Colors
.
white
.
withOpacity
(
0.7
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SpinKitRing
(
color:
AppColors
.
app_blue
,
lineWidth:
4
,
// duration: Duration(seconds: 2),
size:
50
,
),
const
SizedBox
(
height:
15
),
SizedBox
(
width:
200
,
child:
Text
(
"Please wait......."
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
decorationThickness:
0
,
fontSize:
15
,
fontWeight:
FontWeight
.
normal
,
color:
AppColors
.
app_blue
,
lineWidth:
4
,
// duration: Duration(seconds: 2),
size:
50
,
),
const
SizedBox
(
height:
15
,
),
SizedBox
(
width:
200
,
child:
Text
(
"Please wait......."
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
decorationThickness:
0
,
fontSize:
15
,
fontWeight:
FontWeight
.
normal
,
color:
AppColors
.
app_blue
),
),
),
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
),
),
)]
],
))
])),
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
),
),
],
],
),
),
],
),
),
);
...
...
lib/screens/crm/crmDashboard.dart
View file @
3ad2ea55
...
...
@@ -34,6 +34,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
@override
Widget
build
(
BuildContext
context
)
{
return
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
)
:
_scaffold
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
gridPages
=
...
...
@@ -41,354 +50,217 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
.
where
((
page
)
=>
![
8
,
9
,
23
,
24
,
51
,
50
].
contains
(
page
.
id
))
.
toList
();
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
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
(
"CRM"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
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
(
"CRM"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
]
,
)
,
),
],
),
),
bottom:
PreferredSize
(
preferredSize:
Size
.
fromHeight
(
50
),
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
5.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
border:
focusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
)
:
null
,
),
bottom:
PreferredSize
(
preferredSize:
Size
.
fromHeight
(
50
),
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
5.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
border:
focusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
)
:
null
,
),
child:
Row
(
children:
[
Expanded
(
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
child:
TextFormField
(
controller:
provider
.
searchController
,
keyboardType:
TextInputType
.
text
,
maxLines:
1
,
onChanged:
(
value
)
{},
focusNode:
focusNode
,
onTapUpOutside:
(
event
)
{
focusNode
.
unfocus
();
},
child:
Row
(
children:
[
Expanded
(
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
child:
TextFormField
(
controller:
provider
.
searchController
,
keyboardType:
TextInputType
.
text
,
maxLines:
1
,
textInputAction:
TextInputAction
.
done
,
onEditingComplete:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Universalsearchscreen
(
text:
provider
.
searchController
.
text
,
),
settings:
RouteSettings
(
name:
'SearchScreen'
),
),
);
},
decoration:
InputDecoration
(
counterText:
""
,
hintText:
"Search"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
,
),
enabled:
true
,
onChanged:
(
value
)
{},
focusNode:
focusNode
,
onTapUpOutside:
(
event
)
{
focusNode
.
unfocus
();
},
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
textInputAction:
TextInputAction
.
done
,
onEditingComplete:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Universalsearchscreen
(
text:
provider
.
searchController
.
text
,
),
settings:
RouteSettings
(
name:
'SearchScreen'
),
),
);
},
decoration:
InputDecoration
(
counterText:
""
,
hintText:
"Search"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
,
),
enabled:
true
,
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
),
],
),
),
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
),
],
),
),
body:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Column
(
children:
[
if
(
provider
.
allLeads
.
length
>
0
)...[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.28
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
,
),
itemCount:
provider
.
allLeads
.
length
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
physics:
AlwaysScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
0.65
,
),
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
'Hot Leads'
,
'Cold Leads'
,
'Warm Leads'
,
'Total Leads'
,
'Order Lost'
,
'No Requirement'
,
'Open Enquiries'
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
async
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!=
""
)
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!
.
contains
(
"Lead List"
))
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
pageTitleName:
provider
.
allLeads
[
jndex
]
.
filter
!
.
pageName
!,
mode:
provider
.
allLeads
[
jndex
]
.
filter
!
.
mode
,
filter:
provider
.
allLeads
[
jndex
]
.
filter
!,
),
),
);
}
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
allLeads
[
jndex
].
count
!,
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
),
),
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
),
);
},
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
body:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Column
(
children:
[
if
(
provider
.
allLeads
.
length
>
0
)
...[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
],
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.28
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
itemCount:
provider
.
allLeads
.
length
,
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
scrollDirection:
Axis
.
horizontal
,
physics:
AlwaysScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
0.65
,
),
itemCount:
gridPages
.
length
,
itemBuilder:
(
context
,
index
)
{
// final icons = ["comm_ic_1", "comm_ic_2"];
Widget
?
SvgIcon
;
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/home_icons_5.svg"
,
height:
18
,
width:
18
,
);
}
else
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
}
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
'Hot Leads'
,
'Cold Leads'
,
'Warm Leads'
,
'Total Leads'
,
'Order Lost'
,
'No Requirement'
,
'Open Enquiries'
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
{
print
(
gridPages
[
index
].
pageName
!);
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
,
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
);
}
else
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Account List"
,
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectListByMode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
NearbyOpenLeads
(),
),
);
onTap:
()
async
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!=
""
)
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!
.
contains
(
"Lead List"
))
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
pageTitleName:
provider
.
allLeads
[
jndex
]
.
filter
!
.
pageName
!,
mode:
provider
.
allLeads
[
jndex
]
.
filter
!
.
mode
,
filter:
provider
.
allLeads
[
jndex
].
filter
!,
),
),
);
}
}
// switch (gridPages[index].pageName!) {
// case "Lead List":
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
// );
// break;
// case "Prospect List":
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => Accountledger()),
// // );
// break;
//
// default:
// print("111");
// break;
// }
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Row
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgIcon
),
Expanded
(
flex:
5
,
child:
Text
(
"
${gridPages[index].pageName}
"
,
style:
TextStyle
(
fontSize:
14
),
Text
(
provider
.
allLeads
[
jndex
].
count
!,
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
...
...
@@ -396,132 +268,242 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
);
},
),
),
],
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
gridPages
.
length
,
itemBuilder:
(
context
,
index
)
{
// final icons = ["comm_ic_1", "comm_ic_2"];
Widget
?
SvgIcon
;
if
(
provider
.
pendingTasksLists
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Pending Tasks"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/home_icons_5.svg"
,
height:
18
,
width:
18
,
);
}
else
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
}
return
InkResponse
(
onTap:
()
{
print
(
gridPages
[
index
].
pageName
!);
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
),
);
}
else
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Account List"
,
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectListByMode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
NearbyOpenLeads
(),
),
);
}
// switch (gridPages[index].pageName!) {
// case "Lead List":
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
// );
// break;
// case "Prospect List":
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => Accountledger()),
// // );
// break;
//
// default:
// print("111");
// break;
// }
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
),
Container
(
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.34
,
child:
ListView
.
builder
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgIcon
),
physics:
AlwaysScrollableScrollPhysics
(),
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
pendingTasksLists
.
length
,
itemBuilder:
(
context
,
index
)
{
final
headings
=
[
"Lead Name"
,
"Mobile Number"
,
"Appointment Date"
,
"Appointment Type"
,
"Note"
,
"Status"
,
];
final
subHeadings
=
[
provider
.
pendingTasksLists
[
index
].
aname
??
"-"
,
provider
.
pendingTasksLists
[
index
].
conmob
??
"-"
,
provider
.
pendingTasksLists
[
index
].
appdate
??
"-"
,
provider
.
pendingTasksLists
[
index
].
atype
??
"-"
,
provider
.
pendingTasksLists
[
index
].
anote
??
"-"
,
provider
.
pendingTasksLists
[
index
].
lstatus
??
"-"
,
];
return
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.3
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
Expanded
(
flex:
5
,
child:
Text
(
"
${gridPages[index].pageName}
"
,
style:
TextStyle
(
fontSize:
14
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
...
List
.
generate
(
headings
.
length
,
(
j
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
6
,
horizontal:
0
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
"
${headings[j]}
"
,
style:
TextStyle
(
fontSize:
14
),
),
),
Expanded
(
child:
Text
(
"
${subHeadings[j]}
"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
14
,
),
),
),
],
),
);
},)
],
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
)
;
}
,
)
,
]
,
),
),
],
SizedBox
(
height:
150
,),
],
);
},
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
onTap:
()
{
_showPaymentOptionsSheet
(
context
);
},
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
),
if
(
provider
.
pendingTasksLists
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Pending Tasks"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
child:
Text
(
"Add Leads and Prospect"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
Container
(
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.34
,
child:
ListView
.
builder
(
physics:
AlwaysScrollableScrollPhysics
(),
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
pendingTasksLists
.
length
,
itemBuilder:
(
context
,
index
)
{
final
headings
=
[
"Lead Name"
,
"Mobile Number"
,
"Appointment Date"
,
"Appointment Type"
,
"Note"
,
"Status"
,
];
final
subHeadings
=
[
provider
.
pendingTasksLists
[
index
].
aname
??
"-"
,
provider
.
pendingTasksLists
[
index
].
conmob
??
"-"
,
provider
.
pendingTasksLists
[
index
].
appdate
??
"-"
,
provider
.
pendingTasksLists
[
index
].
atype
??
"-"
,
provider
.
pendingTasksLists
[
index
].
anote
??
"-"
,
provider
.
pendingTasksLists
[
index
].
lstatus
??
"-"
,
];
return
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.3
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
...
List
.
generate
(
headings
.
length
,
(
j
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
6
,
horizontal:
0
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
"
${headings[j]}
"
,
style:
TextStyle
(
fontSize:
14
),
),
),
Expanded
(
child:
Text
(
"
${subHeadings[j]}
"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
14
,
),
),
),
],
),
);
}),
],
),
);
},
),
),
],
SizedBox
(
height:
150
),
],
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
onTap:
()
{
_showPaymentOptionsSheet
(
context
);
},
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 Leads and Prospect"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
...
...
lib/screens/finance/addPaymentReceiptList.dart
View file @
3ad2ea55
...
...
@@ -11,6 +11,7 @@ import 'package:provider/provider.dart';
import
'../../Notifiers/financeProvider/paymentReceiptsProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
Addpaymentreceiptlist
extends
StatefulWidget
{
final
pageTitleName
;
const
Addpaymentreceiptlist
({
super
.
key
,
this
.
pageTitleName
});
...
...
@@ -21,7 +22,7 @@ class Addpaymentreceiptlist extends StatefulWidget {
class
_AddpaymentreceiptlistState
extends
State
<
Addpaymentreceiptlist
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
12
,
(
index
)
=>
FocusNode
()
,
);
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
12
,
(
index
)
=>
FocusNode
());
@override
void
initState
()
{
// TODO: implement initState
...
...
@@ -37,7 +38,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
@override
void
dispose
()
{
focusNodes
.
map
((
e
)=>
e
.
dispose
());
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
super
.
dispose
();
}
...
...
@@ -53,12 +54,17 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar2
(
context
,
"
${widget.pageTitleName}
"
,
provider
.
resetForm
,
SizedBox
(
width:
0
,)),
body:
Container
(
appBar:
appbar2
(
context
,
"
${widget.pageTitleName}
"
,
provider
.
resetForm
,
SizedBox
(
width:
0
),
),
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
...
...
@@ -80,22 +86,21 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
[
...
provider
.
receiptAccounts
.
map
(
(
accs
)
=>
DropdownMenuItem
<
Accounts
>(
value:
accs
,
child:
Text
(
accs
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
items:
[
...
provider
.
receiptAccounts
.
map
(
(
accs
)
=>
DropdownMenuItem
<
Accounts
>(
value:
accs
,
child:
Text
(
accs
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
)
.
toList
(),
],
value:
provider
.
selectreceiptAccounts
,
onChanged:
(
Accounts
?
value
)
{
...
...
@@ -106,42 +111,51 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
receiptAccountId
=
value
.
id
!;
provider
.
receiptAccountValue
=
value
.
name
!;
provider
.
receiptAccountValue
=
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
receiptAccountId
.
toString
(),
provider
.
receiptAccountId
.
toString
(),
);
}
}
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
accountSearchController
,
searchController:
provider
.
accountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
accountSearchController
,
controller:
provider
.
accountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
())
??
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
...
...
@@ -171,22 +185,22 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
receiptPaymentAccounts
.
map
(
(
accs
)
=>
DropdownMenuItem
<
ReceiptAccounts
>(
value:
accs
,
child:
Text
(
accs
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
provider
.
receiptPaymentAccounts
.
map
(
(
accs
)
=>
DropdownMenuItem
<
ReceiptAccounts
>(
value:
accs
,
child:
Text
(
accs
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
)
,
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectreceiptPaymentAccounts
,
onChanged:
(
ReceiptAccounts
?
value
)
{
if
(
value
!=
null
)
{
...
...
@@ -199,9 +213,9 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
receiptPaymentAccountsID
=
value
.
id
!;
value
.
id
!;
provider
.
receiptPaymentAccountsValue
=
value
.
name
!;
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
receiptPaymentAccountsID
...
...
@@ -212,36 +226,45 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
())
??
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
.
clear
();
provider
.
paymentAccountSearchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
...
...
@@ -256,59 +279,60 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
errorWidget
(
context
,
provider
.
selectPaymentAccountError
),
textControllerWidget
(
context
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
context
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
focusNodes
[
0
],
focusNodes
[
1
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
amountError
),
///payment date toBE
TextWidget
(
context
,
"Receipt Date"
),
GestureDetector
(
onTap:
()
{
provider
.
showDatePickerDialog
(
context
);
},
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
child:
Container
(
height:
50
,
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
,
),
child:
TextFormField
(
controller:
provider
.
dateController
,
keyboardType:
TextInputType
.
text
,
enabled:
false
,
maxLines:
1
,
maxLines:
1
,
readOnly:
true
,
onChanged:
(
value
)
{
},
onChanged:
(
value
)
{},
focusNode:
focusNodes
[
1
],
onTapUpOutside:
(
event
)
{
if
(
focusNodes
[
1
].
hasFocus
){
focusNodes
[
1
].
unfocus
();
}
if
(
focusNodes
[
1
].
hasFocus
)
{
focusNodes
[
1
].
unfocus
();
}
},
textInputAction:
TextInputAction
.
done
,
onEditingComplete:
()
{
focusNodes
[
1
].
unfocus
();
},
decoration:
InputDecoration
(
hintText:
"Enter Date"
,
...
...
@@ -344,33 +368,37 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
receiptPaymentModes
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
PaymentModes
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
provider
.
receiptPaymentModes
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
PaymentModes
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
)
,
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectreceiptPaymentModes
,
onChanged:
(
PaymentModes
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
receiptPaymentModes
.
isNotEmpty
)
{
provider
.
selectreceiptPaymentModes
=
value
;
if
(
provider
.
receiptPaymentModes
.
isNotEmpty
)
{
provider
.
selectreceiptPaymentModes
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
receiptPaymentModesID
=
value
.
id
!;
provider
.
receiptPaymentModesID
=
value
.
id
!;
provider
.
receiptPaymentModesValues
=
value
.
name
!;
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
receiptPaymentModesID
...
...
@@ -394,97 +422,119 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
"RTGS"
,
"IMPS"
,
"NEFT"
,
].
contains
(
provider
.
paymentModeValue
))
...
[
].
contains
(
provider
.
paymentModeValue
))
...[
textControllerWidget
(
context
,
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
context
,
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
2
],
focusNodes
[
3
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankNameError
),
textControllerWidget
(
context
,
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
context
,
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankBranchError
),
textControllerWidget
(
context
,
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
4
],
focusNodes
[
5
],
TextInputAction
.
next
context
,
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
4
],
focusNodes
[
5
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankNumberError
),
textControllerWidget
(
context
,
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
5
],
focusNodes
[
6
],
TextInputAction
.
next
context
,
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
5
],
focusNodes
[
6
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankIFSCError
),
textControllerWidget
(
context
,
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
focusNodes
[
8
],
TextInputAction
.
next
context
,
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
focusNodes
[
8
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankHolderError
),
]
else
if
(
provider
.
paymentModeValue
==
"UPI"
)
...
[
]
else
if
(
provider
.
paymentModeValue
==
"UPI"
)
...[
textControllerWidget
(
context
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
context
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
focusNodes
[
8
],
TextInputAction
.
next
focusNodes
[
8
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
UPIError
),
],
textControllerWidget
(
context
,
provider
.
paymentReferenceController
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
provider
.
updatereference
,
TextInputType
.
text
,
false
,
null
,
context
,
provider
.
paymentReferenceController
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
provider
.
updatereference
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
focusNodes
[
9
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
paymentreferenceError
),
textControllerWidget
(
context
,
provider
.
descController
,
"Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
9
],
focusNodes
[
10
],
TextInputAction
.
done
context
,
provider
.
descController
,
"Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
9
],
focusNodes
[
10
],
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
descriptionError
),
InkResponse
(
...
...
@@ -514,59 +564,83 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)...[
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
),),
InkResponse
(
Expanded
(
flex:
5
,
child:
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,))
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
),
],
),
)
)
,
],
SizedBox
(
height:
75
,
)
SizedBox
(
height:
75
)
,
],
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
FloatingActionButtonLocation
.
centerFloat
,
bottomNavigationBar:
InkResponse
(
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
true
;
provider
.
addReceiptPaymentRequestionSubmitAPI
(
context
,
provider
.
formattedDate
);
},
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
true
;
provider
.
addReceiptPaymentRequestionSubmitAPI
(
context
,
provider
.
formattedDate
,
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),
):
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
child:
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),
)
:
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
),
...
...
@@ -638,8 +712,6 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
// );
// }
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
...
...
@@ -658,9 +730,9 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
),
child:
Container
(
margin:
EdgeInsets
.
only
(
...
...
lib/screens/finance/directPaymentRequesitionList.dart
View file @
3ad2ea55
...
...
@@ -27,7 +27,7 @@ class Directpaymentrequesitionlist extends StatefulWidget {
class
_DirectpaymentrequesitionlistState
extends
State
<
Directpaymentrequesitionlist
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
12
,
(
index
)
=>
FocusNode
()
,
);
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
12
,
(
index
)
=>
FocusNode
());
@override
void
initState
()
{
...
...
@@ -44,7 +44,7 @@ class _DirectpaymentrequesitionlistState
@override
void
dispose
()
{
focusNodes
.
map
((
e
)
=>
e
.
dispose
()
,
);
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
super
.
dispose
();
}
...
...
@@ -60,7 +60,7 @@ class _DirectpaymentrequesitionlistState
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
...
...
@@ -98,7 +98,8 @@ class _DirectpaymentrequesitionlistState
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
)
...
...
@@ -122,32 +123,39 @@ class _DirectpaymentrequesitionlistState
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
accountSearchController
,
searchController:
provider
.
accountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
accountSearchController
,
controller:
provider
.
accountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
())
??
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
...
...
@@ -164,8 +172,6 @@ class _DirectpaymentrequesitionlistState
),
),
errorWidget
(
context
,
provider
.
selectDirectAccountError
),
TextWidget
(
context
,
"Payment Account"
),
DropdownButtonHideUnderline
(
...
...
@@ -221,36 +227,45 @@ class _DirectpaymentrequesitionlistState
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
())
??
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
.
clear
();
provider
.
paymentAccountSearchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
...
...
@@ -271,11 +286,13 @@ class _DirectpaymentrequesitionlistState
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
focusNodes
[
0
],
focusNodes
[
1
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
amountError
),
...
...
@@ -312,16 +329,13 @@ class _DirectpaymentrequesitionlistState
onChanged:
(
value
)
{},
focusNode:
focusNodes
[
1
],
onTapUpOutside:
(
event
)
{
if
(
focusNodes
[
1
].
hasFocus
){
if
(
focusNodes
[
1
].
hasFocus
)
{
focusNodes
[
1
].
unfocus
();
}
},
textInputAction:
TextInputAction
.
done
,
onEditingComplete:
()
{
focusNodes
[
1
].
unfocus
();
},
decoration:
InputDecoration
(
hintText:
"Enter Date"
,
...
...
@@ -375,7 +389,9 @@ class _DirectpaymentrequesitionlistState
value:
provider
.
selectDirectPaymentModes
,
onChanged:
(
DirectPaymentModes
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
directPaymentModes
.
isNotEmpty
)
{
if
(
provider
.
directPaymentModes
.
isNotEmpty
)
{
provider
.
selectDirectPaymentModes
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
...
...
@@ -412,10 +428,13 @@ class _DirectpaymentrequesitionlistState
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
2
],
focusNodes
[
3
],
TextInputAction
.
next
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
2
],
focusNodes
[
3
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankNameError
),
textControllerWidget
(
...
...
@@ -423,10 +442,13 @@ class _DirectpaymentrequesitionlistState
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankBranchError
),
textControllerWidget
(
...
...
@@ -434,10 +456,13 @@ class _DirectpaymentrequesitionlistState
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
4
],
focusNodes
[
5
],
TextInputAction
.
next
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
4
],
focusNodes
[
5
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankNumberError
),
textControllerWidget
(
...
...
@@ -445,10 +470,13 @@ class _DirectpaymentrequesitionlistState
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
5
],
focusNodes
[
6
],
TextInputAction
.
next
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
5
],
focusNodes
[
6
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankIFSCError
),
textControllerWidget
(
...
...
@@ -456,22 +484,29 @@ class _DirectpaymentrequesitionlistState
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
focusNodes
[
8
],
TextInputAction
.
next
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
focusNodes
[
8
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankHolderError
),
]
else
if
(
provider
.
directPaymentModesValues
==
"UPI"
)
...[
]
else
if
(
provider
.
directPaymentModesValues
==
"UPI"
)
...[
textControllerWidget
(
context
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
focusNodes
[
8
],
TextInputAction
.
next
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
focusNodes
[
8
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
UPIError
),
],
...
...
@@ -480,10 +515,13 @@ class _DirectpaymentrequesitionlistState
provider
.
paymentReferenceController
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
provider
.
updateReference
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
focusNodes
[
9
],
TextInputAction
.
next
provider
.
updateReference
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
focusNodes
[
9
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
paymentreferenceerror
),
textControllerWidget
(
...
...
@@ -491,10 +529,13 @@ class _DirectpaymentrequesitionlistState
provider
.
descController
,
"Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
9
],
focusNodes
[
10
],
TextInputAction
.
done
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
9
],
focusNodes
[
10
],
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
descriptionError
),
InkResponse
(
...
...
@@ -524,27 +565,42 @@ class _DirectpaymentrequesitionlistState
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)...[
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
),),
InkResponse
(
Flexible
(
flex:
4
,
child:
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,))
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
),
],
),
)
)
,
],
],
),
...
...
@@ -553,13 +609,16 @@ class _DirectpaymentrequesitionlistState
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
bottomNavigationBar:
InkResponse
(
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
true
;
provider
.
addDirectPaymentRequestionSubmitAPI
(
context
,
provider
.
formattedDate
,
);
},
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
true
;
provider
.
addDirectPaymentRequestionSubmitAPI
(
context
,
provider
.
formattedDate
,
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
...
...
@@ -569,16 +628,21 @@ class _DirectpaymentrequesitionlistState
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
app_blue
),
):
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
child:
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
app_blue
,
),
)
:
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
),
...
...
@@ -650,8 +714,6 @@ class _DirectpaymentrequesitionlistState
// );
// }
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
...
...
lib/screens/finance/financeDashboard.dart
View file @
3ad2ea55
...
...
@@ -29,175 +29,167 @@ class _FinancedashboardState extends State<Financedashboard> {
@override
Widget
build
(
BuildContext
context
)
{
return
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
)
:
_scaffold
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Dashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
pages
=
provider
.
accessiblePagesList
;
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Finance"
),
body:
SizedBox
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
ListView
.
builder
(
itemCount:
pages
.
length
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
Widget
?
SvgIcon
;
switch
(
pages
[
index
].
mode
)
{
case
"apr_lvl1"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
,
);
break
;
case
"apr_lvl2"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
,
);
break
;
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
);
break
;
}
return
InkResponse
(
onTap:
()
async
{
var
navigate
;
if
(
pages
[
index
].
pageName
==
"Payments List"
)
{
navigate
=
Paymentlistpaymentrequisition
(
pageTitleName:
provider
.
accessiblePagesList
[
index
]
.
pageName
!,
);
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Payment Receipts List"
)
{
navigate
=
Paymentreceiptlist
(
pageTitleName:
provider
.
accessiblePagesList
[
index
]
.
pageName
!,
);
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account List"
)
{
navigate
=
Accountslist
();
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Finance"
),
body:
SizedBox
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
ListView
.
builder
(
itemCount:
pages
.
length
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
Widget
?
SvgIcon
;
switch
(
pages
[
index
].
mode
)
{
case
"apr_lvl1"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
break
;
case
"apr_lvl2"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
);
break
;
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
break
;
}
return
InkResponse
(
onTap:
()
async
{
var
navigate
;
if
(
pages
[
index
].
pageName
==
"Payments List"
)
{
navigate
=
Paymentlistpaymentrequisition
(
pageTitleName:
provider
.
accessiblePagesList
[
index
].
pageName
!,
);
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Payment Receipts List"
)
{
navigate
=
Paymentreceiptlist
(
pageTitleName:
provider
.
accessiblePagesList
[
index
].
pageName
!,
);
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account List"
)
{
navigate
=
Accountslist
();
// break;
}
else
if
(
provider
// break;
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account Ledger"
)
{
navigate
=
Accountledger
();
}
else
{
navigate
=
Allpaymentrequesitionlistsbymodes
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
provider
.
accessiblePagesList
[
index
].
pageName
!,
);
}
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
),
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Row
(
children:
[
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account Ledger"
)
{
navigate
=
Accountledger
();
}
else
{
navigate
=
Allpaymentrequesitionlistsbymodes
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
provider
.
accessiblePagesList
[
index
]
.
pageName
!,
);
}
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
,
"Account List"
)
...[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_1.svg"
,
width:
25
,
),
),
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Row
(
children:
[
if
(
provider
]
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account List"
)...[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_1.svg"
,
width:
25
,
),
)
]
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account Ledger"
)...[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_2.svg"
,
width:
25
,
),
)
]
else
...[
Expanded
(
flex:
1
,
child:
SvgIcon
),
],
Expanded
(
flex:
5
,
child:
Text
(
"
${pages[index].pageName}
"
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
"Account Ledger"
)
...[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_2.svg"
,
width:
25
,
),
],
),
]
else
...[
Expanded
(
flex:
1
,
child:
SvgIcon
),
],
Expanded
(
flex:
5
,
child:
Text
(
"
${pages[index].pageName}
"
),
),
),
);
},
),
SizedBox
(
height:
150
,)
],
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
),
),
);
},
),
),
SizedBox
(
height:
150
),
],
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton
:
InkResponse
(
onTap:
()
{
_showPaymentOptionsSheet
(
context
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
cent
er
,
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"
,
style
:
Text
Style
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
)
,
)
,
),
)
,
floatingActionButton
Location:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
onTap:
()
{
_showPaymentOptionsSheet
(
context
);
}
,
child:
Contain
er
(
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"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
...
...
@@ -295,14 +287,16 @@ class _FinancedashboardState extends State<Financedashboard> {
),
);
}
else
if
(
provider
.
accessiblePagesList2
[
index
]
.
pageName
!.
contains
(
"Add Account"
))
{
.
accessiblePagesList2
[
index
]
.
pageName
!
.
contains
(
"Add Account"
))
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Addcommonpayment
(
from:
"Dashboard"
,
),
builder:
(
context
)
=>
Addcommonpayment
(
from:
"Dashboard"
,
),
),
);
}
else
{
...
...
lib/screens/finance/submitPaymentRequestionListsByMode.dart
View file @
3ad2ea55
...
...
@@ -22,7 +22,8 @@ class Submitpaymentrequestionlistsbymode extends StatefulWidget {
const
Submitpaymentrequestionlistsbymode
({
super
.
key
,
required
this
.
mode
,
required
this
.
pageTitleName
,
this
.
accountId
,
required
this
.
pageTitleName
,
this
.
accountId
,
});
@override
...
...
@@ -34,7 +35,8 @@ class _SubmitpaymentrequestionlistsbymodeState
extends
State
<
Submitpaymentrequestionlistsbymode
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
11
,
(
index
)
=>
FocusNode
());
GlobalKey
_globalKey
=
GlobalKey
();
ScrollController
scrollcontroller
=
ScrollController
();
@override
void
initState
()
{
// TODO: implement initState
...
...
@@ -46,69 +48,49 @@ class _SubmitpaymentrequestionlistsbymodeState
);
print
(
"widget.accountId
${widget.accountId}
"
);
provider
.
addPaymentRequestionViewAPI
(
context
,
widget
.
mode
);
Future
.
delayed
(
Duration
(
milliseconds:
500
),()
{
if
(
widget
.
mode
==
"self"
&&
provider
.
accounts
.
length
==
1
)
{
provider
.
selectedAccount
=
provider
.
accounts
.
first
;
provider
.
accountId
=
provider
.
accounts
.
first
.
id
!;
}
else
if
(
widget
.
mode
==
"other"
&&
provider
.
accounts
!=
null
)
{
if
(
widget
.
accountId
!=
null
)
{
provider
.
selectedAccount
=
provider
.
accounts
.
firstWhereOrNull
(
(
element
)
=>
element
.
id
==
widget
.
accountId
,
);
print
(
"sdsd,al;,al
${provider.selectedAccount!.id}
"
);
print
(
"sdsd,al;,al
${provider.selectedAccount!.name}
"
);
provider
.
accountId
=
provider
.
accounts
.
firstWhere
(
(
e
)
=>
e
.
id
==
widget
.
accountId
,
)!
.
id
!;
provider
.
accountValue
=
provider
.
accounts
.
firstWhere
(
(
e
)
=>
e
.
id
==
widget
.
accountId
,
)!
.
name
!;
}
}
},);
Future
.
delayed
(
Duration
(
milliseconds:
500
),
()
{
if
(
widget
.
mode
==
"self"
&&
provider
.
accounts
.
length
==
1
)
{
provider
.
selectedAccount
=
provider
.
accounts
.
first
;
provider
.
accountId
=
provider
.
accounts
.
first
.
id
!;
}
else
if
(
widget
.
mode
==
"other"
&&
provider
.
accounts
!=
null
)
{
if
(
widget
.
accountId
!=
null
)
{
provider
.
selectedAccount
=
provider
.
accounts
.
firstWhereOrNull
(
(
element
)
=>
element
.
id
==
widget
.
accountId
,
);
print
(
"sdsd,al;,al
${provider.selectedAccount!.id}
"
);
print
(
"sdsd,al;,al
${provider.selectedAccount!.name}
"
);
provider
.
accountId
=
provider
.
accounts
.
firstWhere
((
e
)
=>
e
.
id
==
widget
.
accountId
)!
.
id
!;
provider
.
accountValue
=
provider
.
accounts
.
firstWhere
((
e
)
=>
e
.
id
==
widget
.
accountId
)!
.
name
!;
}
}
});
});
}
@override
void
dispose
()
{
scrollcontroller
.
dispose
();
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
super
.
dispose
();
}
autofill
(
res
){
autofill
(
res
)
{
print
(
"auto"
);
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
);
if
(
provider
.
accounts
!=
null
)
{
provider
.
selectedAccount
=
provider
.
accounts
.
firstWhereOrNull
((
element
)
=>
element
.
id
==
res
,);
provider
.
selectedAccount
=
provider
.
accounts
.
firstWhereOrNull
(
(
element
)
=>
element
.
id
==
res
,
);
print
(
"sdsd,al;,al
${provider.selectedAccount}
"
);
provider
.
accountId
=
provider
.
accounts
.
firstWhere
(
(
e
)
=>
e
.
id
==
res
,
)
.
id
!;
provider
.
accountId
=
provider
.
accounts
.
firstWhere
((
e
)
=>
e
.
id
==
res
).
id
!;
provider
.
accountValue
=
provider
.
accounts
.
firstWhere
(
(
e
)
=>
e
.
id
==
res
,
)
.
name
!;
provider
.
accounts
.
firstWhere
((
e
)
=>
e
.
id
==
res
).
name
!;
}
}
...
...
@@ -121,12 +103,10 @@ class _SubmitpaymentrequestionlistsbymodeState
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Requestionlistprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
...
...
@@ -143,6 +123,7 @@ class _SubmitpaymentrequestionlistsbymodeState
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
SingleChildScrollView
(
controller:
scrollcontroller
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
...
...
@@ -233,7 +214,7 @@ class _SubmitpaymentrequestionlistsbymodeState
)
??
false
;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange:
(
isOpen
)
{
...
...
@@ -257,7 +238,9 @@ class _SubmitpaymentrequestionlistsbymodeState
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Addcommonpayment
(
from:
"Requesition"
,),
(
context
)
=>
Addcommonpayment
(
from:
"Requesition"
,
),
),
);
print
(
"return Response:
${res}
"
);
...
...
@@ -272,7 +255,7 @@ class _SubmitpaymentrequestionlistsbymodeState
Durations
.
long4
,
()
async
{
print
(
"Long411"
);
autofill
(
res
);
autofill
(
res
);
},
);
}
...
...
@@ -297,7 +280,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
errorWidget
(
context
,
provider
.
selectAccountError
),
if
([
"self"
,
"admin"
].
contains
(
widget
.
mode
))
...[
TextWidget
(
context
,
"Select Requisition Type"
),
DropdownButtonHideUnderline
(
...
...
@@ -327,14 +310,14 @@ class _SubmitpaymentrequestionlistsbymodeState
)
.
toList
(),
value:
provider
.
selectReqPurpose
,
onChanged:
(
String
?
value
)
{
if
(
value
!=
null
)
{
provider
.
selectReqPurpose
=
value
;
print
(
"Selected Complaint Type:
${value}
,"
,
);
print
(
"hfjkshfg"
+
provider
.
selectReqPurpose
...
...
@@ -367,7 +350,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
],
errorWidget
(
context
,
provider
.
reqPurposeError
),
textControllerWidget
(
context
,
provider
.
descController
,
...
...
@@ -382,7 +365,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
descriptionError
),
textControllerWidget
(
context
,
provider
.
amountController
,
...
...
@@ -397,7 +380,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
amountError
),
TextWidget
(
context
,
"Select Payment Mode"
),
DropdownButtonHideUnderline
(
child:
Row
(
...
...
@@ -441,6 +424,27 @@ class _SubmitpaymentrequestionlistsbymodeState
"hfjkshfg"
+
provider
.
paymentModeId
.
toString
(),
);
if
([
"Cheque"
,
"RTGS"
,
"IMPS"
,
"NEFT"
,
].
contains
(
provider
.
paymentModeValue
))
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
final
context
=
_globalKey
.
currentContext
;
if
(
context
!=
null
)
{
Scrollable
.
ensureVisible
(
context
,
duration:
Duration
(
milliseconds:
300
,
),
curve:
Curves
.
easeInOut
,
);
}
});
}
}
}
},
...
...
@@ -454,8 +458,8 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
errorWidget
(
context
,
provider
.
selectPaymentError
),
if
(
widget
.
mode
==
"other"
)...[
if
(
widget
.
mode
==
"other"
)
...[
TextWidget
(
context
,
"Select Approval Employee"
),
DropdownButtonHideUnderline
(
child:
Row
(
...
...
@@ -469,32 +473,37 @@ class _SubmitpaymentrequestionlistsbymodeState
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
approvalEmployee
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
Employees
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
provider
.
approvalEmployee
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
Employees
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedApprovalEmployee
,
onChanged:
(
Employees
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
approvalEmployee
.
isNotEmpty
)
{
provider
.
selectedApprovalEmployee
=
value
;
if
(
provider
.
approvalEmployee
.
isNotEmpty
)
{
provider
.
selectedApprovalEmployee
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
selectedApprovalEmployeeID
=
value
.
id
!;
provider
.
selectedApprovalEmployeeValue
=
value
.
name
!;
provider
.
selectedApprovalEmployeeID
=
value
.
id
!;
provider
.
selectedApprovalEmployeeValue
=
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
paymentModeId
.
toString
(),
...
...
@@ -513,7 +522,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
errorWidget
(
context
,
provider
.
selectPaymentError
),
],
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
...
...
@@ -548,24 +557,30 @@ class _SubmitpaymentrequestionlistsbymodeState
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
Expanded
(
flex:
4
,
child:
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
),
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
),
],
...
...
@@ -573,13 +588,14 @@ class _SubmitpaymentrequestionlistsbymodeState
),
],
errorWidget
(
context
,
provider
.
FileError
),
if
([
"Cheque"
,
"RTGS"
,
"IMPS"
,
"NEFT"
,
].
contains
(
provider
.
paymentModeValue
))
...[
SizedBox
(
height:
3
,
key:
_globalKey
),
textControllerWidget
(
context
,
provider
.
bankNameController
,
...
...
@@ -594,7 +610,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankNameError
),
textControllerWidget
(
context
,
provider
.
bankBranchController
,
...
...
@@ -609,7 +625,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankBranchError
),
textControllerWidget
(
context
,
provider
.
bankAccNumberController
,
...
...
@@ -624,7 +640,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankNumberError
),
textControllerWidget
(
context
,
provider
.
bankIfscController
,
...
...
@@ -639,13 +655,13 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankIFSCError
),
],
],
if
([
"Cheque"
,
"RTGS"
,
"IMPS"
,
"NEFT"
,
"UPI"
"UPI"
,
].
contains
(
provider
.
paymentModeValue
))
...[
textControllerWidget
(
context
,
...
...
@@ -688,18 +704,18 @@ class _SubmitpaymentrequestionlistsbymodeState
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
fals
e
;
provider
.
submitClicked
=
tru
e
;
provider
.
addPaymentRequestionSubmitAPI
(
context
,
widget
.
mode
,
provider
.
selectedApprovalEmployeeID
provider
.
selectedApprovalEmployeeID
,
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
...
...
lib/screens/genTracker/GenTrackerDashboard.dart
View file @
3ad2ea55
...
...
@@ -17,6 +17,15 @@ class Gentrackerdashboard extends StatefulWidget {
class
_GentrackerdashboardState
extends
State
<
Gentrackerdashboard
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
)
:
_scaffold
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
final
names
=
[
"Generator Details"
,
// "Register Complaint",
...
...
@@ -29,117 +38,109 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
// "gent_tag_loc",
"gent_tag_den"
,
];
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Tracker"
),
body:
Column
(
children:
[
Expanded
(
flex:
1
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
names
.
length
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
),
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
return
InkResponse
(
onTap:
()
{
switch
(
names
[
index
])
{
case
"Generator Details"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Generator Details"
,
),
),
);
break
;
case
"Register Complaint"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Register Complaint"
,
),
),
);
break
;
case
"Tag Location"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Tag Location"
,
),
),
);
break
;
case
"Tag Generator"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Tag Generator"
,
),
),
);
break
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Tracker"
),
body:
Column
(
children:
[
Expanded
(
flex:
1
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
names
.
length
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
),
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
return
InkResponse
(
onTap:
()
{
switch
(
names
[
index
])
{
case
"Generator Details"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Generator Details"
,
),
),
);
break
;
case
"Register Complaint"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Register Complaint"
,
),
),
);
break
;
case
"Tag Location"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Tag Location"
,
),
),
);
break
;
case
"Tag Generator"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Tag Generator"
,
),
),
);
break
;
default
:
print
(
"111"
);
break
;
}
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
30
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/
${icons[index]}
.svg"
),
SizedBox
(
height:
10
),
Text
(
names
[
index
]),
],
),
),
);
default
:
print
(
"111"
);
break
;
}
},
),
),
SizedBox
(
height:
10
),
Expanded
(
flex:
3
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Text
(
"Note: 'Tag Location' and 'Register Complaint' are moved to 'Generator Details'."
,
style:
TextStyle
(
color:
AppColors
.
grey_thick
,
fontSize:
14
),
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
30
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/
${icons[index]}
.svg"
),
SizedBox
(
height:
10
),
Text
(
names
[
index
]),
],
),
),
),
);
},
),
),
SizedBox
(
height:
10
),
Expanded
(
flex:
3
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Text
(
"Note: 'Tag Location' and 'Register Complaint' are moved to 'Generator Details'."
,
style:
TextStyle
(
color:
AppColors
.
grey_thick
,
fontSize:
14
),
),
SizedBox
(
height:
10
),
],
),
),
),
SizedBox
(
height:
10
),
],
),
);
}
...
...
lib/screens/inventory/InventoryScreen.dart
View file @
3ad2ea55
...
...
@@ -35,78 +35,87 @@ class _InventoryScreenState extends State<InventoryScreen> {
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
InventoryProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
return
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Inventory"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
Container
(
height:
250
,
child:
QRView
(
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
)
:
_scaffold
(
context
);
}
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
"inventory"
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
InventoryProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Inventory"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
Container
(
height:
250
,
overlay:
QrScannerOverlayShape
(
child:
QRView
(
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
"inventory"
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
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
(
"to open Inventory"
,
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
),
overlay:
QrScannerOverlayShape
(
borderColor:
AppColors
.
app_blue
,
borderRadius:
20
,
borderLength:
60
,
borderWidth:
10
,
cutOutSize:
250.0
,
),
InkResponse
(
onTap:
()
async
{
_showPartIdBottomSheet
(
context
);
},
child:
Text
(
"Tap To Enter Part ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
17
,
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
(
"to open Inventory"
,
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
{
_showPartIdBottomSheet
(
context
);
},
child:
Text
(
"Tap To Enter Part ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
17
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
SizedBox
(
height:
50
),
],
),
),
),
SizedBox
(
height:
50
),
],
),
),
);
...
...
@@ -160,7 +169,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
),
),
),
SizedBox
(
height:
5
,
),
SizedBox
(
height:
5
),
Container
(
height:
48
,
alignment:
Alignment
.
center
,
...
...
@@ -188,7 +197,8 @@ class _InventoryScreenState extends State<InventoryScreen> {
controller:
partIDcontroller
,
keyboardType:
TextInputType
.
text
,
focusNode:
partIDfocusNode
,
textCapitalization:
TextCapitalization
.
characters
,
textCapitalization:
TextCapitalization
.
characters
,
style:
TextStyle
(
fontSize:
14
),
onChanged:
(
value
)
{},
...
...
@@ -210,7 +220,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
),
),
),
SizedBox
(
height:
15
,
),
SizedBox
(
height:
15
),
InkWell
(
onTap:
()
{
provider
.
LoadPartDetailsApifunction
(
...
...
@@ -238,9 +248,11 @@ class _InventoryScreenState extends State<InventoryScreen> {
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
,
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
fontSize:
15
),
fontSize:
15
,
),
),
),
),
...
...
lib/screens/order/orderModuleDashboard.dart
View file @
3ad2ea55
...
...
@@ -23,243 +23,237 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Pagesdashboardprovider
>(
context
,
listen:
false
);
var
provider
=
Provider
.
of
<
Pagesdashboardprovider
>(
context
,
listen:
false
,
);
provider
.
orderDashboardAPIFunction
(
context
,
"executive"
,
""
,
""
,
""
);
provider
.
ordersAccessiblePagesAPIFunction
(
context
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
)
:
_scaffold
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
pages
=
provider
.
ordersAccessiblePagesList
;
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Orders"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)
),
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.28
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
itemCount:
provider
.
ordersgain
.
length
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
physics:
AlwaysScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
0.65
),
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
'Order Gain'
,
'Dispatched'
,
'Pending Tasks'
,
'Quote'
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
async
{
if
(
provider
.
ordersgain
[
jndex
].
filter
!.
pageName
!=
""
)
{
if
(
provider
.
ordersgain
[
jndex
].
filter
!.
pageName
!
.
contains
(
"Order List"
))
{
// await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => OrderslistbyModes(
// pageTitleName:
// provider
// .ordersgain[jndex]
// .filter!
// .pageName!,
// mode:
// provider.ordersgain[jndex].filter!.mode,
// filter: provider.ordersgain[jndex].filter!,
// ),
// ),
// );
}
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
12
),
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Orders"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.28
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
itemCount:
provider
.
ordersgain
.
length
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
physics:
AlwaysScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
0.65
,
),
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
'Order Gain'
,
'Dispatched'
,
'Pending Tasks'
,
'Quote'
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
async
{
if
(
provider
.
ordersgain
[
jndex
].
filter
!.
pageName
!=
""
)
{
if
(
provider
.
ordersgain
[
jndex
].
filter
!.
pageName
!
.
contains
(
"Order List"
))
{
// await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => OrderslistbyModes(
// pageTitleName:
// provider
// .ordersgain[jndex]
// .filter!
// .pageName!,
// mode:
// provider.ordersgain[jndex].filter!.mode,
// filter: provider.ordersgain[jndex].filter!,
// ),
// ),
// );
}
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
ordersgain
[
jndex
].
count
!,
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
ordersgain
[
jndex
].
count
!,
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
),
),
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
),
);
},
),
),
],
),
),
);
},
),
),
ListView
.
builder
(
itemCount:
pages
.
length
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
Widget
?
SvgIcon
;
switch
(
pages
[
index
].
mode
)
{
case
"level_one_approval"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
,
);
break
;
case
"level_two_approval"
:
case
"level_two_rejected"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
,
);
break
;
ListView
.
builder
(
itemCount:
pages
.
length
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
Widget
?
SvgIcon
;
switch
(
pages
[
index
].
mode
)
{
case
"level_one_approval"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
break
;
case
"level_two_approval"
:
case
"level_two_rejected"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
);
break
;
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
break
;
};
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
break
;
}
;
return
InkResponse
(
onTap:
()
async
{
var
navigate
;
if
(
pages
[
index
].
pageName
!.
contains
(
"Add Order"
)
)
{
navigate
=
AddorderScreen
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
]
.
pageName
!,
);
}
if
(
pages
[
index
].
pageName
!.
contains
(
"
Add Payment"
)
)
{
(
"
navigate
to
Add
P
ayment
"
);
navigate
=
AddpaymentScreen
(
mod
e:
pages
[
index
].
mod
e
!,
pageTitleName:
pages
[
index
]
.
pageName
!
,
);
}
else
if
(
pages
[
index
].
pageName
!.
contains
(
"Payments List"
))
{
navigate
=
Paymentlistsbymode
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
]
.
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
!.
contains
(
"Order List"
)){
navigate
=
OrderslistbyModes
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
]
.
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
==
"Add TPC Agent"
){
navigate
=
AddtpcagentScreen
();
}
else
if
(
pages
[
index
].
pageName
==
"TPC Agent List (Admin)"
){
navigate
=
Tpcagentlistbymode
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
]
.
pageNam
e
!,
);
}
else
if
(
pages
[
index
].
pageName
==
"Pending TPC Issue List"
){
navigate
=
Tpcagentissuelist
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
]
.
pageName
!
,
);
}
if
(
navigate
!=
null
){
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
)
,
);
}
}
,
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
return
InkResponse
(
onTap:
()
async
{
var
navigate
;
if
(
pages
[
index
].
pageName
!.
contains
(
"Add Order"
))
{
navigate
=
AddorderScreen
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
if
(
pages
[
index
].
pageName
!.
contains
(
"Add Payment"
))
{
(
"navigate to
Add Payment"
)
;
navigate
=
Add
p
ayment
Screen
(
mode:
pages
[
index
].
mode
!,
pageTitleNam
e:
pages
[
index
].
pageNam
e
!,
);
}
else
if
(
pages
[
index
]
.
pageName
!.
contains
(
"Payments List"
,
))
{
navigate
=
Paymentlistsbymode
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
!.
contains
(
"Order List"
,
))
{
navigate
=
OrderslistbyModes
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
==
"Add TPC Agent"
)
{
navigate
=
AddtpcagentScreen
();
}
else
if
(
pages
[
index
]
.
pageName
==
"TPC Agent List (Admin)"
)
{
navigate
=
Tpcagentlistbymode
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
==
"Pending TPC Issue List"
)
{
navigate
=
Tpcagentissuelist
(
mode:
pages
[
index
].
mod
e
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
if
(
navigate
!=
null
)
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
)
,
);
}
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgIcon
),
Expanded
(
flex:
5
,
child:
Text
(
"
${pages[index].pageName}
"
),
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgIcon
),
Expanded
(
flex:
5
,
child:
Text
(
"
${pages[index].pageName}
"
,
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
)
,
)
;
}
,
)
,
]
,
]
,
)
,
)
,
)
;
}
,
),
)
,
]
,
),
),
),
...
...
lib/screens/serviceEngineer/AccountSuggestions.dart
View file @
3ad2ea55
...
...
@@ -27,7 +27,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Accounts"
),
...
...
@@ -54,7 +54,10 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
borderRadius:
BorderRadius
.
circular
(
14
),
border:
searchFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
)
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
)
:
null
,
),
// alignment: Alignment.center,
...
...
@@ -123,7 +126,9 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Account"
,
name:
accountList
![
index
].
accountName
,
name:
accountList
![
index
]
.
accountName
,
genId:
""
,
referenceID:
accountList
![
index
].
accountId
,
...
...
@@ -135,7 +140,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
child:
SizedBox
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
padding:
EdgeInsets
.
fromLTRB
(
0
,
5
,
0
,
10
),
child:
Row
(
children:
[
...
...
@@ -148,9 +154,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
SvgPicture
.
asset
(
width:
30
,
...
...
@@ -159,7 +164,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
),
),
),
SizedBox
(
width:
10
,
),
SizedBox
(
width:
10
),
Expanded
(
flex:
5
,
child:
Text
(
...
...
@@ -168,7 +173,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
maxLines:
3
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
AppColors
.
semi_black
color:
AppColors
.
semi_black
,
),
),
),
...
...
@@ -189,7 +194,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
physics:
AlwaysScrollableScrollPhysics
(),
child:
Container
(
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
// Set width to fill parent width
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
only
(
...
...
@@ -197,7 +203,12 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
topRight:
Radius
.
circular
(
30.0
),
),
),
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
,
),
child:
Container
(
child:
Align
(
alignment:
Alignment
.
center
,
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment