Skip to content
Back to skills

Rules Dart

ASecurity

ANVIL coding rules for dart code (**/*.dart, **/*_test.dart, test/**/*.dart, integration_test/**/*.dart): Dart, Dart / Flutter Testing.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmenttesting

Works with

  • cli

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill rules-dart --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rules Dart?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rules Dart
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-rules-dart/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-rules-dart)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rules-dart
description: "ANVIL coding rules for dart code (**/*.dart, **/*_test.dart, test/**/*.dart, integration_test/**/*.dart): Dart, Dart / Flutter Testing."
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# ANVIL rules: dart

Follow these rules for dart code (**/*.dart, **/*_test.dart, test/**/*.dart, integration_test/**/*.dart).

## Dart

# Dart
- Sound null safety: avoid `!`; handle null explicitly.
- `const` constructors for widgets where possible; keep `build()` pure and cheap.
- Check `context.mounted` after `await` before using a `BuildContext`.
- Dispose controllers, streams and subscriptions.

## Dart / Flutter Testing

# Dart / Flutter Testing

- Group unit tests by component and use `testWidgets` with `tester.pumpAndSettle()` / bounded `pump(duration)` rather than real timers.
- Inject fake repositories, HTTP clients, and clocks cleanly instead of relying on network calls or platform plugins in unit tests.
- Find widgets via semantics (`find.bySemanticsLabel`), keys, or localized text safely rather than fragile tree depth assumptions.
- Dispose controllers and verify error, empty, loading, and success states in async notifiers/BLoCs.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.