void initState() {
final applicationBloc =
Provider.of<ApplicationBloc>(context, listen: false);
//Listen for selected Location
locationSubscription =
applicationBloc.selectedLocation.stream.listen((place) {
if (place != null) {
_locationController.text =
place.name;
_goToPlace(place);
} else
_locationController.text = "";
});
applicationBloc.bounds.stream.listen((bounds) async {
final GoogleMapController controller = await _mapController.future;
controller.animateCamera(CameraUpdate.newLatLngBounds(bounds, 50));
});
super.initState();
}
@override void dispose() {
final applicationBloc =
Provider.of<ApplicationBloc>(context, listen: false);
applicationBloc.dispose();
_locationController.dispose();
locationSubscription.cancel();
boundsSubscription.cancel();
super.dispose();
}
@override Widget build(BuildContext context) {
final applicationBloc = Provider.of<ApplicationBloc>(context);
return Scaffold(
body: (applicationBloc.currentLocation == null)
? Center(
child: CircularProgressIndicator(),
)
: ListView(
children: [