RestoreAsync class abstract
An asynchronous utility class for decompressing data that was compressed using the Shrink
class.
Uses compute to offload decompression to an isolate for UI performance.
Always returns the same output as Restore.*
but wrapped in a Future
.
Example:
final decompressedText = await RestoreAsync.text(compressedTextBytes);
final decompressedJson = await RestoreAsync.json(compressedJsonBytes);
This class provides static methods corresponding to the compression methods
in ShrinkAsync
, allowing restoration of data in separate isolates to avoid
blocking the UI.
Always restores data compressed by the corresponding ShrinkAsync.*
methods.
Constructors
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
bytes(
Uint8List compressed) → Future< Uint8List> -
Asynchronously decompresses a Uint8List that was compressed using
Shrink.bytes
. -
json(
Uint8List compressed) → Future< Map< String, dynamic> > -
Asynchronously decompresses a Uint8List that was compressed using
Shrink.json
and converts it back to a JSON object in a separate isolate. -
text(
Uint8List compressed) → Future< String> -
Asynchronously decompresses a Uint8List that was compressed using
Shrink.text
and converts it back to a string in a separate isolate. -
unique(
Uint8List compressed) → Future< List< int> > -
Asynchronously decompresses a Uint8List that was compressed using
Shrink.unique
and converts it back to a list of unique integers in a separate isolate.