Skip to content

Conversation

@TahaTesser
Copy link
Member

fixes #106560

Code Sample
import 'package:flutter/material.dart';

const List<String> fruits = <String>['Mango', 'Apple', 'Banana', 'Strawberry'];

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key, this.dark = false, this.useMaterial3 = true});

  final bool dark;
  final bool useMaterial3;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      themeMode: dark ? ThemeMode.dark : ThemeMode.light,
      theme: ThemeData(
        useMaterial3: useMaterial3,
        brightness: Brightness.light,
        colorSchemeSeed: const Color(0xff6750a4),
      ),
      darkTheme: ThemeData(
        useMaterial3: useMaterial3,
        brightness: Brightness.dark,
        colorSchemeSeed: const Color(0xff6750a4),
      ),
      home: const DropdownFormFieldSample(),
    );
  }
}

class DropdownFormFieldSample extends StatefulWidget {
  const DropdownFormFieldSample({super.key});

  @override
  State<DropdownFormFieldSample> createState() =>
      _DropdownFormFieldSampleState();
}

class _DropdownFormFieldSampleState extends State<DropdownFormFieldSample> {
  String? _dropdownbuttonFormValue = fruits.first;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('DropdownButton Sample'),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: DropdownButtonFormField<String>(
            borderRadius: BorderRadius.circular(30),
            decoration: InputDecoration(
              border: OutlineInputBorder(
                borderRadius: BorderRadius.circular(30),
              ),
              labelText: 'Select a fruit',
            ),
            value: _dropdownbuttonFormValue,
            items: fruits
                .map<DropdownMenuItem<String>>(
                  (String value) => DropdownMenuItem<String>(
                    value: value,
                    child: Text(value),
                  ),
                )
                .toList(),
            onChanged: (String? value) =>
                setState(() => _dropdownbuttonFormValue = value),
          ),
        ),
      ),
    );
  }
}

Before

Screenshot 2022-06-27 at 14 37 39

After

Screenshot 2022-06-27 at 14 36 59

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 Jun 27, 2022
@TahaTesser TahaTesser requested a review from Piinks June 27, 2022 11:39
@TahaTesser TahaTesser changed the title Fix DropdownButton Inkwell border radius Fix DropdownButton Inkwell border radius Jun 27, 2022
@Piinks Piinks added the a: quality A truly polished experience label Jun 28, 2022
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! This LGTM!

@TahaTesser TahaTesser force-pushed the fix_dropdown_button_clip branch from a5dfd87 to e039489 Compare June 30, 2022 09:53
@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 30, 2022
@auto-submit auto-submit bot merged commit 9a3b9f6 into flutter:master Jun 30, 2022
@TahaTesser TahaTesser deleted the fix_dropdown_button_clip branch June 30, 2022 12:33
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 30, 2022
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: quality A truly polished experience autosubmit Merge PR when tree becomes green via auto submit App 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 InkWell doesn't clip when DropdownButton.borderRadius is provided

2 participants