toConfig method

dynamic toConfig({
  1. bool shimmer = true,
  2. Duration? shimmerDuration,
  3. bool enableCache = true,
  4. bool debugMode = false,
  5. bool gracefulFallback = true,
})

Converts this theme to a SkeletonConfig. Requires import of skeleton_context.dart for SkeletonConfig class.

Implementation

dynamic toConfig({
  bool shimmer = true,
  Duration? shimmerDuration,
  bool enableCache = true,
  bool debugMode = false,
  bool gracefulFallback = true,
}) {
  // Returns a map that can be used to create SkeletonConfig
  return {
    'shimmer': shimmer,
    'baseColor': baseColor,
    'highlightColor': highlightColor,
    'shimmerDuration': shimmerDuration ?? const Duration(milliseconds: 1500),
    'borderRadius': borderRadius,
    'enableCache': enableCache,
    'debugMode': debugMode,
    'gracefulFallback': gracefulFallback,
  };
}