Unverified Commit 9dec4fbd authored by Rydmike's avatar Rydmike Committed by GitHub

FIX: NavigationDrawer hover/focus/pressed does not use indicatorShape (#123325)

FIX: NavigationDrawer hover/focus/pressed do not use indicatorShape
parent af6029c8
......@@ -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>(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment