decodeString method
Decodes string
to an instance of T
.
Implementation
@override
Duration decodeString(String string) {
if (string.endsWith('s')) {
final seconds = double.parse(string.substring(0, string.length - 1));
return Duration(microseconds: (seconds * _million).toInt());
}
throw ArgumentError.value(string);
}