Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization Null check operator #28

Open
riccardocescon opened this issue Dec 6, 2024 · 3 comments
Open

Localization Null check operator #28

riccardocescon opened this issue Dec 6, 2024 · 3 comments

Comments

@riccardocescon
Copy link

I am getting this issue when calling showDurationPicker:

[log] Err : Null check operator used on a null value
      StackTrace : #0      DurationPickerMaterialLocalizations.of (package:material_duration_picker/src/localizations.dart:62:54)
      #1      _DurationPickerState.didChangeDependencies (package:material_duration_picker/material_duration_picker.dart:2401:57)
material_duration_picker.dart:2401
      #2      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5766:11)
framework.dart:5766
      #3      ComponentElement.mount (package:flutter/src/widgets/framework.dart:5593:5)
framework.dart:5593
      #4      Element.inflateWidget (package:flutter/src/widgets/framework.dart:4468:16)
framework.dart:4468
      #5      Element.updateChild (package:flutter/src/widgets/framework.dart:3963:18)
framework.dart:3963

This is how i call it:

FilledButton(
              onPressed: () {
                showDurationPicker(
                  context: context,
                  initialDuration: Duration.zero,
                );
              },
              child: Text('Set Time'),
            ),

I have tried both with setting DefaultDurationPickerMaterialLocalizations.delegate, on the MaterialApp localizationsDelegates, with and without it
Am i missing somethign or is there an issue?
I am using material_duration_picker: ^0.0.2+1

@riccardocescon
Copy link
Author

Also happens with v0.0.1

@Gustl22
Copy link
Contributor

Gustl22 commented Dec 6, 2024

Hey there, thank you for raising the issue!

Are you able to execute the example?

https://github.com/Oberhauser-Dev/dart_packages/blob/main/packages/material_duration_picker/example/lib/main.dart
I just tried it and it worked with flutter 3.24.x.

Which flutter version are you using?

If you can, it's likely you forgot something, although I don't see anything wrong with your implementation ATM.

@riccardocescon
Copy link
Author

Hi,
I will let you know on monday, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants