null safety fixed.

merge-update-with-lab-changes
Sultan khan 2 years ago
parent 649521c31f
commit 413535ef0b

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

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

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

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

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

Loading…
Cancel
Save