Skip to content

DropdownButton doesn't animate newly selected value #4378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Hixie opened this issue Jun 4, 2016 · 6 comments
Closed

DropdownButton doesn't animate newly selected value #4378

Hixie opened this issue Jun 4, 2016 · 6 comments
Labels
a: quality A truly polished experience f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project

Comments

@Hixie
Copy link
Contributor

Hixie commented Jun 4, 2016

Consider:
https://material-design.storage.googleapis.com/publish/material_v_8/material_ext_publish/0B3321sZLoP_HTS1LdnhrTl9TRzg/components-buttons-otherbuttons-060203_MobileDropdowns_xhdpi_006.webm

When you pick something that isn't the current entry, we should apparently animate the text up a little.

@Hixie Hixie added ⚠ bug f: material design flutter/packages/flutter/material repository. customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. labels Jun 4, 2016
@Hixie Hixie added this to the Flutter 1.0 milestone Jun 4, 2016
@abarth
Copy link
Contributor

abarth commented Jun 4, 2016

Yeah, I'm not sure if that's a bug in the video or fit that's actually desired. We should follow up with the designers to see what they intended. /cc @sethladd

@sethladd
Copy link
Contributor

sethladd commented Jun 6, 2016

I've reached out to the material team for confirmation. Thanks for noticing this behavior!

@sethladd
Copy link
Contributor

sethladd commented Jun 7, 2016

The material team responded: "It's a nice to have for the menu, but it's not a high priority."

I think we can punt on this one for our v1 of material.

Thanks for opening the issue to double check. If we decide to implement this, we can reopen.

@sethladd sethladd closed this as completed Jun 7, 2016
@Hixie Hixie reopened this Jun 8, 2016
@Hixie
Copy link
Contributor Author

Hixie commented Jun 8, 2016

Let's keep it open, this would be easy to do and if it's nice to have we should have it. :-)
Doesn't have to block gallery launch though.

@abarth abarth modified the milestones: Flutter 2.0 or later, Flutter 1.0 Jun 9, 2016
@Hixie Hixie added the framework flutter/packages/flutter repository. See also f: labels. label Sep 12, 2016
@Hixie Hixie added the a: quality A truly polished experience label Jan 10, 2018
cdotstout pushed a commit to cdotstout/flutter that referenced this issue Apr 3, 2018
@csells csells changed the title Drop-down button doesn't animate newly selected value Drop-down button doesn't animate newly selected value Jan 13, 2020
@TahaTesser TahaTesser changed the title Drop-down button doesn't animate newly selected value DropdownButton doesn't animate newly selected value May 21, 2020
@TahaTesser
Copy link
Member

TahaTesser commented May 21, 2020

This issue still exist
Dropdown item doesn't seem to animate like in the video

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Material App Bar'),
      ),
      body: Center(
        child: DropdownList(),
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () {},
      ),
    );
  }
}

class DropdownList extends StatefulWidget {
  @override
  _DropdownListState createState() => _DropdownListState();
}

class _DropdownListState extends State<DropdownList> {
  String dropdownValue = 'One';

  @override
  Widget build(BuildContext context) {
    return DropdownButton<String>(
      value: dropdownValue,
      icon: Icon(Icons.arrow_downward),
      iconSize: 24,
      elevation: 16,
      style: TextStyle(color: Colors.deepPurple),
      underline: Container(
        height: 2,
        color: Colors.deepPurpleAccent,
      ),
      onChanged: (String newValue) {
        setState(() {
          dropdownValue = newValue;
        });
      },
      items: <String>['One', 'Two', 'Free', 'Four']
          .map<DropdownMenuItem<String>>((String value) {
        return DropdownMenuItem<String>(
          value: value,
          child: Text(value),
        );
      }).toList(),
    );
  }
}
 
flutter doctor -v
[✓] Flutter (Channel dev, 1.19.0-1.0.pre, on Mac OS X 10.15.4 19E287, locale
    en-GB)
    • Flutter version 1.19.0-1.0.pre at /Users/tahatesser/Code/flutter_dev
    • Framework revision 456d80b9dd (10 days ago), 2020-05-11 11:45:03 -0400
    • Engine revision d96f962ca2
    • Dart version 2.9.0 (build 2.9.0-7.0.dev 092ed38a87)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/tahatesser/Code/SDK
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.8052
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.45.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.10.2

[✓] Connected device (7 available)
    • SM M305F                  • 32003c30dc19668f                     •
      android-arm64  • Android 10 (API 29)
    • Android SDK built for x86 • emulator-5554                        •
      android-x86    • Android 10 (API 29) (emulator)
    • Taha’s iPhone             • 00008020-001059882212002E            • ios
      • iOS 13.5
    • iPhone 11                 • F067D2F5-5386-4EBE-8600-326B40C64462 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
    • macOS                     • macOS                                •
      darwin-x64     • Mac OS X 10.15.4 19E287
    • Web Server                • web-server                           •
      web-javascript • Flutter Tools
    • Chrome                    • chrome                               •
      web-javascript • Google Chrome 81.0.4044.138

• No issues found!

removing gallery label since it's not related to gallery and reproducible from code sample

@TahaTesser TahaTesser added passed first triage and removed customer: gallery Relating to flutter/gallery repository. Please transfer non-framework issues there. labels May 21, 2020
@kf6gpe kf6gpe added the P6 label May 29, 2020
@kf6gpe kf6gpe removed this from the Future milestone Jun 1, 2020
@Hixie Hixie closed this as completed Mar 15, 2023
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2023
@flutter-triage-bot flutter-triage-bot bot added P3 Issues that are less important to the Flutter project and removed P6 labels Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: quality A truly polished experience f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project
Projects
None yet
Development

No branches or pull requests

5 participants