Skip to content

The definitive reference architecture for Mission-Critical Flutter. Enforces forensic-grade standards, strict Clean Architecture, and zero-tolerance error policies for high-stakes enterprise applications. Download The CLI

License

Notifications You must be signed in to change notification settings

LosPhilly/mission-critical-flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mission-Critical Flutter: FlightApp Reference Implementation

Mission Critical Flutter Banner

A High-Integrity Flutter application built with rigor, reliability, and strict engineering standards derived from the Joint Strike Fighter (JSF) C++ Coding Standards.


πŸ“– Overview

This repository serves as the official reference implementation for the Mission-Critical Flutter (MCF) methodology.
It demonstrates how to build safety‑critical mobile applications where failure is not an option.

Standard Flutter encourages rapid prototyping β€” but speed introduces risk.
Mission‑critical systems demand something else:

  • Deterministic behavior
  • Architectural isolation
  • Total type safety
  • Predictable state flow

MCF enforces a strict Dart subset to eliminate entire classes of runtime errors such as:

  • TypeError
  • NullPointer
  • Race conditions
  • Illegal layer access
  • Uncaught UI states

Core Philosophy

  1. Architecture: Strict separation of Presentation, Domain, and Data Layers.
  2. Safety: Zero tolerance for dynamic, implicit casts, or unsafely nullable logic.
  3. State: Immutable, exhaustive, unidirectional state machines.
  4. Verification: 100% business logic test coverage + Golden tests for UI stability.

πŸ— Architecture

This project follows a Clean Architecture pattern with a strict Composition Root, ensuring that dependencies only flow downward.


The Composition Root

main.dart is the single entry point that assembles the complete dependency graph.

Composition Root Diagram


Dependency Flow (Rule 2.2)

The Domain layer is completely pure:
❌ No Flutter
❌ No JSON
❌ No HTTP
❌ No UI imports

Dependency Flow Diagram

lib/
β”œβ”€β”€ domain/            # PURE LOGIC (Rules, Entities, Failures, Interfaces)
β”‚   β”œβ”€β”€ entities/
β”‚   β”œβ”€β”€ failures/
β”‚   └── repositories/  # Abstract Contracts Only
β”‚
β”œβ”€β”€ data/              # INFRASTRUCTURE (Serialization, Networking)
β”‚   β”œβ”€β”€ models/        # DTOs -> Entities
β”‚   └── repositories/  # Concrete Implementations
β”‚
β”œβ”€β”€ presentation/      # UI + State (Flutter Only)
β”‚   β”œβ”€β”€ cubit/         # Logic Containers (Enforce Rule 5.1)
β”‚   └── screens/       # Stateless Widgets
β”‚
└── main.dart          # COMPOSITION ROOT

πŸ”„ State Management (MCF Rule 5.1)

State must always flow downward.
UI elements never mutate state directly.

Unidirectional Data Flow

  • UI dispatches an event/intent
  • Cubit processes the event using Domain logic
  • Cubit emits a new immutable state
  • UI rebuilds based on that state

No shortcuts. No mutable leaks. Zero ambiguity.


πŸ› οΈ The MCF CLI (Strongly Recommended)

To avoid human error and enforce strict compliance, use the official MCF CLI:

Pub.dev: https://pub.dev/packages/mcf_cli
Repository: https://github.com/LosPhilly/mcf_cli

Installation

dart pub global activate mcf_cli

Generate a fully compliant feature:

mcf create feature user_profile

This creates:

  • Domain entity + repository contract
  • Data DTO + repository implementation
  • Presentation Cubit + State + UI scaffold
  • Strict imports + analysis rules

πŸ›‘οΈ MCF Compliance Checklist

Rule Description Status
MCF 2.2 Strict Layer Isolation βœ”οΈ Enforced
MCF 3.1 Strict Analysis (no implicit casts/inference) βœ”οΈ Enforced
MCF 3.4 No bang operator ! allowed βœ”οΈ Zero tolerated
MCF 4.1 Stateless Widgets by default βœ”οΈ Required
MCF 5.1 Unidirectional State Flow βœ”οΈ Mandatory
MCF 6.5 Heavy JSON parsing offloaded to isolates βœ”οΈ compute() used
MCF 6.6 Async reentrancy guards βœ”οΈ Implemented
MCF 7.5 Golden tests for critical UI βœ”οΈ Included

πŸš€ Getting Started

Prerequisites

  • Flutter SDK 3.10.0+
  • Dart SDK 3.0.0+ (sealed classes support)

Installation

Clone the repository:

git clone https://github.com/LosPhilly/mission-critical-flutter
cd flightapp

Install dependencies:

flutter pub get

Run:

flutter run

πŸ§ͺ Verification & Testing

This project uses the Mission-Critical Test Pyramid:


1. Unit Tests (Business Logic)

100% branch coverage for Cubits + Domain logic.

flutter test test/presentation/cubit/user_cubit_test.dart

2. Widget Tests (UI Behavior)

Ensures correct wiring between state and UI.

flutter test test/presentation/screens/profile_screen_test.dart

3. Golden Tests (Visual Regression)

Ensures pixel-perfect UI rendering over time.

Run:

flutter test test/presentation/screens/profile_screen_golden_test.dart

Regenerate after intentional UI changes:

flutter test --update-goldens

πŸ”§ Technical Stack

Component Technology
Framework Flutter
Language Dart (Strict Mode)
State Management flutter_bloc
Equality equatable
Networking http
Testing mocktail β€’ bloc_test
Linting very_good_analysis (MCF‑customized)

πŸ“„ License

Licensed under the MIT License.
See the LICENSE file for full details.

"The difference between a prototype and a product is not features; it is predictability."


✍️ Citation

If you reference this architecture or implementation:

Phillips, Carlos. (2025). Mission-Critical Flutter: Building High-Integrity Applications.

About

The definitive reference architecture for Mission-Critical Flutter. Enforces forensic-grade standards, strict Clean Architecture, and zero-tolerance error policies for high-stakes enterprise applications. Download The CLI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published