{"id":51176203,"url":"https://github.com/rfivesix/flutter_body_highlighter","last_synced_at":"2026-06-27T04:02:02.459Z","repository":{"id":360318080,"uuid":"1249603706","full_name":"rfivesix/flutter_body_highlighter","owner":"rfivesix","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-07T23:20:12.000Z","size":13996,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T01:19:52.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rfivesix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-25T21:56:48.000Z","updated_at":"2026-06-07T23:20:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rfivesix/flutter_body_highlighter","commit_stats":null,"previous_names":["rfivesix/flutter_body_highlighter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rfivesix/flutter_body_highlighter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfivesix%2Fflutter_body_highlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfivesix%2Fflutter_body_highlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfivesix%2Fflutter_body_highlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfivesix%2Fflutter_body_highlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rfivesix","download_url":"https://codeload.github.com/rfivesix/flutter_body_highlighter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfivesix%2Fflutter_body_highlighter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34840899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-27T04:02:01.661Z","updated_at":"2026-06-27T04:02:02.451Z","avatar_url":"https://github.com/rfivesix.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flutter Body Highlighter\n\nA high-performance, offline-first, interactive, and zero-dependency Flutter widget for visualizing and interacting with a human body muscle model. \n\nDesigned specifically to power rich health and fitness features—such as training volume heat maps and muscle recovery trackers—with **zero runtime XML/SVG parsing overhead** and **pixel-perfect vector fidelity**.\n\nBased on and attributed to the coordinates from [react-native-body-highlighter](https://github.com/HichamELBSI/react-native-body-highlighter) by HichamELBSI.\n\n---\n\n## Features\n\n*   **Offline-First \u0026 Zero Dependencies**: Built entirely using pure Dart and Flutter's native `CustomPainter` rendering. No external SVG parsing packages required!\n*   **Dual Gender Silhouettes**: Fully supports both **Male** and **Female** body shapes.\n*   **Front and Back Views**: Render either posterior or anterior chains seamlessly.\n*   **Advanced Highlighting Options**:\n    *   **Intensity-Based Heatmaps**: Automatically colors muscle groups on a multi-level color scale (e.g., intensities 1 to 5).\n    *   **Explicit Color Overrides**: Set custom individual colors per muscle (ideal for recovery tracking, such as Orange for sore, Green for recovered, and Grey for inactive).\n*   **High-DPI Responsive Scaling**: Pixel-perfect vector scaling with aspect-ratio preservation.\n*   **Pure-Dart Tap Collision Detection**: Extremely fast, mathematical tap detection maps user clicks directly back to specific muscle group slugs.\n\n---\n\n## Installation\n\nAdd the package as a dependency in your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  flutter_body_highlighter:\n    git:\n      url: https://github.com/rfivesix/flutter_body_highlighter.git\n      ref: main\n```\n\n---\n\n## Quick Start Example\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:flutter_body_highlighter/flutter_body_highlighter.dart';\n\nvoid main() =\u003e runApp(const MyApp());\n\nclass MyApp extends StatelessWidget {\n  const MyApp({super.key});\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      theme: ThemeData.dark(),\n      home: const BodyHighlighterDemo(),\n    );\n  }\n}\n\nclass BodyHighlighterDemo extends StatefulWidget {\n  const BodyHighlighterDemo({super.key});\n\n  @override\n  State\u003cBodyHighlighterDemo\u003e createState() =\u003e _BodyHighlighterDemoState();\n}\n\nclass _BodyHighlighterDemoState extends State\u003cBodyHighlighterDemo\u003e {\n  BodyGender _gender = BodyGender.male;\n  BodySide _side = BodySide.front;\n  BodyPartSlug? _selectedMuscle;\n\n  // Track highlights\n  final List\u003cBodyPartHighlightData\u003e _highlights = [\n    const BodyPartHighlightData(slug: BodyPartSlug.chest, intensity: 5),\n    const BodyPartHighlightData(slug: BodyPartSlug.quadriceps, intensity: 3),\n    const BodyPartHighlightData(slug: BodyPartSlug.biceps, intensity: 2),\n    const BodyPartHighlightData(slug: BodyPartSlug.gluteal, color: Colors.orange),\n  ];\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: const Text('Body Highlighter Demo'),\n        actions: [\n          IconButton(\n            icon: Icon(_gender == BodyGender.male ? Icons.male : Icons.female),\n            onPressed: () =\u003e setState(() {\n              _gender = _gender == BodyGender.male ? BodyGender.female : BodyGender.male;\n            }),\n          ),\n          IconButton(\n            icon: const Icon(Icons.flip),\n            onPressed: () =\u003e setState(() {\n              _side = _side == BodySide.front ? BodySide.back : BodySide.front;\n            }),\n          ),\n        ],\n      ),\n      body: Center(\n        child: Column(\n          children: [\n            Padding(\n              padding: const EdgeInsets.all(16.0),\n              child: Text(\n                _selectedMuscle != null\n                    ? 'Tapped: ${_selectedMuscle!.slug.toUpperCase()}'\n                    : 'Tap on a muscle group!',\n                style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),\n              ),\n            ),\n            Expanded(\n              child: Padding(\n                padding: const EdgeInsets.symmetric(vertical: 24.0),\n                child: BodyHighlighter(\n                  gender: _gender,\n                  side: _side,\n                  highlightedParts: _highlights,\n                  outlineWidth: 1.2,\n                  onBodyPartTap: (slug, highlight) {\n                    setState(() {\n                      _selectedMuscle = slug;\n                    });\n                  },\n                ),\n              ),\n            ),\n          ],\n        ),\n      ),\n    );\n  }\n}\n```\n\n---\n\n## API Reference\n\n### 1. `BodyHighlighter` (Widget)\n\n| Property | Type | Default | Description |\n| :--- | :--- | :--- | :--- |\n| `highlightedParts` | `List\u003cBodyPartHighlightData\u003e` | **Required** | The collection of muscles and their highlighting parameters. |\n| `gender` | `BodyGender` | `BodyGender.male` | Silhouette gender (`male` or `female`). |\n| `side` | `BodySide` | `BodySide.front` | Side of the body displayed (`front` or `back`). |\n| `baseColor` | `Color?` | `surfaceContainerHighest` | Base fill color for all unhighlighted body parts. |\n| `outlineColor` | `Color?` | `outline` | Border outline color of all body parts. |\n| `outlineWidth` | `double` | `1.0` | Stroke width for outlines. |\n| `intensityColors` | `List\u003cColor\u003e?` | *Gradient theme-primary* | 5-step color scale used to shade muscles based on `intensity`. |\n| `onBodyPartTap` | `Function(BodyPartSlug, BodyPartHighlightData)?` | `null` | Tap callback. If `null`, tap detection is disabled. |\n| `width` | `double?` | `null` | Optional width constraint. |\n| `height` | `double?` | `null` | Optional height constraint. |\n\n### 2. `BodyPartHighlightData` (Model)\n\nAn input data model configuring how a specific muscle group is highlighted:\n\n```dart\nconst BodyPartHighlightData({\n  required this.slug,     // The target muscle group BodyPartSlug\n  this.intensity,         // Shading level [1-5] corresponding to the intensity colors\n  this.color,             // Direct color override (ignores intensity if supplied)\n  this.payload,           // Custom payload to carry domain-specific objects\n});\n```\n\n### 3. `BodyPartSlug` (Enum)\n\nStrong-typed enum representation of all interactive muscle groups. Includes a `fromString(String slug)` helper to convert database strings automatically:\n\n```dart\nenum BodyPartSlug {\n  neck,\n  trapezius,\n  upperBack,\n  lowerBack,\n  chest,\n  abs,\n  obliques,\n  frontDeltoids,\n  backDeltoids,\n  biceps,\n  triceps,\n  forearm,\n  gluteal,\n  quadriceps,\n  hamstring,\n  adductor,\n  abductors,\n  calves;\n  \n  static BodyPartSlug? fromString(String slug);\n  String get slug;\n}\n```\n\n---\n\n## Development \u0026 Regeneration of Assets\n\nIf you ever need to download the latest TS files and rebuild the compiled Dart coordinate databases, run the build-time downloader script:\n\n```bash\ndart tool/svg_to_dart_parser.dart\n```\n\nThis will automatically connect to GitHub, download the TS vectors, optimize coordinates, remove trailing commas, and write clean Dart structures under `lib/src/svg_paths/`.\n\n---\n\n## License\n\nThis package is distributed under the [MIT License](file:///Users/richardgeorgschotte/Projekte/flutter_body_highlighter/LICENSE). It attributes and preserves copyright to both Richard Georg Schotte and HichamELBSI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfivesix%2Fflutter_body_highlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frfivesix%2Fflutter_body_highlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfivesix%2Fflutter_body_highlighter/lists"}