Repository navigation
ExpansionTile InkSplash doesn't respect Shape's borderRadius #125779
Copy link
Copy link
Closed
Labels
frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
Similar issue #86603.
Other failed workaround attempts were to
- Assign
clipBehaviourtoExpansionTile - Wrapped
InkWellwithborderRadius - Wrapped
ClipRRectwithborderRadius
The only workaround that worked is to wrap ExpansionTile with Card or Material suggested in this SO thread
The core underlying problem is the ListTile under the hood, which has seen many instances of the same problem. Usually the workaround is the wrap the ListTile in an InkWell however this is not possible with ExpansionTile.
- Run the sample code.
- Tap on the ListTile to see that the InkSplash doesn't clip the shape's borderRadius
I would like to help to resolve this issue but I am not clear on the proper way to fix this. Is passing the shape property to ListTile the correct move?
Expected results
InkSplash should not exceed shape's border
Actual results
InkSplash exceeds shape's border
Code sample
Code sample
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBlue,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ClipRRect(
clipBehavior: Clip.antiAlias,
borderRadius: BorderRadius.circular(20),
child: ExpansionTile(
clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder(
side: const BorderSide(color: Colors.black, width: 3),
borderRadius: BorderRadius.circular(20),
),
collapsedShape: RoundedRectangleBorder(
side: const BorderSide(color: Colors.black, width: 3),
borderRadius: BorderRadius.circular(20),
),
title: const Text("InkSplash not respecting shape's borderRaidus"),
),
);
}
}
Screenshots or Video
Screenshots / Video demonstration
Screen.Recording.2023-05-01.at.12.07.20.PM.mov
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E261 darwin-arm64,
locale en-MY)
• Flutter version 3.7.12 on channel stable at /Users/samuel/Flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4d9e56e694 (13 days ago), 2023-04-17 21:47:46 -0400
• Engine revision 1a65d409c7
• Dart version 2.19.6
• DevTools version 2.20.1
[✓] Android toolchain - develop for Android devices (Android SDK version
33.0.2)
• Android SDK at /Users/samuel/Library/Android/sdk
• Platform android-33, build-tools 33.0.2
• Java binary at: /Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
17.0.6+0-17.0.6b802.4-9586694)
[✓] VS Code (version 1.77.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.62.0
[✓] Connected device (3 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12
(API 31) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS
13.3.1 22E261 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google
Chrome 112.0.5615.137
! Error: Samuel’s iPhone is busy: Waiting to connect and unlock the device.
Xcode will continue when Samuel’s iPhone is finished. (code -10)
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Type
Projects
- StatusShow more project fieldsDone (PR merged)
Activity
darshankawar commentedon May 2, 2023
Thanks for the report @Mayb3Nots
I think the underlying issue is related to
InkSplashand that leads me to this open issue proposing changes to it andInkRipplefeatures respectively that you can take a look and follow-up for further updates.Also check this for further reference: #20922 (comment)
TahaTesser commentedon May 2, 2023
@Mayb3Nots
Thanks for filing the issue, I can reproduce the behavior
That's right, it looks like the underlying
ListTiledoesn't know about theExpansionTileshape to clip it.You don't need to wrap any clipping widget since
ListTilealready has clipping capabilities, just pass the shapeHere I created a simpler code sample
code sample
You can see without passing the shape,
ListTiledoesn't clip.Screen.Recording.2023-05-02.at.18.25.17.mov
When passing the shape
Screen.Recording.2023-05-02.at.18.24.36.mov
TahaTesser commentedon May 2, 2023
@Mayb3Nots
Feel free to file a PR for this with the test.
[-]ExpansionTile InkSplash doesnt respect Shape's borderRadius [/-][+]ExpansionTile InkSplash doesn't respect Shape's borderRadius [/+]Mayb3Nots commentedon May 6, 2023
Hi @TahaTesser while working on this, I slowly realized that this may be a little more complicated than I thought. Because the
shapeandcollapsedShapedproperties are used for the "external" widget that surrounds theListTile, so if we just pass in theshapeproperty to theListTile, theListTilewill inherit all the properties likecolorandborderwhich is not what we want.This is fine if we dont expand it since the shape is the same as the

ListTileProblem arise when we expands it with children.

And also do we have to take into account for the collapsed and expanded state?
I am thinking maybe just of adding a dedicated
listTileShapeproperty? What do you think?Fix `shape` and `collapsedShape` isn't applied to `ExpansionTile`'s s…
github-actions commentedon Feb 5, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.