Skip to content

Commit 1db19d5

Browse files
authored
Fix(docs): Use 'prop drilling' terminology and add glossary entry (fixes #12828) (#12862)
Resolves #12828 by updating 'state-management.md' to explicitly use the term 'prop drilling' for the constructor-based data passing pattern, replacing the confusing 'dependency injection' reference in that specific context. Also adds 'Prop drilling' to the glossary.
1 parent 420f8c4 commit 1db19d5

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/content/get-started/fundamentals/state-management.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ Column(
157157

158158
Passing the shared data for your app through widget constructors
159159
makes it clear to anyone reading the code that there are shared dependencies.
160-
This is a common design pattern called _dependency injection_
161-
and many frameworks take advantage of it or provide tools to make it easier.
162-
160+
Creating a chain of widgets that only pass data down to their children
161+
is often referred to as [_prop drilling_](/resources/glossary#prop-drilling).
162+
163163
### Using InheritedWidget
164164

165165
Manually passing data down the widget tree can be verbose

src/data/glossary.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,24 @@
178178
- "performance"
179179
- "smooth rendering"
180180

181+
- term: "Prop drilling"
182+
short_description: |-
183+
The process of passing data through multiple layers of widgets
184+
through constructor parameters.
185+
long_description: |-
186+
The process of passing data through multiple layers of widgets
187+
through constructor pareameterss, usually to reach a deeper descendant.
188+
This pattern can become verbose, which is
189+
why other state management solutions
190+
(like `InheritedWidget` or `Provider`) are often used.
191+
related_links:
192+
- text: "State management: Sharing state"
193+
link: "/get-started/fundamentals/state-management#sharing-state-between-widgets"
194+
type: "doc"
195+
labels:
196+
- "state management"
197+
- "architecture"
198+
181199
- term: "Sliver"
182200
short_description: |-
183201
A customizable portion of a scrollable area.

0 commit comments

Comments
 (0)