null safety fixed.

dev_v3.13.6_voipcall
Sultan khan 2 years ago
parent 649521c31f
commit 413535ef0b

@ -29,7 +29,7 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
super.initState();
}
late String image;
String? image="";
late File file;
@override
@ -80,7 +80,7 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
});
});
},
child: image == null
child: image!.isEmpty
? Padding(
padding: const EdgeInsets.all(18.0),
child: Container(
@ -200,7 +200,7 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
onTap: () {
if (file != null && image != null) {
Navigator.pop(context);
widget.image(file, image);
widget.image(file, image!);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).noInsuranceCardAttached);
}

@ -43,7 +43,7 @@ class PrescriptionDeliveryAddressPage extends StatefulWidget {
}
class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAddressPage> {
late AddressInfo _selectedAddress;
late AddressInfo _selectedAddress = AddressInfo();
int _selectedAddressIndex = -1;
Completer<GoogleMapController> _controller = Completer();
late ProjectViewModel projectViewModel;
@ -144,7 +144,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
onValueSelected: (index) {
_selectedAddressIndex = index;
_selectedAddress = model.addressesList[index];
List latLongArr = _selectedAddress.latLong!.split(',');
List latLongArr = _selectedAddress!.latLong!.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
@ -152,7 +152,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
_selectedAddress!.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
@ -200,7 +200,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
stateProvinceId: value.customer!.addresses![0].stateProvinceId,
zipPostalCode: value.customer!.addresses![0].zipPostalCode,
);
List latLongArr = _selectedAddress.latLong!.split(',');
List latLongArr = _selectedAddress!.latLong!.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
@ -208,7 +208,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
_selectedAddress!.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
@ -284,15 +284,15 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
Text(
_selectedAddress.address1!,
_selectedAddress!.address1 ??"",
style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
Text(
_selectedAddress.address2!,
_selectedAddress!.address2 ??"",
style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
Text(
_selectedAddress.city! + " " + _selectedAddress.country!,
(_selectedAddress!.city) ??"" + " " + (_selectedAddress!.country ?? ""),
style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
],
@ -349,7 +349,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
_selectedAddress!.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
@ -365,6 +365,6 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
}
String getAddressName() {
return _selectedAddress.address1 ?? "";
return _selectedAddress!=null && _selectedAddress!.address1 !=null? _selectedAddress!.address1! : "";
}
}

@ -128,8 +128,8 @@ class LocationUtils {
heading: 0.0,
speed: 0.0,
speedAccuracy: 1,
altitudeAccuracy: 0,
headingAccuracy: 0,
// altitudeAccuracy: 0,
// headingAccuracy: 0,
// Added by Aamir
),
);

@ -70,7 +70,7 @@ class LargeAvatar extends StatelessWidget {
: isAppointmentAvatar
? onTap
: () {
showZoomImageDialog(context, url!.trim() ?? "");
showZoomImageDialog(context, url?.trim() ?? "");
},
child: Container(
decoration: BoxDecoration(

@ -171,8 +171,8 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LargeAvatar(
name: name!,
url: profileUrl!,
name: name,
url: profileUrl,
width: 48,
height: 48,
),

Loading…
Cancel
Save