models updates -> 3.13.6

dev_v3.13.6_voipcall
devamirsaleemahmad 2 years ago
parent 1c19b36d2d
commit dfc6e86442

@ -7,9 +7,9 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable
class ConfirmCancelOrderDialog extends StatefulWidget {
final HomeHealthCareViewModel model;
final Function onTap;
final Function? onTap;
ConfirmCancelOrderDialog({Key key, this.model, this.onTap});
ConfirmCancelOrderDialog({Key? key, required this.model, this.onTap});
@override
_ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState();
@ -77,7 +77,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
flex: 1,
child: InkWell(
onTap: () async {
widget.onTap();
widget.onTap!();
Navigator.pop(context);
},
child: Padding(

@ -28,12 +28,12 @@ import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:provider/provider.dart';
class LocationPage extends StatefulWidget {
final Function(PickResult) onPick;
final Function(PickResult)? onPick;
// final double latitude;
// final double longitude;
final dynamic model;
const LocationPage({Key key, this.onPick, this.model}) : super(key: key);
const LocationPage({Key? key, this.onPick, this.model}) : super(key: key);
@override
_LocationPageState createState() => _LocationPageState();
@ -44,22 +44,22 @@ class _LocationPageState extends State<LocationPage> {
double longitude = 0;
bool showCurrentLocation = false;
GoogleMapController mapController;
GoogleMapController? mapController;
bool isHuawei = false;
AppMap appMap;
late AppMap appMap;
AppSharedPreferences sharedPref = AppSharedPreferences();
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
LatLng currentPostion;
late LatLng currentPostion;
// Completer<GoogleMapController> mapController = Completer();
Placemark selectedPlace;
HmsApiAvailability hmsApiAvailability;
ProjectViewModel projectViewModel;
late Placemark selectedPlace;
late HmsApiAvailability hmsApiAvailability;
late ProjectViewModel projectViewModel;
@override
void initState() {
@ -73,9 +73,10 @@ class _LocationPageState extends State<LocationPage> {
latitude = projectViewModel.latitude;
longitude = projectViewModel.longitude;
appMap = AppMap(
_kGooglePlex.toMap(),
//Changed By Aamir
_kGooglePlex.toMap() as Map<dynamic, dynamic>,
onCameraMove: (camera) {
_updatePosition(camera);
_updatePosition(camera as CameraPosition);
},
onMapCreated: () {
currentPostion = LatLng(projectViewModel.latitude, projectViewModel.longitude);
@ -138,13 +139,13 @@ class _LocationPageState extends State<LocationPage> {
createdOnUtc: "",
id: "0",
faxNumber: "",
phoneNumber: projectViewModel.user.mobileNumber,
phoneNumber: projectViewModel.user!.mobileNumber,
province: selectedPlace.administrativeArea,
countryId: 69,
latLong: latitude.toStringAsFixed(6) + "," + longitude.toStringAsFixed(6),
country: selectedPlace.country,
zipPostalCode: selectedPlace.postalCode,
email: projectViewModel.user.emailAddress)
email: projectViewModel.user!.emailAddress)
]),
);
await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
@ -189,28 +190,28 @@ class _LocationPageState extends State<LocationPage> {
AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1: selectedPlace.formattedAddress,
address2: selectedPlace.formattedAddress,
address1: selectedPlace!.formattedAddress,
address2: selectedPlace!.formattedAddress,
customerAttributes: "",
createdOnUtc: "",
id: "0",
faxNumber: "",
phoneNumber: projectViewModel.user.mobileNumber,
phoneNumber: projectViewModel.user!.mobileNumber,
countryId: 69,
latLong: selectedPlace.geometry.location.lat.toString() + "," + selectedPlace.geometry.location.lng.toString(),
email: projectViewModel.user.emailAddress)
latLong: selectedPlace.geometry!.location.lat.toString() + "," + selectedPlace.geometry!.location.lng.toString(),
email: projectViewModel.user!.emailAddress)
]),
);
selectedPlace.addressComponents.forEach((e) {
selectedPlace.addressComponents!.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer.addresses[0].country = e.longName;
addNewAddressRequestModel.customer!.addresses![0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
addNewAddressRequestModel.customer!.addresses![0].zipPostalCode = e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer.addresses[0].city = e.longName;
addNewAddressRequestModel.customer!.addresses![0].city = e.longName;
}
});
@ -252,8 +253,8 @@ class _LocationPageState extends State<LocationPage> {
} else {
if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
latitude = value!.latitude;
longitude = value!.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
});
@ -261,7 +262,7 @@ class _LocationPageState extends State<LocationPage> {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value!.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
@ -269,7 +270,7 @@ class _LocationPageState extends State<LocationPage> {
});
} else {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value!.latitude;
longitude = value.longitude;
setMap();
});

