|
|
|
|
@ -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! : "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|