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

null check operator used on a null value flutter #269

Open
wincLei opened this issue Aug 21, 2024 · 8 comments
Open

null check operator used on a null value flutter #269

wincLei opened this issue Aug 21, 2024 · 8 comments

Comments

@wincLei
Copy link

wincLei commented Aug 21, 2024

macOs 14.2.1 (23C71) | 2.6 GHz 六核Intel Core i7 | 16 GB 2667 MHz DDR4

use New version available: 1.9.1
flutter sdk 3.24.0

pubspec.yaml config

environment:
sdk: '>=3.2.0 <4.0.0'

dependencies:
cupertino_icons: ^1.0.2
get: 4.6.6
flutter_screenutil: ^5.9.1
shared_preferences: ^2.2.2
cached_network_image: ^3.3.1
flutter_svg: ^2.0.10+1
intl: ^0.19.0
dio: ^5.4.3+1
flutter_tts: ^4.0.2
flutter_al: ^0.2.0
json_annotation: ^4.9.0
flutter:
sdk: flutter

dev_dependencies:
flutter_lints: ^2.0.0
flutter_test:
sdk: flutter

flutter:
uses-material-design: true

assets:
- assets/
- assets/images/
- assets/images/login/
- assets/sounds/object/

run get generate model on home with lib/app/modules/user/json/user.json

throw exception
null check operator used on a null value flutter

when i use flutter sdk 3.16.0 and get_cli 1.8.4 is ok

@uni-do-to
Copy link

Same issue

@sanjay-rb
Copy link

I am also facing same issue

`
get generate model with /Users/sanjayrb/projects/mtracker/json/account.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._generateClassDefinition (package:get_cli/common/utils/json_serialize/model_generator.dart:54:7)
#5 ModelGenerator.generateUnsafeDart (package:get_cli/common/utils/json_serialize/model_generator.dart:148:9)
#6 ModelGenerator.generateDartClasses (package:get_cli/common/utils/json_serialize/model_generator.dart:181:28)
#7 GenerateModelCommand.execute (package:get_cli/commands/impl/generate/model/model.dart:41:35)
<asynchronous suspension>
#8 main. (file:///Users/sanjayrb/.pub-cache/hosted/pub.dev/get_cli-1.9.1/bin/get.dart:18:38)
<asynchronous suspension>
#9 main (file:///Users/sanjayrb/.pub-cache/hosted/pub.dev/get_cli-1.9.1/bin/get.dart:18:9)
<asynchronous suspension>
`

@bigbott
Copy link

bigbott commented Aug 28, 2024

Same here.

1 similar comment
@kingyyy
Copy link

kingyyy commented Aug 29, 2024

Same here.

@locooo
Copy link

locooo commented Aug 30, 2024

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/locoo/.pub-cache/hosted/pub.dev/get_cli-1.9.1/bin/get.dart:18:38)

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

@irayshi
Copy link

irayshi commented Sep 9, 2024

I also had the same problem, so for now I downgraded the version to 1.8.1 because I don't know why I can't install version 1.8.4.

@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

9 participants