halildurmus / dartwinrt

Idiomatic Dart projection of the modern Windows Runtime (WinRT) APIs.
BSD 3-Clause "New" or "Revised" License
50 stars 3 forks source link

Add example of getting battery information #189

Closed timsneath closed 1 year ago

timsneath commented 1 year ago

Description

Adds a couple of battery-related classes that enable reporting on available power. Adds an example of calling them.

Related Issue

Type of Change

halildurmus commented 1 year ago

Awesome, thank you!

timsneath commented 1 year ago

Yay! My first commit :) Thanks for the reminder about README.md.

Do you want to require review approvals on this repo? I'm sure others will follow in my footsteps.

halildurmus commented 1 year ago

Yes, definitely :)

halildurmus commented 1 year ago

In case you haven't noticed yet, there is a new tool called add_type located in the tool\ directory.

This tool simplifies the process of adding new WinRT types by analyzing the type and identifying any dependent types (if any), which it then adds to JSON files. The tool also fetches relevant documentation for the types from Microsoft's website, which is great.

Just wanted to let you know as manually adding a new WinRT class with extensive dependent types (e.g. StorageFile) can be a cumbersome task.

timsneath commented 1 year ago

Yup! That worked a treat for me ๐ŸŽ‰

(I did try it with Windows.ApplicationModel.DataTransfer.Clipboard, and that was less successful, because missing support for map projections. But that's fine -- I'll keep exploring interesting APIs as I have time.)