|
|
|
@ -42,12 +42,12 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
|
|
|
|
AddressInfo _selectedAddress;
|
|
|
|
AddressInfo _selectedAddress;
|
|
|
|
bool showCurrentLocation = false;
|
|
|
|
bool showCurrentLocation = false;
|
|
|
|
Completer<GoogleMapController> _controller = Completer();
|
|
|
|
Completer<GoogleMapController> _controller = Completer();
|
|
|
|
|
|
|
|
GoogleMapController googleMapController;
|
|
|
|
|
|
|
|
final Set<Marker> markers = new Set();
|
|
|
|
static CameraPosition _kGooglePlex = CameraPosition(
|
|
|
|
static CameraPosition _kGooglePlex = CameraPosition(
|
|
|
|
target: LatLng(37.42796133580664, -122.085749655962),
|
|
|
|
target: LatLng(37.42796133580664, -122.085749655962),
|
|
|
|
zoom: 14.4746,
|
|
|
|
zoom: 14.4746,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
final Set<Marker> markers = new Set();
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
|
|
|
|
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
|
|
|
|
@ -56,6 +56,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
|
|
|
|
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
|
|
|
|
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
|
|
|
|
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
|
|
|
|
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
markers.clear();
|
|
|
|
markers.clear();
|
|
|
|
markers.add(
|
|
|
|
markers.add(
|
|
|
|
Marker(
|
|
|
|
Marker(
|
|
|
|
@ -64,6 +65,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
|
|
|
|
),
|
|
|
|
),
|
|
|
|
position: LatLng(latitude, longitude)),
|
|
|
|
position: LatLng(latitude, longitude)),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
_kGooglePlex = CameraPosition(
|
|
|
|
_kGooglePlex = CameraPosition(
|
|
|
|
target: LatLng(latitude, longitude),
|
|
|
|
target: LatLng(latitude, longitude),
|
|
|
|
zoom: 14.4746,
|
|
|
|
zoom: 14.4746,
|
|
|
|
@ -98,137 +100,47 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
showNewAppBar: true,
|
|
|
|
showNewAppBar: true,
|
|
|
|
appBarTitle: TranslationBase.of(context).homeHealthCare,
|
|
|
|
appBarTitle: TranslationBase.of(context).homeHealthCare,
|
|
|
|
body: Stack(
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: 120),
|
|
|
|
|
|
|
|
child: GoogleMap(
|
|
|
|
|
|
|
|
mapType: MapType.normal,
|
|
|
|
|
|
|
|
markers: markers,
|
|
|
|
|
|
|
|
initialCameraPosition: _kGooglePlex,
|
|
|
|
|
|
|
|
onMapCreated: (GoogleMapController controller) {
|
|
|
|
|
|
|
|
_controller.complete(controller);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PlacePicker(
|
|
|
|
|
|
|
|
// apiKey: GOOGLE_API_KEY,
|
|
|
|
|
|
|
|
// enableMyLocationButton: true,
|
|
|
|
|
|
|
|
// automaticallyImplyAppBarLeading: false,
|
|
|
|
|
|
|
|
// autocompleteOnTrailingWhitespace: false,
|
|
|
|
|
|
|
|
// selectInitialPosition: true,
|
|
|
|
|
|
|
|
// autocompleteLanguage: projectViewModel.currentLanguage,
|
|
|
|
|
|
|
|
// enableMapTypeButton: false,
|
|
|
|
|
|
|
|
// searchForInitialValue: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // onPlacePicked: (PickResult result) {
|
|
|
|
|
|
|
|
// // print(result.adrAddress);
|
|
|
|
|
|
|
|
// // widget.changePageViewIndex(3);
|
|
|
|
|
|
|
|
// // },
|
|
|
|
|
|
|
|
// selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
|
|
|
|
|
|
|
|
// print("state: $state, isSearchBarFocused: $isSearchBarFocused");
|
|
|
|
|
|
|
|
// return isSearchBarFocused
|
|
|
|
|
|
|
|
// ? Container()
|
|
|
|
|
|
|
|
// : FloatingCard(
|
|
|
|
|
|
|
|
// bottomPosition: 0.0,
|
|
|
|
|
|
|
|
// leftPosition: 0.0,
|
|
|
|
|
|
|
|
// rightPosition: 0.0,
|
|
|
|
|
|
|
|
// width: 500,
|
|
|
|
|
|
|
|
// borderRadius: BorderRadius.circular(12.0),
|
|
|
|
|
|
|
|
// child: Container(
|
|
|
|
|
|
|
|
// margin: EdgeInsets.all(12),
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// // SecondaryButton(
|
|
|
|
|
|
|
|
// // color: Colors.grey[800],
|
|
|
|
|
|
|
|
// // textColor: Colors.white,
|
|
|
|
|
|
|
|
// // onTap: () {
|
|
|
|
|
|
|
|
// // Navigator.push(
|
|
|
|
|
|
|
|
// // context,
|
|
|
|
|
|
|
|
// // FadePage(
|
|
|
|
|
|
|
|
// // page: LocationPage(
|
|
|
|
|
|
|
|
// // latitude: latitude,
|
|
|
|
|
|
|
|
// // longitude: longitude,
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // );
|
|
|
|
|
|
|
|
// // },
|
|
|
|
|
|
|
|
// // label: TranslationBase.of(context).addNewAddress,
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // SizedBox(
|
|
|
|
|
|
|
|
// // height: 10,
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// SecondaryButton(
|
|
|
|
|
|
|
|
// color: Colors.red[800],
|
|
|
|
|
|
|
|
// textColor: Colors.white,
|
|
|
|
|
|
|
|
// onTap: () {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// widget.patientERInsertPresOrderRequestModel.latitude = selectedPlace.geometry.location.lat;
|
|
|
|
|
|
|
|
// widget.patientERInsertPresOrderRequestModel.longitude = selectedPlace.geometry.location.lng;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// widget.changePageViewIndex(3);
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// label: TranslationBase.of(context).confirm,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// initialPosition: LatLng(latitude, longitude),
|
|
|
|
|
|
|
|
// useCurrentLocation: showCurrentLocation,
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (widget.model.addressesList.isNotEmpty)
|
|
|
|
if (widget.model.addressesList.isNotEmpty)
|
|
|
|
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
|
|
|
Card(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 12, right: 12, bottom: 12, top: 12),
|
|
|
|
height: 60,
|
|
|
|
shape: cardRadius(12),
|
|
|
|
width: MediaQuery.of(context).size.width * .9,
|
|
|
|
elevation: 3,
|
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white),
|
|
|
|
child: InkWell(
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
onTap: () => confirmSelectLocationDialog(widget.model.addressesList),
|
|
|
|
child: ButtonTheme(
|
|
|
|
child: Container(
|
|
|
|
alignedDropdown: true,
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
child: DropdownButton<AddressInfo>(
|
|
|
|
width: double.infinity,
|
|
|
|
hint: Text(
|
|
|
|
// height: 65,
|
|
|
|
widget.model.addressesList[0].address1,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
style: TextStyle(color: CustomColors.black, fontSize: 14),
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
iconEnabledColor: CustomColors.grey2,
|
|
|
|
child: Row(
|
|
|
|
style: TextStyle(color: CustomColors.black, fontSize: 14),
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
dropdownColor: CustomColors.white,
|
|
|
|
children: [
|
|
|
|
value: _selectedAddress,
|
|
|
|
Expanded(
|
|
|
|
items: widget.model.addressesList.map((AddressInfo value) {
|
|
|
|
child: Text(
|
|
|
|
return DropdownMenuItem<AddressInfo>(
|
|
|
|
getAddressName(),
|
|
|
|
value: value,
|
|
|
|
style: TextStyle(
|
|
|
|
child: new AutoSizeText(
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
value.address1,
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
letterSpacing: -0.45,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
}).toList(),
|
|
|
|
|
|
|
|
onChanged: (r) {},
|
|
|
|
|
|
|
|
underline: Container(
|
|
|
|
|
|
|
|
height: 0,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Icon(Icons.arrow_drop_down)
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
Positioned(
|
|
|
|
|
|
|
|
top: 80,
|
|
|
|
|
|
|
|
left: 20,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Icon(
|
|
|
|
|
|
|
|
Icons.add_circle_rounded,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
height: 50,
|
|
|
|
child: Texts(
|
|
|
|
width: double.infinity,
|
|
|
|
TranslationBase.of(context).addNewAddress,
|
|
|
|
),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
@ -240,60 +152,80 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Icon(Icons.add_circle_outline_sharp),
|
|
|
|
|
|
|
|
mWidth(12),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
TranslationBase.of(context).addNewAddress,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
letterSpacing: -0.46,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
))
|
|
|
|
),
|
|
|
|
// Container(
|
|
|
|
),
|
|
|
|
// child: InkWell(
|
|
|
|
),
|
|
|
|
// onTap: () => confirmSelectLocationDialog(widget.model.addressesList),
|
|
|
|
Expanded(
|
|
|
|
// child: Container(
|
|
|
|
child: Stack(
|
|
|
|
// padding: EdgeInsets.all(10),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
// width: double.infinity,
|
|
|
|
children: [
|
|
|
|
// // height: 65,
|
|
|
|
GoogleMap(
|
|
|
|
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white),
|
|
|
|
mapType: MapType.normal,
|
|
|
|
// child: Row(
|
|
|
|
zoomControlsEnabled: false,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
myLocationButtonEnabled: true,
|
|
|
|
// children: [
|
|
|
|
myLocationEnabled: true,
|
|
|
|
// Expanded(
|
|
|
|
initialCameraPosition: _kGooglePlex,
|
|
|
|
// child: Texts(
|
|
|
|
onCameraMove: ((_position) => _updatePosition(_position)),
|
|
|
|
// getAddressName(),
|
|
|
|
onMapCreated: (GoogleMapController controller) {
|
|
|
|
// fontSize: 14,
|
|
|
|
googleMapController = controller;
|
|
|
|
// ),
|
|
|
|
_controller.complete(controller);
|
|
|
|
// ),
|
|
|
|
},
|
|
|
|
// Icon(Icons.arrow_drop_down)
|
|
|
|
),
|
|
|
|
// ],
|
|
|
|
Icon(
|
|
|
|
// ),
|
|
|
|
Icons.place,
|
|
|
|
// ),
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
// ),
|
|
|
|
size: 50,
|
|
|
|
// height: 56,
|
|
|
|
),
|
|
|
|
// width: double.infinity,
|
|
|
|
|
|
|
|
// color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomSheet: Container(
|
|
|
|
),
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
Padding(
|
|
|
|
height: 70.0,
|
|
|
|
padding: const EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14),
|
|
|
|
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
|
|
|
|
child: SecondaryButton(
|
|
|
|
child: Button(
|
|
|
|
color: Colors.red[800],
|
|
|
|
onTap: () async {
|
|
|
|
textColor: Colors.white,
|
|
|
|
Navigator.push(
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
widget.patientERInsertPresOrderRequestModel.latitude = latitude;
|
|
|
|
|
|
|
|
widget.patientERInsertPresOrderRequestModel.longitude = longitude;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
navigateTo(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
NewHomeHealthCareStepThreePage(
|
|
|
|
page: NewHomeHealthCareStepThreePage(
|
|
|
|
|
|
|
|
patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
|
|
|
|
patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
|
|
|
|
model: widget.model,
|
|
|
|
model: widget.model,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
label: TranslationBase.of(context).continues,
|
|
|
|
label: TranslationBase.of(context).continues,
|
|
|
|
backgroundColor: Colors.red[900],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void _updatePosition(CameraPosition _position) {
|
|
|
|
|
|
|
|
latitude = _position.target.latitude;
|
|
|
|
|
|
|
|
longitude = _position.target.longitude;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void confirmSelectLocationDialog(List<AddressInfo> addresses) {
|
|
|
|
void confirmSelectLocationDialog(List<AddressInfo> addresses) {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
|