From 3752adcb7e354a1f79031b219260a2e94b682ae8 Mon Sep 17 00:00:00 2001 From: Thomas Klein Langenhorst Date: Fri, 2 Sep 2022 17:10:36 +0200 Subject: [PATCH] fixed some docs and mistake --- lib/src/date_time_picker.dart | 20 ++++++++++++++++ .../month_date_time_picker.dart | 24 +++---------------- .../week_date_time_picker.dart | 20 +--------------- 3 files changed, 24 insertions(+), 40 deletions(-) diff --git a/lib/src/date_time_picker.dart b/lib/src/date_time_picker.dart index 6af15da..b5ad742 100644 --- a/lib/src/date_time_picker.dart +++ b/lib/src/date_time_picker.dart @@ -25,6 +25,26 @@ import 'package:intl/date_symbol_data_local.dart'; /// markedDates: [ /// DateTime(2022, 3, 14), /// ], +/// wrongTimeDialog: +/// AlertDialog( +/// title: const Text('Invalid Time'), +/// content: SingleChildScrollView( +/// child: ListBody( +/// children: const [ +/// Text( +/// 'The time you try to choose is diabled, try to pick another time.'), +/// ], +/// ), +/// ), +/// actions: [ +/// TextButton( +/// child: const Text('OK'), +/// onPressed: () { +/// Navigator.pop(context); +/// }, +/// ), +/// ], +/// ), /// header: Container( /// height: 100, /// width: MediaQuery.of(context).size.width, diff --git a/lib/src/widgets/month_date_time_picker.dart/month_date_time_picker.dart b/lib/src/widgets/month_date_time_picker.dart/month_date_time_picker.dart index 09a7c00..e9702f9 100644 --- a/lib/src/widgets/month_date_time_picker.dart/month_date_time_picker.dart +++ b/lib/src/widgets/month_date_time_picker.dart/month_date_time_picker.dart @@ -88,27 +88,9 @@ class MonthDateTimePicker extends StatelessWidget { dateTimePickerController.disabledTimes ?? [], )) { showDialog( - context: context, - builder: (context) => AlertDialog( - title: const Text('Verkeerde tijd gekozen'), - content: SingleChildScrollView( - child: ListBody( - children: const [ - Text( - 'De tijd die u wilt kiezen, is niet mogelijk, maak een andere keuze.'), - ], - ), - ), - actions: [ - TextButton( - child: const Text('OK'), - onPressed: () { - Navigator.pop(context); - }, - ), - ], - ), - ); + context: context, + builder: (context) => + dateTimePickerController.wrongTimeDialog!); } } diff --git a/lib/src/widgets/week_date_time_picker/week_date_time_picker.dart b/lib/src/widgets/week_date_time_picker/week_date_time_picker.dart index 0670cb1..eecff48 100644 --- a/lib/src/widgets/week_date_time_picker/week_date_time_picker.dart +++ b/lib/src/widgets/week_date_time_picker/week_date_time_picker.dart @@ -62,25 +62,7 @@ class WeekDateTimePicker extends StatelessWidget { )) { showDialog( context: context, - builder: (context) => AlertDialog( - title: const Text('Verkeerde tijd gekozen'), - content: SingleChildScrollView( - child: ListBody( - children: const [ - Text( - 'De tijd die u wilt kiezen, is niet mogelijk, maak een andere keuze.'), - ], - ), - ), - actions: [ - TextButton( - child: const Text('OK'), - onPressed: () { - Navigator.pop(context); - }, - ), - ], - ), + builder: (context) => dateTimePickerController.wrongTimeDialog!, ); } }