tileImage method
Image?
tileImage({
- double? size,
- Key? key,
- double scale = 1.0,
- Widget frameBuilder(
- BuildContext,
- Widget,
- int?,
- bool,
- Widget errorBuilder()?,
- String? semanticLabel,
- bool excludeFromSemantics = false,
- Color? color,
- Animation<
double> ? opacity, - BlendMode? colorBlendMode,
- BoxFit? fit,
- AlignmentGeometry alignment = Alignment.center,
- ImageRepeat repeat = ImageRepeat.noRepeat,
- Rect? centerSlice,
- bool matchTextDirection = false,
- bool gaplessPlayback = false,
- bool isAntiAlias = false,
- FilterQuality filterQuality = FilterQuality.low,
- int? cacheWidth,
- int? cacheHeight,
Retrieves the most recently modified tile from the store, extracts it's bytes, and renders them to an Image
Prefer tileImageAsync to avoid blocking the UI thread. Otherwise, this has slightly better performance.
Eventually returns null
if there are no cached tiles in this store,
otherwise an Image with size
height and width.
This method requires the store to be ready, else an FMTCStoreNotReady error will be raised.
Implementation
Image? tileImage({
double? size,
Key? key,
double scale = 1.0,
Widget Function(BuildContext, Widget, int?, bool)? frameBuilder,
Widget Function(BuildContext, Object, StackTrace?)? errorBuilder,
String? semanticLabel,
bool excludeFromSemantics = false,
Color? color,
Animation<double>? opacity,
BlendMode? colorBlendMode,
BoxFit? fit,
AlignmentGeometry alignment = Alignment.center,
ImageRepeat repeat = ImageRepeat.noRepeat,
Rect? centerSlice,
bool matchTextDirection = false,
bool gaplessPlayback = false,
bool isAntiAlias = false,
FilterQuality filterQuality = FilterQuality.low,
int? cacheWidth,
int? cacheHeight,
}) {
final latestTile = _registry(_name)
.tiles
.where(sort: Sort.desc)
.anyLastModified()
.findFirstSync();
if (latestTile == null) return null;
return Image.memory(
Uint8List.fromList(latestTile.bytes),
key: key,
scale: scale,
frameBuilder: frameBuilder,
errorBuilder: errorBuilder,
semanticLabel: semanticLabel,
excludeFromSemantics: excludeFromSemantics,
width: size,
height: size,
color: color,
opacity: opacity,
colorBlendMode: colorBlendMode,
fit: fit,
alignment: alignment,
repeat: repeat,
centerSlice: centerSlice,
matchTextDirection: matchTextDirection,
gaplessPlayback: gaplessPlayback,
isAntiAlias: isAntiAlias,
filterQuality: filterQuality,
cacheWidth: cacheWidth,
cacheHeight: cacheHeight,
);
}