Skip to content
pubscout

activity_files

0.8.5, released 4 weeks ago by eikedreier.com

Toolkit for parsing, editing, validating, and converting workout activity files in GPX, TCX, FIT, GeoJSON, and CSV.

WASM-ready
$ flutter pub add activity_files
Source repository

What it does

Provides a pure Dart toolkit and command-line tool to parse, normalize, validate, edit, and convert workout activity files across GPX, TCX, FIT, GeoJSON, and CSV formats. It includes stream-aware builders, point-level editing, multi-sport workflows, and robust error diagnostics.

AI-written summary of version 0.8.5, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to parse, edit, or convert workout files like GPX, TCX, or FIT in a Dart or Flutter application.
  • You want a format-agnostic model for GPS points, laps, and sensor channels.
  • You need detailed diagnostic messages instead of parser crashes when handling malformed activity files.

Skip it when

  • You are working with file formats completely unrelated to workout or fitness tracking activities.
  • You need a full-featured mapping SDK rather than a file parsing/conversion toolkit.

Strengths

  • Supports multiple popular activity file formats including GPX, TCX, FIT, GeoJSON, and CSV.
  • Parsers are designed never to throw on malformed files, reporting issues as structured diagnostics.
  • Includes multi-sport split/merge workflows and point-level editing capabilities.

Weaknesses

  • Payloads and streams over 64MB require explicit isolate usage or streaming APIs.
  • Strict FIT integrity checks require specific import configurations.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Pure Dart library; add to pubspec.yaml dependencies.

import 'package:activity_files/activity_files.dart';

Future<void> convertGpxToFit(Uint8List bytes) async {
  final imported = await ActivityFiles.import(bytes, useIsolate: true);
  if (imported.hasErrors) {
    throw StateError('Import failed:\n${imported.diagnosticsSummary()}');
  }
  final normalized = ActivityFiles.edit(imported.activity).sortAndDedup().trimInvalid().activity;
  final export = ActivityFiles.export(activity: normalized, to: ActivityFileFormat.fit, runValidation: true);
  final fitBytes = export.asBytes();
}

Alternatives

Packages that do the same job and could replace activity_files.

Works with

Packages commonly used together with activity_files: ones it builds on, ones built on it, and its own family.