Created
March 28, 2020 20:52
-
-
Save preetjdp/2d6db1d94b4995e1046b3c727e6eac81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NearByPeople { | |
| List<User> nearbyPeople; | |
| NearByPeople({@required this.nearbyPeople}); | |
| List<BuddyLocation> nearByLocationPoints() { | |
| return nearbyPeople.map((person) => person.location).toList(); | |
| } | |
| Set<Marker> nearbyMarkers(BuildContext context) { | |
| List<BuddyLocation> nearbyLocationPoints = nearByLocationPoints(); | |
| return nearbyLocationPoints | |
| .map((point) => Marker( | |
| markerId: MarkerId(point.uid), | |
| position: point.latLng, | |
| flat: true, | |
| icon: Provider.of<BitmapDescriptor>(context))) | |
| .toSet(); | |
| } | |
| factory NearByPeople.fromList(List<User> users) => | |
| NearByPeople(nearbyPeople: users); | |
| factory NearByPeople.initialData() { | |
| return NearByPeople(nearbyPeople: [User.initialData()]); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment