wrap<T> function

String wrap<T>(
  1. String returnType,
  2. {bool nullable = false}
)

Wrap the dart source code fragment of a type in Future. i.e. Future<${type}>.

Implementation

String wrap<T>(String returnType, {bool nullable = false}) =>
    '${T.toString().split("<")[0]}<${returnType}${nullable && returnType != "void" ? "?" : ""}>';