flutter-examples icon indicating copy to clipboard operation
flutter-examples copied to clipboard

type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.

Open ivangoluuk opened this issue 3 years ago • 20 comments

../../../developer/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.4.48/lib/src/date_picker/date_picker.dart:7596:37: Error: The argument type 'ScrollableState?' can't be assigned to the parameter type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.

  • 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../../developer/flutter/packages/flutter/lib/src/widgets/scrollable.dart').

     scrollableState: Scrollable.of(context),
    
                                 ^
    

../../../developer/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.4.48/lib/src/date_picker/date_picker.dart:7611:40: Error: A value of type 'ScrollableState?' can't be assigned to a variable of type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.

  • 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../../developer/flutter/packages/flutter/lib/src/widgets/scrollable.dart').

     ..scrollableState = Scrollable.of(context)
    
                                    ^
    

../../../developer/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.4.48/lib/src/date_picker/date_picker.dart:7665:71: Error: A value of type 'RenderAbstractViewport?' can't be returned from a function with return type 'RenderAbstractViewport' because 'RenderAbstractViewport?' is nullable and 'RenderAbstractViewport' isn't.

  • 'RenderAbstractViewport' is from 'package:flutter/src/rendering/viewport.dart' ('../../../developer/flutter/packages/flutter/lib/src/rendering/viewport.dart').

RenderAbstractViewport get _stackViewPort => RenderAbstractViewport.of(this);

ivangoluuk avatar Feb 01 '23 17:02 ivangoluuk

@ivangoluuk did you find a solution? I am having the same problem

esluidev avatar Feb 01 '23 21:02 esluidev

I have the same problem. don't use version: syncfusion_flutter_datepicker: ^20.4.48

Use like this: syncfusion_flutter_datepicker: "20.4.44"

miguelflores1993 avatar Feb 02 '23 13:02 miguelflores1993

hey thank u so much. its working now

ivangoluuk avatar Feb 02 '23 16:02 ivangoluuk

This works for me too. Thank you

kefeh avatar Feb 02 '23 19:02 kefeh

What changed for this to happen ? I even got this error in the same version I was using.

seborys40 avatar Feb 03 '23 00:02 seborys40

@ivangoluuk

Based on the instructions provided, we attempted to replicate the reported issue but were unable to do so. A sample has been created and is attached, including the output from testing.

Please be aware that the version of SfDateRangePicker used in this test is 20.4.48 and Flutter version is 3.7.0.

We suggest updating to the latest version of Flutter and re-testing the issue. If the problem persists, please inform us. datepicker_sample.zip Output.zip

MuniappanSubramanian avatar Feb 03 '23 10:02 MuniappanSubramanian

I have the same problem. don't use version: syncfusion_flutter_datepicker: ^20.4.48

Use like this: syncfusion_flutter_datepicker: "20.4.44"

This one worked for me.

Dev-Muhammad-Junaid avatar Feb 04 '23 11:02 Dev-Muhammad-Junaid

I have the same problem. don't use version: syncfusion_flutter_datepicker: ^20.4.48

Use like this: syncfusion_flutter_datepicker: "20.4.44"

+1 Thank you for the fix. Also curious as to what caused this to break.

StrixSC avatar Feb 05 '23 05:02 StrixSC

I have the same problem. don't use version: syncfusion_flutter_datepicker: ^20.4.48

Use like this: syncfusion_flutter_datepicker: "20.4.44"

hello, I try to use this way, but the pub get give me 20.4.48, even I execute the "flutter clean" command first. Is there anything I can do?

Mae623 avatar Feb 06 '23 07:02 Mae623

I have the same problem. don't use version: syncfusion_flutter_datepicker: ^20.4.48 Use like this: syncfusion_flutter_datepicker: "20.4.44"

hello, I try to use this way, but the pub get give me 20.4.48, even I execute the "flutter clean" command first. Is there anything I can do?

You can remove the library from pubspec.yaml first and paste directly. Also I have added both dependecncies with " "

Dev-Muhammad-Junaid avatar Feb 06 '23 07:02 Dev-Muhammad-Junaid

I have the same problem. don't use version: syncfusion_flutter_datepicker: ^20.4.48 Use like this: syncfusion_flutter_datepicker: "20.4.44"

hello, I try to use this way, but the pub get give me 20.4.48, even I execute the "flutter clean" command first. Is there anything I can do?

You can remove the library from pubspec.yaml first and paste directly. Also I have added both dependecncies with " "

Thank you for reply. These are my step below, hope for your look: 1."flutter clean" command 2.delete pubspec.lock file 3.remove 'syncfusion_flutter_datepicker: ^20.4.44' from pubspec.yaml 4."pub get" command 5.add 'syncfusion_flutter_datepicker: ^20.4.44' into pubspec.yaml 6."pub get" command

However, it turns out to be syncfusion_flutter_datepicker: dependency: "direct main" description: name: syncfusion_flutter_datepicker url: "https://pub.flutter-io.cn" source: hosted version: "20.4.48" Sigh!

