getDefaultDuration static method

Duration getDefaultDuration(
  1. SketchyType type
)

Returns a default duration for each SketchyType animation.

This method is used internally to provide default durations if the user doesn't specify a duration when creating a SketchySentance instance.

Implementation

static Duration getDefaultDuration(SketchyType type) {
  switch (type) {
    case SketchyType.highlight:
      return const Duration(milliseconds: 500);
    case SketchyType.underline:
      return const Duration(milliseconds: 500);
    case SketchyType.strikethrough:
      return const Duration(milliseconds: 700);
    case SketchyType.circle:
      return const Duration(seconds: 2);
    case SketchyType.rectangle:
      return const Duration(seconds: 2);
  }
}