jonataslaw / get_cli

Official Getx CLI
Apache License 2.0
610 stars 179 forks source link

null check operator used on a null value flutter #269

Open wincLei opened 3 months ago

wincLei commented 3 months ago

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:

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 commented 3 months ago

Same issue

sanjay-rb commented 3 months ago

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)

\

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

\

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

\ `

bigbott commented 2 months ago

Same here.

kingyyy commented 2 months ago

Same here.

locooo commented 2 months ago

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 commented 2 months ago

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 commented 1 month ago

See this #283

whitecodel commented 1 week ago

You can try this CLI tools for generating models

https://github.com/whitecodel/jsontodart