Dart Flutter Guide .cursorrules prompt file
About .cursorrules prompt file
What you can build
Dart and Flutter Code Linter: A coding tool that provides real-time suggestions and enforces the described Dart and Flutter guidelines through a linter, ensuring developers adhere to best practices and maintain code quality.
Flutter UI Builder: An application that allows developers to visually design Flutter UI components, facilitating the automatic generation of clean code with const constructors and optimal widget structures.
Riverpod Workflow Optimizer: A plugin that configures Riverpod setup automatically and provides suggestions for state management, ensuring efficient use of providers with correct lifecycle handling.
Clean Architecture Visualizer: A tool to visualize clean architecture layers, allowing developers to map controllers, services, repositories, and other components efficiently.
Performance Optimization Toolkit: A comprehensive service that analyzes Flutter apps and provides recommendations for performance improvements based on defined guidelines, such as the use of const and optimized widget builds.
Dart Code Snippet Library: A repository of code snippets that follow the given guidelines, offering common patterns and solutions for various coding scenarios using Dart and Flutter.
Firebase Error Handling Assistant: An integration tool that helps manage errors in Firebase operations, suggesting best practices for error handling and providing template code following the outlined guidelines.
Flutter Documentation Companion: A browser extension that offers quick access to Flutter, Riverpod, and Firebase documentation alongside code editors, aiding developers in adhering to best practices in real-time.
Code Refactoring Service: An automated service that refactors existing Dart and Flutter projects to align with the provided coding guidelines, enhancing code readability, performance, and maintainability.
Testing Framework for Dart and Flutter: A dedicated testing framework or toolset for writing unit, widget, integration, and acceptance tests, facilitating the application of best practices in test naming and structure.
Benefits
- Detailed Naming Conventions: Comprehensive guidelines for naming variables, functions, classes, files, and directories to ensure consistency throughout the codebase.
- Dart and Flutter-Specific Practices: Extensive advice covering optimal design patterns, state management, UI design, error handling, and Riverpod integration within Dart and Flutter applications.
- Structured Architecture and Testing Paradigm: Emphasis on clean architecture, module organization, repository pattern, and rigorous testing conventions - unit, widget, integration, and acceptance testing.
Synopsis
Developers seeking to enhance their Dart and Flutter projects with clean code can utilize this prompt to build consistent and high-performance applications using Riverpod, Freezed, Flutter Hooks, and Firebase.
Overview of .cursorrules prompt
The .cursorrules file provides comprehensive coding guidelines for developers working with Dart and Flutter, highlighting best practices for code consistency, readability, and performance. It covers general principles like language use, code style, programming paradigms, naming conventions, file structure, and documentation. The file delves into Dart-specific directives on type declaration, nomenclature, functions, data handling, classes, and exceptions. Flutter-specific rules address UI design, widgets, state management with Riverpod, error handling, and extensions. It also offers conventions for modeling and database management, code generation processes, testing strategies, performance optimization, clean architecture principles, and various miscellaneous best practices.