Skip to content

Button splash radius does not update when pressed #121626

@mikuhl-dev

Description

@mikuhl-dev

Steps to Reproduce

  1. Update buttons border radius when pressed.

Expected results:

Buttons splash border radius updates when pressed.

image

Actual results:

Buttons splash border radius does not update when pressed.

image

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(
      theme: ThemeData.dark(
        useMaterial3: true,
      ),
      home: Scaffold(
        body: Center(
          child: FilledButton(
            style: ButtonStyle(
              fixedSize: MaterialStateProperty.all(const Size(80, 80)),
              shape: MaterialStateProperty.resolveWith(
                (states) => RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(
                    states.contains(MaterialState.pressed) ? 20 : 50,
                  ),
                ),
              ),
            ),
            child: const Text('Button'),
            onPressed: () {},
          ),
        ),
      ),
    );
  }
}
Logs
[√] Flutter (Channel stable, 3.7.3, on Microsoft Windows [Version 10.0.22623.1325], locale en-US)
    • Flutter version 3.7.3 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9944297138 (3 weeks ago), 2023-02-08 15:46:04 -0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.1

This circular button that changes border radius when pressed is found in many of googles apps.

image

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.found in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8frameworkflutter/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 version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions