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:
Jiten Patel
2024-10-22 22:34:23 +05:30
committed by GitHub
parent 849ce1d888
commit 3e9901dac9
3 changed files with 120 additions and 0 deletions

View File

@@ -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.