mirror of
https://github.com/flutter/flutter
synced 2024-08-27 12:00:58 +00:00
FIX: NavigationDrawer hover/focus/pressed does not use indicatorShape (#123325)
FIX: NavigationDrawer hover/focus/pressed do not use indicatorShape
This commit is contained in:
parent
af6029c8fe
commit
9dec4fbd1e
|
@ -328,7 +328,7 @@ class _NavigationDestinationBuilder extends StatelessWidget {
|
|||
child: InkWell(
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: info.onTap,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(28.0)),
|
||||
customBorder: info.indicatorShape ?? navigationDrawerTheme.indicatorShape ?? defaults.indicatorShape!,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
|
|
|
@ -349,12 +349,16 @@ void main() {
|
|||
// Test default indicator color and shape.
|
||||
expect(_getIndicatorDecoration(tester)?.color, theme.colorScheme.secondaryContainer);
|
||||
expect(_getIndicatorDecoration(tester)?.shape, const StadiumBorder());
|
||||
// Test that InkWell for hover, focus and pressed use default shape.
|
||||
expect(_getInkWell(tester)?.customBorder, const StadiumBorder());
|
||||
|
||||
await tester.pumpWidget(buildNavigationDrawer(indicatorColor: color, indicatorShape: shape));
|
||||
|
||||
// Test custom indicator color and shape.
|
||||
expect(_getIndicatorDecoration(tester)?.color, color);
|
||||
expect(_getIndicatorDecoration(tester)?.shape, shape);
|
||||
// Test that InkWell for hover, focus and pressed use custom shape.
|
||||
expect(_getInkWell(tester)?.customBorder, shape);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -376,6 +380,13 @@ Material _getMaterial(WidgetTester tester) {
|
|||
);
|
||||
}
|
||||
|
||||
InkWell? _getInkWell(WidgetTester tester) {
|
||||
return tester.firstWidget<InkWell>(
|
||||
find.descendant(
|
||||
of: find.byType(NavigationDrawer), matching: find.byType(InkWell)),
|
||||
);
|
||||
}
|
||||
|
||||
ShapeDecoration? _getIndicatorDecoration(WidgetTester tester) {
|
||||
return tester
|
||||
.firstWidget<Container>(
|
||||
|
|
Loading…
Reference in a new issue