Shimmer.listTile constructor

Shimmer.listTile({
  1. Key? key,
  2. Color backgroundColor = _defaultBackgroundColor,
  3. double borderRadius = _defaultBorderRadius,
  4. Gradient? gradient,
  5. Duration period = _defaultPeriod,
})

A shimmer effect widget.

Inspired by: https://github.com/hnvn/flutter_shimmer/blob/master/lib/shimmer.dart

List tile uses a ListTile as a child.

Implementation

Shimmer.listTile({
  super.key,
  Color backgroundColor = _defaultBackgroundColor,
  double borderRadius = _defaultBorderRadius,
  Gradient? gradient,
  this.period = _defaultPeriod,
})  : gradient = gradient ?? _getDefaultGradient(backgroundColor),
      child = ListTile(
        contentPadding: EdgeInsets.zero,
        leading: CircleAvatar(
          backgroundColor: backgroundColor,
        ),
        title: _Container(
          borderRadius: borderRadius,
          color: backgroundColor,
        ),
        subtitle: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            _Container(
              borderRadius: borderRadius,
              color: backgroundColor,
              width: 50.0,
            ),
          ],
        ),
      );