fit_sdk 0.1.0 copy "fit_sdk: ^0.1.0" to clipboard
fit_sdk: ^0.1.0 copied to clipboard

A Dart port of the Garmin FIT SDK for encoding and decoding FIT (Flexible and Interoperable Data Transfer) files. This library allows you to read and write FIT files used by Garmin and other fitness devices.

example/README.md

FIT SDK Demos #

This directory contains demos demonstrating how to use the FIT SDK for Dart.

Demos #

1. decode.dart #

Demonstrates how to decode a FIT file and read its messages.

Usage:

Run with no arguments to see a demo using a generated in-memory file:

dart run demo/decode.dart

Run with a file path to decode a specific FIT file:

dart run demo/decode.dart path/to/file.fit

2. encode.dart #

Demonstrates how to create a new FIT activity file from scratch.

Usage:

Run with no arguments to create example_activity.fit:

dart run demo/encode.dart

Run with an output file path to specify the output filename:

dart run demo/encode.dart custom_output.fit

3. broadcaster.dart #

Demonstrates how to use the MesgBroadcaster for type-safe message handling.

dart run demo/broadcaster.dart

Running the Demos #

Make sure you have the FIT SDK package installed:

dart pub get

Then run any demo:

dart run demo/<demo_name>.dart [<path/to/FIT/file>]

What You'll Learn #

  • decode.dart: How to read FIT files, parse messages, and access field values. Supports decoding arbitrary files via command line arguments.
  • encode.dart: How to create FIT files, add messages, and save them. Supports specifying output path.
  • broadcaster.dart: How to use event-based message handling for cleaner code.
0
likes
120
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart port of the Garmin FIT SDK for encoding and decoding FIT (Flexible and Interoperable Data Transfer) files. This library allows you to read and write FIT files used by Garmin and other fitness devices.

Repository (GitHub)
View/report issues

Topics

#garmin #fit #fitness #sports #health

Documentation

API reference

License

MIT (license)

More

Packages that depend on fit_sdk