listIf<T> static method

List<T> listIf<T>(
  1. bool condition,
  2. ListFactory<T> factory
)

Implementation

static List<T> listIf<T>(bool condition, ListFactory<T> factory) =>
    condition ? factory() : [];