last method

String last({
  1. String separator = "/",
})

Divides a Uri by separator and returns the last part.

Uriseparatorで分割しその最後の部分を返します。

final path = Uri.parse("aaaa/bbbb/cccc/dddd");
final first = path.first(); // dddd

Implementation

String last({String separator = "/"}) {
  return toString().split(separator).lastOrNull ?? "";
}