Skip to content

solutionsunity/flutter-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Flutter Development Documentation

License: MIT Flutter AI Agent Ready

Centralized documentation and development standards for AI-powered Flutter development. This repository provides comprehensive coding standards, guidelines, and AI assistant configurations that can be shared across multiple Flutter projects, designed primarily for AI agents with human developer support.

✨ Features

  • πŸ€– AI Agent Optimized - Pre-configured for AI assistants (Augment, Cursor, etc.)
  • πŸ“š Comprehensive Documentation - Complete Flutter coding standards and guidelines
  • πŸ”— One-Line Setup - Instant integration with any Flutter project
  • πŸ”„ Auto-Update - Keep standards current across all projects
  • 🎯 Tiered Approach - Guidelines for small, medium, and large projects
  • πŸ—οΈ Architecture Patterns - Clean Architecture, BLoC, Cubit, and more

πŸš€ Quick Setup

Step 1: One-Line Installation (Recommended)

Install in default directory: (/opt/flutter/flutter-docs)

curl -sSL https://raw.githubusercontent.com/solutionsunity/flutter-docs/main/install.sh | bash

Install in specific project directory:

# Syntax: bash -s [project_path]
curl -sSL https://raw.githubusercontent.com/solutionsunity/flutter-docs/main/install.sh | bash -s /path/to/project

What the installer does:

  • πŸ“₯ Clones/updates the flutter-docs repository to /opt/flutter/flutter-docs (standardized location)
  • πŸ”— Creates symlinks to documentation and AI configuration
  • πŸ“ Updates .gitignore with proper root-relative paths

Step 2: Link to Existing Installation

If you already have flutter-docs installed, simply create symlinks from your project:

# From your Flutter project directory
/opt/flutter/flutter-docs/link.sh

What the linker does:

  • πŸ”— Creates symlink to docs/ directory
  • πŸ”— Creates symlink to .augment/ directory
  • πŸ“ Updates .gitignore with proper root-relative paths (/docs, /.augment)
  • βœ… Validates target directory and prevents conflicts
  • πŸ”„ Detects existing symlinks and avoids duplicates

Manual Installation

If you prefer manual setup:

# 1. Clone the repository
git clone https://github.com/solutionsunity/flutter-docs.git /opt/flutter/flutter-docs

# 2. Navigate to your Flutter project
cd /path/to/your/flutter-project

# 3. Create symlinks and update .gitignore
/opt/flutter/flutter-docs/link.sh

πŸ“ Repository Structure

flutter-docs/
β”œβ”€β”€ .augment/                      # πŸ€– AI Assistant Configuration
β”‚   └── rules/                     # AI agent rules and guidelines
β”‚       β”œβ”€β”€ README.md              # Documentation index
β”‚       β”œβ”€β”€ core-principles.md     # Essential coding standards
β”‚       β”œβ”€β”€ state-management-guide.md  # Tiered state management
β”‚       β”œβ”€β”€ testing-guide.md       # Testing pyramid & best practices
β”‚       β”œβ”€β”€ security-best-practices.md # Security guidelines
β”‚       β”œβ”€β”€ package-reference.md   # Official packages
β”‚       β”œβ”€β”€ clean-architecture-guide.md # Clean Architecture
β”‚       β”œβ”€β”€ bloc-pattern-guide.md  # BLoC pattern
β”‚       β”œβ”€β”€ cubit-pattern-guide.md # Cubit pattern
β”‚       β”œβ”€β”€ supabase-integration-guide.md # Supabase
β”‚       └── dartz-functional-programming-guide.md # Functional programming
β”œβ”€β”€ docs/                          # πŸ“š Legacy documentation
β”‚   β”œβ”€β”€ legacy/                    # Archived documentation
β”‚   └── sync.sh                    # Synchronization script
β”œβ”€β”€ install.sh                     # πŸ”§ One-line installer
β”œβ”€β”€ link.sh                        # πŸ”— Symlink creation script
└── README.md                      # This file

πŸ“š Documentation Standards

Core Documentation (Start Here)

Document Description Purpose
Core Principles Essential coding standards Code quality, Dart/Flutter best practices
State Management Tiered approach setState, Provider, BLoC/Cubit
Testing Guide Testing pyramid 70% unit, 20% widget, 10% integration
Security Security best practices API keys, secure storage, authentication
Package Reference Official packages flutter_bloc, equatable, supabase, etc.

Advanced & Tech-Stack Specific Guides