Mae623 avatar Feb 06 '23 08:02 Mae623

The bug seems linked to dart 3

Mae623 avatar Feb 06 '23 08:02 Mae623

The bug seems linked to dart 3

Yes, Possibly! , Dart and Android studio updates were the only things I did before adding these dependencies..

Dev-Muhammad-Junaid avatar Feb 06 '23 08:02 Dev-Muhammad-Junaid

The bug seems linked to dart 3

Yes, Possibly! , Dart and Android studio updates were the only things I did before adding these dependencies..

I only execute the "pub upgrade" command once Maybe upgrade to dart 3 is the only way I can do Sigh!

Mae623 avatar Feb 06 '23 08:02 Mae623

I have the same problem. don't use version: syncfusion_flutter_datepicker: ^20.4.48 Use like this: syncfusion_flutter_datepicker: "20.4.44"

hello, I try to use this way, but the pub get give me 20.4.48, even I execute the "flutter clean" command first. Is there anything I can do?

You can remove the library from pubspec.yaml first and paste directly. Also I have added both dependecncies with " "

Thank you for reply. These are my step below, hope for your look: 1."flutter clean" command 2.delete pubspec.lock file 3.remove 'syncfusion_flutter_datepicker: ^20.4.44' from pubspec.yaml 4."pub get" command 5.add 'syncfusion_flutter_datepicker: ^20.4.44' into pubspec.yaml 6."pub get" command

However, it turns out to be syncfusion_flutter_datepicker: dependency: "direct main" description: name: syncfusion_flutter_datepicker url: "https://pub.flutter-io.cn" source: hosted version: "20.4.48" Sigh!

find syncfusion_flutter_datepicker in pubspec.lock, change 20.4.48 to 20.4.44

unclemeric avatar Feb 09 '23 06:02 unclemeric

I have the same problem. don't use version: syncfusion_flutter_datepicker: ^20.4.48 Use like this: syncfusion_flutter_datepicker: "20.4.44"

hello, I try to use this way, but the pub get give me 20.4.48, even I execute the "flutter clean" command first. Is there anything I can do?

You can remove the library from pubspec.yaml first and paste directly. Also I have added both dependecncies with " "

Thank you for reply. These are my step below, hope for your look: 1."flutter clean" command 2.delete pubspec.lock file 3.remove 'syncfusion_flutter_datepicker: ^20.4.44' from pubspec.yaml 4."pub get" command 5.add 'syncfusion_flutter_datepicker: ^20.4.44' into pubspec.yaml 6."pub get" command However, it turns out to be syncfusion_flutter_datepicker: dependency: "direct main" description: name: syncfusion_flutter_datepicker url: "https://pub.flutter-io.cn" source: hosted version: "20.4.48" Sigh!

find syncfusion_flutter_datepicker in pubspec.lock, change 20.4.48 to 20.4.44

Execute "pub get" again after this change?

Mae623 avatar Feb 09 '23 06:02 Mae623

This date picker package has the most amount of bugs. The controller.forward always returns null. There is no way to remove todaySelection from week. No way to set a style for date items, you should reimplement the builder. But after reimplementing the builder, the selection badge doesn't disappear... Come on guys, do something

nzackoya avatar Feb 13 '23 13:02 nzackoya

This bug is still present tested on Flutter 3.3.6, Dart 2.18.2, SfDateRangePicker 21.1.38. I understand that my Dart SDK is above the recommended SDK version for this package. Hopefully they'll upgrade soon. Thanks.

AfiqMutaz avatar Apr 07 '23 07:04 AfiqMutaz

This bug is still present tested on Flutter 3.3.6, Dart 2.18.2, SfDateRangePicker 21.1.38. I understand that my Dart SDK is above the recommended SDK version for this package. Hopefully they'll upgrade soon. Thanks.

maybe you could try Dart3

Mae623 avatar Apr 09 '23 23:04 Mae623

Regarding Queries: The controller.forward always returns null. There is no way to remove todaySelection from the week. No way to set a style for date items, you should reimplement the builder. But after reimplementing the builder, the selection badge doesn't disappear... Come on guys, do something

As per the shared information, we have checked the controller.forward() was working fine from our end. Also you can remove the todaySelection from the week by using todayTextStyle property. We have a UG documentation for the same. Also we have prepared the sample for the above queries. Please find the sample from the following link.

UG link: https://help.syncfusion.com/flutter/daterangepicker/customizations#month-cell-customization https://help.syncfusion.com/flutter/daterangepicker/date-navigations#programmatically-change-to-adjacent-dates https://help.syncfusion.com/flutter/daterangepicker/builders#cell-builder

Sample link:

cellbuilder.zip

We hope that this helps you. Please let us know if you need further assistance.

Indumathi1195R avatar Apr 26 '23 04:04 Indumathi1195R