@ -17,17 +17,17 @@ import 'package:provider/provider.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final Function? changePageViewIndex;
final HomeHealthCareViewModel model;
const NewHomeHealthCareStepOnePage({Key key, this.patientERInsertPresOrderRequestModel, this.model, this.changePageViewIndex}) : super(key: key);
const NewHomeHealthCareStepOnePage({Key? key, required this.patientERInsertPresOrderRequestModel, required this.model, this.changePageViewIndex}) : super(key: key);
@override
_NewHomeHealthCareStepOnePageState createState() => _NewHomeHealthCareStepOnePageState();
}
class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOnePage> {
PickResult _result;
late PickResult _result;
@override
void initState() {
@ -57,25 +57,25 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
child: Row(
children: [
Checkbox(
value: isServiceSelected(num.tryParse(service.serviceID)),
value: isServiceSelected(int.parse(service.serviceID!)),
activeColor: Color(0xffD02127),
tristate: false,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onChanged: (bool newValue) {
onChanged: (bool? newValue) {
setState(() {
if (!isServiceSelected(num.tryParse(service.serviceID)))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList(
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
serviceID: num.tryParse(service.serviceID),
if (!isServiceSelected(int.parse(service.serviceID!)))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.add(PatientERHHCInsertServicesList(
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.length,
serviceID: int.parse(service.serviceID!),
serviceName: projectViewModel.isArabic ? service.textN : service.text));
else
removeSelected(num.tryParse(service.serviceID));
removeSelected(int.parse(service.serviceID!));
});
}),
SizedBox(width: 6),
Expanded(
child: Text(
projectViewModel.isArabic ? service.textN : service.text.toLowerCase()?.capitalize(),
projectViewModel.isArabic ? service.textN! : service.text!.toLowerCase().capitalize(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
@ -96,7 +96,7 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).next,
(this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal)
(this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.length == 0 || widget.model.state == ViewState.BusyLocal)
? null
: () async {
widget.model.setState(ViewState.Busy);
@ -122,7 +122,7 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
isServiceSelected(int serviceId) {
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.where((element) => serviceId == element.serviceID);
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.where((element) => serviceId == element.serviceID);
if (patientERHHCInsertServicesList.length > 0) {
return true;
}
@ -131,11 +131,11 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
removeSelected(int serviceId) {
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.where((element) => serviceId == element.serviceID);
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.where((element) => serviceId == element.serviceID);
if (patientERHHCInsertServicesList.length > 0)
setState(() {
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.remove(patientERHHCInsertServicesList.first);
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.remove(patientERHHCInsertServicesList.first);
});
}
}

@ -21,11 +21,11 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
class NewHomeHealthCareStepThreePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final PatientERInsertPresOrderRequestModel? patientERInsertPresOrderRequestModel;
final Function? changePageViewIndex;
final HomeHealthCareViewModel model;
NewHomeHealthCareStepThreePage({Key key, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, this.model});
NewHomeHealthCareStepThreePage({Key? key, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, required this.model});
@override
_NewHomeHealthCareStepThreePageState createState() => _NewHomeHealthCareStepThreePageState();
@ -42,17 +42,17 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude != null) {
if (widget.patientERInsertPresOrderRequestModel!.latitude != null) {
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
widget.patientERInsertPresOrderRequestModel.latitude.hashCode.toString(),
widget.patientERInsertPresOrderRequestModel!.latitude.hashCode.toString(),
),
position: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, widget.patientERInsertPresOrderRequestModel.longitude)),
position: LatLng(widget.patientERInsertPresOrderRequestModel!.latitude!, widget.patientERInsertPresOrderRequestModel!.longitude!)),
);
_kGooglePlex = CameraPosition(
target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, widget.patientERInsertPresOrderRequestModel.longitude),
target: LatLng(widget.patientERInsertPresOrderRequestModel!.latitude!, widget.patientERInsertPresOrderRequestModel!.longitude!),
zoom: 14.4746,
);
}
@ -116,13 +116,13 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
clipBehavior: Clip.antiAlias,
child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=" +
widget.patientERInsertPresOrderRequestModel.latitude.toString() +
widget.patientERInsertPresOrderRequestModel!.latitude.toString() +
"," +
widget.patientERInsertPresOrderRequestModel.longitude.toString() +
widget.patientERInsertPresOrderRequestModel!.longitude.toString() +
"&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" +
widget.patientERInsertPresOrderRequestModel.latitude.toString() +
widget.patientERInsertPresOrderRequestModel!.latitude.toString() +
"," +
widget.patientERInsertPresOrderRequestModel.longitude.toString() +
widget.patientERInsertPresOrderRequestModel!.longitude.toString() +
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
width: double.infinity,
height: double.infinity,
@ -141,7 +141,7 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
),
),
...List.generate(
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
widget.patientERInsertPresOrderRequestModel!.patientERHHCInsertServicesList!.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -165,7 +165,7 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
),
),
Text(
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList[index].serviceName,
widget.patientERInsertPresOrderRequestModel!.patientERHHCInsertServicesList![index].serviceName!,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
@ -198,7 +198,7 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
TranslationBase.of(context).confirm,
() {
widget.model.setState(ViewState.Busy);
widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel).then((value) {
widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel!).then((value) {
widget.model.setState(ViewState.Idle);
if (widget.model.state != ViewState.ErrorLocal) {
if (widget.model.orderId != null) {

@ -27,14 +27,14 @@ import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'location_page.dart';
class NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final Function(PickResult)? onPick;
final double? latitude;
final double? longitude;
final PatientERInsertPresOrderRequestModel? patientERInsertPresOrderRequestModel;
final Function? changePageViewIndex;
final HomeHealthCareViewModel model;
const NewHomeHealthCareStepTowPage({Key key, this.onPick, this.latitude, this.longitude, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, this.model}) : super(key: key);
const NewHomeHealthCareStepTowPage({Key? key, this.onPick, this.latitude, this.longitude, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, required this.model}) : super(key: key);
@override
_NewHomeHealthCareStepTowPageState createState() => _NewHomeHealthCareStepTowPageState();
@ -43,25 +43,26 @@ class NewHomeHealthCareStepTowPage extends StatefulWidget {
class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowPage> {
double latitude = 0;
double longitude = 0;
AddressInfo _selectedAddress;
late AddressInfo _selectedAddress;
bool showCurrentLocation = false;
final Set<Marker> markers = new Set();
AppMap appMap;
late AppMap appMap;
AppSharedPreferences sharedPref = AppSharedPreferences();
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
LatLng currentPostion;
late LatLng currentPostion;
Completer<GoogleMapController> mapController = Completer();
LocationUtils locationUtils;
late LocationUtils locationUtils;
@override
void initState() {
appMap = AppMap(
_kGooglePlex.toMap(),
//Changed by Aamir
_kGooglePlex.toMap() as Map<dynamic, dynamic>,
onCameraMove: (camera) {
_updatePosition(camera);
_updatePosition(camera as CameraPosition);
},
onMapCreated: () {
_getUserLocation();
@ -116,7 +117,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
}
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
setLatitudeAndLongitude({bool isSetState = false, String? latLong}) {
if (latLong == null) {
if (widget.model.addressesList.isEmpty) {
setState(() {
@ -128,7 +129,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
}
if (!showCurrentLocation) {
List latLongArr = latLong.split(',');
List latLongArr = latLong!.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
@ -249,8 +250,8 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
TranslationBase.of(context).continues,
() {
setState(() {
widget.patientERInsertPresOrderRequestModel.latitude = latitude;
widget.patientERInsertPresOrderRequestModel.longitude = longitude;
widget.patientERInsertPresOrderRequestModel!.latitude = latitude;
widget.patientERInsertPresOrderRequestModel!.longitude = longitude;
});
navigateTo(
@ -291,7 +292,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
String getAddressName() {
if (_selectedAddress != null)
return _selectedAddress.address1;
return _selectedAddress.address1!;
else
return TranslationBase.of(context).selectAddress;
}

@ -19,7 +19,7 @@ import 'package:provider/provider.dart';
import 'new_Home_health_care_step_one_page.dart';
class NewHomeHealthCarePage extends StatefulWidget {
NewHomeHealthCarePage({this.model});
NewHomeHealthCarePage({required this.model});
final HomeHealthCareViewModel model;
@ -28,10 +28,10 @@ class NewHomeHealthCarePage extends StatefulWidget {
}
class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with TickerProviderStateMixin {
PageController _controller;
late PageController _controller;
int _currentIndex = 1;
double _latitude;
double _longitude;
late double _latitude;
late double _longitude;
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = new PatientERInsertPresOrderRequestModel();
@ -45,7 +45,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
_getCurrentLocation() async {
if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_latitude = value!.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
@ -55,7 +55,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_latitude = value!.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
@ -64,7 +64,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
});
} else {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_latitude = value!.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
@ -169,12 +169,12 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.model.pendingOrder.statusText,
widget.model.pendingOrder!.statusText!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffCC9B14), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD.toString()}',
'${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder!.iD.toString()}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
@ -186,7 +186,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
),
Expanded(
child: Text(
widget.model.pendingOrder.nearestProjectName.toString(),
widget.model.pendingOrder!.nearestProjectName.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
),
@ -200,14 +200,14 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)),
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder!.created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),
if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2)
if (widget.model.pendingOrder!.statusId == 1 || widget.model.pendingOrder!.statusId == 2)
InkWell(
onTap: () {
showConfirmMessage(widget.model, widget.model.pendingOrder);
showConfirmMessage(widget.model, widget.model.pendingOrder!);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),

@ -4,10 +4,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class StepsWidget extends StatelessWidget {
final int index;
final Function changeCurrentTab;
final int? index;
final Function? changeCurrentTab;
StepsWidget({Key key, this.index, this.changeCurrentTab});
StepsWidget({Key? key, this.index, this.changeCurrentTab});
@override
Widget build(BuildContext context) {
@ -20,15 +20,15 @@ class StepsWidget extends StatelessWidget {
child: Row(
children: [
InkWell(
onTap: () => changeCurrentTab(0),
onTap: () => changeCurrentTab!(0),
child: Container(
width: 35,
height: 35,
decoration: containerColorRadiusBorder(
index == 0
? CustomColors.accentColor
: index > 0
? Colors.green[700]
: index! > 0
? Colors.green[700]!
: Colors.white,
2000,
Colors.black),
@ -45,15 +45,15 @@ class StepsWidget extends StatelessWidget {
),
Expanded(child: mDivider(Colors.grey)),
InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
onTap: () => index! >= 2 ? changeCurrentTab!(1) : null,
child: Container(
width: 35,
height: 35,
decoration: containerColorRadiusBorder(
index == 1
? CustomColors.accentColor
: index > 1
? Colors.green[700]
: index! > 1
? Colors.green[700]!
: Colors.white,
2000,
Colors.black),
@ -70,7 +70,7 @@ class StepsWidget extends StatelessWidget {
),
Expanded(child: mDivider(Colors.grey)),
InkWell(
onTap: () => index == 2 ? changeCurrentTab(3) : null,
onTap: () => index == 2 ? changeCurrentTab!(3) : null,
child: Container(
width: 35,
height: 35,

@ -20,7 +20,7 @@ class HomeHealthCarePage extends StatefulWidget {
}
class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
@override
void initState() {

@ -17,9 +17,9 @@ import 'package:provider/provider.dart';
import 'Dialog/confirm_cancel_order_dialog.dart';
class OrdersLogDetailsPage extends StatelessWidget {
final HomeHealthCareViewModel model;
final HomeHealthCareViewModel? model;
const OrdersLogDetailsPage({Key key, this.model}) : super(key: key);
const OrdersLogDetailsPage({Key? key, this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -50,16 +50,16 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: model.hhcAllPresOrders.length > 0
body: model!.hhcAllPresOrders.length > 0
? ListView.separated(
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(),
itemBuilder: (context, index) {
GetCMCAllOrdersResponseModel order = model.hhcAllPresOrders.reversed.toList()[index];
GetCMCAllOrdersResponseModel order = model!.hhcAllPresOrders.reversed.toList()[index];
int status = order.statusId;
String _statusDisp = order.statusText;
Color _color;
int status = order.statusId!;
String _statusDisp = order.statusText!;
Color? _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
@ -142,14 +142,14 @@ class OrdersLogDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)),
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),
if (order.statusId == 1 || order.statusId == 2)
InkWell(
onTap: () {
showConfirmMessage(model, order);
showConfirmMessage(model!, order);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -172,7 +172,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
);
},
separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.hhcAllPresOrders.length)
itemCount: model!.hhcAllPresOrders.length)
: getNoDataWidget(context),
);
}

@ -48,9 +48,9 @@ import 'h2o/h2o_page.dart';
class AllHabibMedicalService extends StatefulWidget {
//TODO
final Function goToMyProfile;
final Function? goToMyProfile;
AllHabibMedicalService({Key? key, required this.goToMyProfile});
AllHabibMedicalService({Key? key, this.goToMyProfile});
@override
_AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState();

@ -15,7 +15,7 @@ import 'components/SearchByClinic.dart';
class Search extends StatefulWidget {
final int type;
final List? clnicIds;
VoidCallbackAction? onBackClick;
Function()? onBackClick;
Search({this.type = 0, this.clnicIds, this.onBackClick});
@ -45,7 +45,7 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bookAppo,
backgroundColor: Color(0xFFF7F7F7),
onTap: widget.onBackClick,
onTap: widget.onBackClick!(),
body: Column(
children: [
TabBar(
@ -68,8 +68,8 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)],
onTap: (idx){
if(idx == 0)
onTap: (idx) {
if (idx == 0)
projectViewModel.analytics.appointment.book_appointment_by_clinic();
else
projectViewModel.analytics.appointment.book_appointment_by_doctor();

@ -16,9 +16,9 @@ class SearchResults extends StatefulWidget {
bool isLiveCareAppointment;
bool isObGyneAppointment;
bool isDoctorNameSearch;
OBGyneProcedureListResponse obGyneProcedureListResponse;
OBGyneProcedureListResponse? obGyneProcedureListResponse;
SearchResults({required this.doctorsList, required this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, required this.isLiveCareAppointment, required this.obGyneProcedureListResponse});
SearchResults({required this.doctorsList, required this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, required this.isLiveCareAppointment, this.obGyneProcedureListResponse});
@override
_SearchResultsState createState() => _SearchResultsState();

@ -39,7 +39,7 @@ import 'package:provider/provider.dart';
class MyFamily extends StatefulWidget {
final bool isAppbarVisible;
VoidCallbackAction? onBackClick;
Function()? onBackClick;
MyFamily({this.isAppbarVisible = true, this.onBackClick});
@ -91,7 +91,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
imagesInfo: imagesInfo,
showNewAppBar: true,
showNewAppBarTitle: true,
onTap: widget.isAppbarVisible == false ? widget.onBackClick : null,
onTap: widget.isAppbarVisible == false ? widget.onBackClick!() : null,
icon: "assets/images/new/bottom_nav/family_files.svg",
description: TranslationBase.of(context).familyInfo,
body: Column(

@ -1,71 +1,71 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class AppointmentHistory {
String setupID;
int projectID;
int appointmentNo;
DateTime appointmentDate;
String? setupID;
int? projectID;
int? appointmentNo;
DateTime? appointmentDate;
dynamic appointmentDateN;
int appointmentType;
String bookDate;
int patientType;
int patientID;
int clinicID;
int doctorID;
String endDate;
String startTime;
String endTime;
int status;
int visitType;
int visitFor;
int patientStatusType;
int companyID;
int bookedBy;
String bookedOn;
int confirmedBy;
String confirmedOn;
int arrivalChangedBy;
DateTime arrivedOn;
int? appointmentType;
String? bookDate;
int? patientType;
int? patientID;
int? clinicID;
int? doctorID;
String? endDate;
String? startTime;
String? endTime;
int? status;
int? visitType;
int? visitFor;
int? patientStatusType;
int? companyID;
int? bookedBy;
String ?bookedOn;
int? confirmedBy;
String? confirmedOn;
int? arrivalChangedBy;
DateTime? arrivedOn;
dynamic editedBy;
dynamic editedOn;
dynamic doctorName;
dynamic doctorNameN;
String statusDesc;
String? statusDesc;
dynamic statusDescN;
bool vitalStatus;
bool? vitalStatus;
dynamic vitalSignAppointmentNo;
int episodeID;
int actualDoctorRate;
String clinicName;
bool complainExists;
String doctorImageURL;
String doctorNameObj;
int doctorRate;
List<String> doctorSpeciality;
String doctorTitle;
int gender;
String genderDescription;
bool iSAllowOnlineCheckedIN;
bool isActiveDoctor;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
int isFollowup;
bool isLiveCareAppointment;
bool isMedicalReportRequested;
bool isOnlineCheckedIN;
String latitude;
int? episodeID;
int? actualDoctorRate;
String? clinicName;
bool? complainExists;
String? doctorImageURL;
String? doctorNameObj;
int? doctorRate;
List<String>? doctorSpeciality;
String? doctorTitle;
int? gender;
String? genderDescription;
bool? iSAllowOnlineCheckedIN;
bool? isActiveDoctor;
bool? isActiveDoctorProfile;
bool? isDoctorAllowVedioCall;
bool? isExecludeDoctor;
int? isFollowup;
bool? isLiveCareAppointment;
bool? isMedicalReportRequested;
bool? isOnlineCheckedIN;
String? latitude;
dynamic listHISGetContactLensPerscription;
dynamic listHISGetGlassPerscription;
String longitude;
int nextAction;
int noOfPatientsRate;
int originalClinicID;
int originalProjectID;
String projectName;
String qR;
int remaniningHoursTocanPay;
bool sMSButtonVisable;
String? longitude;
int? nextAction;
int? noOfPatientsRate;
int? originalClinicID;
int? originalProjectID;
String? projectName;
String? qR;
int? remaniningHoursTocanPay;
bool? sMSButtonVisable;
AppointmentHistory(
{this.setupID,

@ -8,7 +8,7 @@ class FeedbackDetails extends StatelessWidget {
final COCItem items;
FeedbackDetails({
@required this.items,
required this.items,
});
@override

@ -12,16 +12,16 @@ import 'package:flutter/material.dart';
import 'status_feedback_page.dart';
class FeedbackHomePage extends StatefulWidget {
final AppoitmentAllHistoryResultList appointment;
final AppoitmentAllHistoryResultList? appointment;
final MessageType messageType;
const FeedbackHomePage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key);
const FeedbackHomePage({Key? key, this.appointment, this.messageType = MessageType.NON}) : super(key: key);
@override
_FeedbackHomePageState createState() => _FeedbackHomePageState();
}
class _FeedbackHomePageState extends State<FeedbackHomePage> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
@override
void initState() {
@ -72,7 +72,7 @@ class _FeedbackHomePageState extends State<FeedbackHomePage> with SingleTickerPr
controller: _tabController,
children: <Widget>[
SendFeedbackPage(
appointment: widget.appointment,
appointment: widget.appointment!,
messageType: widget.messageType,
),
StatusFeedbackPage()

@ -29,10 +29,10 @@ import 'package:provider/provider.dart';
// import 'package:speech_to_text/speech_to_text.dart' as stt;
class SendFeedbackPage extends StatefulWidget {
final AppoitmentAllHistoryResultList appointment;
final AppoitmentAllHistoryResultList? appointment;
final MessageType messageType;
const SendFeedbackPage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key);
const SendFeedbackPage({Key? key, this.appointment, this.messageType = MessageType.NON}) : super(key: key);
@override
_SendFeedbackPageState createState() => _SendFeedbackPageState();
@ -42,10 +42,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
TextEditingController titleController = TextEditingController();
TextEditingController messageController = TextEditingController();
List<String> images = [];
String title;
AppoitmentAllHistoryResultList appointHistory;
late String title;
late AppoitmentAllHistoryResultList appointHistory;
bool isShowListAppointHistory = true;
String message;
late String message;
final formKey = GlobalKey<FormState>();
MessageType messageType = MessageType.NON;
var _currentLocaleId;
@ -83,7 +83,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
setMessageType(MessageType messageType) {
setState(() {
this.messageType = messageType;
this.appointHistory = widget.appointment;
this.appointHistory = widget.appointment!;
});
}
@ -91,7 +91,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
void initState() {
setState(() {
this.messageType = widget.messageType;
this.appointHistory = widget.appointment;
this.appointHistory = widget.appointment!;
});
// requestPermissions();
event.controller.stream.listen((p) {
@ -176,14 +176,14 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
child: DoctorCard(
onTap: null,
isInOutPatient: appointHistory.isInOutPatient,
name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj,
name: appointHistory.doctorTitle! + " " + appointHistory.doctorNameObj!,
// billNo: _appointmentResult.invoiceNo,
profileUrl: appointHistory.doctorImageURL,
subName: appointHistory.projectName,
isLiveCareAppointment: appointHistory.isLiveCareAppointment,
date: DateUtil.convertStringToDate(appointHistory.appointmentDate),
rating: appointHistory.actualDoctorRate + 0.0,
appointmentTime: appointHistory.startTime.substring(0, 5),
date: DateUtil.convertStringToDate(appointHistory.appointmentDate!),
rating: appointHistory.actualDoctorRate! + 0.0,
appointmentTime: appointHistory.startTime!.substring(0, 5),
),
),
SizedBox(height: 12),
@ -204,13 +204,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
child: DoctorCard(
onTap: null,
isInOutPatient: appoList[index].isInOutPatient,
name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
name: appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
profileUrl: appoList[index].doctorImageURL,
subName: appoList[index].projectName,
isLiveCareAppointment: appoList[index].isLiveCareAppointment,
date: DateUtil.convertStringToDate(appoList[index].appointmentDate),
rating: appoList[index].actualDoctorRate + 0.0,
appointmentTime: appoList[index].startTime.substring(0, 5),
date: DateUtil.convertStringToDate(appoList[index].appointmentDate!),
rating: appoList[index].actualDoctorRate! + 0.0,
appointmentTime: appoList[index].startTime!.substring(0, 5),
),
),
),
@ -313,7 +313,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
? null
: () {
final form = formKey.currentState;
if (form.validate()) {
if (form!.validate()) {
GifLoaderDialogUtils.showMyDialog(context);
model
.sendCOCItem(
@ -351,7 +351,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines}) {
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
@ -494,7 +494,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
setState(() {
appointHistory = null;
appointHistory = AppoitmentAllHistoryResultList();
isShowListAppointHistory = true;
});
} else {}

@ -29,7 +29,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
TextEditingController complainNumberController = TextEditingController();
StatusType statusType = StatusType.ComplaintNumber;
int selectedStatusIndex = 3;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
@ -243,22 +243,22 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(isArabic ? cOCItemList[index].statusAr : cOCItemList[index].status, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Text(isArabic ? cOCItemList[index].statusAr! : cOCItemList[index].status!, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(cOCItemList[index].formType.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12))),
MyRichText(TranslationBase.of(context).number + ": ", cOCItemList[index].itemID.toString(), isArabic),
Text(cOCItemList[index].cOCTitle,
Text(cOCItemList[index].cOCTitle!,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(cOCItemList[index].date.split(" ")[0],
Text(cOCItemList[index].date!.split(" ")[0],
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)),
Text(cOCItemList[index].date.split(" ")[1].substring(0, 4),
Text(cOCItemList[index].date!.split(" ")[1].substring(0, 4),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)),
],
),
@ -272,7 +272,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
{VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

@ -17,7 +17,7 @@ class AttachInsuranceCardImageDialog extends StatefulWidget {
final String mobileNo;
final Function(File file, String image) image;
const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.identificationNo, this.mobileNo, this.image}) : super(key: key);
const AttachInsuranceCardImageDialog({Key? key, required this.name, required this.fileNo, required this.identificationNo, required this.mobileNo, required this.image}) : super(key: key);
@override
_AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState();
@ -29,8 +29,8 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
super.initState();
}
String image;
File file;
late String image;
late File file;
@override
Widget build(BuildContext context) {
@ -150,7 +150,7 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
page: UpdateInsuranceManually(
patientIdentificationNo: widget.identificationNo,
patientMobileNumber: widget.mobileNo,
patientID: num.parse(widget.fileNo),
patientID: int.parse(widget.fileNo),
),
),
);

@ -20,7 +20,7 @@ class UpdateInsuranceManually extends StatefulWidget {
String patientMobileNumber;
int patientID;
UpdateInsuranceManually({@required this.patientIdentificationNo, @required this.patientMobileNumber, @required this.patientID});
UpdateInsuranceManually({required this.patientIdentificationNo, required this.patientMobileNumber, required this.patientID});
@override
State<UpdateInsuranceManually> createState() => _UpdateInsuranceManuallyState();
@ -31,7 +31,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
TextEditingController _cardHolderNameTextController = TextEditingController();
TextEditingController _membershipNoTextController = TextEditingController();
TextEditingController _policyNoTextController = TextEditingController();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
@ -41,8 +41,8 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
int _selectedInsuranceCompanyIndex = -1;
int _selectedInsuranceCompanySchemeIndex = -1;
InsuranceCompaniesGetModel selectedInsuranceCompanyObj;
InsuranceCompaniesSchemeModel selectedInsuranceCompaniesSchemesObj;
late InsuranceCompaniesGetModel selectedInsuranceCompanyObj;
late InsuranceCompaniesSchemeModel selectedInsuranceCompaniesSchemesObj;
@override
void initState() {
@ -92,7 +92,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
selectedInsuranceCompanyObj != null ? selectedInsuranceCompanyObj.companyName : TranslationBase.of(context).insuranceCompany,
selectedInsuranceCompanyObj != null ? selectedInsuranceCompanyObj.companyName! : TranslationBase.of(context).insuranceCompany,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
@ -142,7 +142,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
selectedInsuranceCompaniesSchemesObj != null ? selectedInsuranceCompaniesSchemesObj.subCategoryDesc : TranslationBase.of(context).insuranceClassName,
selectedInsuranceCompaniesSchemesObj != null ? selectedInsuranceCompaniesSchemesObj.subCategoryDesc! : TranslationBase.of(context).insuranceClassName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
@ -189,7 +189,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
void confirmSelectInsuranceCompanyDialog() {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < insuranceCompaniesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesList[i].companyName, i),
for (int i = 0; i < insuranceCompaniesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesList[i].companyName!, i),
];
showDialog(
context: context,
@ -210,7 +210,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
void confirmSelectInsuranceCompanySchemeDialog() {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < insuranceCompaniesSchemesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesSchemesList[i].subCategoryDesc, i),
for (int i = 0; i < insuranceCompaniesSchemesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesSchemesList[i].subCategoryDesc!, i),
];
showDialog(
context: context,
@ -267,7 +267,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
void getInsuranceScheme() {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService.getInsuranceSchemes(selectedInsuranceCompanyObj.projectID, selectedInsuranceCompanyObj.companyID).then((value) {
_insuranceCardService.getInsuranceSchemes(selectedInsuranceCompanyObj.projectID!, selectedInsuranceCompanyObj.companyID!).then((value) {
value.forEach((result) {
insuranceCompaniesSchemesList.add(InsuranceCompaniesSchemeModel.fromJson(result));
});

@ -13,7 +13,7 @@ import 'package:provider/provider.dart';
class InsuranceApprovalDetail extends StatelessWidget {
final InsuranceApprovalModel insuranceApprovalModel;
InsuranceApprovalDetail({Key key, this.insuranceApprovalModel}) : super(key: key);
InsuranceApprovalDetail({Key? key, required this.insuranceApprovalModel}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -45,11 +45,11 @@ class InsuranceApprovalDetail extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
insuranceApprovalModel.approvalStatusDescption,
insuranceApprovalModel.approvalStatusDescption!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: insuranceApprovalModel.status == 9 ? Color(0xff359846) : Color(0xffD02127), letterSpacing: -0.4, height: 18 / 10),
),
Text(
insuranceApprovalModel.doctorName,
insuranceApprovalModel.doctorName!,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
@ -62,8 +62,8 @@ class InsuranceApprovalDetail extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LargeAvatar(
name: insuranceApprovalModel.doctorName,
url: insuranceApprovalModel.doctorImageURL,
name: insuranceApprovalModel.doctorName!,
url: insuranceApprovalModel.doctorImageURL!,
width: 48,
height: 48,
),
@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget {
MyRichText(TranslationBase.of(context).unusedCount, insuranceApprovalModel?.unUsedCount.toString() ?? "", projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic),
SizedBox(height: 6),
MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.receiptOn)) ?? "",
MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.receiptOn!)) ?? "",
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.expiryDate)) ?? "",
MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.expiryDate!)) ?? "",
projectViewModel.isArabic),
],
),

@ -19,7 +19,7 @@ import 'insurance_approval_detail_screen.dart';
class InsuranceApproval extends StatefulWidget {
int appointmentNo;
InsuranceApproval({this.appointmentNo});
InsuranceApproval({required this.appointmentNo});
@override
_InsuranceApprovalState createState() => _InsuranceApprovalState();
@ -37,7 +37,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png'));
return BaseView<InsuranceViewModel>(
onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(),
builder: (BuildContext _context, InsuranceViewModel model, Widget child) => AppScaffold(
builder: (BuildContext _context, InsuranceViewModel model, Widget? child) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
baseViewModel: model,
@ -54,10 +54,10 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
Color _patientStatusColor;
String _patientStatusString;
if (model.insuranceApproval[index].isLiveCareAppointment) {
if (model.insuranceApproval[index].isLiveCareAppointment!) {
_patientStatusColor = Color(0xff2E303A);
_patientStatusString = TranslationBase.of(context).liveCare.capitalizeFirstofEach;
} else if (!model.insuranceApproval[index].isInOutPatient) {
} else if (!model.insuranceApproval[index].isInOutPatient!) {
_patientStatusColor = Color(0xffD02127);
_patientStatusString = TranslationBase.of(context).inPatient.capitalizeFirstofEach;
} else {
@ -108,7 +108,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.insuranceApproval[index].approvalStatusDescption,
model.insuranceApproval[index].approvalStatusDescption!,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
@ -117,7 +117,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
height: 18 / 10),
),
Text(
model.insuranceApproval[index].doctorName,
model.insuranceApproval[index].doctorName!,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
@ -129,8 +129,8 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
Row(
children: [
LargeAvatar(
name: model.insuranceApproval[index].doctorName,
url: model.insuranceApproval[index].doctorImageURL,
name: model.insuranceApproval[index].doctorName!,
url: model.insuranceApproval[index].doctorImageURL!,
width: 48,
height: 48,
),
@ -140,9 +140,9 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName != null ? model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach : "",
MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index].clinicName != null ? model.insuranceApproval[index].clinicName!.toLowerCase().capitalizeFirstofEach : "",
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index]?.approvalNo.toString() ?? "", projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index].approvalNo.toString() ?? "", projectViewModel.isArabic),
],
),
),

@ -21,7 +21,7 @@ import '../base/base_view.dart';
class InsuranceCard extends StatefulWidget {
int appointmentNo;
InsuranceCard({this.appointmentNo});
InsuranceCard({required this.appointmentNo});
@override
_InsuranceCardState createState() => _InsuranceCardState();
@ -38,7 +38,7 @@ class _InsuranceCardState extends State<InsuranceCard> {
return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsurance(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
showHomeAppBarIcon: false,
@ -76,12 +76,12 @@ class _InsuranceCardState extends State<InsuranceCard> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.insurance[index].groupName,
model.insurance[index].groupName!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.64),
),
mHeight(8),
Text(
TranslationBase.of(context).companyName + model.insurance[index].companyName,
TranslationBase.of(context).companyName + model.insurance[index].companyName!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
Divider(
@ -99,7 +99,7 @@ class _InsuranceCardState extends State<InsuranceCard> {
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
Text(
model.insurance[index].subCategoryDesc,
model.insurance[index].subCategoryDesc!,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
],
@ -112,7 +112,7 @@ class _InsuranceCardState extends State<InsuranceCard> {
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.insurance[index].cardValidTo)),
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.insurance[index].cardValidTo!)),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
],
@ -147,7 +147,7 @@ class _InsuranceCardState extends State<InsuranceCard> {
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
Text(
model.insurance[index].patientCardID,
model.insurance[index].patientCardID!,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
],
@ -160,7 +160,7 @@ class _InsuranceCardState extends State<InsuranceCard> {
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
Text(
model.insurance[index].insurancePolicyNumber,
model.insurance[index].insurancePolicyNumber!,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
)
],

@ -24,7 +24,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
final String name;
final String mobileNo;
const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name, this.mobileNo}) : super(key: key);
const InsuranceCardUpdateDetails({Key? key, required this.insuranceCardDetailsModel, required this.patientIdentificationID, required this.patientID, required this.name, required this.mobileNo}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -61,7 +61,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
insuranceCardDetailsModel[index].memberID,
insuranceCardDetailsModel[index].memberID!,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
@ -73,7 +73,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
height: 2,
),
Text(
insuranceCardDetailsModel[index].companyName,
insuranceCardDetailsModel[index].companyName!,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
@ -100,7 +100,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
),
),
Text(
insuranceCardDetailsModel[index].memberName,
insuranceCardDetailsModel[index].memberName!,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
@ -123,7 +123,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
),
),
Text(
insuranceCardDetailsModel[index].policyNumber,
insuranceCardDetailsModel[index].policyNumber!,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
@ -154,7 +154,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
),
),
Text(
insuranceCardDetailsModel[index].effectiveTo,
insuranceCardDetailsModel[index].effectiveTo!,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
@ -177,7 +177,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
),
),
Text(
insuranceCardDetailsModel[index].subCategory,
insuranceCardDetailsModel[index].subCategory!,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
@ -349,7 +349,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
);
}
void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, String identificationNo, String mobileNo, InsuranceViewModel model}) {
void confirmAttachInsuranceCardImageDialogDialog({required BuildContext context, required String name, required String fileNo, required String identificationNo, required String mobileNo, required InsuranceViewModel model}) {
showDialog(
context: context,
builder: (cxt) => AttachInsuranceCardImageDialog(

@ -8,7 +8,7 @@ import 'package:flutter_html/flutter_html.dart';
class InsuranceCardDetails extends StatelessWidget {
final String data;
InsuranceCardDetails({this.data});
InsuranceCardDetails({required this.data});
@override
Widget build(BuildContext context) {

@ -18,9 +18,9 @@ class InsurancePage extends StatelessWidget {
final InsuranceViewModel model;
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
InsurancePage({Key key, this.model}) : super(key: key);
InsurancePage({Key? key, required this.model}) : super(key: key);
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -41,15 +41,15 @@ class InsurancePage extends StatelessWidget {
getDetails(
setupID: '010266',
projectID: 15,
patientIdentificationID: projectViewModel.user.patientIdentificationNo,
patientIdentificationID: projectViewModel.user!.patientIdentificationNo!,
//model.user.patientIdentificationNo,
patientID: projectViewModel.user.patientID,
patientID: projectViewModel.user!.patientID!,
//model.user.patientID,
parentID: 0,
isFamily: projectViewModel.isLoginChild,
//false,
name: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
mobileNumber: projectViewModel.user.mobileNumber,
name: projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
mobileNumber: projectViewModel.user!.mobileNumber!,
//model.user.firstName + " " + model.user.lastName,
context: context,
);
@ -64,7 +64,7 @@ class InsurancePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
@ -72,7 +72,7 @@ class InsurancePage extends StatelessWidget {
),
),
Text(
TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), //model.user.patientID.toString(),
TranslationBase.of(context).fileno + ": " + projectViewModel.user!.patientID.toString(), //model.user.patientID.toString(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
@ -95,18 +95,18 @@ class InsurancePage extends StatelessWidget {
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].status == 3
? InkWell(
onTap: () {
getDetails(
projectID: 15,
patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber,
patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].patientIdenficationNumber!,
setupID: '010266',
patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID,
name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
parentID: model.user.patientID,
patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].responseID!,
name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].patientName!,
parentID: model.user!.patientID!,
isFamily: true,
mobileNumber: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].mobileNumber,
mobileNumber: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].mobileNumber!,
context: context);
},
child: Container(
@ -125,11 +125,11 @@ class InsurancePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].patientName!,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46),
),
Text(
TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(),
TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].responseID.toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46),
),
],
@ -145,9 +145,9 @@ class InsurancePage extends StatelessWidget {
: Container();
},
separatorBuilder: (context, index) {
return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0);
return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].status == 3 ? 8 : 0);
},
itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length,
itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!.length,
),
],
),
@ -155,7 +155,7 @@ class InsurancePage extends StatelessWidget {
);
}
getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, String mobileNumber, bool isFamily, int parentID = 0, BuildContext context}) {
getDetails({required String setupID, required int projectID, required String patientIdentificationID, required int patientID, required String name, required String mobileNumber, required bool isFamily, int parentID = 0, required BuildContext context}) {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService
.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID)
@ -176,7 +176,7 @@ class InsurancePage extends StatelessWidget {
});
} else {
// AppToast.showErrorToast(message: _insuranceCardService.error);
updateManually(context, _insuranceCardService.error, patientIdentificationID, patientID, mobileNumber);
updateManually(context, _insuranceCardService.error!, patientIdentificationID, patientID, mobileNumber);
}
});
}

@ -17,9 +17,9 @@ class InsuranceUpdate extends StatefulWidget {
}
class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
List<ImagesInfo> imagesInfo =[];
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
void initState() {
@ -39,7 +39,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
projectViewModel = Provider.of(context);
return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsuranceUpdated(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold(
appBarTitle: TranslationBase.of(context).updateInsurCards,
description: TranslationBase.of(context).infoInsurCards,
infoList: TranslationBase.of(context).infoPrescriptionsPoints,
@ -127,7 +127,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
@ -146,7 +146,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
),
),
Text(
model.insuranceUpdate[index].createdOn,
model.insuranceUpdate[index].createdOn!,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
@ -167,7 +167,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
Container(
margin: EdgeInsets.only(top: 6.5, left: 2.0),
child: Text(
model.insuranceUpdate[index].statusDescription,
model.insuranceUpdate[index].statusDescription!,
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.w600,

@ -25,7 +25,7 @@ import 'package:provider/provider.dart';
class HomePageFragment2 extends StatefulWidget {
DashboardViewModel model;
Function onPharmacyClick, onLoginClick, onMedicalFileClick;
Function? onPharmacyClick, onLoginClick, onMedicalFileClick;
HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick, this.onMedicalFileClick});
@ -34,10 +34,10 @@ class HomePageFragment2 extends StatefulWidget {
}
class _HomePageFragment2State extends State<HomePageFragment2> {
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
List<HmgServices> hmgServices = [];
List<AppoitmentAllHistoryResultList> appoList = [];
ApplePayResponse applePayResponse;
late ApplePayResponse applePayResponse;
@override
void initState() {
@ -80,12 +80,12 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
padding: const EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6),
child: InkWell(
onTap: () {
widget.onMedicalFileClick();
widget.onMedicalFileClick!();
},
child: LoggedSliderView(
projectViewModel,
new SliderData(TranslationBase.of(context).fileno + ": " + (projectViewModel.user?.patientID?.toString() ?? ""),
projectViewModel.user.firstName + ' ' + (projectViewModel.user?.lastName ?? ""), "", bannerColor[0].darkColor, bannerColor[0].lightColor),
projectViewModel.user!.firstName! + ' ' + (projectViewModel.user?.lastName ?? ""), "", bannerColor[0].darkColor, bannerColor[0].lightColor),
widget.model,
),
),
@ -97,7 +97,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
margin: EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6),
child: SliderView(
onLoginClick: () {
widget.onLoginClick();
widget.onLoginClick!();
projectViewModel.analytics.loginRegistration.login_register_initiate();
},
),
@ -133,7 +133,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
),
TextButton(
onPressed: () {
widget.onMedicalFileClick();
widget.onMedicalFileClick!();
// navigateTo(context, MedicalProfilePageNew());
},
child: Text(
@ -349,7 +349,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
Container(
width: double.infinity,
height: double.infinity,
padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.4),
padding: EdgeInsets.all(SizeConfig.widthMultiplier! * 3.4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
@ -417,7 +417,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
flex: 1,
child: InkWell(
onTap: () {
if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick();
if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick!();
},
child: Stack(children: [
Container(
@ -477,7 +477,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
Container(
width: double.infinity,
height: double.infinity,
padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.4),
padding: EdgeInsets.all(SizeConfig.widthMultiplier! * 3.4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,

@ -31,7 +31,7 @@ import 'landing_page_pharmcy.dart';
class HomePage extends StatefulWidget {
final Function goToMyProfile;
HomePage({Key key, this.goToMyProfile});
HomePage({Key? key, required this.goToMyProfile});
@override
_HomePageState createState() => _HomePageState();
@ -86,7 +86,7 @@ class _HomePageState extends State<HomePage> {
),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(5))),
child: (model.user != null && model.user.outSA == 1)
child: (model.user != null && model.user!.outSA == 1)
? Container(
width: double.infinity,
height: double.infinity,
@ -133,7 +133,7 @@ class _HomePageState extends State<HomePage> {
elevation: 0,
disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38),
disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12),
onPressed: (model.user != null && model.user.outSA == 1)
onPressed: (model.user != null && model.user!.outSA == 1)
? () {}
: () {
navigateToCovidDriveThru();
@ -268,11 +268,11 @@ class _HomePageState extends State<HomePage> {
SizedBox(
height: 8,
),
model.user.cRSVerificationStatus == 2
model.user!.cRSVerificationStatus == 2
? Row(
children: [
Texts(
model.user.firstName + " " + model.user.lastName,
model.user!.firstName! + " " + model.user!.lastName!,
color: Colors.grey[100],
bold: true,
fontSize: 15,
@ -283,11 +283,11 @@ class _HomePageState extends State<HomePage> {
),
],
)
: model.user.cRSVerificationStatus == 3
: model.user!.cRSVerificationStatus == 3
? Row(
children: [
Texts(
model.user.firstName + " " + model.user.lastName,
model.user!.firstName! + " " + model.user!.lastName!,
color: Colors.grey[100],
bold: true,
fontSize: 15,
@ -301,7 +301,7 @@ class _HomePageState extends State<HomePage> {
: Row(
children: [
Texts(
model.user.firstName + " " + model.user.lastName,
model.user!.firstName! + " " + model.user!.lastName!,
color: Colors.grey[100],
bold: true,
fontSize: 15,
@ -309,7 +309,7 @@ class _HomePageState extends State<HomePage> {
],
),
Texts(
'${model.user.patientID}',
'${model.user!.patientID!}',
color: Colors.white,
fontSize: 14,
),
@ -317,7 +317,7 @@ class _HomePageState extends State<HomePage> {
height: 5,
),
Texts(
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user.age.toString() + "y"}',
'${DateUtil.getMonthDayYearDateFormatted(model.user!.dateofBirthDataTime!)} ,${model.user!.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user!.age.toString() + "y"}',
color: Colors.grey[100],
fontWeight: FontWeight.normal,
fontSize: 14,
@ -414,7 +414,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(projectViewModel.user)));
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(projectViewModel.user!)));
},
child: Container(
decoration: BoxDecoration(
@ -447,7 +447,7 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[
if (projectViewModel.havePrivilege(64))
DashboardItem(
onTap: (model.user != null && model.user.outSA == 1)
onTap: (model.user != null && model.user!.outSA == 1)
? () {}
: () {
Navigator.push(
@ -459,8 +459,8 @@ class _HomePageState extends State<HomePage> {
},
child: Center(
child: Padding(
padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user!.outSA == 1)
? Container(
width: double.infinity,
height: double.infinity,
@ -485,7 +485,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.55,
fontSize: SizeConfig.textMultiplier! * 1.55,
)
],
)),
@ -496,11 +496,11 @@ class _HomePageState extends State<HomePage> {
),
if (projectViewModel.havePrivilege(65))
DashboardItem(
onTap: () => (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model),
onTap: () => (model.user != null && model.user!.outSA == 1) ? () {} : getPharmacyToken(model),
child: Center(
child: Padding(
padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user!.outSA == 1)
? Container(
width: double.infinity,
height: double.infinity,
@ -531,7 +531,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.55,
fontSize: SizeConfig.textMultiplier! * 1.55,
)
],
),
@ -542,7 +542,7 @@ class _HomePageState extends State<HomePage> {
),
if (projectViewModel.havePrivilege(67))
DashboardItem(
onTap: (model.user != null && model.user.outSA == 1)
onTap: (model.user != null && model.user!.outSA == 1)
? () {}
: () {
Navigator.push(
@ -554,8 +554,8 @@ class _HomePageState extends State<HomePage> {
},
child: Center(
child: Padding(
padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user!.outSA == 1)
? Container(
width: double.infinity,
height: double.infinity,
@ -580,7 +580,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.55,
fontSize: SizeConfig.textMultiplier! * 1.55,
)
],
)),
@ -621,7 +621,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 1.7,
fontSize: SizeConfig.textMultiplier! * 1.7,
)
],
),
@ -657,7 +657,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 1.7,
fontSize: SizeConfig.textMultiplier! * 1.7,
)
],
),
@ -698,7 +698,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 1.7,
fontSize: SizeConfig.textMultiplier! * 1.7,
)
],
),
@ -755,7 +755,7 @@ class _HomePageState extends State<HomePage> {
height: 100,
imageName: 'contact_us_bg.png',
opacity: 0.5,
color: Colors.grey[700],
color: Colors.grey[700]!,
width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())),
),
@ -796,7 +796,7 @@ class _HomePageState extends State<HomePage> {
height: 100,
imageName: 'contact_us_bg.png',
opacity: 0.5,
color: Colors.grey[700],
color: Colors.grey[700]!,
width: MediaQuery.of(context).size.width * 0.45,
),
],
@ -833,22 +833,22 @@ class _HomePageState extends State<HomePage> {
}
class DashboardItem extends StatelessWidget {
const DashboardItem({this.hasBorder = false, this.imageName, @required this.child, this.onTap, Key key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true})
const DashboardItem({this.hasBorder = false, this.imageName, this.child, this.onTap, Key? key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true})
: super(key: key);
final bool hasBorder;
final String imageName;
final Widget child;
final Function onTap;
final double width;
final double height;
final Color color;
final double opacity;
final String? imageName;
final Widget? child;
final Function? onTap;
final double? width;
final double? height;
final Color? color;
final double? opacity;
final bool hasColorFilter;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
onTap: onTap!(),
child: Container(
width: width != null ? width : MediaQuery.of(context).size.width * 0.29,
height: height != null
@ -860,7 +860,7 @@ class DashboardItem extends StatelessWidget {
color: !hasBorder
? color != null
? color
: Color(0xFF050705).withOpacity(opacity)
: Color(0xFF050705).withOpacity(opacity!)
: Colors.white,
borderRadius: BorderRadius.circular(6.0),
border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent),

@ -16,10 +16,10 @@ import 'fragments/home_page_fragment2.dart';
import 'landing_page_pharmcy.dart';
class HomePage2 extends StatefulWidget {
final Function goToMyProfile;
Function onLoginClick, onMedicalFileClick;
final Function? goToMyProfile;
Function? onLoginClick, onMedicalFileClick;
HomePage2({Key key, this.goToMyProfile, this.onLoginClick, this.onMedicalFileClick});
HomePage2({Key? key, this.goToMyProfile, this.onLoginClick, this.onMedicalFileClick});
@override
_HomePageState2 createState() => _HomePageState2();
@ -27,7 +27,7 @@ class HomePage2 extends StatefulWidget {
class _HomePageState2 extends State<HomePage2> {
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -45,13 +45,13 @@ class _HomePageState2 extends State<HomePage2> {
HomePageFragment2(
model,
onLoginClick: () {
widget.onLoginClick();
widget.onLoginClick!();
},
onPharmacyClick: () {
getPharmacyToken(model);
},
onMedicalFileClick: () {
widget.onMedicalFileClick();
widget.onMedicalFileClick!();
},
)
],

@ -50,8 +50,8 @@ import '../../locator.dart';
import '../../routes.dart';
class LandingPage extends StatefulWidget {
static LandingPage shared;
_LandingPageState state;
static late LandingPage shared;
late _LandingPageState state;
LandingPage() {
LandingPage.shared = this;
@ -73,16 +73,16 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var authProvider = new AuthProvider();
int currentTab = 0;
PageController pageController;
ProjectViewModel projectViewModel;
ToDoCountProviderModel model;
late PageController pageController;
late ProjectViewModel projectViewModel;
late ToDoCountProviderModel model;
var notificationCount = '';
var themeNotifier;
DateTime currentBackPressTime;
DateTime? currentBackPressTime;
// SignalRUtil signalRUtil;
ToDoCountProviderModel toDoProvider;
late ToDoCountProviderModel toDoProvider;
bool _showBottomNavigationBar = true;
@ -99,7 +99,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
final voIPKit = FlutterIOSVoIPKit.instance;
var dummyCallId = '123456';
var dummyCallerName = 'Dummy Tester';
Timer timeOutTimer;
late Timer timeOutTimer;
bool isTalking = false;
var sharedPref = new AppSharedPreferences();
@ -151,7 +151,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
bool isPageNavigated = false;
LocationUtils locationUtils;
late LocationUtils locationUtils;
Future<bool> onWillPop() {
if (currentTab != 0) {
@ -159,7 +159,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return Future.value(false);
} else {
DateTime now = DateTime.now();
if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) {
if (currentBackPressTime == null || now.difference(currentBackPressTime!) > Duration(seconds: 2)) {
currentBackPressTime = now;
AppToast.showToast(message: TranslationBase.of(context).pressAgain);
return Future.value(false);
@ -302,13 +302,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// for now commented to reduce this call will enable it when needed
// HMGNetworkConnectivity(context).start();
_firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token);
_firebaseMessaging.getToken().then((String? token) {
print("Firebase Token: " + token!);
sharedPref.setString(PUSH_TOKEN, token);
if (Platform.isIOS) {
voIPKit.getVoIPToken().then((value) {
print('🎈 example: getVoIPToken: $value');
AppSharedPreferences().setString(APNS_TOKEN, value);
AppSharedPreferences().setString(APNS_TOKEN, value!);
getOneSignalVOIPToken(value);
});
}
@ -470,13 +470,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
elevation: 0,
backgroundColor: CustomColors.backgroudGreyColor,
textTheme: TextTheme(
headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),
headline6: TextStyle(color: Theme.of(context).textTheme.headline1!.color, fontWeight: FontWeight.bold),
),
title: Text(
getText(currentTab).toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold,
color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1.color,
color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1!.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// bold: true,
),
@ -487,7 +487,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
currentTab == 0
? IconButton(
icon: SvgPicture.asset("assets/images/new/menu.svg"),
color: Theme.of(context).textTheme.headline1.color,
color: Theme.of(context).textTheme.headline1!.color,
onPressed: () => Scaffold.of(context).openDrawer(),
)
: IconButton(
@ -647,14 +647,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(num.parse(notificationCount));
FlutterAppIconBadge.updateBadge(int.parse(notificationCount));
}
}),
});
}
projectViewModel.analytics.setUser(data);
} else {
projectViewModel.analytics.setUser(null);
//changed by Aamir
projectViewModel.analytics.setUser(AuthenticatedUser());
}
if (Platform.isIOS) {
String voipToken = await sharedPref.getString(APNS_TOKEN);

@ -26,15 +26,15 @@ import '../../locator.dart';
class LandingPagePharmacy extends StatefulWidget {
final int currentTab;
const LandingPagePharmacy({Key key, this.currentTab = 0}) : super(key: key);
const LandingPagePharmacy({Key? key, this.currentTab = 0}) : super(key: key);
@override
_LandingPagePharmacyState createState() => _LandingPagePharmacyState();
}
class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
ProjectViewModel projectProvider;
late ProjectViewModel projectProvider;
int currentTab = 0;
PageController pageController;
late PageController pageController;
void initState() {
super.initState();
@ -88,7 +88,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
try {
ScanResult result = await BarcodeScanner.scan();
try {
String barcode = result?.rawContent;
String barcode = result.rawContent;
GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient()
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",

@ -122,7 +122,7 @@ class LoggedSliderView extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Text(
'${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime)} ,${projectViewModel.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user.age.toString() + " " + TranslationBase.of(context).patientAge.toString()}',
'${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user!.dateofBirthDataTime!)} ,${projectViewModel.user!.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user!.age.toString() + " " + TranslationBase.of(context).patientAge.toString()}',
style: TextStyle(
color: Colors.white,
fontSize: 12,

@ -7,7 +7,7 @@ class OfferView extends StatelessWidget {
return Container(
width: double.infinity,
height: MediaQuery.of(context).size.width / 5,
decoration: containerColorRadiusBorderWidth(Colors.grey[200], 20, Colors.grey[300], 2),
decoration: containerColorRadiusBorderWidth(Colors.grey[200]!, 20, Colors.grey[300]!, 2),
child: Row(
children: [
Expanded(

@ -1,12 +1,14 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PharmacyView extends StatelessWidget {
Function onPharmacyClick;
PharmacyView({this.onPharmacyClick});
PharmacyView({required this.onPharmacyClick});
@override
Widget build(BuildContext context) {
return InkWell(
@ -55,4 +57,9 @@ class PharmacyView extends StatelessWidget {
),
);
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<Function>('onPharmacyClick', onPharmacyClick));
}
}

@ -48,7 +48,7 @@ class ServicesView extends StatelessWidget {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
LocationUtils locationUtils;
late LocationUtils locationUtils;
bool isHomePage;
ServicesView(this.hmgServices, this.index, this.isHomePage);
@ -111,7 +111,7 @@ class ServicesView extends StatelessWidget {
Container(
width: double.infinity,
height: double.infinity,
padding: EdgeInsets.only(left: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3, top: SizeConfig.widthMultiplier * 3, bottom: SizeConfig.widthMultiplier * 2),
padding: EdgeInsets.only(left: SizeConfig.widthMultiplier! * 3, right: SizeConfig.widthMultiplier! * 3, top: SizeConfig.widthMultiplier! * 3, bottom: SizeConfig.widthMultiplier! * 2),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -137,7 +137,7 @@ class ServicesView extends StatelessWidget {
maxLines: 1,
minFontSize: 10,
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.bold,
letterSpacing: -0.39,
height: 0.8,
@ -148,7 +148,7 @@ class ServicesView extends StatelessWidget {
maxLines: 1,
minFontSize: 8,
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.4,
fontSize: SizeConfig.textMultiplier! * 1.4,
letterSpacing: -0.27,
fontWeight: FontWeight.w600,
),

@ -11,9 +11,9 @@ import 'package:provider/provider.dart';
class SliderView extends StatelessWidget {
Function onLoginClick;
SliderView({this.onLoginClick});
SliderView({required this.onLoginClick});
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -92,6 +92,7 @@ class SliderView extends StatelessWidget {
width: MediaQuery.of(context).size.width / (projectViewModel.isArabic ? 4 : 6),
child: CustomTextButton(
shape: cardRadiusNew(8),
//shape: OutlinedBorder(),
backgroundColor: Color(0xFFFBF2E31),
elevation: 0,
onPressed: () {

@ -5,11 +5,11 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ScheduleClinicCard extends StatefulWidget {
bool isSelected;
bool? isSelected;
final ClinicsHaveScheduleList clinicsHaveScheduleList;
var languageID;
ScheduleClinicCard({this.isSelected, this.languageID, @required this.clinicsHaveScheduleList});
ScheduleClinicCard({this.isSelected, this.languageID, required this.clinicsHaveScheduleList});
@override
_ScheduleClinicCardState createState() => _ScheduleClinicCardState();
@ -27,7 +27,7 @@ class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(width: widget.isSelected ? 3 : 0, color: widget.isSelected ? CustomColors.green : Colors.transparent),
border: Border.all(width: widget.isSelected! ? 3 : 0, color: widget.isSelected! ? CustomColors.green : Colors.transparent),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
@ -48,11 +48,11 @@ class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
margin: EdgeInsets.only(
left: projectViewModel.isArabic
? 0
: widget.isSelected
: widget.isSelected!
? 4
: 6,
right: projectViewModel.isArabic
? widget.isSelected
? widget.isSelected!
? 4
: 6
: 0),

@ -471,7 +471,7 @@ BoxDecoration cardRadius(double radius, {Color color, double elevation}) {
);
}
ShapeBorder cardRadiusNew(double radius) {
OutlinedBorder cardRadiusNew(double radius) {
return RoundedRectangleBorder(
side: BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.all(Radius.circular(radius)),

Loading…
Cancel
Save