Uint8ListBase64Converter class
A custom JSON converter for encoding and decoding Uint8List objects to and from base64 strings.
The Uint8ListBase64Converter class implements the JsonConverter interface,
allowing seamless serialization and deserialization of Uint8List objects within
models that use the json_serializable package.
This is particularly useful for handling binary data (e.g., image bytes or cryptographic keys) in a way that's human-readable and safe to transmit over JSON.
Constructors
- Uint8ListBase64Converter()
-
Creates a constant instance of
Uint8ListBase64Converter.const
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
-
fromJson(
String? json) → Uint8List? - Converts a JSON base64-encoded String to a Uint8List.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
Uint8List? object) → String? - Converts a Uint8List into a base64-encoded String.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited