parse<T> method

  1. @override
T? parse<T>(
  1. String? param
)
override

Implementation

@override
T? parse<T>(String? param) {
  switch (T) {
    case String:
      return param as T?;
    case int:
      return int.tryParse(param ?? '') as T?;
    case double:
      return double.tryParse(param ?? '') as T?;
    case bool:
      return (param == null ? null : param == 'true') as T?;
    default:
      return param as T?;
  }
}