Skip to content

FooButton tests wrap the FooButton with Material even though they use it internally #96804

@werainkhatri

Description

@werainkhatri

FooButton (ElevatedButton, TextButton, ButtonStyleButton, etc) use the Material widget internally, but in their respective tests are wrapped with Material again. AFAIK they can be removed.

Example:

await tester.pumpWidget(
Material(
child: Directionality(
textDirection: TextDirection.ltr,
child: SizedBox(
width: 100,
height: 100,
child: ElevatedButton(
autofocus: true,
onPressed: () {},
onLongPress: () {},
onHover: (bool value) { hovering = value; },
focusNode: focusNode,
child: SizedBox(key: childKey),
),
),
),
),
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions