Skip to content

Conversation

@TahaTesser
Copy link
Member

@TahaTesser TahaTesser commented May 3, 2022

fixes #102914

minimal code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        brightness: Brightness.light,
      ),
      home: const Home(),
    );
  }
}

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);

  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  int _value = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.blue,

      body: Padding(
        padding: const EdgeInsets.symmetric(
          vertical: 8.0,
          horizontal: 16.0,
        ),
        child: MyDropdown(
          value: _value,
          onChanged: (value) {
            if (value != null && value != _value) {
              setState(() {
                _value = value;
              });
            }
          },
        ),
      ),
    );
  }
}

class MyDropdown extends StatelessWidget {
  const MyDropdown({
    Key? key,
    required this.value,
    required this.onChanged,
  }) : super(key: key);

  final int value;
  final ValueChanged<int?> onChanged;

  @override
  Widget build(BuildContext context) {
    return DropdownButton<int>(
      isExpanded: true,
      onChanged: onChanged,
      value: value,
      borderRadius: const BorderRadius.all(
        Radius.circular(32.0),
      ),
      dropdownColor: Colors.red[700],
      items: [
        for (int i = 0; i < 100; i++)
          DropdownMenuItem(
            value: i,
            child: Text(
              i.toString(),
            ),
          ),
      ],
    );
  }
}

Bug

bug

Fixed

fixed

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels May 3, 2022
@TahaTesser TahaTesser requested a review from Piinks May 3, 2022 09:35
Copy link
Contributor

@Piinks Piinks 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! Thank you! LGTM

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • This commit is not mergeable and has conflicts. Please rebase your PR and fix all the conflicts.

@TahaTesser TahaTesser force-pushed the fix_dropdown_menu_clip branch from 6666e3b to 5d3184e Compare May 7, 2022 07:35
@fluttergithubbot fluttergithubbot merged commit 2f65753 into flutter:master May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2022
@TahaTesser TahaTesser deleted the fix_dropdown_menu_clip branch May 7, 2022 09:58
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
ditman added a commit to ditman/flutter-packages that referenced this pull request May 9, 2022
Roll Flutter from b305eb6 to 4c57320 (33 revisions)

flutter/flutter@b305eb6...4c57320

2022-05-09 [email protected] Roll Flutter Engine from 71b9adccfb63 to 6248a5a9ae28 (1 revision) (flutter/flutter#103350)
2022-05-09 [email protected] Roll Flutter Engine from 3af7fb24d4dd to 71b9adccfb63 (1 revision) (flutter/flutter#103347)
2022-05-09 [email protected] [flutter_tools] stringArg refactor (flutter/flutter#103231)
2022-05-09 [email protected] Replace ListView with ListView.builder for LicensesPage (flutter/flutter#102692)
2022-05-09 [email protected] Adds `menuBarMenuLabel`, and removes unneeded key localizations (flutter/flutter#102100)
2022-05-09 [email protected] Roll Plugins from 49b06b3 to c5c319a (15 revisions) (flutter/flutter#103345)
2022-05-09 [email protected] Roll Engine from e7c44a582c58 to 3af7fb24d4dd (1 revision) (flutter/flutter#103334)
2022-05-09 [email protected] Roll Engine from c02712fe1160 to e7c44a582c58 (1 revision) (flutter/flutter#103333)
2022-05-09 [email protected] Roll Engine from 6efd8f00dcc6 to c02712fe1160 (1 revision) (flutter/flutter#103327)
2022-05-09 [email protected] `CupertinoTabScaffold`/`CupertinoTabController`: Add interactive examples (flutter/flutter#103196)
2022-05-09 [email protected] Roll Engine from c930e64a13bc to 6efd8f00dcc6 (1 revision) (flutter/flutter#103323)
2022-05-08 [email protected] Roll Engine from d0e6e14d27cc to c930e64a13bc (2 revisions) (flutter/flutter#103308)
2022-05-08 [email protected] Roll Engine from fffb3eb58e7d to d0e6e14d27cc (1 revision) (flutter/flutter#103307)
2022-05-08 [email protected] Use consistent date instead of DateTime.now() in evaluation tests (flutter/flutter#103269)
2022-05-08 [email protected] Roll Engine from 259ccadd8203 to fffb3eb58e7d (1 revision) (flutter/flutter#103298)
2022-05-08 [email protected] Roll Engine from 0b84783081a7 to 259ccadd8203 (1 revision) (flutter/flutter#103293)
2022-05-08 [email protected] Roll Engine from 19d5f037f221 to 0b84783081a7 (1 revision) (flutter/flutter#103291)
2022-05-08 [email protected] Roll Engine from 2d1f34cbdde2 to 19d5f037f221 (1 revision) (flutter/flutter#103289)
2022-05-08 [email protected] Roll Engine from b89e093d887f to 2d1f34cbdde2 (1 revision) (flutter/flutter#103287)
2022-05-08 [email protected] Roll Engine from aa80520b7fc9 to b89e093d887f (1 revision) (flutter/flutter#103286)
2022-05-08 [email protected] Roll Engine from 4c05cb763866 to aa80520b7fc9 (1 revision) (flutter/flutter#103283)
2022-05-07 [email protected] Roll Engine from 235d951ccfbd to 4c05cb763866 (1 revision) (flutter/flutter#103279)
2022-05-07 [email protected] Roll Engine from 24466845e7a9 to 235d951ccfbd (4 revisions) (flutter/flutter#103276)
2022-05-07 [email protected] Roll Engine from 2d2f8629cdb2 to 24466845e7a9 (1 revision) (flutter/flutter#103274)
2022-05-07 [email protected] Roll Engine from 4a358030cb07 to 2d2f8629cdb2 (1 revision) (flutter/flutter#103273)
2022-05-07 [email protected] [flutter_tools] add --uninstall-first flag and pipe it through to ios-deploy (flutter/flutter#102948)
2022-05-07 [email protected] Fix a `_WrappedScrollBehavior.shouldNotify` bug (flutter/flutter#103267)
2022-05-07 [email protected] Remove custom `unawaited`, prefer `dart:async` version (flutter/flutter#103212)
2022-05-07 [email protected] Added clipBehavior on TabBarView (flutter/flutter#103166)
2022-05-07 [email protected] Fix empty Stack with infinite constraints throws (flutter/flutter#102642)
2022-05-07 [email protected] Updating the Slider Widget to allow up and down arrow keys to navigate out of the slider when in directional NavigationMode. (flutter/flutter#103149)
2022-05-07 [email protected] Fix `DropdownButton` menu clip (flutter/flutter#102970)
2022-05-07 [email protected] Roll Engine from 094cb30943a5 to 4a358030cb07 (1 revision) (flutter/flutter#103260)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
Piinks added a commit that referenced this pull request May 19, 2022
shrinkWrap: true,
children: children,
child: ClipRRect(
borderRadius: widget.borderRadius ?? BorderRadius.zero,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is being reverted, it may be that we only want to apply this clip when the border radius is provided by the user. Otherwise the clipBehavior can be Clip.none.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you!

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.

DropdownButton scrollbar is not clipped within the menu border radius

3 participants