You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,28 @@
1
1
## Json 2 Dart Command line utility
2
2
3
+
## Important note
4
+
5
+
There is already a package called `json2dart` so this package will be called `json2dartc` !
6
+
3
7
<imgsrc="./media/example.gif"width="600">
4
8
5
9
This project was made using [javiercbk's json_to_dart package](https://github.com/javiercbk/json_to_dart) ! This CLI was made to directly convert JSON stuctures into Dart classes . I personally don't like build runners and json serializers so I made this for my workflow . Feel free to open issues and submit PRs .
6
10
7
11
## How to use
8
12
9
-
Download the project and in `/build` foolder we have excutables for windows and linux / darwin systems . Add this folder to system PATH . Then in your terminal
13
+
Install this via `pub`
14
+
15
+
`pub global activate json2dartc`
16
+
17
+
## Example
10
18
11
-
`json2dart -u https://reqres.in/api/users -m get -e data -n Example`
19
+
`json2dartc -u https://reqres.in/api/users -m get -e data -n Example`
12
20
13
21
## Null safety
14
22
15
23
To turn on null safe code generation , add the flag `--null-safe` , Example :
16
24
17
-
`json2dart -u https://reqres.in/api/users -m get -n Example --null-safe`
25
+
`json2dartc -u https://reqres.in/api/users -m get -n Example --null-safe`
18
26
19
27
## Options
20
28
@@ -39,5 +47,6 @@ To turn on null safe code generation , add the flag `--null-safe` , Example :
0 commit comments