Fix: showDatePicker should have a simple example in the docs (#156196)
This PR introduces a basic example of how to use the `showDatePicker` function. The purpose of this PR is to simplify the onboarding process for new Flutter developers by providing a straightforward demonstration of handling the asynchronous Future returned by the showDatePicker. This will help users unfamiliar with the intricacies of asynchronous operations in Flutter. Fixes #156157
This commit is contained in:
@@ -156,6 +156,13 @@ const double _fontSizeToScale = 14.0;
|
||||
///
|
||||
/// {@macro flutter.widgets.RawDialogRoute}
|
||||
///
|
||||
/// {@tool dartpad}
|
||||
/// This sample demonstrates how to create a basic date picker.
|
||||
/// Tapping the button displays a date picker which returns the selected date.
|
||||
///
|
||||
/// ** See code in examples/api/lib/material/date_picker/show_date_picker.1.dart **
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// ### State Restoration
|
||||
///
|
||||
/// Using this method will not enable state restoration for the date picker.
|
||||
|
||||
Reference in New Issue
Block a user