winmd 5.0.2 copy "winmd: ^5.0.2" to clipboard
winmd: ^5.0.2 copied to clipboard

A Dart package for working with Windows Metadata (.winmd) files.

example/main.dart

// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Parse the Windows Metadata for a WinRT type and generate a Dart wrapper

import 'package:winmd/winmd.dart';

void main() async {
  // Load the WinRT metadata
  final scope = await MetadataStore.loadWinRTMetadata();

  // A Windows Runtime class
  const typeToGenerate = 'Windows.Media.Playback.MediaPlayer';

  // Find the TypeDef for this class
  final typeDef = scope.findTypeDef(typeToGenerate)!;

  // Create a Dart projection
  print('$typeToGenerate contains the following methods:');

  for (final method in typeDef.methods) {
    print('  ${method.name}');
  }

  MetadataStore.close();
}
9
likes
0
pub points
53%
popularity

Publisher

verified publisherhalildurmus.dev

A Dart package for working with Windows Metadata (.winmd) files.

Repository (GitHub)
View/report issues

Topics

#winmd #windows #metadata

License

unknown (license)

Dependencies

archive, ffi, nuget, path, win32, win32_registry

More

Packages that depend on winmd