nullIfEmptyUri method Null safety

Uri? nullIfEmptyUri(
  1. Uri? str
)

Implementation

Uri? nullIfEmptyUri(Uri? str) => str?.hasEmptyPath == true ? null : str;