forked from mirrors/material_3_expressive
Refactor badge handling across components to use m3e colors, remove unused _SmallDot widget, and clean up redundant code.
This commit is contained in:
parent
4940d3ce69
commit
05c489991a
6 changed files with 21 additions and 32 deletions
|
|
@ -135,7 +135,6 @@ class _NavigationRailM3EState extends State<NavigationRailM3E>
|
|||
|
||||
void _insertOverlay() {
|
||||
final overlay = Overlay.of(context, rootOverlay: true);
|
||||
if (overlay == null) return;
|
||||
_modalEntry = OverlayEntry(builder: (ctx) => _buildModalOverlay(ctx));
|
||||
overlay.insert(_modalEntry!);
|
||||
}
|
||||
|
|
@ -147,7 +146,6 @@ class _NavigationRailM3EState extends State<NavigationRailM3E>
|
|||
|
||||
void _insertCollapsedPeekOverlay() {
|
||||
final overlay = Overlay.of(context, rootOverlay: true);
|
||||
if (overlay == null) return;
|
||||
_collapsedPeekEntry =
|
||||
OverlayEntry(builder: (ctx) => _buildCollapsedPeekOverlay(ctx));
|
||||
overlay.insert(_collapsedPeekEntry!);
|
||||
|
|
|
|||
|
|
@ -65,19 +65,3 @@ class RailBadgeM3E extends StatelessWidget {
|
|||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
class _SmallDot extends StatelessWidget {
|
||||
const _SmallDot({required this.color});
|
||||
final Color color;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,11 +36,9 @@ class NavigationRailTokensAdapter {
|
|||
}
|
||||
|
||||
Color get badgeBackground =>
|
||||
_maybe(() => context.m3e.colors.error) ?? _cs.error;
|
||||
_maybe(() => context.m3e.colors.primary) ?? _cs.primary;
|
||||
Color get badgeLargeLabel =>
|
||||
_maybe(() => context.m3e.colors.onError) ?? _cs.onError;
|
||||
Color get badgeSmallDot =>
|
||||
_maybe(() => context.m3e.colors.error) ?? _cs.error;
|
||||
_maybe(() => context.m3e.colors.onPrimary) ?? _cs.onPrimary;
|
||||
|
||||
ShapeBorder get indicatorShapeFull {
|
||||
// Full corner per M3E: use the most rounded token, fallback to StadiumBorder.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue