Skip to content

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Mar 27, 2023

Description

This PR makes splashes and highlights customBorder propertie updatable.

Video captures using the following 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(100, 100)),
              shape: MaterialStateProperty.resolveWith(
                (states) => RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(
                    states.contains(MaterialState.pressed) ? 20 : 50,
                  ),
                ),
              ),
            ),
            child: const Text('Button'),
            onPressed: () {},
          ),
        ),
      ),
    );
  }
}

Before (Button's splash is drawn according to the initial border)

Enregistrement.de.l.ecran.2023-03-27.a.16.16.44.mov

After (Button's splash is updated according to the new border)

Enregistrement.de.l.ecran.2023-03-27.a.17.20.06.mov

Related Issue

Fixes #121626

Tests

Adds 1 test.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Mar 27, 2023
@bleroux bleroux requested a review from HansMuller March 27, 2023 15:23
@bleroux
Copy link
Contributor Author

bleroux commented Mar 27, 2023

@HansMuller
If this PR is ok, I will try to file one or more PRs to make some of the other InteractiveInkFeature fields updatable.

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce fix. LGTM

@HansMuller HansMuller merged commit 94f8772 into flutter:master Mar 27, 2023
@bleroux bleroux deleted the fix_button_splash_radius_does_not_update_when_pressed branch March 27, 2023 20:54
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Button splash radius does not update when pressed

2 participants