Document Description Purpose
Clean Architecture Three-layer architecture Domain, Data, Presentation layers
BLoC Pattern Event-driven state management Complex state management
Cubit Pattern Simplified state management Simpler than BLoC
Supabase Integration Backend integration Auth, database, storage
Dartz FP Functional programming Either/Option types, error handling

πŸ€– AI Agent Integration

This repository is optimized for AI agents like Augment, Cursor, GitHub Copilot, and others:

For AI Agents

  • .augment/rules/ - Contains AI-specific instructions and context
  • Comprehensive docs - All standards in easily parseable markdown
  • Auto-sync - AI can run ./docs/sync.sh to get latest updates
  • Tiered approach - Guidelines scale from small to large projects

Recommended AI Workflow

  1. Session start: Run ./docs/sync.sh to ensure latest updates
  2. Before coding: Reference ./.augment/rules/README.md for guidelines
  3. During development: Follow standards in documentation
  4. State management: Use decision tree in state-management-guide.md
  5. Testing: Follow testing pyramid in testing-guide.md

πŸ”„ Staying Updated

Keep your documentation and standards current:

# From any project with symlinked docs
./docs/sync.sh

This script automatically:

  • Pulls the latest changes from this repository
  • Updates all symlinked documentation across your projects
  • Ensures you're always using the current standards

πŸ“Š Project Size Decision Matrix

Project Size Screens Developers Timeline State Management Architecture
Small 1-5 1-2 <3 months setState, ValueNotifier Component-based
Medium 5-20 2-5 3-12 months Provider Feature-first
Large 20+ 5+ 12+ months BLoC/Cubit Clean Architecture

🎯 Key Principles

Code Quality

  • βœ… Explicit type declarations (no dynamic)
  • βœ… Descriptive naming with auxiliary verbs
  • βœ… Functions under 30 lines
  • βœ… Early returns to avoid nesting

Performance

  • βœ… const constructors everywhere possible
  • βœ… ListView.builder for long lists
  • βœ… Extract widgets to reduce nesting
  • βœ… Avoid deeply nested widget trees

Testing

  • βœ… 70% unit tests (business logic)
  • βœ… 20% widget tests (UI components)
  • βœ… 10% integration tests (user flows)
  • βœ… Mock dependencies for fast, reliable tests

Security

  • βœ… CRITICAL: Never hardcode API keys or credentials
  • βœ… CRITICAL: Use flutter_dotenv for environment variables
  • βœ… Use flutter_secure_storage for sensitive data
  • βœ… Always use HTTPS
  • βœ… Validate all user input

State Management

  • βœ… CRITICAL: Use StatelessWidget for screens with Cubit/BLoC
  • βœ… Only use StatefulWidget for local UI state
  • βœ… Avoid dual state management (setState + Cubit)
  • βœ… Single source of truth for business logic

❓ FAQ

Q: I ran link.sh before initializing git. How do I get the .gitignore entries?

A: Simply run link.sh again after git init. The script detects git repositories and will create the .gitignore entries automatically.

git init
/opt/flutter/flutter-docs/link.sh

Q: Can I use this in a directory that's not a git repository?

A: Yes! The link.sh script works in any directory. It will create symlinks but skip .gitignore updates if git isn't initialized.

Q: How do I update to the latest documentation standards?

A: Run ./docs/sync.sh from any project with symlinked docs. This pulls the latest updates from the central repository.

Q: Will this interfere with my Flutter package docs/ directories?

A: No! The .gitignore uses root-relative paths (/docs) that only ignore the symlinked docs directory at your repository root.

Q: What's the difference between this and the odoo-docs repository?

A: Both follow the same pattern but contain different technology-specific guidelines. This repository is for Flutter development, while odoo-docs is for Odoo development.

πŸ’‘ Best Practices

  1. Always symlink - Don't copy files, use symlinks to stay updated
  2. Sync regularly - Run ./docs/sync.sh before starting work
  3. Follow standards - Check documentation before coding
  4. Use tiered approach - Choose patterns based on project size
  5. Test thoroughly - Follow the testing pyramid (70/20/10)

🀝 Contributing

We welcome contributions to improve these standards:

  1. Fork this repository
  2. Create a feature branch
  3. Make your improvements
  4. Submit a pull request

πŸ“„ License

MIT License - Feel free to use and adapt for your projects.


Last Updated: 2025-11-16 Version: 2.1.0 Maintained by: Flutter Development Team

About

Flutter development documentation and best practices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages