Skip to content

shape property from ExpansionTileTheme is not use  #129785

Closed

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

Activity

  1. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Jun 30, 2023
  2. added a commit that references this issue on Jul 11, 2023
    af2e282
  3. github-actions commented on Jul 26, 2023

    @github-actions

    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 -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Jul 26, 2023
  5. added a commit that references this issue on Nov 6, 2023
    6a74250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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 onp: material_uimaterial_ui package in flutter/packagesr: 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