π§° flutter_devstat
flutter_devstat is a lightweight command-line utility that helps you maintain clean and consistent Flutter project structures.
It automatically annotates all Dart files in your Flutter app with their file paths (like // lib/config.dart), making large projects easier to navigate and refactor.
π Features
- π Annotate Dart files with file path headers
- π Update existing annotations automatically when files move or rename
- π Analyze project structure or generate reports
- π§ Flexible CLI flags:
-aβ Annotate or update all Dart files-vβ Show current version-u,-hβ Show usage/help info-p,--pathsβ Show all Dart file paths instead of the tree view
- 𧬠Project identity injection via
pubspec.yaml- Optional developer metadata headers (
name,email,website,project) - Optional automatic copyright generation
- Strict header formatting enforcement
- Optional developer metadata headers (
π¦ Installation
πΉ Add to a Flutter project
flutter pub add flutter_devstat --dev
πΉ Activate globally
dart pub global activate flutter_devstat
π§βπ» Usage
Annotate or update all Dart files:
dart run flutter_devstat -a
Display help/usage:
dart run flutter_devstat -h
Show version:
dart run flutter_devstat -v
Example output:
β
Annotating Dart files...
πΉ Updated: // lib/main.dart
πΉ Added: // lib/widgets/button.dart
β
23 files processed successfully.
π§Ύ Project Identity Configuration (v1.3.2+)
You can optionally define developer and project metadata in your pubspec.yaml.
When present, DevStat automatically injects and maintains a standardized
header block at the top of every Dart file.
flutter_devstat:
dev_info:
name: "BXAMRA"
email: "bxamra@icloud.com"
website: "https://bxamra.github.io"
project: "My App"
generate_copyright: true
Example header output:
// lib/main.dart
/*
* BXAMRA
* bxamra@icloud.com
* https://bxamra.github.io
* Copyright 2026 BXAMRA. All rights reserved.
*
* Project : My App
*/
Only the fields that exist are inserted. If no fields are defined, only the file path header is added.
π§© Example Dart File
Before:
import 'package:flutter/material.dart';
class AppConfig {}
After running flutter_devstat -a:
// lib/config.dart
/*
* BXAMRA
* bxamra@icloud.com
*/
import 'package:flutter/material.dart';
class AppConfig {}
βοΈ Development
If you want to modify or contribute to the tool locally:
Clone the repository:
git clone https://github.com/bxamra/flutter_devstat.git
cd flutter_devstat
Run directly:
dart run bin/flutter_devstat.dart -a
Run tests:
dart test
π€ Publishing (for maintainers)
Before publishing to pub.dev:
-
Update version in
pubspec.yaml -
Run checks:
dart pub publish --dry-run -
Then publish:
dart pub publish
π§Ύ Example Output (Project Tree Mode)
π Flutter Project Structure Analyzer (DevStat)
v1.3.2 Β© BXAMRA
βflutter_devstat/
β
ββββlib/ - 5 files
β
βββ|config.dart
βββ|utils/
β βββ-logger.dart
β βββ-validator.dart
βββ-main.dart
Total 5 files across 2 directories
Example
You can try out Flutter DevStat by running the example:
dart run example/example.dart
π· License
This project is licensed under the MIT License.
π€ Author
BXAMRA π§ bxamra@icloud.com π bxamra.github.io
Libraries
- flutter_devstat
- Flutter DevStat Library Provides project structure analysis utilities.