🚀 Dart AI Assistant
An AI-powered coding assistant for Dart and Flutter that learns your coding patterns, predicts your next code, and helps detect errors in real time.
Dart AI Assistant brings together local learning, code predictions, ranked completions, diagnostics, security checks, and optional AI-powered tools to support your Dart and Flutter workflow.
✨ Features
🧠 Learn Your Coding Style
- Advanced Learning Engine: Learns coding patterns, preferences, and naming conventions across 20 pattern categories, including error handling, null safety, and state management.
- Learn This Pattern / Forget a Pattern: Select code and teach the extension through the lightbulb or right-click menu. User-taught patterns receive 100% confidence and are prioritized over passively learned patterns.
- Import Project for Learning: Learn from an existing project, with imports capped at 100 files and the most recently modified files prioritized.
- Repeat-import protection: Unchanged files already imported for project learning are skipped on later imports; edited files are processed again.
🔮 Predict and Complete Code
- Code Prediction: Predicts upcoming lines of code using learned patterns and coding style.
- Unified Completions: Combines snippets, widgets, predictions, and learned patterns into a single ranked list, reducing duplicate suggestions.
- 100+ Dart & Flutter snippets: Built-in snippets for common development tasks, including Uganda-specific Mobile Money patterns.
📚 Knowledge and Learning Data
- Unified Knowledge Store: Learning patterns, predictions, and extracted knowledge are persisted locally through a shared
DataStore.
- Knowledge extraction: Imported documents can be separated into code snippets and explanatory sections, with normalized duplicate sections skipped.
- Knowledge Base: Import documentation, tutorials, and notes to provide more context for suggestions.
- Learning Dashboard: Explore learned patterns and pattern categories.
- Search Patterns: Inspect the patterns recorded by the Learning Engine.
🛠️ Detect and Fix Issues
- Smart Error Detection: Runs real
dart analyze diagnostics on save, alongside fast feedback while typing.
- AI Fixes (optional): Fix all detected errors or request help with a single issue through the lightbulb menu using Ask Dart AI to fix this. Requires your own Anthropic API key.
- Applied Fix Tracking: Successfully applied Dart AI fixes and ErrorPrevention quick fixes contribute to the lifetime fix count in learning statistics.
- Code Health Reports: Clickable reports that jump to affected lines and refresh automatically on save while visible.
- Security Scanning: Checks for hardcoded secrets, sensitive data in
SharedPreferences, and other risky patterns.
- Automatic Formatting: Helps keep Dart code clean and consistently formatted.
📦 Installation
Recommended: VS Code Marketplace
- Open Visual Studio Code.
- Open the Extensions panel with
Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS).
- Search for Dart AI Assistant, or install it from the Marketplace:
Install Dart AI Assistant
You can also install it from the terminal:
code --install-extension a-i-0-studio.dart-ai-assistant
🧑💻 Build from Source
# Clone the repository
git clone https://github.com/Ben09d/dart-ai-assistant.git
cd dart-ai-assistant
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Run tests
npm test
# Package the extension
npm install -g @vscode/vsce
vsce package
Then install the generated .vsix package:
code --install-extension dart-ai-assistant-1.1.0.vsix
Or use VS Code → Extensions → ... → Install from VSIX.
🚀 Getting Started
- Open a Dart (
.dart) file in VS Code.
- Start coding. The extension learns from your coding patterns as you work.
- To learn from an existing project, open the Command Palette with
Ctrl+Shift+P / Cmd+Shift+P and run Dart AI: Import Project for Learning.
- Use
Ctrl+Shift+F / Cmd+Shift+F to run Fix All Errors.
- Select code and press
Ctrl+. / Cmd+. to open the lightbulb menu, then choose Learn This Pattern.
- Open the Command Palette and run Dart AI: View Learning Dashboard to explore learning statistics.
⌨️ Key Commands
| Command |
What it does |
Dart AI: Fix All Errors |
Fixes detected errors; AI-powered fixes require an API key |
Dart AI: Set API Key |
Saves your Anthropic API key securely |
Dart AI: Import Project for Learning |
Learns from an existing project codebase |
Dart AI: View Learning Dashboard |
Shows coding-pattern statistics and categories |
Dart AI: Search Patterns |
Inspects recorded patterns |
Dart AI: Learn This Pattern |
Teaches the selected code as a pattern |
Dart AI: Forget a Pattern |
Removes a learned pattern |
Dart AI: Show Next Line Predictions |
Displays predicted next lines |
Dart AI: Show Code Health |
Shows a clickable report for the current file |
Dart AI: Prevent Errors |
Shows a clickable report of likely problems |
Dart AI: Security Scan |
Scans for potential security issues |
Dart AI: Search Knowledge Base |
Searches imported documentation and notes |
🤖 Optional AI Features Setup
Most features work locally without an account or AI API key. AI-powered fixes, explanations, test generation, and refactoring require your own Anthropic API key. Any API usage is billed to your Anthropic account.
- Get an API key from the Anthropic Console.
- In VS Code, open the Command Palette and run Dart AI: Set API Key.
- Place your cursor on an error, press
Ctrl+. / Cmd+. and choose Ask Dart AI to fix this.
🔐 How your API key is stored
The key is stored using VS Code's encrypted secret storage, which uses the operating system's credential storage (Windows Credential Manager, macOS Keychain, or the Linux keyring). It is not stored in settings.json.
No API key? AI-powered features that require Anthropic are unavailable, but the extension's other features continue to work.
⚙️ Configuration
Example settings:
{
"dartAI.enableAutoCorrect": true,
"dartAI.enableLearning": true,
"dartAI.securityLevel": "standard",
"dartAI.autoFormat": true
}
Available settings and behavior may depend on the extension version.
🧩 Recommended companion extension
For the full Dart/Flutter development experience—including syntax highlighting, hot reload, and debugging—install the official Dart extension.
Dart AI Assistant uses the Dart SDK's dart analyze on save for real syntax diagnostics. For files outside a Dart/Flutter project (without a pubspec.yaml), syntax checking is unavailable; the extension displays a one-time message explaining why.
🔐 Privacy and Local Data
- Local-first learning: Learning data stays on your machine.
- Local storage: Persisted learning and knowledge-base data is stored in VS Code extension global storage in
data.json.
- Migration: On upgrade, existing learning state is copied and legacy knowledge-base content is extracted into sections. The old source copies are retained.
- Duplicate handling: Knowledge imports are split into code snippets and explanatory sections; matching normalized sections are not stored a second time. Project-learning imports skip unchanged files based on path and content fingerprint.
- Store import/export APIs:
DataStore.exportAll() and DataStore.importAll() support whole-store JSON snapshots. These are storage APIs; there is currently no user-facing command to export or import the entire store.
- External AI requests: Nothing is sent externally unless you configure an API key and use an AI feature.
- Data sent to Anthropic: When an AI feature is used, relevant code (for example, lines around an error) and the error message are sent to Anthropic using your key, subject to Anthropic's terms.
- API key security: Your API key is stored securely and is not written to project files.
🗺️ Roadmap
🆓 Free and Local-First — Always
- [ ] Support for more Dart frameworks
- [ ] More advanced refactoring patterns
- [ ] Performance profiling
- [ ] Dependency analysis
- [ ] Code complexity metrics
- [ ] Custom rule configuration
💎 Individual PRO — Exploratory
- [ ] Cloud-synced coding profile across devices
- [ ] Richer cross-project analytics
👥 Team — Exploratory
- [ ] Shared, curated coding rules
- [ ] Team learning capabilities
Cloud and team features are exploratory. Dart AI Assistant is intended to remain fully usable for free with its local-first features.
💬 Have ideas for a future paid tier? Tell us what would make it worthwhile.
For release details, see the CHANGELOG.
🤝 Contributing
Contributions, bug reports, and feature requests are welcome!
- Fork the repository.
- Create a branch:
git checkout -b feature/amazing-feature
- Make your changes and run the tests:
npm test
- Commit your changes.
- Push your branch and open a Pull Request.
📄 License
This project is licensed under the MIT License. See LICENSE for details.
👤 Author
Built by Ben09d, Freelance Flutter Developer.
⭐ Support the Project
If Dart AI Assistant is useful to you, consider starring the repository or leaving a review on the VS Code Marketplace.
Your feedback helps guide future improvements. 💙