flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
164.99k stars 27.19k forks source link

CupertinoPicker example does not select initial value when dismissed #110732

Closed stevethehu closed 1 year ago

stevethehu commented 2 years ago

Steps to reproduce:

  1. go to https://api.flutter.dev/flutter/cupertino/CupertinoPicker-class.html
  2. open the picker in the dartpad and select a value other than Apple, e.g. Orange
  3. dismiss the picker and observe that the button has updated to the selected value
  4. open the picker again and observe that the initially selected value is Apple
  5. dismiss the picker and observe that the button does not update to Apple

Expected behavior: the button should be updated to the selected value when the picker is dismissed

darshankawar commented 2 years ago

Thanks for the report. Using steps to replicate and code from the link, I see same behavior, ie, when we select another value and then dismiss the picker, opening it again shows the default value of Apple, wherein, per OP, the expected value to be shown should be the selected value. Also, the default value highlighted, ie, Apple and when we dismiss the picker, Apple is not reflected, whereas, we have to scroll down and select Apple to see the updated value.

https://user-images.githubusercontent.com/67046386/187867674-758214d2-6345-46aa-b2a2-a702dde6c7d9.mov

stable, master flutter doctor -v ``` [✓] Flutter (Channel stable, 3.3.0, on macOS 12.2.1 21D62 darwin-x64, locale en-GB) • Flutter version 3.3.0 on channel stable at /Users/dhs/documents/fluttersdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ffccd96b62 (29 hours ago), 2022-08-29 17:28:57 -0700 • Engine revision 5e9e0e0aa8 • Dart version 2.18.0 • DevTools version 2.15.0 [!] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Applications/Xcode.app/Contents/Developer ! Flutter recommends a minimum Xcode version of 13. Download the latest version or update via the Mac App Store. • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (5 available) • SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 11 (API 30) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 18D61 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. [✓] Flutter (Channel master, 3.1.0-0.0.pre.2607, on macOS 12.2.1 21D62 darwin-x64, locale en-GB) • Flutter version 3.1.0-0.0.pre.2607 on channel master at /Users/dhs/documents/fluttersdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 92ab7625e8 (38 minutes ago), 2022-09-01 00:04:25 -0400 • Engine revision b149eea0a3 • Dart version 2.19.0 (build 2.19.0-154.0.dev) • DevTools version 2.16.0 [!] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Applications/Xcode.app/Contents/Developer ! Flutter recommends a minimum Xcode version of 13. Download the latest version or update via the Mac App Store. • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (5 available) • SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 11 (API 30) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 18D61 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. ```
github-actions[bot] commented 1 year ago

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.