Skip to content

Instantly share code, notes, and snippets.

Flutter Project Rules (.mdc)

0) Scope

These rules govern architecture, code style, and file layout for this Flutter repo. They are enforceable guidelines for PR review and AI-assisted edits in Cursor.


1) Architecture & Folder Structure (Feature-first, Clean-ish)

Goal: Separate concerns by feature, keep UI and data apart, and share only stable cross-cutting utilities.

# PRD and Task Generation Rules
## Triggers
- `/prd [feature-name]` - Creates PRD document
- `/create-to-dos [feature-name]` - Creates implementation to-dos breakdown document
- `/process-to-do [feature-name] [phase]` - Process specific to-dos from a feature
- `/wrap-to-do [feature-name]` - Create implementation notes for completed work
## Goals
- **PRD**: Guide the AI assistant in creating detailed Product Requirements Documents (PRDs) in Markdown format based on user prompts. PRDs should be clear, actionable, and suitable for junior developers to understand and implement.
@callmephil
callmephil / velocity_rendering.dart
Created May 12, 2025 17:49
velocity rendering sliver flutter
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'dart:async';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:signals/signals_flutter.dart';
import 'package:signals_hooks/signals_hooks.dart';
import 'package:sqlite3/common.dart';
import 'package:sqlite3/sqlite3.dart';
const _memoryPath = ':memory:';
CommonDatabase useDatabase({
String path = _memoryPath,
String? vfs,

This step by step guide uses issue RegEx: add a way to get the positions of groups #42307 as a concrete example. You can also watch associated videos:

Step 0: Ask the team

Ask Dart team before jumping into the implementation. The best place to ask is on the issue tracker, you can also try hackers-dart channel on Flutter Discord or one of the channels on Dart Community discord - but most SDK developers are not on either of them.

Why ask the team?

@eliasvelazquezdev
eliasvelazquezdev / docker-ecr-build.sh
Last active November 27, 2024 21:29
Shell script that automates the process of ECR login, Docker image building and pushing to an ECR repo
#!/bin/bash
# Function to validate input is not empty
validate_input() {
local input=$1
local field_name=$2
if [ -z "$input" ]; then
echo "Error: $field_name cannot be empty"
exit 1
fi
@bizz84
bizz84 / update-android-project.sh
Last active October 23, 2025 02:26
Script to update Gradle, Java and other Android project settings in a Flutter project
#!/bin/bash
# Update Gradle, Java and other Android project settings in a Flutter project
# Works with both .gradle and .gradle.kts build files
# See: https://gradle.org/releases/
# See: https://developer.android.com/build/releases/gradle-plugin#compatibility
DESIRED_GRADLE_VERSION="8.11.1"
# Build errors often show the required Java version
DESIRED_JAVA_VERSION="17"
# See: https://developer.android.com/ndk/downloads
@g-apparence
g-apparence / pendulum.dart
Last active October 30, 2024 15:10
Create a basic pendulum with flutter
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math.dart' as v;
import 'model.dart';
void main() {
runApp(const MyApp());
@rodydavis
rodydavis / builder.dart
Last active October 6, 2024 13:32
SQLite3 Sync UI
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:sqlite3/common.dart';
import '../src/database/types.dart';
class SqlBuilder extends StatefulWidget {
const SqlBuilder({
super.key,