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
fd946558
Commit
fd946558
authored
May 13, 2025
by
varun.m
Browse files
update password and AppDelegate, Podfile,
and info.plist and App Icons by Srinivas 13-05-2025
parent
2d144052
Changes
190
Hide whitespace changes
Inline
Side-by-side
lib/main.dart
View file @
fd946558
...
...
@@ -21,6 +21,7 @@ import 'package:generp/Notifiers/PendingComplaintsProvider.dart';
import
'package:generp/Notifiers/ProfileNotifier.dart'
;
import
'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart'
;
import
'package:generp/Notifiers/TodayMontlyVisitsProvider.dart'
;
import
'package:generp/Notifiers/UpdatePasswordProvider'
;
import
'package:generp/Notifiers/VisitDetailsProvider.dart'
;
import
'package:generp/Notifiers/loginNotifier.dart'
;
import
'package:generp/Notifiers/scanLoginProvider.dart'
;
...
...
@@ -31,13 +32,14 @@ import 'package:generp/screens/splash.dart';
import
'package:provider/provider.dart'
;
const
AndroidNotificationChannel
channel
=
AndroidNotificationChannel
(
'generp_channel'
,
// id
'generp_channel_name'
,
importance:
Importance
.
max
,
playSound:
false
);
'generp_channel'
,
// id
'generp_channel_name'
,
importance:
Importance
.
max
,
playSound:
false
,
);
final
FlutterLocalNotificationsPlugin
flutterLocalNotificationsPlugin
=
FlutterLocalNotificationsPlugin
();
FlutterLocalNotificationsPlugin
();
Future
<
void
>
_firebaseMessagingBackgroundHandler
(
RemoteMessage
message
)
async
{
await
Firebase
.
initializeApp
();
...
...
@@ -60,20 +62,19 @@ Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
);
}
else
{
FlutterRingtonePlayer
().
play
(
fromAsset:
"assets/notification_sound.mp3"
,
// will be the sound on Android
ios:
IosSounds
.
glass
// will be the sound on iOS
fromAsset:
"assets/notification_sound.mp3"
,
// will be the sound on Android
ios:
IosSounds
.
glass
,
// will be the sound on iOS
);
}
if
(
kDebugMode
){
if
(
kDebugMode
)
{
print
(
'A Background message just showed up:
${message.messageId}
'
);
}
}
void
main
(
)
async
{
void
main
(
)
async
{
WidgetsFlutterBinding
.
ensureInitialized
();
if
(
kDebugMode
){
if
(
kDebugMode
)
{
if
(
Firebase
.
apps
.
isNotEmpty
)
{
print
(
"Firebase is initialized"
);
}
else
{
...
...
@@ -81,7 +82,6 @@ void main() async{
}
}
if
(
Platform
.
isAndroid
)
{
await
Firebase
.
initializeApp
(
options:
FirebaseOptions
(
...
...
@@ -128,9 +128,9 @@ void main() async{
);
}
else
{
FlutterRingtonePlayer
().
play
(
fromAsset:
"assets/notification_sound.mp3"
,
// will be the sound on Android
ios:
IosSounds
.
glass
// will be the sound on iOS
fromAsset:
"assets/notification_sound.mp3"
,
// will be the sound on Android
ios:
IosSounds
.
glass
,
// will be the sound on iOS
);
}
});
...
...
@@ -139,7 +139,8 @@ void main() async{
await
flutterLocalNotificationsPlugin
.
resolvePlatformSpecificImplementation
<
AndroidFlutterLocalNotificationsPlugin
>()
AndroidFlutterLocalNotificationsPlugin
>()
?.
createNotificationChannel
(
channel
);
await
FirebaseMessaging
.
instance
.
setForegroundNotificationPresentationOptions
(
...
...
@@ -148,15 +149,14 @@ void main() async{
sound:
true
,
);
FirebaseMessaging
.
instance
.
getToken
().
then
((
value
)
{
String
?
token
=
value
;
if
(
kDebugMode
){
print
(
"fbstoken:{
$token
}"
);
}
SharedpreferencesService
().
saveString
(
"fbstoken"
,
token
!);
});
FirebaseMessaging
.
instance
.
getToken
().
then
((
value
)
{
String
?
token
=
value
;
if
(
kDebugMode
)
{
print
(
"fbstoken:{
$token
}"
);
}
SharedpreferencesService
().
saveString
(
"fbstoken"
,
token
!);
});
runApp
(
const
MyApp
());
}
...
...
@@ -170,86 +170,96 @@ class MyApp extends StatelessWidget {
FirebaseMessaging
.
onMessageOpenedApp
.
listen
((
RemoteMessage
message
)
{
String
type
=
message
.
data
[
'type'
]
??
''
;
String
redirectUrl
=
message
.
data
[
'redirect_url'
]
??
''
;
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => Dashboard()),
// );
if
(
kDebugMode
){
if
(
kDebugMode
)
{
print
(
'A new onMessageOpenedApp event was published!'
);
}
});
return
MultiProvider
(
providers:
[
ChangeNotifierProvider
(
create:
(
_
)=>
SplashVersionNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Scanloginprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Loginnotifier
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Counter
()),
ChangeNotifierProvider
(
create:
(
_
)=>
HomescreenNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)=>
ProfileNotifer
()),
ChangeNotifierProvider
(
create:
(
_
)=>
LogoutNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)=>
AttendanceNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)=>
CheckInOutProvider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
InventoryProvider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Serviceengineerdashboardprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Pendingcomplaintsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Todaymontlyvisitsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Paymentcollectionprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Visitdetailsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Pcwalletprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Paymentdetailsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Generatordetailsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Nearbygeneratorsprovider
()),
],
child:
Builder
(
builder:
(
BuildContext
context
){
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
theme:
ThemeData
(
fontFamily:
'Lexend'
,
splashColor:
Colors
.
transparent
,
highlightColor:
Colors
.
transparent
,
hoverColor:
Colors
.
transparent
,
scaffoldBackgroundColor:
Colors
.
white
,
dialogBackgroundColor:
Colors
.
white
,
cardColor:
Colors
.
white
,
shadowColor:
Colors
.
white54
,
searchBarTheme:
const
SearchBarThemeData
(),
tabBarTheme:
const
TabBarTheme
(),
dialogTheme:
const
DialogTheme
(
shadowColor:
Colors
.
white
,
surfaceTintColor:
Colors
.
white
,
backgroundColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
5.0
)),
// Set the border radius of the dialog
return
MultiProvider
(
providers:
[
ChangeNotifierProvider
(
create:
(
_
)
=>
SplashVersionNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
UpdatePasswordProvider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Scanloginprovider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Loginnotifier
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Counter
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
HomescreenNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
ProfileNotifer
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
LogoutNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
AttendanceNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
CheckInOutProvider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
InventoryProvider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Serviceengineerdashboardprovider
(),
),
ChangeNotifierProvider
(
create:
(
_
)
=>
Pendingcomplaintsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Todaymontlyvisitsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Paymentcollectionprovider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Visitdetailsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Pcwalletprovider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Paymentdetailsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Generatordetailsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)
=>
Nearbygeneratorsprovider
()),
],
child:
Builder
(
builder:
(
BuildContext
context
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
theme:
ThemeData
(
fontFamily:
'Lexend'
,
splashColor:
Colors
.
transparent
,
highlightColor:
Colors
.
transparent
,
hoverColor:
Colors
.
transparent
,
scaffoldBackgroundColor:
Colors
.
white
,
dialogBackgroundColor:
Colors
.
white
,
cardColor:
Colors
.
white
,
shadowColor:
Colors
.
white54
,
searchBarTheme:
const
SearchBarThemeData
(),
tabBarTheme:
const
TabBarThemeData
(),
dialogTheme:
const
DialogThemeData
(
shadowColor:
Colors
.
white
,
surfaceTintColor:
Colors
.
white
,
backgroundColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
5.0
),
),
// Set the border radius of the dialog
),
),
),
buttonTheme:
const
ButtonThemeData
(),
appBarTheme:
const
AppBarTheme
(
shadowColor:
Colors
.
white
,
surfaceTintColor:
Colors
.
white
,
color:
Colors
.
white
,
),
cardTheme:
const
CardTheme
(
shadowColor:
Colors
.
white
,
surfaceTintColor:
Colors
.
white
,
color:
Colors
.
white
,
//),
),
textButtonTheme:
TextButtonThemeData
(
style:
ButtonStyle
(
// overlayColor: MaterialStateProperty.all(Colors.white),
buttonTheme:
const
ButtonThemeData
(),
appBarTheme:
const
AppBarTheme
(
shadowColor:
Colors
.
white
,
surfaceTintColor:
Colors
.
white
,
color:
Colors
.
white
,
),
cardTheme:
const
CardThemeData
(
shadowColor:
Colors
.
white
,
surfaceTintColor:
Colors
.
white
,
color:
Colors
.
white
,
//),
),
textButtonTheme:
TextButtonThemeData
(
style:
ButtonStyle
(
// overlayColor: MaterialStateProperty.all(Colors.white),
),
),
bottomSheetTheme:
const
BottomSheetThemeData
(
surfaceTintColor:
Colors
.
white
,
backgroundColor:
Colors
.
white
,
dragHandleColor:
Color
(
0xFFe4e4e4
),
dragHandleSize:
Size
(
60.0
,
6.0
),
),
colorScheme:
const
ColorScheme
.
light
(
background:
Colors
.
white
,
).
copyWith
(
background:
Colors
.
white
),
),
bottomSheetTheme:
const
BottomSheetThemeData
(
surfaceTintColor:
Colors
.
white
,
backgroundColor:
Colors
.
white
),
colorScheme:
const
ColorScheme
.
light
(
background:
Colors
.
white
)
.
copyWith
(
background:
Colors
.
white
),
),
home:
const
Splash
(),
);
},
),);
home:
const
Splash
(),
);
},
),
);
}
}
lib/screens/UpdatePasswordScreen.dart
View file @
fd946558
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/UpdatePasswordProvider'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
class
Update
p
assword
Screen
extends
State
ful
Widget
{
const
Update
p
assword
Screen
({
super
.
key
});
class
Update
P
assword
extends
State
less
Widget
{
const
Update
P
assword
({
super
.
key
});
@override
State
<
UpdatepasswordScreen
>
createState
()
=>
_UpdatepasswordScreenState
();
}
class
_UpdatepasswordScreenState
extends
State
<
UpdatepasswordScreen
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
const
Placeholder
();
final
provider
=
Provider
.
of
<
UpdatePasswordProvider
>(
context
);
return
Scaffold
(
appBar:
appbar
(
context
,
"Update Password"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
Column
(
children:
[
Expanded
(
child:
Container
(
width:
double
.
infinity
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
30.0
),
),
),
padding:
EdgeInsets
.
all
(
10
),
child:
Column
(
children:
[
Container
(
height:
280
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20.0
),
),
child:
Column
(
children:
[
SizedBox
(
height:
10
),
_buildTextField
(
controller:
provider
.
password
,
hintText:
"New Password*"
,
errorText:
provider
.
passwordError
,
),
SizedBox
(
height:
10
),
_buildTextField
(
controller:
provider
.
confPassword
,
hintText:
"Confirm New Password*"
,
errorText:
provider
.
confirmPasswordError
,
),
Spacer
(),
provider
.
isLoading
?
CircularProgressIndicator
()
:
InkWell
(
onTap:
()
=>
provider
.
updatePassword
(
context
),
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Text
(
"Update"
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
SizedBox
(
height:
10
),
],
),
),
],
),
),
),
],
),
),
);
}
Widget
_buildTextField
({
required
TextEditingController
controller
,
required
String
hintText
,
String
?
errorText
,
})
{
return
Column
(
children:
[
Container
(
height:
55
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
),
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
alignment:
Alignment
.
center
,
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
TextField
(
controller:
controller
,
obscureText:
true
,
decoration:
InputDecoration
(
hintText:
hintText
,
hintStyle:
TextStyle
(
color:
Color
(
0xFF818181
)),
border:
InputBorder
.
none
,
),
),
),
),
if
(
errorText
!=
null
)
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
left:
25
),
child:
Text
(
errorText
,
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
),
),
),
],
);
}
}
lib/screens/splash.dart
View file @
fd946558
import
'dart:convert'
;
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
import
'package:provider/provider.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'../Notifiers/splashVersionNotifier.dart'
;
...
...
@@ -15,8 +18,6 @@ class Splash extends StatefulWidget {
}
class
_SplashState
extends
State
<
Splash
>
{
late
Image
splashImage
;
@override
...
...
@@ -24,10 +25,108 @@ class _SplashState extends State<Splash> {
// TODO: implement initState
super
.
initState
();
splashImage
=
Image
.
asset
(
"assets/images/ic_splash.jpg"
);
final
spalshProvider
=
Provider
.
of
<
SplashVersionNotifier
>(
context
,
listen:
false
);
requestPermissions
();
final
spalshProvider
=
Provider
.
of
<
SplashVersionNotifier
>(
context
,
listen:
false
,
);
spalshProvider
.
initPackageInfo
();
spalshProvider
.
handleVersionCheck
(
context
);
}
void
requestPermissions
()
async
{
await
getCameraPermissions
();
await
getStoragePermission
();
await
getLocationPermissions
();
}
Future
<
void
>
getStoragePermission
()
async
{
if
(
await
Permission
.
manageExternalStorage
.
request
().
isGranted
)
{
print
(
"Storage"
);
setState
(()
{});
}
else
if
(
await
Permission
.
storage
.
request
().
isPermanentlyDenied
)
{
print
(
"Storage"
);
await
openAppSettings
();
}
else
if
(
await
Permission
.
storage
.
request
().
isDenied
)
{
print
(
"Storage"
);
setState
(()
{});
}
}
Future
<
void
>
getCameraPermissions
()
async
{
if
(
await
Permission
.
camera
.
request
().
isGranted
)
{
print
(
"Camera1"
);
setState
(()
{});
}
else
if
(
await
Permission
.
camera
.
request
().
isPermanentlyDenied
)
{
print
(
"Camera2"
);
if
(
Platform
.
isAndroid
)
{
await
openAppSettings
();
}
else
if
(
Platform
.
isIOS
)
{
setState
(()
{});
}
}
else
if
(
await
Permission
.
camera
.
request
().
isDenied
)
{
print
(
"Camera3"
);
setState
(()
{});
}
}
Future
<
void
>
getLocationPermissions
()
async
{
if
(
await
Permission
.
location
.
request
().
isGranted
)
{
print
(
"Location1a"
);
setState
(()
{});
}
else
if
(
await
Permission
.
location
.
request
().
isPermanentlyDenied
)
{
print
(
"Location1b"
);
if
(
Platform
.
isAndroid
)
{
await
openAppSettings
();
}
else
if
(
Platform
.
isIOS
)
{
// await AppSettings.openAppSettings(type: AppSettingsType.location);
}
}
else
if
(
await
Permission
.
location
.
request
().
isDenied
)
{
print
(
"Location1c"
);
setState
(()
{});
}
if
(
await
Permission
.
locationAlways
.
request
().
isGranted
)
{
print
(
"Location2a"
);
setState
(()
{});
}
else
if
(
await
Permission
.
locationAlways
.
request
().
isPermanentlyDenied
)
{
print
(
"Location2b"
);
if
(
Platform
.
isAndroid
)
{
await
openAppSettings
();
}
else
if
(
Platform
.
isIOS
)
{
// await AppSettings.openAppSettings(type: AppSettingsType.location);
}
}
else
if
(
await
Permission
.
locationAlways
.
request
().
isDenied
)
{
print
(
"Location2c"
);
setState
(()
{});
}
if
(
await
Permission
.
locationWhenInUse
.
request
().
isGranted
)
{
print
(
"Location3a"
);
setState
(()
{});
}
else
if
(
await
Permission
.
locationWhenInUse
.
request
()
.
isPermanentlyDenied
)
{
print
(
"Location3b"
);
if
(
Platform
.
isAndroid
)
{
await
openAppSettings
();
}
else
if
(
Platform
.
isIOS
)
{
// await AppSettings.openAppSettings(type: AppSettingsType.location);
}
}
else
if
(
await
Permission
.
locationWhenInUse
.
request
().
isDenied
)
{
print
(
"Location3c"
);
setState
(()
{});
}
}
Future
<
void
>
getNotificationsPermissions
()
async
{
if
(
await
Permission
.
notification
.
request
().
isGranted
)
{
setState
(()
{});
}
else
if
(
await
Permission
.
notification
.
request
().
isPermanentlyDenied
)
{
await
openAppSettings
();
}
else
if
(
await
Permission
.
notification
.
request
().
isDenied
)
{
setState
(()
{});
}
}
@override
...
...
@@ -37,22 +136,21 @@ class _SplashState extends State<Splash> {
precacheImage
(
splashImage
.
image
,
context
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Consumer
<
SplashVersionNotifier
>(
builder:
(
context
,
value
,
child
)
{
return
Container
(
body:
Consumer
<
SplashVersionNotifier
>(
builder:
(
context
,
value
,
child
)
{
return
Container
(
alignment:
Alignment
.
center
,
child:
Container
(
alignment:
Alignment
.
center
,
height:
300
,
width:
300
,
child:
splashImage
,
));
}
),
);
},
),
);
}
...
...
lib/services/api_calling.dart
View file @
fd946558
...
...
@@ -64,7 +64,6 @@ class ApiCalling {
}
// final androiddirectory = await getDownloadsDirectory();
// directory = androiddirectory!.path;
}
else
if
(
Platform
.
isIOS
)
{
final
iosDirectory
=
await
getApplicationSupportDirectory
();
directory
=
iosDirectory
!.
path
;
...
...
@@ -72,18 +71,23 @@ class ApiCalling {
final
contentDisposition
=
res
.
headers
[
'content-disposition'
];
debugPrint
(
"contentDisposition
${contentDisposition?.split('filename=')[1]}
"
);
"contentDisposition
${contentDisposition?.split('filename=')[1]}
"
,
);
// final filename = contentDisposition != null
// ? contentDisposition.split('filename=')[1]
// : 'file';
var
filename
=
(
contentDisposition
?.
split
(
'filename='
)[
1
])?.
replaceAll
(
'"'
,
""
);
var
filename
=
(
contentDisposition
?.
split
(
'filename='
)[
1
])?.
replaceAll
(
'"'
,
""
,
);
// ignore: unnecessary_brace_in_string_interps
final
file
=
File
(
'
${directory}
/
${filename}
'
);
await
file
.
writeAsBytes
(
bytes
);
toast
(
cntxt
,
"File saved to your downloads as
${filename}
to
${directory}
, Successfully"
);
cntxt
,
"File saved to your downloads as
${filename}
to
${directory}
, Successfully"
,
);
debugPrint
(
'File saved successfully'
);
return
jsonDecode
(
res
.
body
);
}
else
{
...
...
@@ -97,29 +101,29 @@ class ApiCalling {
}
static
Future
<
VersionsResponse
?>
checkAppVersionApi
()
async
{
try
{
final
response
=
await
post
(
{},
getAppVersionUrl
,
{});
if
(
response
!=
null
){
print
(
"
${response.body}
"
);
try
{
final
response
=
await
post
({},
getAppVersionUrl
,
{});
if
(
response
!=
null
)
{
//
print("${response.body}");
return
VersionsResponse
.
fromJson
(
jsonDecode
(
response
.
body
));
}
else
{
}
else
{
return
null
;
}
}
catch
(
e
,
s
){
}
catch
(
e
,
s
)
{
return
null
;
}
}
static
Future
<
SessionResponse
?>
CheckSessionExistsApi
(
empId
,
session
)
async
{
static
Future
<
SessionResponse
?>
CheckSessionExistsApi
(
empId
,
session
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
};
print
(
data
);
//
print(data);
final
res
=
await
post
(
data
,
getEmployeeSessionDetailsUrl
,
{});
if
(
res
!=
null
)
{
print
(
"check_session:
${res.body}
"
);
//
print("check_session: ${res.body}");
return
SessionResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -130,20 +134,26 @@ class ApiCalling {
return
null
;
}
}
static
Future
<
StatusResponse
?>
LoginFunctionApi
(
email
,
password
,
token
,
deviceID
,
deviceInfo
)
async
{
email
,
password
,
token
,
deviceID
,
deviceInfo
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'email_id'
:
(
email
).
toString
(),
'password'
:
(
password
).
toString
(),
'token_id'
:
(
token
).
toString
(),
'device_id'
:
(
deviceID
).
toString
(),
'device_details'
:
(
deviceInfo
).
toString
()
'device_details'
:
(
deviceInfo
).
toString
()
,
};
final
res
=
await
post
(
data
,
loginUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
"Login:
${res.body}
"
);
print
(
data
);
//
debugPrint("Login: ${res.body}");
//
print(data);
return
StatusResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -156,17 +166,21 @@ class ApiCalling {
}
static
Future
<
UpdatePasswordResponse
?>
UpdatePasswordApi
(
empId
,
session
,
password
,
conf_password
)
async
{
empId
,
session
,
password
,
conf_password
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'password'
:
(
password
).
toString
(),
'confirm_password'
:
(
conf_password
).
toString
()
'confirm_password'
:
(
conf_password
).
toString
()
,
};
final
res
=
await
post
(
data
,
updatePasswordUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
"update password
${res.body}
"
);
//
debugPrint("update password ${res.body}");
return
UpdatePasswordResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -186,7 +200,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
employeeDashboardUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
"Dashboard:
${res.body}
"
);
//
debugPrint("Dashboard: ${res.body}");
return
DashboardResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -198,7 +212,6 @@ class ApiCalling {
}
}
static
Future
<
ProfileResponse
?>
ProfileFunctionApi
(
empId
,
session
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
...
...
@@ -207,7 +220,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
employeeProfileUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
"profile-details:
${res.body}
"
);
//
debugPrint("profile-details: ${res.body}");
return
ProfileResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
...
...
@@ -219,8 +232,13 @@ class ApiCalling {
return
null
;
}
}
static
Future
<
LoginQRResponse
?>
QRLoginRequestAPI
(
empId
,
session
,
type
,
token
)
async
{
empId
,
session
,
type
,
token
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -230,7 +248,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
qrCodeLoginUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
LoginQRResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -250,7 +268,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
logoutAppUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
LogoutResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
...
...
@@ -264,7 +282,12 @@ class ApiCalling {
}
static
Future
<
CheckInResponse
?>
CheckInApi
(
empId
,
sessioId
,
location
,
latlngs
,
check_in_pic
)
async
{
empId
,
sessioId
,
location
,
latlngs
,
check_in_pic
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -281,7 +304,6 @@ class ApiCalling {
res
=
jsonDecode
(
res
);
}
if
(
res
!=
null
)
{
return
CheckInResponse
.
fromJson
(
res
);
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -294,7 +316,12 @@ class ApiCalling {
}
static
Future
<
CheckOutResponse
?>
CheckOutApi
(
empId
,
sessioId
,
location
,
latlngs
,
image
)
async
{
empId
,
sessioId
,
location
,
latlngs
,
image
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -330,7 +357,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
employeeAttendanceDashboardUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
AttendanceDashboard
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -348,11 +375,11 @@ class ApiCalling {
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'year'
:
(
year
).
toString
(),
'month'
:
month
.
toString
()
'month'
:
month
.
toString
()
,
};
final
res
=
await
post
(
data
,
employeeMonthwiseAttendanceUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
"montly attendance:
${res.body}
"
);
//
debugPrint("montly attendance: ${res.body}");
// return AttendanceHistory.fromJson(jsonDecode(res.body));
return
res
.
body
;
}
else
{
...
...
@@ -366,7 +393,10 @@ class ApiCalling {
}
static
Future
<
AttendanceDaywiseResponse
?>
DateWiseAttendanceApi
(
empId
,
session
,
date
)
async
{
empId
,
session
,
date
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -375,7 +405,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
employeeDayAttendanceDetailsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
"Attendacnce API /;
${res.body}
"
);
//
debugPrint("Attendacnce API /; ${res.body}");
return
AttendanceDaywiseResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -387,12 +417,13 @@ class ApiCalling {
}
}
///gen tracker
///gen tracker
static
Future
<
loadGeneratorDetailsResponse
?>
LoadGeneratorDetailsAPI
(
empId
,
session
,
gen_hash_id
)
async
{
empId
,
session
,
gen_hash_id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -401,7 +432,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
genTrackerGeneratorDetailsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
loadGeneratorDetailsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -413,20 +444,22 @@ class ApiCalling {
}
}
static
Future
<
generatorComplaintResponse
?>
LoadGeneratorComplaintListAPI
(
empId
,
session
,
gen_id
,
open_status
)
async
{
empId
,
session
,
gen_id
,
open_status
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'gen_id'
:
(
gen_id
).
toString
(),
'open_status'
:
(
open_status
).
toString
()
'open_status'
:
(
open_status
).
toString
()
,
};
final
res
=
await
post
(
data
,
genTrackerGeneratorComplaintsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
generatorComplaintResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -439,17 +472,21 @@ class ApiCalling {
}
static
Future
<
TagLocationResponse
?>
TagLocationAPI
(
empId
,
session
,
gen_hash_id
,
location
)
async
{
empId
,
session
,
gen_hash_id
,
location
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'gen_hash_id'
:
(
gen_hash_id
).
toString
(),
'location'
:
(
location
).
toString
()
'location'
:
(
location
).
toString
()
,
};
final
res
=
await
post
(
data
,
genTrackerTagLocationUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
TagLocationResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -462,17 +499,21 @@ class ApiCalling {
}
static
Future
<
TagGeneratorResponse
?>
TagGeneratorAPI
(
empId
,
session
,
gen_hash_id
,
engine_no
)
async
{
empId
,
session
,
gen_hash_id
,
engine_no
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'gen_hash_id'
:
(
gen_hash_id
).
toString
(),
'engine_no'
:
(
engine_no
).
toString
()
'engine_no'
:
(
engine_no
).
toString
()
,
};
final
res
=
await
post
(
data
,
genTrackerTagGeneratorUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
TagGeneratorResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -485,14 +526,15 @@ class ApiCalling {
}
static
Future
<
SubmitComplaintResponse
?>
SubmitGeneratorComplaintAPI
(
empId
,
session
,
complaint_type_id
,
complaint_category_id
,
complaint_desc_id
,
running_hrs
,
gen_id
,
complaint_note
)
async
{
empId
,
session
,
complaint_type_id
,
complaint_category_id
,
complaint_desc_id
,
running_hrs
,
gen_id
,
complaint_note
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -502,11 +544,11 @@ class ApiCalling {
'complaint_desc_id'
:
(
complaint_desc_id
).
toString
(),
'running_hrs'
:
(
running_hrs
).
toString
(),
'gen_id'
:
(
gen_id
).
toString
(),
'complaint_note'
:
(
complaint_note
).
toString
()
'complaint_note'
:
(
complaint_note
).
toString
()
,
};
final
res
=
await
post
(
data
,
genTrackerRegisterComplaint
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
SubmitComplaintResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -519,7 +561,10 @@ class ApiCalling {
}
static
Future
<
ComplaintsSelectionResponse
?>
ComplaintSelectionAPI
(
empId
,
session
,
gen_hash_id
)
async
{
empId
,
session
,
gen_hash_id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -528,7 +573,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
complaintsSelectionUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
ComplaintsSelectionResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -540,12 +585,13 @@ class ApiCalling {
}
}
///Inventory Module API's
static
Future
<
Inventory_Part_details_response
?>
LoadPartDetailsAPI
(
empId
,
session
,
part_id
)
async
{
empId
,
session
,
part_id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -554,7 +600,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
inventoryPartDetailsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
Inventory_Part_details_response
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -567,7 +613,13 @@ class ApiCalling {
}
static
Future
<
loadGeneratorDetailsResponse
?>
InventoryUpdateStockAPI
(
empId
,
session
,
qty
,
descr
,
part_id
,
tran_type
)
async
{
empId
,
session
,
qty
,
descr
,
part_id
,
tran_type
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -579,7 +631,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
inventoryStockUpdateUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
loadGeneratorDetailsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -602,7 +654,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianGeneratorDetailsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
loadGeneratorDetailsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -614,10 +666,10 @@ class ApiCalling {
}
}
static
Future
<
TechnicianResponse
?>
loadTechnicianDashboardApi
(
empId
,
session
)
async
{
empId
,
session
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -625,7 +677,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianDashboardUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
TechnicianResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -638,7 +690,9 @@ class ApiCalling {
}
static
Future
<
TodayVisitResponse
?>
getTodayVisitsListAPI
(
empId
,
session
)
async
{
empId
,
session
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -646,7 +700,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianTodayVisitsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
TodayVisitResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -659,7 +713,9 @@ class ApiCalling {
}
static
Future
<
TodayVisitResponse
?>
getMonthVisitsListAPI
(
empId
,
session
)
async
{
empId
,
session
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -667,7 +723,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianMonthlyVisitsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
TodayVisitResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -680,7 +736,12 @@ class ApiCalling {
}
static
Future
<
NearbyGeneratorsResponse
?>
loadNearbyGeneratorsAPI
(
empId
,
session
,
tech_loc
,
radius
,
status
)
async
{
empId
,
session
,
tech_loc
,
radius
,
status
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -691,8 +752,8 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianNearbyGeneratorsUrl
,
{});
if
(
res
!=
null
)
{
print
(
data
);
debugPrint
(
res
.
body
);
//
print(data);
//
debugPrint(res.body);
return
NearbyGeneratorsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -705,7 +766,10 @@ class ApiCalling {
}
static
Future
<
AccountSuggestionResonse
?>
AccountSuggestionAPI
(
empId
,
session
,
search_string
)
async
{
empId
,
session
,
search_string
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -714,7 +778,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianAccountSearchUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
AccountSuggestionResonse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -735,9 +799,10 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianPendingComplaintUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
TechnicianPendingComplaintsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
jsonDecode
(
res
.
body
),
);
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
...
...
@@ -749,7 +814,12 @@ class ApiCalling {
}
static
Future
<
TechnicianLoadNumbersResponse
?>
LoadContactsTechnicianAPI
(
empId
,
session
,
type
,
gen_id
,
account_id
)
async
{
empId
,
session
,
type
,
gen_id
,
account_id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -760,7 +830,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianAddPaymentUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
TechnicianLoadNumbersResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -774,16 +844,17 @@ class ApiCalling {
static
Future
<
TechnicianAddPaymentCollectionResponse
?>
TechnicianUpdatepaymentAPI
(
empId
,
session
,
ref_type
,
ref_id
,
payment_mode_id
,
payment_ref_no
,
amount
,
otp_validated_name
,
otp_validated_mobile_number
,
payment_proof
)
async
{
empId
,
session
,
ref_type
,
ref_id
,
payment_mode_id
,
payment_ref_no
,
amount
,
otp_validated_name
,
otp_validated_mobile_number
,
payment_proof
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -798,7 +869,12 @@ class ApiCalling {
};
var
res
;
if
(
payment_proof
!=
null
)
{
res
=
await
postImage3
(
data
,
{},
technicianAddPaymentCollectionUrl
,
payment_proof
);
res
=
await
postImage3
(
data
,
{},
technicianAddPaymentCollectionUrl
,
payment_proof
,
);
res
=
jsonDecode
(
res
);
}
else
{
res
=
await
post
(
data
,
technicianAddPaymentCollectionUrl
,
{});
...
...
@@ -818,7 +894,11 @@ class ApiCalling {
static
Future
<
PaymentCollectionValidateOTPResponse
?>
TechnicianPaymentOTPValidateAPI
(
empId
,
session
,
payment_collection_id
,
otp
)
async
{
empId
,
session
,
payment_collection_id
,
otp
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -828,9 +908,10 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianPaymentCollectionOtpUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
PaymentCollectionValidateOTPResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
jsonDecode
(
res
.
body
),
);
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
...
...
@@ -842,9 +923,9 @@ class ApiCalling {
}
static
Future
<
PaymentCollectionResponse
?>
paymentCollectionListAPI
(
empId
,
session
,
)
async
{
empId
,
session
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -852,7 +933,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianPaymentCollectionUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
PaymentCollectionResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -865,7 +946,9 @@ class ApiCalling {
}
static
Future
<
PaymentCollectionWalletResponse
?>
loadTransactionsListAPI
(
empId
,
session
)
async
{
empId
,
session
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -873,7 +956,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianWalletCollectionUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
PaymentCollectionWalletResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -886,7 +969,10 @@ class ApiCalling {
}
static
Future
<
ViewVisitDetailsResponseNew
?>
loadVisitDetailsAPI
(
empId
,
session
,
comp_id
)
async
{
empId
,
session
,
comp_id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -895,7 +981,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianComplaintDetailsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
ViewVisitDetailsResponseNew
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -908,7 +994,10 @@ class ApiCalling {
}
static
Future
<
FollowupListResponse
?>
loadFollowupListAPI
(
empId
,
session
,
comp_id
)
async
{
empId
,
session
,
comp_id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -917,7 +1006,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianComplaintFollowUpUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
FollowupListResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -929,8 +1018,19 @@ class ApiCalling {
}
}
static
Future
<
AddContactResponse
?>
AddContactAPI
(
empId
,
session
,
gen_id
,
name
,
designation
,
mob1
,
mob2
,
tel
,
mail
,
type
,
account_id
)
async
{
static
Future
<
AddContactResponse
?>
AddContactAPI
(
empId
,
session
,
gen_id
,
name
,
designation
,
mob1
,
mob2
,
tel
,
mail
,
type
,
account_id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -947,7 +1047,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
technicianAddContactUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(res.body);
return
AddContactResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -960,15 +1060,16 @@ class ApiCalling {
}
static
Future
<
UpdateComplaintResponse
?>
UpdateComplaintAPI
(
empId
,
session
,
complaint_id
,
in_time
,
feedback
,
fsr_no
,
running_hrs
,
complaint_status
,
fsr_file
)
async
{
empId
,
session
,
complaint_id
,
in_time
,
feedback
,
fsr_no
,
running_hrs
,
complaint_status
,
fsr_file
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -980,8 +1081,8 @@ class ApiCalling {
'running_hrs'
:
(
running_hrs
).
toString
(),
'complaint_status'
:
(
complaint_status
).
toString
(),
};
print
(
data
);
print
(
fsr_file
);
//
print(data);
//
print(fsr_file);
var
res
;
if
(
fsr_file
!=
null
)
{
res
=
await
postImage4
(
data
,
{},
technicianUpdateVisitUrl
,
fsr_file
);
...
...
@@ -1003,4 +1104,4 @@ class ApiCalling {
return
null
;
}
}
}
\ No newline at end of file
}
macos/Flutter/Flutter-Debug.xcconfig
View file @
fd946558
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
macos/Flutter/Flutter-Release.xcconfig
View file @
fd946558
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
macos/Flutter/GeneratedPluginRegistrant.swift
View file @
fd946558
...
...
@@ -21,6 +21,7 @@ import share_plus
import
shared_preferences_foundation
import
sqflite_darwin
import
url_launcher_macos
import
webview_flutter_wkwebview
func
RegisterGeneratedPlugins
(
registry
:
FlutterPluginRegistry
)
{
ConnectivityPlusPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"ConnectivityPlusPlugin"
))
...
...
@@ -39,4 +40,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SharedPreferencesPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SharedPreferencesPlugin"
))
SqflitePlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SqflitePlugin"
))
UrlLauncherPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"UrlLauncherPlugin"
))
WebViewFlutterPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"WebViewFlutterPlugin"
))
}
macos/Podfile
0 → 100644
View file @
fd946558
platform
:osx
,
'10.15'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV
[
'COCOAPODS_DISABLE_STATS'
]
=
'true'
project
'Runner'
,
{
'Debug'
=>
:debug
,
'Profile'
=>
:release
,
'Release'
=>
:release
,
}
def
flutter_root
generated_xcode_build_settings_path
=
File
.
expand_path
(
File
.
join
(
'..'
,
'Flutter'
,
'ephemeral'
,
'Flutter-Generated.xcconfig'
),
__FILE__
)
unless
File
.
exist?
(
generated_xcode_build_settings_path
)
raise
"
#{
generated_xcode_build_settings_path
}
must exist. If you're running pod install manually, make sure
\"
flutter pub get
\"
is executed first"
end
File
.
foreach
(
generated_xcode_build_settings_path
)
do
|
line
|
matches
=
line
.
match
(
/FLUTTER_ROOT\=(.*)/
)
return
matches
[
1
].
strip
if
matches
end
raise
"FLUTTER_ROOT not found in
#{
generated_xcode_build_settings_path
}
. Try deleting Flutter-Generated.xcconfig, then run
\"
flutter pub get
\"
"
end
require
File
.
expand_path
(
File
.
join
(
'packages'
,
'flutter_tools'
,
'bin'
,
'podhelper'
),
flutter_root
)
flutter_macos_podfile_setup
target
'Runner'
do
use_frameworks!
flutter_install_all_macos_pods
File
.
dirname
(
File
.
realpath
(
__FILE__
))
target
'RunnerTests'
do
inherit!
:search_paths
end
end
post_install
do
|
installer
|
installer
.
pods_project
.
targets
.
each
do
|
target
|
flutter_additional_macos_build_settings
(
target
)
end
end
pubspec.lock
View file @
fd946558
...
...
@@ -29,10 +29,18 @@ packages:
dependency: transitive
description:
name: async
sha256:
d2872f9c1
97
3
1c
2
e5
f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256:
"758e6d74e
971c
3
e5
aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.13.0"
background_location:
dependency: "direct main"
description:
name: background_location
sha256: fbb83ceb8cefcc6793f0a362f12773c28fc290a5e2c76cb593ee592ec7b6cb32
url: "https://pub.dev"
source: hosted
version: "0.13.0"
boolean_selector:
dependency: transitive
description:
...
...
@@ -229,10 +237,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "
6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc
"
sha256: "
5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44
"
url: "https://pub.dev"
source: hosted
version: "1.3.
2
"
version: "1.3.
3
"
ffi:
dependency: transitive
description:
...
...
@@ -852,26 +860,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256:
c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256:
"8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
url: "https://pub.dev"
source: hosted
version: "1
0
.0.
8
"
version: "1
1
.0.
1
"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256:
f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256:
"1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.
9
"
version: "3.0.
10
"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "
6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3
"
sha256: "
8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1
"
url: "https://pub.dev"
source: hosted
version: "3.0.
1
"
version: "3.0.
2
"
lints:
dependency: transitive
description:
...
...
@@ -1473,10 +1481,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256:
"0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256:
ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "1
4.3.1
"
version: "1
5.0.0
"
web:
dependency: transitive
description:
...
...
@@ -1501,6 +1509,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
sha256: "18b1640839cf6546784a524c72aded5b6e86b23e7167dc2311cc96f7658b64bd"
url: "https://pub.dev"
source: hosted
version: "2.11.0"
webview_flutter_wkwebview:
dependency: "direct main"
description:
name: webview_flutter_wkwebview
sha256: c9f9be526fa0d3347374ceaa05c4b3acb85f4f112abd62f7d74b7d301fa515ff
url: "https://pub.dev"
source: hosted
version: "3.20.0"
win32:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
fd946558
...
...
@@ -70,6 +70,8 @@ dependencies:
pin_code_fields
:
^8.0.1
cached_network_image
:
^3.4.1
geocoding
:
^3.0.0
webview_flutter_wkwebview
:
^3.20.0
background_location
:
^0.13.0
dev_dependencies
:
flutter_test
:
...
...
Prev
1
…
6
7
8
9
10
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