loadingTimeDebugTileBuilder function

Widget loadingTimeDebugTileBuilder(
  1. BuildContext context,
  2. Widget tileWidget,
  3. Tile tile
)

Shows the Tile loading time in ms

Implementation

Widget loadingTimeDebugTileBuilder(
  BuildContext context,
  Widget tileWidget,
  Tile tile,
) {
  final loadStarted = tile.loadStarted;
  final 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,
          ),
        ),
      ],
    ),
  );
}