Skip to content

ExpansionTile InkSplash doesn't respect Shape's borderRadius  #125779

@Mayb3Nots

Description

@Mayb3Nots

Is there an existing issue for this?

Steps to reproduce

Similar issue #86603.

Other failed workaround attempts were to

  • Assign clipBehaviour to ExpansionTile
  • Wrapped InkWell with borderRadius
  • Wrapped ClipRRect with borderRadius

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.

  1. Run the sample code.
  2. 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!

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions