Git Product home page Git Product logo

date_range_picker's People

Contributors

anicdh avatar calebisstupid avatar dinver avatar gagan-garcha avatar khakan-ali avatar renidelonzek avatar tiholic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

date_range_picker's Issues

Selecting the last date in DateRangePicker.showDatePicker throws assert error in MonthPicker

Hi,
This is my code
var picked = await DateRagePicker.showDatePicker(
context: context,
initialFirstDate: DateTime.fromMillisecondsSinceEpoch(
_flightSearch.itineraries[0].departureDate),
initialLastDate: (DateTime.fromMillisecondsSinceEpoch(
_flightSearch.itineraries[1].departureDate)),
firstDate: DateTime.now().add(Duration(days: -1)) ,
lastDate: tenYears,
);
when the picker is opened and the user selects the last year and the last date, MonthPickers " assert(!selectedFirstDate.isBefore(firstDate) &&
(selectedLastDate == null || !selectedLastDate.isAfter(lastDate)))" is fired.

type 'List<dynamic>' is not a subtype of type 'List<DateTime>' of 'result'

Function showDatePicker crash with this error when you pick a range of Dates and tap on "OK" button.

type 'List' is not a subtype of type 'List' of 'result'.

flutter: When the exception was thrown, this was the stack:
flutter: #0      _ModalRoute&TransitionRoute&LocalHistoryRoute.didPop (package:flutter/src/widgets/routes.dart)
flutter: #1      NavigatorState.pop (package:flutter/src/widgets/navigator.dart:1824:15)
flutter: #2      Navigator.pop (package:flutter/src/widgets/navigator.dart:1183:34)
flutter: #3      _DatePickerDialogState._handleOk (package:date_range_picker/date_range_picker.dart:1114:15)
flutter: #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
flutter: #5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:562:30)
flutter: #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
flutter: #7      TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
flutter: #8      TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:175:7)
flutter: #9      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)
flutter: #10     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
flutter: #11     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
flutter: #12     _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:180:19)
flutter: #13     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:158:22)
flutter: #14     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:138:7)
flutter: #15     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7)
flutter: #16     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7)
flutter: #17     _invoke1 (dart:ui/hooks.dart:168:13)
flutter: #18     _dispatchPointerDataPacket (dart:ui/hooks.dart:122:5)

Not being able to select range if there are disabled dates in between

I have provided a method to selectableDayPredicate to disable certain dates. However, I am still able to select these disabled dates as long as the initial start and end date lie out side of this range.

For example, selectableDayPredicate returns false for 2019-06-20, and is thus disabled on the date picker. If you select a range of 2019-06-01 to 2019-06-25, you are able to even though it includes a disabled date.

Any way around this?

Enforcing range or accepting null initial date

Hi,
Thanks for library. Can you enforce that user MUST select range not one date ?
Or maybe allow from/to with empty other one ? Then accept null and one of initial values.
Thanks
Michal

Time selection is not possible

Hi,

This plugin always picks up the current time. can you please add an option for the user to select the time as shown in the screenshot?

image

[FEATURE] Maximum selectable span

In my case I need to give to user the possibility to select max 7 days span. At the moment the span selection is free. It will be a very good feature to add to this package, something like:

DateRagePicker.showDatePicker(
          context: context,
          …
          maxSelectableSpan: 7
)

A RenderFlex overflowed by 13 pixels on the bottom [Pixel 3a]

Visually, I don't see the overflow, but I get this when clicking on a Date Range field, which pops up a DateRangePicker:

I/flutter ( 6785): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 6785): The following assertion was thrown during layout:
I/flutter ( 6785): A RenderFlex overflowed by 13 pixels on the bottom.
I/flutter ( 6785): 
I/flutter ( 6785): The relevant error-causing widget was:
I/flutter ( 6785):   Column
I/flutter ( 6785):   file:///Users/anthony/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.6/lib/date_range_picker.dart:1180:24
I/flutter ( 6785): 
I/flutter ( 6785): The overflowing RenderFlex has an orientation of Axis.vertical.
I/flutter ( 6785): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and
I/flutter ( 6785): black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
I/flutter ( 6785): Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the
I/flutter ( 6785): RenderFlex to fit within the available space instead of being sized to their natural size.
I/flutter ( 6785): This is considered an error condition because it indicates that there is content that cannot be
I/flutter ( 6785): seen. If the content is legitimately bigger than the available space, consider clipping it with a
I/flutter ( 6785): ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex,
I/flutter ( 6785): like a ListView.
I/flutter ( 6785): The specific RenderFlex in question is: RenderFlex#18147 relayoutBoundary=up7 OVERFLOWING:
I/flutter ( 6785):   needs compositing
I/flutter ( 6785):   creator: Column ← SizedBox ← LayoutBuilder ← OrientationBuilder ← DefaultTextStyle ←
I/flutter ( 6785):     AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#55cb6 ink renderer] ←
I/flutter ( 6785):     NotificationListener<LayoutChangedNotification> ← CustomPaint ← _ShapeBorderPaint ← PhysicalShape
I/flutter ( 6785):     ← _MaterialInterior ← ⋯
I/flutter ( 6785):   parentData: <none> (can use size)
I/flutter ( 6785):   constraints: BoxConstraints(w=312.7, 0.0<=h<=459.1)
I/flutter ( 6785):   size: Size(312.7, 459.1)
I/flutter ( 6785):   direction: vertical
I/flutter ( 6785):   mainAxisAlignment: start
I/flutter ( 6785):   mainAxisSize: min
I/flutter ( 6785):   crossAxisAlignment: stretch
I/flutter ( 6785):   verticalDirection: down
I/flutter ( 6785): ◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
I/flutter ( 6785): ════════════════════════════════════════════════════════════════════════════════════════════════════

