Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Let's Dart in 2026: Write Less, Do More

Avatar for Gidudu wisdom nico Gidudu wisdom nico
August 16, 2026
4

Let's Dart in 2026: Write Less, Do More

A walkthrough of three Dart features that cut boilerplate without changing what your code does: primary constructors, dot shorthands, and augmentations. Each comes with a before/after comparison and a note on where it actually matters in production Flutter code. Delivered at I/O Extended Bugiri 2026.

Avatar for Gidudu wisdom nico

Gidudu wisdom nico

August 16, 2026

Transcript

  1. I/O EXTENDED BUGIRI 2026 Let's Dart in 2026 Write Less,

    Do More — with Primary Constructors, Dot Shorthands, and Augmentations Gidudu Muyobo Nicholas Senior Flutter Engineer · Organizer, Flutter Kampala · @nicowalter256
  2. About Me NG Human Ugandan · Kampala Role Senior Flutter

    Engineer, LearningKav Community Lead Organizer, Flutter Kampala (1,100+ devs) · GDG Bugiri Lead Speaking 20+ talks across Uganda, Kenya & Nigeria since 2022 Writing freeCodeCamp contributor · gidudunicholas.dev ABOUT ME I/O EXTENDED BUGIRI 2026
  3. Expectations Three Dart features that cut boilerplate — with a

    before/after for each 01 Primary Constructors 02 Dot Shorthands 03 Augmentations Stop writing the same field list twice Drop the type name when the compiler already knows it Split one class across files without mixins or workarounds
  4. 01 Primary Constructors The Problem Most Dart classes exist just

    to hold a handful of fields — and today that means writing the field list twice: once in the class body, once again in the constructor signature. Two declarations become one. final double x; Where It Matters in Flutter Immutable widget property classes, simple state objects passed through Provider/Riverpod, and DTOs mapped from JSON. PRIMARY CONSTRUCTORS final double y; Point(this.x, this.y); I/O EXTENDED BUGIRI 2026
  5. Primary Constructors — Before & After BEFORE class Point {

    final double x; final double y; W I T H PR I M ARY CO N ST RU C TO R class Point(this.x, this.y) { final double x; final double y; } Point(this.x, this.y); } The class's shape is visible at a glance — the constructor parameter list moves up next to the declaration, the same way Kotlin and C# read primary constructors. PRIMARY CONSTRUCTORS I/O EXTENDED BUGIRI 2026
  6. 02 Dot Shorthands The Problem Dart already infers a lot

    from context — but enum-like and staticmember access still forces you to repeat the type name, even when the compiler already knows exactly which type is expected. Where It Matters in Flutter Widget build methods are dense with exactly this pattern — Alignment, TextAlign, Axis, FontWeight, custom enums repeated dozens of times per file. DOT SHORTHANDS Same idea as Swift's implicit member syntax. Colors.blue → .blue Alignment.center → .center FontWeight.bold → .bold I/O EXTENDED BUGIRI 2026
  7. Dot Shorthands — Before & After BEFORE Color textColor =

    Colors.blue; Alignment align = Alignment.center; FontWeight weight = FontWeight.bold; WITH DOT SHORTHANDS Color textColor = .blue; Alignment align = .center; FontWeight weight = .bold; When the expected type is known from context — a variable's declared type, a parameter's type, a return type — Dart lets you drop the type name and start straight from the dot. Pure noise reduction, no behavior change. DOT SHORTHANDS I/O EXTENDED BUGIRI 2026
  8. 03 Augmentations The Problem Splitting a large class across files

    today means giving up on organizing by concern, or reaching for mixins and extensions that don't really model “this is still one class.” One class. Two files. user.dart class User { ... } Where It Matters Generated code — serialization, routing, database models — can now augment a hand-written class instead of forcing “all generated” or “all hand-written.” AUGMENTATIONS + user_validation.dart augment class User { ... } I/O EXTENDED BUGIRI 2026
  9. Augmentations — Before & After BEFORE (mixin workaround) WITH AUGMENTATIONS

    // user.dart class User with UserValidation { final String name; User(this.name); } // user.dart class User { final String name; User(this.name); } // user_validation.dart mixin UserValidation { bool get isValid => ...; } // user_validation.dart augment class User { bool get isValid => ...; } AUGMENTATIONS I/O EXTENDED BUGIRI 2026
  10. Takeaway None of these three features change what Dart can

    do — they change how much code it takes to say the same thing. That's a small idea individually. But across a codebase of real size — multi-country apps, teams onboarding new developers, config-heavy client apps like the ones common across the Ugandan Flutter community — the cumulative reduction in boilerplate is what actually moves review time, onboarding time, and bug surface area. TAKEAWAY I/O EXTENDED BUGIRI 2026