Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1.76 KB

File metadata and controls

35 lines (25 loc) · 1.76 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

A Flutter/Dart package providing custom asset loaders for the easy_localization package. Each loader extends AssetLoader from easy_localization and implements load(String path, Locale locale) to return Map<String, dynamic> translations.

Common Commands

flutter pub get          # Install dependencies
flutter analyze          # Run static analysis (lints/recommended.yaml)
flutter test             # Run all tests
flutter test --coverage  # Run tests with coverage

Architecture

All loaders live in lib/src/ and are re-exported from lib/easy_localization_loader.dart. Each loader extends AssetLoader from easy_localization:

  • CsvAssetLoader — Parses CSV files via CSVParser helper class (supports autodetect of delimiters/EOLs). Caches the parsed CSV after first load.
  • JsonAssetLoader — Loads JSON from Flutter assets.
  • XmlAssetLoader / XmlSingleAssetLoader — XML format (per-locale files vs single file).
  • YamlAssetLoader / YamlSingleAssetLoader — YAML format (per-locale files vs single file).
  • HttpAssetLoader — Fetches JSON translations from a remote URL.
  • SmartNetworkAssetLoader — Network-first with local file caching and fallback to bundled assets. Uses connectivity_plus for network detection.
  • FileAssetLoader — Loads from device filesystem (not Flutter assets).
  • TestsAssetLoader — For use in tests, accepts translations directly.

Release Process

  1. Update CHANGELOG.md
  2. Update version in pubspec.yaml
  3. Create a GitHub release named v<version> (e.g., v2.0.3) — a CI pipeline deploys to pub.dev