CachedNetworkMarker class
The generator of custom marker. To show the custom marker on Google map for flutter, you have to pass the bitmap to BitmapDescriptor. This class will generate the custom marker with specified image url, and returns the bitmap. You can only use circleAvatar for now, but maybe more shapes will be added in the future. All marker bitmaps will be cached on user local for a month.
Your image will be resized automatically with original aspect ratio. The size of image will be decided with params for each generators.
Constructors
- CachedNetworkMarker({required String url, required double dpr, DefaultCacheManager? cm})
-
Creates the marker generator. Provide the device pixel ratio by
MediaQuery.of(context).devicePixelRatio
Properties
- cacheManager → DefaultCacheManager
-
CacheManager instance
final
- dpr → double
-
Device pixel ratio of target device.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → String
-
The url of target image.
final
Methods
-
circleAvatar(
CircleAvatarParams params) → Future< Uint8List> - Generate the circle avatar marker bitmap. Specify the color and sizes of marker with CircleAvatarParams. The image will be resized to diameter of circle(CircleAvatarParams.radius * dpr * 2) with original aspect ratio. It will automatically clip the center of image so the overflowed part won't be showed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited