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

Unhandled exception: Null check operator used on a null value #281

Open
faizahmaddae opened this issue Sep 30, 2024 · 3 comments
Open

Unhandled exception: Null check operator used on a null value #281

faizahmaddae opened this issue Sep 30, 2024 · 3 comments

Comments

@faizahmaddae
Copy link

get generate model on home with assets/models/server.json

Unhandled exception:
Null check operator used on a null value
#0 PubspecUtils.nullSafeSupport (package:get_cli/common/utils/pubspec/pubspec_utils.dart:146:76)
#1 new TypeDefinition (package:get_cli/common/utils/json_serialize/sintaxe.dart:81:22)
#2 new TypeDefinition.fromDynamic (package:get_cli/common/utils/json_serialize/sintaxe.dart:68:12)
#3 ModelGenerator._generateClassDefinition (package:get_cli/common/utils/json_serialize/model_generator.dart:68:36)
#4 ModelGenerator.generateUnsafeDart (package:get_cli/common/utils/json_serialize/model_generator.dart:148:9)
#5 ModelGenerator.generateDartClasses (package:get_cli/common/utils/json_serialize/model_generator.dart:181:28)
#6 GenerateModelCommand.execute (package:get_cli/commands/impl/generate/model/model.dart:41:35)

#7 main. (file:///Users/faiz/.pub-cache/hosted/pub.dev/get_cli-1.9.1/bin/get.dart:18:38)

#8 main (file:///Users/faiz/.pub-cache/hosted/pub.dev/get_cli-1.9.1/bin/get.dart:18:9)

@pimdo
Copy link

pimdo commented Oct 5, 2024

Had same issue, workaround:
temporary add extra field sdkConstraint to pubspec.yaml:

environment:
  sdk: ^3.5.3
  sdkConstraint: ">=2.12.0 <3.5.3"

@knottx
Copy link
Contributor

knottx commented Oct 9, 2024

See this #283

@whitecodel
Copy link

You can try this CLI tools for generating models

https://github.com/whitecodel/jsontodart

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

No branches or pull requests

4 participants