From 9a838455e2357606ba04a101d4d36de398cf2597 Mon Sep 17 00:00:00 2001 From: Taha Tesser Date: Fri, 1 Mar 2024 17:36:24 +0200 Subject: [PATCH] Fix `showDateRangePicker` is missing `dartpad` tag and cleanup (#144475) fixes [`showDateRangePicker` interactive sample not loading](https://github.com/flutter/flutter/issues/144474) ### Description This fixes `showDateRangePicker` example not loading in Dartpad. Similar fix was made for `showDatePicker` in https://github.com/flutter/flutter/pull/99401 --- .../api/lib/material/date_picker/show_date_picker.0.dart | 5 ++--- .../lib/material/date_picker/show_date_range_picker.0.dart | 5 ++--- packages/flutter/lib/src/material/date_picker.dart | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/api/lib/material/date_picker/show_date_picker.0.dart b/examples/api/lib/material/date_picker/show_date_picker.0.dart index cd6b8d5fae1..05b14229094 100644 --- a/examples/api/lib/material/date_picker/show_date_picker.0.dart +++ b/examples/api/lib/material/date_picker/show_date_picker.0.dart @@ -13,10 +13,9 @@ class DatePickerApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), + return const MaterialApp( restorationScopeId: 'app', - home: const DatePickerExample(restorationId: 'main'), + home: DatePickerExample(restorationId: 'main'), ); } } diff --git a/examples/api/lib/material/date_picker/show_date_range_picker.0.dart b/examples/api/lib/material/date_picker/show_date_range_picker.0.dart index 9efd6d037c3..16f3721f046 100644 --- a/examples/api/lib/material/date_picker/show_date_range_picker.0.dart +++ b/examples/api/lib/material/date_picker/show_date_range_picker.0.dart @@ -13,10 +13,9 @@ class DatePickerApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), + return const MaterialApp( restorationScopeId: 'app', - home: const DatePickerExample(restorationId: 'main'), + home: DatePickerExample(restorationId: 'main'), ); } } diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index cf75c91d10f..96390116ada 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -1020,7 +1020,7 @@ class _DatePickerHeader extends StatelessWidget { /// /// {@macro flutter.widgets.RestorationManager} /// -/// {@tool sample} +/// {@tool dartpad} /// This sample demonstrates how to create a restorable Material date range picker. /// This is accomplished by enabling state restoration by specifying /// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to