C2pa class
Main entry point for the c2pa_flutter plugin.
Provides factory methods for creating reader and writer instances.
Call init once before using any other C2PA functionality:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await C2pa.init();
runApp(MyApp());
}
Then use the reader and writer:
// Read
final reader = C2pa.reader();
final store = reader.readFromFile('/path/to/image.jpg');
final manifest = store?.active;
// Write
final writer = C2pa.writer();
final signedBytes = await writer.sign(
imageBytes: originalBytes,
mimeType: 'image/jpeg',
manifest: manifest,
signer: signer,
);
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
-
init(
) → Future< void> - Initializes the C2PA Rust library.
-
reader(
) → C2paReader - Creates a new C2paReader for reading C2PA manifests.
-
writer(
) → C2paWriter - Creates a new C2paWriter for writing and signing C2PA manifests.