Tagged articles
2 articles
Page 1 of 1
Xianyu Technology
Xianyu Technology
Aug 4, 2020 · Mobile Development

Dart Annotation Code Generation in Flutter: Concepts and Implementation

Flutter’s lack of runtime reflection forces developers to use compile‑time annotation‑based code generation, where simple const annotations trigger custom generators defined via source_gen, configured in build.yaml, and can emit code through string concatenation, Mustache templates, or the code_builder library, offering a flexible alternative to Java’s APT approach.

DARTFlutterannotation
0 likes · 10 min read
Dart Annotation Code Generation in Flutter: Concepts and Implementation
Xianyu Technology
Xianyu Technology
Dec 14, 2018 · Mobile Development

How to Build a Lightweight Flutter Router with Dart Annotations

This article explains how to replace cumbersome if‑else or manual map‑based routing in Flutter with a lightweight, annotation‑driven solution that automatically generates a page‑to‑URL mapping at compile time, using Dart's source_gen, build, and analyser packages.

Code GenerationDARTFlutter
0 likes · 10 min read
How to Build a Lightweight Flutter Router with Dart Annotations