Skip to content

Commit

Permalink
Update flutter_rust_bridge to v1.82.0 and add parseErrorData (#23)
Browse files Browse the repository at this point in the history
* Update flutter_rust_bridge to v1.82.0 and add parseErrorData

* flutter_rust_bridge version updated
  • Loading branch information
HaiderSaleem authored Oct 3, 2023
1 parent 9a91149 commit 8b5f11e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/metadata_god/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
25 changes: 11 additions & 14 deletions packages/metadata_god/lib/src/bridge_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,15 @@ class MetadataGodImpl implements MetadataGod {
parseSuccessData: _wire2api_metadata,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kReadMetadataConstMeta,
argValues: [
file
],
argValues: [file],
hint: hint,
parseErrorData: parseReturnedError,
));
}

FlutterRustBridgeTaskConstMeta get kReadMetadataConstMeta => const FlutterRustBridgeTaskConstMeta(
debugName: "read_metadata",
argNames: [
"file"
],
argNames: ["file"],
);

Future<void> writeMetadata({required String file, required Metadata metadata, dynamic hint}) {
Expand All @@ -106,20 +103,15 @@ class MetadataGodImpl implements MetadataGod {
parseSuccessData: _wire2api_unit,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kWriteMetadataConstMeta,
argValues: [
file,
metadata
],
argValues: [file, metadata],
hint: hint,
parseErrorData: parseReturnedError,
));
}

FlutterRustBridgeTaskConstMeta get kWriteMetadataConstMeta => const FlutterRustBridgeTaskConstMeta(
debugName: "write_metadata",
argNames: [
"file",
"metadata"
],
argNames: ["file", "metadata"],
);

void dispose() {
Expand Down Expand Up @@ -183,6 +175,11 @@ class MetadataGodImpl implements MetadataGod {
);
}

String parseReturnedError(dynamic errorData) {
// Convert the error data to a string representation.
return errorData.toString();
}

String? _wire2api_opt_String(dynamic raw) {
return raw == null ? null : _wire2api_String(raw);
}
Expand Down

0 comments on commit 8b5f11e

Please sign in to comment.