Skip to content

shape property from ExpansionTileTheme is not use  #129785

@SirusCodes

Description

@SirusCodes

Is there an existing issue for this?

Steps to reproduce

Run the code snippet as it has 2 ExpansionTile

a. ExpansionTile 1 which takes shape from ExpansionTileTheme
b. ExpansionTile 2 where shape is passed directly

Expected results

Both the ExpansionTile on expanded should have red outline.

Actual results

ExpansionTile 1 border color is default color (should have taken shape from ExpansionTileTheme)
ExpansionTile 2 border color is red (which is correct)

Code sample

Code sample
import 'package:flutter/material.dart';

/// Flutter code sample for [ExpansionTile].

void main() => runApp(const ExpansionTileApp());

class ExpansionTileApp extends StatelessWidget {
  const ExpansionTileApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(useMaterial3: true),
      home: Scaffold(
        appBar: AppBar(title: const Text('ExpansionTile Sample')),
        body: const ExpansionTileExample(),
      ),
    );
  }
}

class ExpansionTileExample extends StatelessWidget {
  const ExpansionTileExample({super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        ExpansionTileTheme(
          data: ExpansionTileThemeData(
            shape: Border.all(color: Colors.red),
          ),
          child: const ExpansionTile(
            title: Text('ExpansionTile 1'),
            initiallyExpanded: true,
            children: <Widget>[
              ListTile(title: Text('This is tile number 1')),
            ],
          ),
        ),
        ExpansionTile(
          title: const Text('ExpansionTile 2'),
          shape: Border.all(color: Colors.red),
          initiallyExpanded: true,
          children: const <Widget>[
            ListTile(title: Text('This is tile number 2')),
          ],
        ),
      ],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration ![image](https://github.com/flutter/flutter/assets/50910066/76c06152-b284-46f0-8974-a299771e1a57)

Logs

No response

Flutter Doctor output

Ran it on dartpad.dev

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.found in release: 3.12Found to occur in 3.12frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions