Repository navigation
ExpansionTile InkSplash doesn't respect Shape's borderRadius #125779
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on May 2, 2023 Thanks for the report @Mayb3Nots
I think the underlying issue is related toInkSplashand 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)
- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on May 2, 2023 - addedframeworkflutter/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/packagesand removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter respondsin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on May 2, 2023 @Mayb3Nots
Thanks for filing the issue, I can reproduce the behaviorIs passing the
shapeproperty toListTilethe correct move?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 sinceListTilealready has clipping capabilities, just pass the shapeHere I created a simpler code sample
code sample
import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData(useMaterial3: true), home: const Example(), ); } } class Example extends StatelessWidget { const Example({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('ExpansionTile'), ), body: Center( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 20), child: ExpansionTile( backgroundColor: Colors.red, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), ), collapsedShape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), ), title: const Text('Title'), ), ), ), ); } }
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
I would like to help to resolve this issue but I am not clear on the proper way to fix this
Feel free to file a PR for this with the test.
- changed the title
[-]ExpansionTile InkSplash doesnt respect Shape's borderRadius [/-][+]ExpansionTile InkSplash doesn't respect Shape's borderRadius [/+]on May 4, 2023 I would like to help to resolve this issue but I am not clear on the proper way to fix this
Feel free to file a PR for this with the test.
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
ListTile

Problem 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?- addedteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
on Jul 8, 2023 - added a commit that references this issue
on Jan 22, 2024 - moved this from PR submitted to Done (PR merged) in Nevercode
on Jan 22, 2024 - addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Jan 22, 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.- locked as resolved and limited conversation to collaborators
on Feb 5, 2024
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone (PR merged)
Is there an existing issue for this?
Steps to reproduce
Similar issue #86603.
Other failed workaround attempts were to
clipBehaviourtoExpansionTileInkWellwithborderRadiusClipRRectwithborderRadiusThe only workaround that worked is to wrap
ExpansionTilewithCardorMaterialsuggested in this SO threadThe core underlying problem is the
ListTileunder the hood, which has seen many instances of the same problem. Usually the workaround is the wrap theListTilein anInkWellhowever this is not possible withExpansionTile.I would like to help to resolve this issue but I am not clear on the proper way to fix this. Is passing the
shapeproperty toListTilethe correct move?Expected results
InkSplash should not exceed shape's border
Actual results
InkSplash exceeds shape's border
Code sample
Code sample
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