dashboard replaced with client profile page
This commit is contained in:
commit
50306ed759
|
|
@ -23,8 +23,8 @@ if (flutterVersionName == null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.ftc.app.ftc_mobile_app"
|
namespace "com.app.ftc_patient"
|
||||||
compileSdkVersion flutter.compileSdkVersion
|
compileSdkVersion 32
|
||||||
ndkVersion "25.1.8937393"
|
ndkVersion "25.1.8937393"
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|
@ -42,11 +42,11 @@ android {
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "com.ftc.app.ftc_mobile_app"
|
applicationId "com.app.ftc_patient"
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion 32
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
"project_info": {
|
|
||||||
"project_number": "583559514958",
|
|
||||||
"project_id": "ftc-services-ea8d6",
|
|
||||||
"storage_bucket": "ftc-services-ea8d6.appspot.com"
|
|
||||||
},
|
|
||||||
"client": [
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:583559514958:android:89af243ca4a3888a32ec1f",
|
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "com.ftc.app.ftc_mobile_app"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyDF2vZbiWQROGvyvLeeCmAjPLnPLYjE6Os"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configuration_version": "1"
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ftc.app.ftc_mobile_app
|
package com.app.ftc_patient
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
|
@ -507,7 +507,7 @@
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.0;
|
MARKETING_VERSION = 1.0.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.ftcs.app;
|
PRODUCT_BUNDLE_IDENTIFIER = com.app.ftc_patient;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = FTCS_Dev;
|
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = FTCS_Dev;
|
||||||
|
|
@ -700,7 +700,7 @@
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.0;
|
MARKETING_VERSION = 1.0.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.ftcs.app;
|
PRODUCT_BUNDLE_IDENTIFIER = com.app.ftc_patient;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = FTCS_Dev;
|
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = FTCS_Dev;
|
||||||
|
|
@ -737,7 +737,7 @@
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.0;
|
MARKETING_VERSION = 1.0.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.ftcs.app;
|
PRODUCT_BUNDLE_IDENTIFIER = com.app.ftc_patient;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = FTCS_Dev;
|
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = FTCS_Dev;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:ftc_mobile_app/models/profile_screen_model.dart';
|
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
|
||||||
import 'package:ftc_mobile_app/models/rota/LiveRoasterResponseData.dart';
|
import 'package:ftc_mobile_app/models/rota/LiveRoasterResponseData.dart';
|
||||||
import 'package:ftc_mobile_app/models/rota/WeekArrayData.dart';
|
import 'package:ftc_mobile_app/models/rota/WeekArrayData.dart';
|
||||||
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
|
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import '../../ftc_mobile_app.dart';
|
import '../../ftc_mobile_app.dart';
|
||||||
|
|
||||||
class DashboardScreenController extends GetxController {
|
class DashboardScreenController extends GetxController {
|
||||||
|
|
@ -16,7 +15,7 @@ class DashboardScreenController extends GetxController {
|
||||||
final selectedIndex = 1.obs;
|
final selectedIndex = 1.obs;
|
||||||
final myShiftsList = RxList<DaysArrayData>();
|
final myShiftsList = RxList<DaysArrayData>();
|
||||||
final ongoingShift = Rx<DaysArrayData?>(null);
|
final ongoingShift = Rx<DaysArrayData?>(null);
|
||||||
final myProfileData = Rx<StaffMembers?>(null);
|
final myProfileData = Rx<UserData?>(null);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
|
|
@ -49,10 +48,14 @@ class DashboardScreenController extends GetxController {
|
||||||
}
|
}
|
||||||
|
|
||||||
getProfileDetail() async {
|
getProfileDetail() async {
|
||||||
final resp = await ClientService().getUserDetails();
|
final resp = await ClientService().getUserDetails().showLoader();
|
||||||
|
|
||||||
if (resp is ProfileDataModel) {
|
if (resp.success == true) {
|
||||||
myProfileData.value = resp.data?.staffMembers?.firstOrNull;
|
myProfileData.value = resp.data?.users?.firstOrNull;
|
||||||
|
} else {
|
||||||
|
if (resp.message.isNotNullOrEmpty()) {
|
||||||
|
FrequentFunctions.showToast(message: resp.message!);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class ViewProfileScreenController extends GetxController {
|
||||||
addressTEC.text = d?.user?.modelId?.homeAddress ?? "";
|
addressTEC.text = d?.user?.modelId?.homeAddress ?? "";
|
||||||
});
|
});
|
||||||
|
|
||||||
detail.value = dashboardController.myProfileData();
|
// detail.value = dashboardController.myProfileData();
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,12 @@ void main() async {
|
||||||
GetTimeAgo.setCustomLocaleMessages('en', CustomTimeAgoMessages());
|
GetTimeAgo.setCustomLocaleMessages('en', CustomTimeAgoMessages());
|
||||||
|
|
||||||
//Notification initialize
|
//Notification initialize
|
||||||
NotificationUtils.init();
|
// NotificationUtils.init();
|
||||||
try {
|
// try {
|
||||||
await FcmNotification.getInstance().init();
|
// await FcmNotification.getInstance().init();
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
debugPrint("FcmNotification init error: $e");
|
// debugPrint("FcmNotification init error: $e");
|
||||||
}
|
// }
|
||||||
|
|
||||||
await LocalStorageManager.init();
|
await LocalStorageManager.init();
|
||||||
Get.lazyPut(() => AppSessionManager(), fenix: true);
|
Get.lazyPut(() => AppSessionManager(), fenix: true);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class _CustomDrawerState extends State<CustomDrawer> {
|
||||||
return MyCircleImage(
|
return MyCircleImage(
|
||||||
imageSize: 80.r,
|
imageSize: 80.r,
|
||||||
url:
|
url:
|
||||||
"${WebUrls.baseUrl}${DashboardScreenController.instance.myProfileData()?.user?.profilePictureUrl ?? ""}",
|
"${WebUrls.baseUrl}${DashboardScreenController.instance.myProfileData()?.profilePictureUrl ?? ""}",
|
||||||
errorWidget: CustomImageWidget(
|
errorWidget: CustomImageWidget(
|
||||||
imagePath: AssetsManager.kPersonMainIcon,
|
imagePath: AssetsManager.kPersonMainIcon,
|
||||||
imageColor: CustomAppColors.kDarkBlueTextColor,
|
imageColor: CustomAppColors.kDarkBlueTextColor,
|
||||||
|
|
@ -61,7 +61,7 @@ class _CustomDrawerState extends State<CustomDrawer> {
|
||||||
() => CustomTextWidget(
|
() => CustomTextWidget(
|
||||||
text: DashboardScreenController.instance
|
text: DashboardScreenController.instance
|
||||||
.myProfileData()
|
.myProfileData()
|
||||||
?.staffMemberName ??
|
?.displayName ??
|
||||||
"",
|
"",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
fontColor: CustomAppColors.kBlackColor,
|
fontColor: CustomAppColors.kBlackColor,
|
||||||
|
|
@ -69,16 +69,6 @@ class _CustomDrawerState extends State<CustomDrawer> {
|
||||||
fontSize: 14.sp,
|
fontSize: 14.sp,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Obx(
|
|
||||||
() => CustomTextWidget(
|
|
||||||
text: DashboardScreenController.instance
|
|
||||||
.myProfileData()
|
|
||||||
?.staffDesignation ??
|
|
||||||
"",
|
|
||||||
fontColor: CustomAppColors.kLightGreyColor,
|
|
||||||
fontSize: 10.sp,
|
|
||||||
fontWeight: FontWeight.w500),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -99,55 +89,6 @@ class _CustomDrawerState extends State<CustomDrawer> {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
dashboardController.selectedIndex.value = 1;
|
dashboardController.selectedIndex.value = 1;
|
||||||
drawerController.selectedIndex.value = 1;
|
drawerController.selectedIndex.value = 1;
|
||||||
// Navigator.pushNamed(
|
|
||||||
// context,
|
|
||||||
// CustomRouteNames.kDashboardScreenRoute,
|
|
||||||
// );
|
|
||||||
}),
|
|
||||||
6.verticalSpace,
|
|
||||||
_getDrawerNavItem(
|
|
||||||
title: "Rota",
|
|
||||||
iconPath: AssetsManager.kPersonMainIcon,
|
|
||||||
color: CustomAppColors.kLightGreyColor,
|
|
||||||
selected: drawerController.selectedIndex.value == 0,
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
// dashboardController.selectedIndex.value = 0;
|
|
||||||
// drawerController.selectedIndex.value = 0;
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context,
|
|
||||||
CustomRouteNames.kRotaDashboardScreenRoute,
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
6.verticalSpace,
|
|
||||||
_getDrawerNavItem(
|
|
||||||
title: "Clients",
|
|
||||||
iconPath: AssetsManager.kPeopleIcon,
|
|
||||||
color: CustomAppColors.kLightGreyColor,
|
|
||||||
selected: drawerController.selectedIndex.value == 3,
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
dashboardController.selectedIndex.value = 3;
|
|
||||||
drawerController.selectedIndex.value = 3;
|
|
||||||
// Navigator.pushNamed(
|
|
||||||
// context,
|
|
||||||
// CustomRouteNames.kClientsListScreenRoute,
|
|
||||||
// );
|
|
||||||
}),
|
|
||||||
6.verticalSpace,
|
|
||||||
_getDrawerNavItem(
|
|
||||||
title: "Inbox",
|
|
||||||
iconPath: AssetsManager.kMessageIcon,
|
|
||||||
color: CustomAppColors.kLightGreyColor,
|
|
||||||
selected: drawerController.selectedIndex.value == 2,
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
dashboardController.selectedIndex.value = 2;
|
|
||||||
drawerController.selectedIndex.value = 2;
|
|
||||||
// Navigator.pushNamed(
|
|
||||||
// context,
|
|
||||||
// CustomRouteNames.kInboxScreenRoute,
|
|
||||||
// );
|
|
||||||
}),
|
}),
|
||||||
6.verticalSpace,
|
6.verticalSpace,
|
||||||
_getDrawerNavItem(
|
_getDrawerNavItem(
|
||||||
|
|
@ -191,26 +132,7 @@ class _CustomDrawerState extends State<CustomDrawer> {
|
||||||
// CustomRouteNames.kNotificationListScreenRoute,
|
// CustomRouteNames.kNotificationListScreenRoute,
|
||||||
// );
|
// );
|
||||||
}),
|
}),
|
||||||
const Expanded(child: FrequentFunctions.noWidget),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
CustomTextWidget(
|
|
||||||
text: "Shift end at ",
|
|
||||||
fontColor: CustomAppColors.kLightGreyColor,
|
|
||||||
isExpanded: false,
|
|
||||||
fontSize: 16.sp,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
|
||||||
CustomTextWidget(
|
|
||||||
text: "07Hrs 50Sec",
|
|
||||||
fontColor: CustomAppColors.kSecondaryColor,
|
|
||||||
isExpanded: false,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontSize: 16.sp,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class _ClientProfileScreenState extends State<ClientProfileScreen> {
|
||||||
backgroundColor: CustomAppColors.kPrimaryColor,
|
backgroundColor: CustomAppColors.kPrimaryColor,
|
||||||
screenKey: controller.screenKey,
|
screenKey: controller.screenKey,
|
||||||
onScreenTap: controller.removeFocus,
|
onScreenTap: controller.removeFocus,
|
||||||
showAppBar: true,
|
showAppBar: false,
|
||||||
appBar: CustomAppBar(
|
appBar: CustomAppBar(
|
||||||
leadingButton: Container(),
|
leadingButton: Container(),
|
||||||
showBoxShadow: false,
|
showBoxShadow: false,
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,24 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return CustomScaffold(
|
||||||
|
appBar: appBar,
|
||||||
|
backgroundColor: CustomAppColors.kPrimaryColor,
|
||||||
|
screenKey: controller.screenKey,
|
||||||
|
onScreenTap: controller.removeFocus,
|
||||||
|
showAppBar: true,
|
||||||
|
sideDrawer: const CustomDrawer(),
|
||||||
|
body: SafeArea(
|
||||||
|
child: Obx(() {
|
||||||
|
if (controller.myProfileData() == null) {
|
||||||
|
return FrequentFunctions.centerText(text: "No data found");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ClientProfileScreen(userData: controller.myProfileData()!);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return CustomScaffold(
|
return CustomScaffold(
|
||||||
appBar: appBar,
|
appBar: appBar,
|
||||||
sideDrawer: const CustomDrawer(),
|
sideDrawer: const CustomDrawer(),
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
return MyCircleImage(
|
return MyCircleImage(
|
||||||
imageSize: 80.r,
|
imageSize: 80.r,
|
||||||
url:
|
url:
|
||||||
"${WebUrls.baseUrl}${DashboardScreenController.instance.myProfileData()?.user?.profilePictureUrl ?? ""}",
|
"${WebUrls.baseUrl}${DashboardScreenController.instance.myProfileData()?.profilePictureUrl ?? ""}",
|
||||||
errorWidget: CircleAvatar(
|
errorWidget: CircleAvatar(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
child: CustomImageWidget(
|
child: CustomImageWidget(
|
||||||
|
|
@ -67,7 +67,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
() => CustomTextWidget(
|
() => CustomTextWidget(
|
||||||
text: DashboardScreenController.instance
|
text: DashboardScreenController.instance
|
||||||
.myProfileData()
|
.myProfileData()
|
||||||
?.staffMemberName ??
|
?.displayName ??
|
||||||
"",
|
"",
|
||||||
fontSize: 14.sp,
|
fontSize: 14.sp,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
|
|
@ -76,17 +76,17 @@ class HomeScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
|
|
||||||
//designation
|
//designation
|
||||||
Obx(
|
// Obx(
|
||||||
() => CustomTextWidget(
|
// () => CustomTextWidget(
|
||||||
text: DashboardScreenController.instance
|
// text: DashboardScreenController.instance
|
||||||
.myProfileData()
|
// .myProfileData()
|
||||||
?.staffDesignation ??
|
// ?.staffDesignation ??
|
||||||
"",
|
// "",
|
||||||
fontSize: 14.sp,
|
// fontSize: 14.sp,
|
||||||
fontColor: CustomAppColors.kPrimaryColor,
|
// fontColor: CustomAppColors.kPrimaryColor,
|
||||||
fontWeight: FontWeight.w600,
|
// fontWeight: FontWeight.w600,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
16.verticalSpace,
|
16.verticalSpace,
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import 'package:ftc_mobile_app/models/clients/recent_incidents_model.dart';
|
||||||
import 'package:ftc_mobile_app/models/clients/add_pbs_plan_model.dart';
|
import 'package:ftc_mobile_app/models/clients/add_pbs_plan_model.dart';
|
||||||
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/GetRiskAssessmentResponse.dart';
|
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/GetRiskAssessmentResponse.dart';
|
||||||
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/RiskAssessmentData.dart';
|
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/RiskAssessmentData.dart';
|
||||||
|
import 'package:ftc_mobile_app/utilities/enums/api_method.dart';
|
||||||
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
|
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
|
||||||
import '../models/appointmentsListResponse/AppointmentsListResponse.dart';
|
import '../models/appointmentsListResponse/AppointmentsListResponse.dart';
|
||||||
import '../models/clients/HealthIssuesDetailsModel.dart';
|
import '../models/clients/HealthIssuesDetailsModel.dart';
|
||||||
|
|
@ -30,49 +31,29 @@ class ClientService {
|
||||||
|
|
||||||
final HttpRequestClient _httpClient = HttpRequestClient();
|
final HttpRequestClient _httpClient = HttpRequestClient();
|
||||||
|
|
||||||
Future<dynamic> getUserDetails() async {
|
Future<AllClientsResponse> getUserDetails() async {
|
||||||
// String userJson = LocalStorageManager.getSessionToken(
|
|
||||||
// tokenKey: LocalStorageKeys.kUserModelKey,
|
|
||||||
// );
|
|
||||||
// UserModel userModel = UserModel.fromJson(json.decode(userJson));
|
|
||||||
Map<String, dynamic> requestBody = {
|
Map<String, dynamic> requestBody = {
|
||||||
"sortproperty": "createdAt",
|
|
||||||
"sortorder": -1,
|
|
||||||
"offset": 0,
|
"offset": 0,
|
||||||
"limit": 1,
|
"limit": 1,
|
||||||
"query": {
|
"query": {
|
||||||
"critarion": {
|
"critarion": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"_id": LocalStorageManager.userId,
|
// "_id": LocalStorageManager.userId,
|
||||||
|
"_id": "659535b08d2973ab265f1091"
|
||||||
},
|
},
|
||||||
"addedby": "_id email name",
|
|
||||||
"lastModifiedBy": "_id email name"
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
ResponseModel responseModel = await _httpClient.customRequest(
|
ResponseModel responseModel = await _httpClient.safeApiCall(
|
||||||
"POST",
|
method: ApiMethod.post,
|
||||||
url: WebUrls.userProfileUrl,
|
url: WebUrls.getServiceUsersListUrl,
|
||||||
requestBody: requestBody,
|
body: requestBody,
|
||||||
requestHeader: {'Content-Type': 'application/json'},
|
|
||||||
isBearerHeaderRequired: true,
|
|
||||||
isBearer: true,
|
|
||||||
);
|
);
|
||||||
if (responseModel.statusCode >= 200 &&
|
if ((responseModel.statusCode ~/ 100) == 2) {
|
||||||
responseModel.statusCode <= 230 &&
|
final resp = AllClientsResponseData.fromJson(responseModel.data);
|
||||||
responseModel.statusDescription.toLowerCase().contains("success")) {
|
return AllClientsResponse(success: true, data: resp);
|
||||||
final profileDataModel = ProfileDataModel.fromJson({
|
|
||||||
'status': "${responseModel.statusCode}",
|
|
||||||
"data": responseModel.data,
|
|
||||||
'message': responseModel.statusDescription,
|
|
||||||
});
|
|
||||||
// await LocalStorageManager.saveSession(
|
|
||||||
// tokenKey: LocalStorageKeys.kProfileModelKey,
|
|
||||||
// tokenValue: json.encode(profileDataModel.toJson()),
|
|
||||||
// );
|
|
||||||
return profileDataModel;
|
|
||||||
} else {
|
} else {
|
||||||
return responseModel.statusDescription;
|
return AllClientsResponse(success: false, message: responseModel.statusDescription);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -223,11 +204,6 @@ class ClientService {
|
||||||
responseModel.statusCode <= 230 &&
|
responseModel.statusCode <= 230 &&
|
||||||
responseModel.statusDescription.toLowerCase().contains("success")) {
|
responseModel.statusDescription.toLowerCase().contains("success")) {
|
||||||
final resp = AllClientsResponseData.fromJson(responseModel.data);
|
final resp = AllClientsResponseData.fromJson(responseModel.data);
|
||||||
|
|
||||||
// List<ServiceUserModel> serviceUsers = [];
|
|
||||||
// for (var singleUser in responseModel.data['serviceUsers']) {
|
|
||||||
// serviceUsers.add(ServiceUserModel.fromJson(singleUser));
|
|
||||||
// }
|
|
||||||
return AllClientsResponse(success: true, data: resp);
|
return AllClientsResponse(success: true, data: resp);
|
||||||
} else {
|
} else {
|
||||||
return AllClientsResponse(
|
return AllClientsResponse(
|
||||||
|
|
@ -914,10 +890,7 @@ class ClientService {
|
||||||
url: WebUrls.getCarePlansListURL,
|
url: WebUrls.getCarePlansListURL,
|
||||||
requestBody: {
|
requestBody: {
|
||||||
"query": {
|
"query": {
|
||||||
"critarion": {
|
"critarion": {"userId": serviceUserId, "active": true}
|
||||||
"userId": serviceUserId,
|
|
||||||
"active": true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"sortproperty": "eventDateTime",
|
"sortproperty": "eventDateTime",
|
||||||
"sortorder": -1,
|
"sortorder": -1,
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ dev_dependencies:
|
||||||
flutter_lints: ^2.0.0
|
flutter_lints: ^2.0.0
|
||||||
flutter_launcher_icons: ^0.13.1
|
flutter_launcher_icons: ^0.13.1
|
||||||
flutter_native_splash: ^2.2.11
|
flutter_native_splash: ^2.2.11
|
||||||
|
change_app_package_name: ^1.3.0
|
||||||
|
|
||||||
# For generating Splash Screen
|
# For generating Splash Screen
|
||||||
flutter_native_splash:
|
flutter_native_splash:
|
||||||
|
|
|
||||||
Reference in New Issue