Files class
high level usecase to manage files on nostr
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkUrl(
{required String url, List< String> ? serverUrls, String? pubkey}) → Future<String> -
checks if a url is a blossom url.
it its not a blossom url, the url is returned.
if its a blossom url, blossom is used to check if the blob exists on the server(s)
returns alive url if the blob exists, throws an error if the blob does not exist -
delete(
{required String sha256, List< String> ? serverUrls}) → Future<List< BlobDeleteResult> > -
deletes a file from the server(s)
ifserverUrls
is null, the userServerList is fetched from nostr. \ -
download(
{required String url, List< String> ? serverUrls, String? pubkey}) → Future<BlobResponse> -
download a file from the server(s)
if its a blossom url (sha256 in url), blossom is used to download
if its a public url, the file is downloaded directly
serverUrls
andpubkey
are used to download from blossom
ifserverUrls
is null, the userServerList is fetched from nostr (using the pubkey).
if bothserverUrls
andpubkey
are null, throws an error. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
upload(
{required NdkFile file, List< String> ? serverUrls, bool serverMediaOptimisation = false}) → Future<List< BlobUploadResult> > -
upload a file to the server(s)
ifserverUrls
is null, the userServerList is fetched from nostr.
if no serverUrls (param or nostr) are found, throws an errorserverMediaOptimisation
is whether the server should optimise the mediaBUD-05
, IMPORTANT: the server hash will be different \
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- sha256Regex → RegExp
-
Regular expression to match SHA256 in URLs
final