duration static method

Duration duration(
  1. DataSource source,
  2. List<Object> key,
  3. BuildContext context
)

Returns a Duration from the specified integer.

If it's not an integer, the default obtained from AnimationDefaults.durationOf is used (which is why a BuildContext is required).

Implementation

static Duration duration(DataSource source, List<Object> key, BuildContext context) {
  final int? value = source.v<int>(key);
  if (value == null) {
    return AnimationDefaults.durationOf(context);
  }
  return Duration(milliseconds: value);
}