Merge branch 'merge_dq_master' into 'master'
Merge dq master See merge request Cloud_Solution/diplomatic-quarter!224merge-requests/225/merge
commit
71417da030
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 147 KiB |
@ -1 +1 @@
|
||||
d69545ca05f0ca200eba92121a1458fb
|
||||
59a6c452ee075b50114918f17f1ad8f5
|
@ -0,0 +1,88 @@
|
||||
class InsuranceCardDetailsModel {
|
||||
int approvalLimit;
|
||||
int companyGroupID;
|
||||
String companyName;
|
||||
String companyRemarks;
|
||||
String dOB;
|
||||
int deductible;
|
||||
String effectiveFrom;
|
||||
String effectiveTo;
|
||||
String eligabilityFailureReason;
|
||||
bool isMemberEligible;
|
||||
String memberID;
|
||||
String memberName;
|
||||
String memberStatus;
|
||||
dynamic message;
|
||||
String nationalId;
|
||||
String policyNumber;
|
||||
String responseMessage;
|
||||
String room;
|
||||
String subCategory;
|
||||
|
||||
InsuranceCardDetailsModel(
|
||||
{this.approvalLimit,
|
||||
this.companyGroupID,
|
||||
this.companyName,
|
||||
this.companyRemarks,
|
||||
this.dOB,
|
||||
this.deductible,
|
||||
this.effectiveFrom,
|
||||
this.effectiveTo,
|
||||
this.eligabilityFailureReason,
|
||||
this.isMemberEligible,
|
||||
this.memberID,
|
||||
this.memberName,
|
||||
this.memberStatus,
|
||||
this.message,
|
||||
this.nationalId,
|
||||
this.policyNumber,
|
||||
this.responseMessage,
|
||||
this.room,
|
||||
this.subCategory});
|
||||
|
||||
InsuranceCardDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||
approvalLimit = json['ApprovalLimit'];
|
||||
companyGroupID = json['CompanyGroupID'];
|
||||
companyName = json['CompanyName'];
|
||||
companyRemarks = json['CompanyRemarks'];
|
||||
dOB = json['DOB'];
|
||||
deductible = json['Deductible'];
|
||||
effectiveFrom = json['EffectiveFrom'];
|
||||
effectiveTo = json['EffectiveTo'];
|
||||
eligabilityFailureReason = json['EligabilityFailureReason'];
|
||||
isMemberEligible = json['IsMemberEligible'];
|
||||
memberID = json['MemberID'];
|
||||
memberName = json['MemberName'];
|
||||
memberStatus = json['MemberStatus'];
|
||||
message = json['Message'];
|
||||
nationalId = json['NationalId'];
|
||||
policyNumber = json['PolicyNumber'];
|
||||
responseMessage = json['ResponseMessage'];
|
||||
room = json['Room'];
|
||||
subCategory = json['SubCategory'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ApprovalLimit'] = this.approvalLimit;
|
||||
data['CompanyGroupID'] = this.companyGroupID;
|
||||
data['CompanyName'] = this.companyName;
|
||||
data['CompanyRemarks'] = this.companyRemarks;
|
||||
data['DOB'] = this.dOB;
|
||||
data['Deductible'] = this.deductible;
|
||||
data['EffectiveFrom'] = this.effectiveFrom;
|
||||
data['EffectiveTo'] = this.effectiveTo;
|
||||
data['EligabilityFailureReason'] = this.eligabilityFailureReason;
|
||||
data['IsMemberEligible'] = this.isMemberEligible;
|
||||
data['MemberID'] = this.memberID;
|
||||
data['MemberName'] = this.memberName;
|
||||
data['MemberStatus'] = this.memberStatus;
|
||||
data['Message'] = this.message;
|
||||
data['NationalId'] = this.nationalId;
|
||||
data['PolicyNumber'] = this.policyNumber;
|
||||
data['ResponseMessage'] = this.responseMessage;
|
||||
data['Room'] = this.room;
|
||||
data['SubCategory'] = this.subCategory;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
class PrivilegeModel {
|
||||
int iD;
|
||||
String serviceName;
|
||||
bool privilege;
|
||||
dynamic region;
|
||||
|
||||
PrivilegeModel({this.iD, this.serviceName, this.privilege, this.region});
|
||||
|
||||
PrivilegeModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
serviceName = json['ServiceName'];
|
||||
privilege = json['Previlege'];
|
||||
region = json['Region'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['ServiceName'] = this.serviceName;
|
||||
data['Previlege'] = this.privilege;
|
||||
data['Region'] = this.region;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,267 @@
|
||||
class WeatherIndicatorModel {
|
||||
Null date;
|
||||
int languageID;
|
||||
int serviceName;
|
||||
Null time;
|
||||
Null androidLink;
|
||||
Null authenticationTokenID;
|
||||
Null data;
|
||||
bool dataw;
|
||||
int dietType;
|
||||
Null errorCode;
|
||||
Null errorEndUserMessage;
|
||||
Null errorEndUserMessageN;
|
||||
Null errorMessage;
|
||||
int errorType;
|
||||
int foodCategory;
|
||||
Null iOSLink;
|
||||
bool isAuthenticated;
|
||||
int mealOrderStatus;
|
||||
int mealType;
|
||||
int messageStatus;
|
||||
int numberOfResultRecords;
|
||||
Null patientBlodType;
|
||||
Null successMsg;
|
||||
Null successMsgN;
|
||||
Null citiesList;
|
||||
Null cityName;
|
||||
Null get5DaysWeatherForecastList;
|
||||
List<GetCityInfoList> getCityInfoList;
|
||||
Null getTodayWeatherForecastList;
|
||||
Null iniciesList;
|
||||
|
||||
WeatherIndicatorModel(
|
||||
{this.date,
|
||||
this.languageID,
|
||||
this.serviceName,
|
||||
this.time,
|
||||
this.androidLink,
|
||||
this.authenticationTokenID,
|
||||
this.data,
|
||||
this.dataw,
|
||||
this.dietType,
|
||||
this.errorCode,
|
||||
this.errorEndUserMessage,
|
||||
this.errorEndUserMessageN,
|
||||
this.errorMessage,
|
||||
this.errorType,
|
||||
this.foodCategory,
|
||||
this.iOSLink,
|
||||
this.isAuthenticated,
|
||||
this.mealOrderStatus,
|
||||
this.mealType,
|
||||
this.messageStatus,
|
||||
this.numberOfResultRecords,
|
||||
this.patientBlodType,
|
||||
this.successMsg,
|
||||
this.successMsgN,
|
||||
this.citiesList,
|
||||
this.cityName,
|
||||
this.get5DaysWeatherForecastList,
|
||||
this.getCityInfoList,
|
||||
this.getTodayWeatherForecastList,
|
||||
this.iniciesList});
|
||||
|
||||
WeatherIndicatorModel.fromJson(Map<String, dynamic> json) {
|
||||
date = json['Date'];
|
||||
languageID = json['LanguageID'];
|
||||
serviceName = json['ServiceName'];
|
||||
time = json['Time'];
|
||||
androidLink = json['AndroidLink'];
|
||||
authenticationTokenID = json['AuthenticationTokenID'];
|
||||
data = json['Data'];
|
||||
dataw = json['Dataw'];
|
||||
dietType = json['DietType'];
|
||||
errorCode = json['ErrorCode'];
|
||||
errorEndUserMessage = json['ErrorEndUserMessage'];
|
||||
errorEndUserMessageN = json['ErrorEndUserMessageN'];
|
||||
errorMessage = json['ErrorMessage'];
|
||||
errorType = json['ErrorType'];
|
||||
foodCategory = json['FoodCategory'];
|
||||
iOSLink = json['IOSLink'];
|
||||
isAuthenticated = json['IsAuthenticated'];
|
||||
mealOrderStatus = json['MealOrderStatus'];
|
||||
mealType = json['MealType'];
|
||||
messageStatus = json['MessageStatus'];
|
||||
numberOfResultRecords = json['NumberOfResultRecords'];
|
||||
patientBlodType = json['PatientBlodType'];
|
||||
successMsg = json['SuccessMsg'];
|
||||
successMsgN = json['SuccessMsgN'];
|
||||
citiesList = json['CitiesList'];
|
||||
cityName = json['CityName'];
|
||||
get5DaysWeatherForecastList = json['Get5DaysWeatherForecastList'];
|
||||
if (json['GetCityInfo_List'] != null) {
|
||||
getCityInfoList = new List<GetCityInfoList>();
|
||||
json['GetCityInfo_List'].forEach((v) {
|
||||
getCityInfoList.add(new GetCityInfoList.fromJson(v));
|
||||
});
|
||||
}
|
||||
getTodayWeatherForecastList = json['GetTodayWeatherForecastList'];
|
||||
iniciesList = json['IniciesList'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Date'] = this.date;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['ServiceName'] = this.serviceName;
|
||||
data['Time'] = this.time;
|
||||
data['AndroidLink'] = this.androidLink;
|
||||
data['AuthenticationTokenID'] = this.authenticationTokenID;
|
||||
data['Data'] = this.data;
|
||||
data['Dataw'] = this.dataw;
|
||||
data['DietType'] = this.dietType;
|
||||
data['ErrorCode'] = this.errorCode;
|
||||
data['ErrorEndUserMessage'] = this.errorEndUserMessage;
|
||||
data['ErrorEndUserMessageN'] = this.errorEndUserMessageN;
|
||||
data['ErrorMessage'] = this.errorMessage;
|
||||
data['ErrorType'] = this.errorType;
|
||||
data['FoodCategory'] = this.foodCategory;
|
||||
data['IOSLink'] = this.iOSLink;
|
||||
data['IsAuthenticated'] = this.isAuthenticated;
|
||||
data['MealOrderStatus'] = this.mealOrderStatus;
|
||||
data['MealType'] = this.mealType;
|
||||
data['MessageStatus'] = this.messageStatus;
|
||||
data['NumberOfResultRecords'] = this.numberOfResultRecords;
|
||||
data['PatientBlodType'] = this.patientBlodType;
|
||||
data['SuccessMsg'] = this.successMsg;
|
||||
data['SuccessMsgN'] = this.successMsgN;
|
||||
data['CitiesList'] = this.citiesList;
|
||||
data['CityName'] = this.cityName;
|
||||
data['Get5DaysWeatherForecastList'] = this.get5DaysWeatherForecastList;
|
||||
if (this.getCityInfoList != null) {
|
||||
data['GetCityInfo_List'] =
|
||||
this.getCityInfoList.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['GetTodayWeatherForecastList'] = this.getTodayWeatherForecastList;
|
||||
data['IniciesList'] = this.iniciesList;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class GetCityInfoList {
|
||||
CategoriesNames categoriesNames;
|
||||
String category;
|
||||
String categoryValue;
|
||||
int cityID;
|
||||
String cityName;
|
||||
String cityNameN;
|
||||
String colorName;
|
||||
String createdOn;
|
||||
String iD;
|
||||
int iniceID;
|
||||
bool isOrderEmpty;
|
||||
bool isValuesReversed;
|
||||
bool language;
|
||||
double latitude;
|
||||
double longitude;
|
||||
String name;
|
||||
int orderNum;
|
||||
double temperature;
|
||||
String value;
|
||||
|
||||
GetCityInfoList(
|
||||
{this.categoriesNames,
|
||||
this.category,
|
||||
this.categoryValue,
|
||||
this.cityID,
|
||||
this.cityName,
|
||||
this.cityNameN,
|
||||
this.colorName,
|
||||
this.createdOn,
|
||||
this.iD,
|
||||
this.iniceID,
|
||||
this.isOrderEmpty,
|
||||
this.isValuesReversed,
|
||||
this.language,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.name,
|
||||
this.orderNum,
|
||||
this.temperature,
|
||||
this.value});
|
||||
|
||||
GetCityInfoList.fromJson(Map<String, dynamic> json) {
|
||||
categoriesNames = json['CategoriesNames'] != null
|
||||
? new CategoriesNames.fromJson(json['CategoriesNames'])
|
||||
: null;
|
||||
category = json['Category'];
|
||||
categoryValue = json['CategoryValue'];
|
||||
cityID = json['CityID'];
|
||||
cityName = json['CityName'];
|
||||
cityNameN = json['CityNameN'];
|
||||
colorName = json['ColorName'];
|
||||
createdOn = json['CreatedOn'];
|
||||
iD = json['ID'];
|
||||
iniceID = json['IniceID'];
|
||||
isOrderEmpty = json['IsOrderEmpty'];
|
||||
isValuesReversed = json['IsValuesReversed'];
|
||||
language = json['Language'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
name = json['Name'];
|
||||
orderNum = json['OrderNum'];
|
||||
temperature = json['Temperature'];
|
||||
value = json['Value'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.categoriesNames != null) {
|
||||
data['CategoriesNames'] = this.categoriesNames.toJson();
|
||||
}
|
||||
data['Category'] = this.category;
|
||||
data['CategoryValue'] = this.categoryValue;
|
||||
data['CityID'] = this.cityID;
|
||||
data['CityName'] = this.cityName;
|
||||
data['CityNameN'] = this.cityNameN;
|
||||
data['ColorName'] = this.colorName;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['ID'] = this.iD;
|
||||
data['IniceID'] = this.iniceID;
|
||||
data['IsOrderEmpty'] = this.isOrderEmpty;
|
||||
data['IsValuesReversed'] = this.isValuesReversed;
|
||||
data['Language'] = this.language;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['Name'] = this.name;
|
||||
data['OrderNum'] = this.orderNum;
|
||||
data['Temperature'] = this.temperature;
|
||||
data['Value'] = this.value;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class CategoriesNames {
|
||||
String category1;
|
||||
String category2;
|
||||
String category3;
|
||||
String category4;
|
||||
String category5;
|
||||
|
||||
CategoriesNames(
|
||||
{this.category1,
|
||||
this.category2,
|
||||
this.category3,
|
||||
this.category4,
|
||||
this.category5});
|
||||
|
||||
CategoriesNames.fromJson(Map<String, dynamic> json) {
|
||||
category1 = json['Category1'];
|
||||
category2 = json['Category2'];
|
||||
category3 = json['Category3'];
|
||||
category4 = json['Category4'];
|
||||
category5 = json['Category5'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Category1'] = this.category1;
|
||||
data['Category2'] = this.category2;
|
||||
data['Category3'] = this.category3;
|
||||
data['Category4'] = this.category4;
|
||||
data['Category5'] = this.category5;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
|
||||
class PrivilegeService extends BaseService {
|
||||
|
||||
List<PrivilegeModel> privilegeModelList = List();
|
||||
|
||||
Future getPrivilege() async {
|
||||
Map<String, dynamic> body = Map();
|
||||
body['PatientType'] = 4;
|
||||
await baseAppClient.post(GET_PRIVILEGE,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
response['ServicePrivilegeList'].forEach((item) {
|
||||
privilegeModelList.add(PrivilegeModel.fromJson(item));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
|
||||
class WeatherService extends BaseService {
|
||||
List<GetCityInfoList> weatherIndicatorData = List();
|
||||
|
||||
Map<String, dynamic> body = Map();
|
||||
String Latitude = "";
|
||||
String Longitude = "";
|
||||
String PhoneNumber = "";
|
||||
|
||||
Future getWeatherData() async {
|
||||
hasError = false;
|
||||
|
||||
var lat = await sharedPref.getDouble(USER_LAT);
|
||||
var long = await sharedPref.getDouble(USER_LONG);
|
||||
body['Latitude'] = lat ?? 0;
|
||||
body['Longitude'] = long ?? 0;
|
||||
|
||||
await baseAppClient.post(WEATHER_INDICATOR,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
weatherIndicatorData = [];
|
||||
response['GetCityInfo_List'].forEach((data) {
|
||||
weatherIndicatorData.add(GetCityInfoList.fromJson(data));
|
||||
});
|
||||
print(weatherIndicatorData);
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
await this.sharedPref.setObject(WEATHER, weatherIndicatorData[0]);
|
||||
return Future.value(weatherIndicatorData[0]);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/service/er/er_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/weather_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
|
||||
class WeatherViewModel extends BaseViewModel {
|
||||
WeatherService _weatherService = locator<WeatherService>();
|
||||
List<GetCityInfoList> get weatherIndicatorData =>
|
||||
_weatherService.weatherIndicatorData;
|
||||
getWeatherData() async {
|
||||
setState(ViewState.Busy);
|
||||
|
||||
// if (id != null && projectID != null) {
|
||||
// await _erService.getProjectAvgERWaitingTimeOrders(
|
||||
// id: id, projectID: projectID);
|
||||
// } else {
|
||||
await _weatherService.getWeatherData();
|
||||
// }
|
||||
if (_weatherService.hasError) {
|
||||
error = _weatherService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/location_util.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
|
||||
|
||||
class HealthWeatherIndicator extends StatefulWidget {
|
||||
@override
|
||||
_HospitalsPageState createState() => _HospitalsPageState();
|
||||
}
|
||||
|
||||
class _HospitalsPageState extends State<HealthWeatherIndicator> {
|
||||
var data;
|
||||
LocationUtils locationUtils;
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
var weather = '--';
|
||||
@override
|
||||
void initState() {
|
||||
locationUtils =
|
||||
new LocationUtils(isShowConfirmDialog: true, context: context);
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
|
||||
getWeather();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return BaseView<WeatherViewModel>(
|
||||
onModelReady: (model) => model.getWeatherData(),
|
||||
allowAny: true,
|
||||
builder: (_, mode, widget) => AppScaffold(
|
||||
isShowDecPage: false,
|
||||
appBarTitle: TranslationBase.of(context).healthWeatherIndicators,
|
||||
isShowAppBar: true,
|
||||
body: mode.weatherIndicatorData.length > 0
|
||||
? SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
width: double.infinity,
|
||||
height: 150,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image:
|
||||
ExactAssetImage('assets/images/Weather_img.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8.0)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.healthWeatherIndicators,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.healthTipsBasedOnCurrentWeather,
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
),
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/Weather_ico.png',
|
||||
width: 60,
|
||||
height: 60,
|
||||
),
|
||||
Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: AppText(weather,
|
||||
fontSize: 22,
|
||||
color: Colors.white))
|
||||
],
|
||||
),
|
||||
],
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: AppText(
|
||||
projectViewModel.isArabic
|
||||
? mode.weatherIndicatorData[0].cityNameN
|
||||
: mode.weatherIndicatorData[0].cityName,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Column(
|
||||
children: mode.weatherIndicatorData.map((data) {
|
||||
return WeatherSlider(data);
|
||||
}).toList()))
|
||||
]))
|
||||
: Center(child: AppCircularProgressIndicator())),
|
||||
);
|
||||
}
|
||||
|
||||
getWeather() async {
|
||||
var data = await this.sharedPref.getObject(WEATHER);
|
||||
setState(() {
|
||||
weather = data['Temperature'].toString() + '\u2103' ?? '--';
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
import 'dart:io';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AttachInsuranceCardImageDialog extends StatefulWidget {
|
||||
final String name;
|
||||
final String fileNo;
|
||||
final Function(File file, String image) image;
|
||||
|
||||
const AttachInsuranceCardImageDialog(
|
||||
{Key key, this.name, this.fileNo, this.image})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AttachInsuranceCardImageDialogState createState() =>
|
||||
_AttachInsuranceCardImageDialogState();
|
||||
}
|
||||
|
||||
class _AttachInsuranceCardImageDialogState
|
||||
extends State<AttachInsuranceCardImageDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
String image;
|
||||
File file;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Texts(TranslationBase.of(context).attachInsuraceImage),
|
||||
Divider(),
|
||||
Texts(widget.name),
|
||||
SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
ImageOptions.showImageOptions(context, (String image,File file) {
|
||||
setState(() {
|
||||
this.image = image;
|
||||
this.file = file;
|
||||
});
|
||||
});
|
||||
},
|
||||
child: image == null
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(18.0),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
height: 250,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
border: Border.all(color: Colors.grey, width: 1.5)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// mainAxisAlignment: MainAxisAlignment.,
|
||||
children: [
|
||||
SizedBox(height: 25,),
|
||||
Icon(
|
||||
Icons.camera_enhance_rounded,
|
||||
size: 85,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.attach_file),
|
||||
Texts(TranslationBase.of(context).selectAttachment.toUpperCase())
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.file(
|
||||
file,
|
||||
fit: BoxFit.fill,
|
||||
height: 250,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 25.0,
|
||||
),
|
||||
Divider(),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.image(file, image);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,346 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'AttachInsuranceCardImageDialog.dart';
|
||||
|
||||
class InsuranceCardUpdateDetails extends StatelessWidget {
|
||||
final List<InsuranceCardDetailsModel> insuranceCardDetailsModel;
|
||||
final String patientIdentificationID;
|
||||
final int patientID;
|
||||
final String name;
|
||||
|
||||
const InsuranceCardUpdateDetails(
|
||||
{Key key,
|
||||
this.insuranceCardDetailsModel,
|
||||
this.patientIdentificationID,
|
||||
this.patientID,
|
||||
this.name})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return BaseView<InsuranceViewModel>(
|
||||
builder: (context, model, w) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
isShowDecPage: false,
|
||||
appBarTitle: TranslationBase.of(context).cardDetail,
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
...List.generate(
|
||||
insuranceCardDetailsModel.length,
|
||||
(index) => Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
margin: EdgeInsets.only(left: 8, right: 8, top: 8),
|
||||
height: projectViewModel.isArabic ? 320 : 240,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
color: Color(0xff515B5D),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
insuranceCardDetailsModel[index].memberID,
|
||||
textScaleFactor: 2.1,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
letterSpacing: 8.0,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 15),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Texts(
|
||||
insuranceCardDetailsModel[index].companyName,
|
||||
fontSize: 14,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).policyHolder,
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
),
|
||||
Texts(
|
||||
insuranceCardDetailsModel[index]
|
||||
.memberName,
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Texts(TranslationBase.of(context).policyNo,
|
||||
color: Colors.white),
|
||||
Texts(
|
||||
insuranceCardDetailsModel[index]
|
||||
.policyNumber,
|
||||
color: Colors.white),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context)
|
||||
.expiryDateTitle,
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
Texts(
|
||||
insuranceCardDetailsModel[index].dOB,
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).classTitle,
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
Texts(
|
||||
insuranceCardDetailsModel[index]
|
||||
.subCategory,
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).approval,
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
Texts(
|
||||
insuranceCardDetailsModel[index]
|
||||
.approvalLimit
|
||||
.toString(),
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if(insuranceCardDetailsModel.isEmpty)
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(10.0),
|
||||
child: Card(
|
||||
margin: EdgeInsets.fromLTRB(
|
||||
8.0, 16.0, 8.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
padding: EdgeInsets.all(10.0),
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 2.0,
|
||||
left: 10.0,
|
||||
right: 20.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
name,
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Texts(
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.fileno +
|
||||
": " +patientID.toString(),
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 150,),
|
||||
Image.asset('assets/images/no-data-found.png',width: 80,height: 80,),
|
||||
SizedBox(height: 8,),
|
||||
Texts(TranslationBase.of(context).noDataAvailable)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
width: double.infinity,
|
||||
height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 8, right: 8),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
if(insuranceCardDetailsModel.isEmpty)
|
||||
SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label: TranslationBase.of(context).scanNow.toUpperCase(),
|
||||
color: Theme.of(context).primaryColor,
|
||||
onTap: () async {
|
||||
confirmAttachInsuranceCardImageDialogDialog(
|
||||
context: context,
|
||||
name: name,
|
||||
fileNo: patientID.toString(),
|
||||
model: model);
|
||||
},
|
||||
),
|
||||
if(insuranceCardDetailsModel.isNotEmpty)
|
||||
SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label: TranslationBase.of(context).agree.toUpperCase(),
|
||||
color: Theme.of(context).primaryColor,
|
||||
onTap: () async {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
await model.uploadInsuranceCard(
|
||||
patientIdentificationID: patientIdentificationID,
|
||||
patientID: patientID);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
AppToast.showErrorToast(message: model.error);
|
||||
} else {
|
||||
AppToast.showSuccessToast(
|
||||
message: TranslationBase.of(context).requestSent);
|
||||
}
|
||||
},
|
||||
),if(insuranceCardDetailsModel.isNotEmpty)
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),if(insuranceCardDetailsModel.isNotEmpty)
|
||||
SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label: TranslationBase.of(context).disagree.toUpperCase(),
|
||||
color: Colors.grey[800],
|
||||
onTap: () async {
|
||||
confirmAttachInsuranceCardImageDialogDialog(
|
||||
context: context,
|
||||
name: name,
|
||||
fileNo: patientID.toString(),
|
||||
model: model);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void confirmAttachInsuranceCardImageDialogDialog(
|
||||
{BuildContext context,
|
||||
String name,
|
||||
String fileNo,
|
||||
InsuranceViewModel model}) {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: AttachInsuranceCardImageDialog(
|
||||
fileNo: fileNo,
|
||||
name: name,
|
||||
image: (file, image) async {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
await model.uploadInsuranceCard(
|
||||
patientIdentificationID: patientIdentificationID,
|
||||
patientID: patientID,
|
||||
image: image);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
if (model.state == ViewState.ErrorLocal ||
|
||||
model.state == ViewState.Error) {
|
||||
AppToast.showErrorToast(message: model.error);
|
||||
} else {
|
||||
AppToast.showSuccessToast(
|
||||
message: TranslationBase.of(context).requestSent);
|
||||
}
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,261 @@
|
||||
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../locator.dart';
|
||||
import 'insurance_card_update_details.dart';
|
||||
|
||||
class InsurancePage extends StatelessWidget {
|
||||
final InsuranceViewModel model;
|
||||
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
|
||||
|
||||
InsurancePage({Key key, this.model}) : super(key: key);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 65,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(10.0),
|
||||
color: Colors.white,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
padding: EdgeInsets.all(10.0),
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
if (model.user != null)
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 2.0,
|
||||
left: 10.0,
|
||||
right: 20.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
model.user.firstName ?? '' + " " + model.user.lastName ?? '',
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Texts(
|
||||
TranslationBase.of(context)
|
||||
.fileno +
|
||||
": " +
|
||||
model.user.patientID
|
||||
.toString(),
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 2.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: SecondaryButton(
|
||||
label: TranslationBase.of(
|
||||
context)
|
||||
.fetchData,
|
||||
small: true,
|
||||
textColor: Colors.white,
|
||||
onTap: () {
|
||||
getDetails(
|
||||
setupID: '010266',
|
||||
projectID: 15,
|
||||
patientIdentificationID:
|
||||
model.user
|
||||
.patientIdentificationNo,
|
||||
patientID: model
|
||||
.user.patientID,
|
||||
name: model.user
|
||||
.firstName +
|
||||
" " +
|
||||
model
|
||||
.user.lastName,context: context);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
if(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
|
||||
...List.generate(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, (index) =>
|
||||
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
|
||||
? Container(
|
||||
margin: EdgeInsets.all(10.0),
|
||||
child: Card(
|
||||
margin: EdgeInsets.fromLTRB(
|
||||
8.0, 16.0, 8.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
padding: EdgeInsets.all(10.0),
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 2.0,
|
||||
left: 10.0,
|
||||
right: 20.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
model
|
||||
.getAllSharedRecordsByStatusResponse
|
||||
.getAllSharedRecordsByStatusList[
|
||||
index]
|
||||
.patientName,
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Texts(
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.fileno +
|
||||
": " +
|
||||
model
|
||||
.getAllSharedRecordsByStatusResponse
|
||||
.getAllSharedRecordsByStatusList[
|
||||
index]
|
||||
.patientID
|
||||
.toString(),
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
margin:
|
||||
EdgeInsets.only(top: 2.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: SecondaryButton(
|
||||
label: TranslationBase
|
||||
.of(context)
|
||||
.fetchData,
|
||||
small: true,
|
||||
textColor:
|
||||
Colors.white,
|
||||
onTap: () {
|
||||
getDetails(
|
||||
projectID: 15,
|
||||
patientIdentificationID: model
|
||||
.getAllSharedRecordsByStatusResponse
|
||||
.getAllSharedRecordsByStatusList[
|
||||
index]
|
||||
.patientIdenficationNumber,
|
||||
setupID:
|
||||
'010266',
|
||||
patientID: model
|
||||
.getAllSharedRecordsByStatusResponse
|
||||
.getAllSharedRecordsByStatusList[
|
||||
index]
|
||||
.responseID,
|
||||
name: model
|
||||
.getAllSharedRecordsByStatusResponse
|
||||
.getAllSharedRecordsByStatusList[
|
||||
index].patientName,context: context);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
getDetails(
|
||||
{String setupID,
|
||||
int projectID,
|
||||
String patientIdentificationID,
|
||||
int patientID,
|
||||
String name,BuildContext context}) {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
_insuranceCardService
|
||||
.getPatientInsuranceDetails(
|
||||
setupID: setupID,
|
||||
projectID: projectID,
|
||||
patientID: patientID,
|
||||
patientIdentificationID: patientIdentificationID)
|
||||
.then((value) {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: InsuranceCardUpdateDetails(
|
||||
insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList,
|
||||
patientID: patientID,
|
||||
patientIdentificationID: patientIdentificationID,
|
||||
name: name,
|
||||
)));
|
||||
} else {
|
||||
AppToast.showErrorToast(message: _insuranceCardService.error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,257 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LineChartCurvedBloodPressure extends StatelessWidget {
|
||||
final String title;
|
||||
final List<TimeSeriesSales2> timeSeries1;
|
||||
final List<TimeSeriesSales2> timeSeries2;
|
||||
final int indexes;
|
||||
|
||||
LineChartCurvedBloodPressure(
|
||||
{this.title, this.timeSeries1, this.indexes, this.timeSeries2});
|
||||
|
||||
List<int> xAxixs = List();
|
||||
List<double> yAxixs = List();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
getXaxix();
|
||||
return AspectRatio(
|
||||
aspectRatio: 1.1,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||
// color: Colors.white,
|
||||
),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: 15, letterSpacing: 2),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
|
||||
child: LineChart(
|
||||
sampleData1(context),
|
||||
swapAnimationDuration: const Duration(milliseconds: 250),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Theme.of(context).primaryColor),
|
||||
),
|
||||
SizedBox(width: 5,),
|
||||
Texts(TranslationBase.of(context).systolicLng)
|
||||
],
|
||||
),
|
||||
SizedBox(width: 15,),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.grey),
|
||||
),
|
||||
SizedBox(width: 5,),
|
||||
Texts(TranslationBase.of(context).diastolicLng)
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
getXaxix() {
|
||||
for (int index = 0; index < timeSeries1.length; index++) {
|
||||
int mIndex = indexes * index;
|
||||
if (mIndex < timeSeries1.length) {
|
||||
xAxixs.add(mIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LineChartData sampleData1(context) {
|
||||
return LineChartData(
|
||||
lineTouchData: LineTouchData(
|
||||
touchTooltipData: LineTouchTooltipData(
|
||||
tooltipBgColor: Colors.white,
|
||||
),
|
||||
touchCallback: (LineTouchResponse touchResponse) {},
|
||||
handleBuiltInTouches: true,
|
||||
),
|
||||
gridData: FlGridData(
|
||||
show: true, drawVerticalLine: true, drawHorizontalLine: true),
|
||||
titlesData: FlTitlesData(
|
||||
bottomTitles: SideTitles(
|
||||
showTitles: true,
|
||||
getTextStyles: (value) => const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10,
|
||||
),
|
||||
rotateAngle: -65,
|
||||
//rotateAngle:-65,
|
||||
margin: 22,
|
||||
getTitles: (value) {
|
||||
if (timeSeries1.length < 15) {
|
||||
if (timeSeries1.length > value.toInt()) {
|
||||
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||
} else
|
||||
return '';
|
||||
} else {
|
||||
if (value.toInt() == 0)
|
||||
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||
if (value.toInt() == timeSeries1.length - 1)
|
||||
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||
if (xAxixs.contains(value.toInt())) {
|
||||
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
),
|
||||
leftTitles: SideTitles(
|
||||
showTitles: true,
|
||||
getTextStyles: (value) => const TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10,
|
||||
),
|
||||
getTitles: (value) {
|
||||
return '${value.toInt()}';
|
||||
},
|
||||
margin: 12,
|
||||
),
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black,
|
||||
width: 0.5,
|
||||
),
|
||||
left: BorderSide(
|
||||
color: Colors.black,
|
||||
),
|
||||
right: BorderSide(
|
||||
color: Colors.black,
|
||||
),
|
||||
top: BorderSide(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
),
|
||||
),
|
||||
minX: 0,
|
||||
maxX: (timeSeries1.length - 1).toDouble(),
|
||||
maxY: getMaxY() + 0.3,
|
||||
minY: getMinY(),
|
||||
lineBarsData: getData(context),
|
||||
);
|
||||
}
|
||||
|
||||
double getMaxY() {
|
||||
double max = 0;
|
||||
timeSeries1.forEach((element) {
|
||||
double resultValueDouble = element.sales;
|
||||
if (resultValueDouble > max) max = resultValueDouble;
|
||||
});
|
||||
timeSeries2.forEach((element) {
|
||||
double resultValueDouble = element.sales;
|
||||
if (resultValueDouble > max) max = resultValueDouble;
|
||||
});
|
||||
|
||||
return max.roundToDouble();
|
||||
}
|
||||
|
||||
double getMinY() {
|
||||
double min = timeSeries1[0].sales;
|
||||
timeSeries1.forEach((element) {
|
||||
double resultValueDouble = element.sales;
|
||||
if (resultValueDouble < min) min = resultValueDouble;
|
||||
});
|
||||
timeSeries2.forEach((element) {
|
||||
double resultValueDouble = element.sales;
|
||||
if (resultValueDouble < min) min = resultValueDouble;
|
||||
});
|
||||
|
||||
int value = min.toInt();
|
||||
|
||||
return value.toDouble();
|
||||
}
|
||||
|
||||
List<LineChartBarData> getData(context) {
|
||||
List<FlSpot> spots = List();
|
||||
for (int index = 0; index < timeSeries1.length; index++) {
|
||||
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
|
||||
}
|
||||
|
||||
List<FlSpot> spots2 = List();
|
||||
for (int index = 0; index < timeSeries2.length; index++) {
|
||||
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
|
||||
}
|
||||
|
||||
final LineChartBarData lineChartBarData1 = LineChartBarData(
|
||||
spots: spots,
|
||||
isCurved: true,
|
||||
colors: [Theme.of(context).primaryColor],
|
||||
barWidth: 5,
|
||||
isStrokeCapRound: true,
|
||||
dotData: FlDotData(
|
||||
show: false,
|
||||
),
|
||||
belowBarData: BarAreaData(
|
||||
show: false,
|
||||
),
|
||||
);
|
||||
final LineChartBarData lineChartBarData2 = LineChartBarData(
|
||||
spots: spots2,
|
||||
isCurved: true,
|
||||
colors: [Colors.grey],
|
||||
barWidth: 5,
|
||||
isStrokeCapRound: true,
|
||||
dotData: FlDotData(
|
||||
show: false,
|
||||
),
|
||||
belowBarData: BarAreaData(
|
||||
show: false,
|
||||
),
|
||||
);
|
||||
|
||||
return [lineChartBarData1, lineChartBarData2];
|
||||
}
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class VitalSignBloodPressureWidget extends StatefulWidget {
|
||||
final List<VitalSignResModel> vitalList;
|
||||
final String title1;
|
||||
final String title2;
|
||||
final String title3;
|
||||
final String viewKey1;
|
||||
final String viewKey2;
|
||||
|
||||
VitalSignBloodPressureWidget(
|
||||
{Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2});
|
||||
|
||||
@override
|
||||
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
|
||||
}
|
||||
|
||||
class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)),
|
||||
border: Border.all(color: Colors.grey, width: 1),
|
||||
),
|
||||
margin: EdgeInsets.all(20),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Table(
|
||||
border: TableBorder.symmetric(
|
||||
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
|
||||
),
|
||||
children: fullData(projectViewModel),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<TableRow> fullData(ProjectViewModel projectViewModel) {
|
||||
List<TableRow> tableRow = [];
|
||||
tableRow.add(TableRow(children: [
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).date,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
height: 60,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(widget.title2, color: Colors.white),
|
||||
),
|
||||
height: 60),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(widget.title3, color: Colors.white),
|
||||
),
|
||||
height: 60),
|
||||
),
|
||||
]));
|
||||
widget.vitalList.forEach((vital) {
|
||||
var data = vital.toJson()[widget.viewKey1];
|
||||
if (data != 0)
|
||||
tableRow.add(TableRow(children: [
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'${vital.toJson()[widget.viewKey1]}',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'${vital.toJson()[widget.viewKey2]}',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]));
|
||||
});
|
||||
return tableRow;
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
|
||||
import 'LineChartCurved.dart';
|
||||
import 'LineChartCurvedBloodPressure.dart';
|
||||
|
||||
class VitalSingChartBloodPressure extends StatelessWidget {
|
||||
VitalSingChartBloodPressure({
|
||||
Key key,
|
||||
@required this.vitalList,
|
||||
@required this.name,
|
||||
@required this.viewKey1,
|
||||
@required this.viewKey2,
|
||||
@required this.title1,
|
||||
@required this.title2,
|
||||
@required this.title3,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<VitalSignResModel> vitalList;
|
||||
final String name;
|
||||
final String viewKey1;
|
||||
final String viewKey2;
|
||||
final String title1;
|
||||
final String title2;
|
||||
final String title3;
|
||||
List<TimeSeriesSales2> timeSeriesData1 = [];
|
||||
List<TimeSeriesSales2> timeSeriesData2 = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
generateData();
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
AppExpandableNotifier(
|
||||
isExpand: true,
|
||||
headerWidget: LineChartCurvedBloodPressure(
|
||||
title: name,
|
||||
timeSeries1: timeSeriesData1,
|
||||
timeSeries2: timeSeriesData2,
|
||||
indexes: timeSeriesData1.length ~/ 5.5,
|
||||
),
|
||||
bodyWidget: VitalSignBloodPressureWidget(
|
||||
vitalList: vitalList,
|
||||
title1: title1,
|
||||
title2: title2,
|
||||
title3: title3,
|
||||
viewKey1: viewKey1,
|
||||
viewKey2: viewKey2,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
generateData() {
|
||||
if (vitalList.length > 0) {
|
||||
vitalList.reversed.toList().forEach(
|
||||
(element) {
|
||||
if (element.toJson()[viewKey1]?.toInt() != 0)
|
||||
timeSeriesData1.add(
|
||||
TimeSeriesSales2(
|
||||
new DateTime(element.vitalSignDate.year,
|
||||
element.vitalSignDate.month, element.vitalSignDate.day),
|
||||
element.toJson()[viewKey1].toDouble(),
|
||||
),
|
||||
);
|
||||
if (element.toJson()[viewKey2]?.toInt() != 0)
|
||||
timeSeriesData2.add(
|
||||
TimeSeriesSales2(
|
||||
new DateTime(element.vitalSignDate.year,
|
||||
element.vitalSignDate.month, element.vitalSignDate.day),
|
||||
element.toJson()[viewKey2].toDouble(),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue