writeMetadata method

  1. @override
Future<bool> writeMetadata(
  1. String filePath,
  2. Metadata metadata
)
override

Writes metadata to the file at filePath.

Returns true if the write succeeded.

Implementation

@override
Future<bool> writeMetadata(String filePath, Metadata metadata) async {
  try {
    final result = await methodChannel.invokeMethod<bool>(
      'writeMetadata',
      {
        'filePath': filePath,
        'metadata': metadata.toMap(),
      },
    );
    return result ?? false;
  } on PlatformException catch (e) {
    debugPrint('[media_metadata] PlatformException: ${e.message}');
    return false;
  }
}