From 885f2ef9cb04cbe00805c7626e4eee3535cff054 Mon Sep 17 00:00:00 2001 From: "Shams Zakhour (ignore Sfshaza)" Date: Wed, 4 Feb 2026 14:18:16 -0800 Subject: [PATCH] Add 'Primary constructor' to glossary --- src/data/glossary.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/data/glossary.yml b/src/data/glossary.yml index 18569deb498..cd012b2bbd4 100644 --- a/src/data/glossary.yml +++ b/src/data/glossary.yml @@ -291,6 +291,26 @@ - "design" - "ui" +- term: "Primary constructor" + short_description: |- + A constructor declared as part of the type declaration. + long_description: |- + A _primary constructor_ is a concise way to declare a constructor + directly in the type declaration. + + Currently, this feature is only available for [extension types][]. + It allows you to define the underlying representation object + and bind it to a field in one step. + + [extension types]: https://dart.dev/language/extension-types + related_links: + - text: "Extension types constructors" + link: "https://dart.dev/language/extension-types#constructors" + type: "external" + labels: + - "dart" + - "language" + - term: "Prop drilling" short_description: |- The process of passing data through multiple layers of widgets