loadingTimeDebugTileBuilder top-level property

TileBuilder loadingTimeDebugTileBuilder
final

Shows the Tile loading time in ms

Implementation

final TileBuilder loadingTimeDebugTileBuilder =
    (BuildContext context, Widget tileWidget, Tile tile) {
  var loadStarted = tile.loadStarted;
  var loaded = tile.loaded;

  final time = loaded == null
      ? 'Loading'
      : '${(loaded.millisecond - loadStarted.millisecond).abs()} ms';

  return Container(
    decoration: BoxDecoration(
      border: Border.all(),
    ),
    child: Stack(
      fit: StackFit.passthrough,
      children: [
        tileWidget,
        Center(
          child: Text(
            time,
            style: Theme.of(context).textTheme.headline5,
          ),
        ),
      ],
    ),
  );
};