jonataslaw / jonataslaw/get_cli

Problem with get cli "get generate model" can not map the class name correctly

Open
#128 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
654
Forks
193
PR merge metrics
No merged PRs in 30d

Description

The syntax "get generate model....." produce some error if using get_cli ver 1.6.0 (latest as of July 8, 2021) and using flutter 2.5.1 (latest as of Oct 1, 2021). Somehow the get_cli can create the model.dart file but with so many "Class ?" shown all over the place (using the json data from "https://randomuser.me/api/?results=10").

The get_cli simply "can not map correctly" the class name as it created below the file into the class name definition of the top part of the model file (get_cli just put it as "Class ?" all over the declaration, bug in the get_cli version 1.6.0?).

You must manually change the resulting model.dart file to change the "Class ?" into "Info ?" or "Name ?" or "Dob ?" according to the classes name created by get_cli 1.6.0 at the below part of the model dart file.

If you don't believe me, please try it yourselves (using get_cli 1.6.0 and flutter 2.5.1, run the "get generate model..." to generate dart file model based on the sample json data from "https://randomuser.me/api/?results=10" and see what happened inside the content of the resulting model.dart file).

The get_cli 1.6.0 get generate model also not automatically adding the "!" syntax to comply with null safety requirement of the latest flutter version (we must add the "!" into the dart file manually.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.