Skip to content

Commit 8f7b664

Browse files
committed
doc: deploy PR #771 preview
1 parent 23b5674 commit 8f7b664

1 file changed

Lines changed: 28 additions & 30 deletions

File tree

docs/prPreview/771/components_navigation_ouds_navigation_bar_item/OudsNavigationBarItem/toNavigationDestination.html

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ <h1><span class="kind-method">toNavigationDestination</span> method
6969
<p>This is intended to be used by <a href="../../components_navigation_ouds_navigation_bar/OudsNavigationBar-class.html">OudsNavigationBar</a> on Android with Material.
7070
Internally, <a href="../../components_navigation_ouds_navigation_bar/OudsNavigationBar-class.html">OudsNavigationBar</a> is backed by the Material 3 <a href="https://api.flutter.dev/flutter/material/NavigationBar-class.html">NavigationBar</a>
7171
and <a href="https://api.flutter.dev/flutter/material/NavigationDestination-class.html">NavigationDestination</a> widgets.</p>
72+
<p>The indicator is automatically managed by <a href="https://api.flutter.dev/flutter/material/NavigationBar-class.html">NavigationBar</a> when the item is selected.
73+
Text scaling constraints (maxScaleFactor: 1.08 = 108%) are applied at the bar level
74+
by the parent <a href="../../components_navigation_ouds_navigation_bar/OudsNavigationBar-class.html">OudsNavigationBar</a> to prevent item overflow at high zoom.</p>
7275
<ul>
7376
<li><code>context</code> is used to access theme tokens and layout values.</li>
7477
<li><code>controlState</code> drives icon/top-indicator colors according to the current
@@ -87,42 +90,37 @@ <h2><span>Implementation</span></h2>
8790
required bool isSelected,
8891
}) {
8992
final modifier = OudsNavigationBarStatusModifier(context);
90-
final bar = OudsTheme.of(context).componentsTokens(context).bar;
9193

92-
&#47;&#47; Build composite label that includes badge information
94+
&#47;&#47; Build composite label that includes badge information for accessibility.
95+
&#47;&#47; The label and badge description are combined into a single string so that
96+
&#47;&#47; accessibility tools announce both pieces of information in the correct order.
9397
String destinationLabel = label;
9498
if (badge != null) {
9599
destinationLabel = &#39;$label, ${badge!.contentDescription}&#39;;
96100
}
97101

98-
return Column(
99-
mainAxisSize: MainAxisSize.min,
100-
children: [
101-
_buildTopIndicatorBar(context, bar, isSelected, controlState),
102-
const SizedBox(height: 2),
103-
&#47;&#47; The text scaling constraints (maxScaleFactor: 1.08 = 108%) are applied at the bar level
104-
&#47;&#47; by the parent OudsNavigationBar to prevent item overflow at high zoom, ensuring the 26px icon
105-
&#47;&#47; stays at 28.08px at maximum zoom and fits within the navigation bar.
106-
NavigationDestination(
107-
label: destinationLabel,
108-
icon: _buildBadgeIconNavigationDestination(
109-
context,
110-
icon,
111-
modifier,
112-
controlState,
113-
badge,
114-
isSelected: isSelected,
115-
),
116-
selectedIcon: _buildBadgeIconNavigationDestination(
117-
context,
118-
icon,
119-
modifier,
120-
controlState,
121-
badge,
122-
isSelected: isSelected,
123-
),
124-
),
125-
],
102+
&#47;&#47; Return NavigationDestination directly without Column wrapper.
103+
&#47;&#47; The indicator is automatically managed by NavigationBar for selected items.
104+
&#47;&#47; Navigation bar applies text scaling constraints at the bar level (maxScaleFactor: 1.08 = 108%)
105+
&#47;&#47; to prevent item overflow at high zoom and ensure the 26px icon stays at 28.08px maximum.
106+
return NavigationDestination(
107+
label: destinationLabel,
108+
icon: _buildBadgeIconNavigationDestination(
109+
context,
110+
icon,
111+
modifier,
112+
controlState,
113+
badge,
114+
isSelected: isSelected,
115+
),
116+
selectedIcon: _buildBadgeIconNavigationDestination(
117+
context,
118+
icon,
119+
modifier,
120+
controlState,
121+
badge,
122+
isSelected: isSelected,
123+
),
126124
);
127125
}</code></pre>
128126
</section>

0 commit comments

Comments
 (0)