I am running the Android Emulator for a Pixel 3a:

  • Resolution of 1080 x 2220 (440 dpi)
  • API 28
  • Android 9.0

Dialog won't show

I'm using Flutter version 1.12.13+hotfix.8 on stable channel.
The dialog won't show up and there's no error that I can track

Unhandled Exception

I getting this error Unhandled Exception: 'package:date_range_picker/date_range_picker.dart': Failed assertion: line 1280 pos 10: '!initialLastDate.isAfter(lastDate)': initialDate must be on or before lastDate and the dialog won't show up. Any help would appreciated. 🙏
This is my code :

Future<List<DateTime>> _showDateRangePicker() async {
    final List<DateTime> pickedDateRange = await DateRangePicker.showDatePicker(
      context: context,
      initialFirstDate: new DateTime(2020, 1, 1),
      initialLastDate: new DateTime(2020, 4, 1),
      firstDate: new DateTime(2015),
      lastDate: new DateTime(2020)
    );

    if(pickedDateRange == null && pickedDateRange.length < 2) {
      return [];
    }

    return pickedDateRange;
  }

Should allow select from year to month and then date

Just like bootstrap daterangepicker. When user have to select a long range, like 5 years, use have to slide 60 times to back to first date, and then slide back 60 times again to choose second date.
It will be better if you provide a function allow select year, and month.

Thank you

How to change calendar primary color?

I would like to change header background color/select date color and ok/cancel text color to a same color. So how to change calendar primary color?

List<DateTime> returns a null object if only one date is selected

I've run into an issue where if the DateRangePicker returns with only one date selected, the List<DateTime> returned will be of length == 2 but only the first item will be a valid DateTime object while the second item is null, which is very misleading if I'm using the length of the List<DateTime> to verify that the user has selected a date range rather than a single date.

RTL is not as expected

Text Direction RTL doesn't work as Expected, the start date and end date doesn't show with correct direction.

Locale functionality doesn't run properly

Hello,
When I fill up locale variable with a location different to Locale('en') I've run into an issue:

I/flutter ( 5182): When the exception was thrown, this was the stack:
I/flutter ( 5182): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
I/flutter ( 5182): #1 _DatePickerDialogState.didChangeDependencies
package:date_range_picker/date_range_picker.dart:1033

Localizations variable in date_range_picker.dart file is null.

If I change Locale('fr') to Locale('en') localizations variable is not null and all run properly.

Code:
final List picked = await DateRangePicker.showDatePicker(
context: context,
initialFirstDate: DateTime.now(),
initialLastDate: (DateTime.now()).add(Duration(days: 2)),
firstDate: (DateTime.now()).subtract(Duration(days: 1)),
lastDate: (DateTime.now()).add(Duration(days: 365)),
locale: Locale('fr')
);

Any way around this?

Thanks.

Landscape mode

Hi, I have a design problem in Landscape mode, is there an update for this?

img_0333

Can you please add a license?

Thanks for this great date picker widget! Can you please add a license? Currently the LICENSE file is empty. Thanks.

ButtonBar.bar is deprecated

ButtonBar.bar constructor used in _DatePickerDialogState.buld code is marked as deprecated.
Deprecation note says "This feature was deprecated after v1.9.1." and suggests to "Use ButtonBarTheme instead.", see flutter/flutter#37544 for details.
Not sure that's a reason for concern, but nonetheless

Selected date dropped when switching a year

The selected date drops when switching a year through the year picker. I want to select for example June 5th 2015 to June 5th 2019 without having to scroll through dates manually. Is it possible to add such a feature in? Thanks

Calendar crash while selecting last index of year.

whenever i am selecting last index of list in year list : for instance i selected 2022 from list of calendar then crash the calendar and show error below

═══════ Exception caught by widgets library ═══════════════════════════════════════════════════════
'package:flutter_calendar/calendar_lib.dart': Failed assertion: line 608 pos 16: '!selectedFirstDate.isBefore(firstDate) &&
(selectedLastDate == null || !selectedLastDate.isAfter(lastDate))': is not true.

doesn't support null safety

not able to migrate null safety because daterange picker dependency doest not have sound null safety version

Method not found: 'ButtonTheme.bar'

When I try to run my app in chrome, I keep getting this error:

../../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/date_range_picker-1.0.6/lib/date_range_picker.dart:1152:44: Error: Method not found: 'ButtonTheme.bar'. final Widget actions = new ButtonTheme.bar(

I just updated flutter to the last version of and as posted in this post in StackOverflow, ButtonTheme.bar is deprecated. This results in not being able to run the app in web. I don't use "directly" ButtonTheme, but the package flutter_form_builder does. Someone already posted the issue in flutter_form_builder.

Maybe a solution would be to modify date_range_picker yourself to replace the ButtonTheme with ButtonBarTheme...

Asking

Hello guys, can any one tell how to detect sliding date on UI ? I got stuck some days, I can not find that code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.