RTPropertyString.fromFirebaseStorageUrl constructor

RTPropertyString.fromFirebaseStorageUrl(
  1. String url, {
  2. String? delimiter,
  3. String? splitDelimiter,
})

Implementation

factory RTPropertyString.fromFirebaseStorageUrl(
  String url, {
  String? delimiter,
  String? splitDelimiter,
}) {
  var pathSegments = Uri.tryParse(url)?.pathSegments;
  if (pathSegments == null) return RTPropertyString(items: []);
  var name = pathSegments.last.split('/').last.replaceAll('.svg', '');
  return RTPropertyString.fromString(
    name,
    delimiter: delimiter,
    splitDelimiter: splitDelimiter,
  );
}