11import 'dart:convert' show json;
22
33class ListsResp {
4- List <List <List <int >>> asd;
5- List <int > qaz;
6- List <List <List <Zxc >>> qwe;
4+ List <List <List <int ?>?>?> ? asd;
5+ List <int ?> ? qaz;
6+ List <List <List <Zxc ?>?>?> ? qwe;
77
88 ListsResp .fromParams ({this .asd, this .qaz, this .qwe});
99
10- factory ListsResp (jsonStr) => jsonStr == null
11- ? null
12- : jsonStr is String
13- ? ListsResp .fromJson (json.decode (jsonStr))
14- : ListsResp .fromJson (jsonStr);
10+ factory ListsResp (Object jsonStr) => jsonStr is String
11+ ? ListsResp .fromJson (json.decode (jsonStr))
12+ : ListsResp .fromJson (jsonStr);
13+
14+ static ListsResp ? parse (jsonStr) =>
15+ ['null' , '' , null ].contains (jsonStr) ? null : ListsResp (jsonStr);
1516
1617 ListsResp .fromJson (jsonRes) {
1718 asd = jsonRes['asd' ] == null ? null : [];
1819
1920 for (var asdItem in asd == null ? [] : jsonRes['asd' ]) {
20- List <List <int >> asdChild = asdItem == null ? null : [];
21+ List <List <int ?>?> ? asdChild = asdItem == null ? null : [];
2122 for (var asdItemItem in asdChild == null ? [] : asdItem) {
22- List <int > asdChildChild = asdItemItem == null ? null : [];
23+ List <int ?> ? asdChildChild = asdItemItem == null ? null : [];
2324 for (var asdItemItemItem in asdChildChild == null ? [] : asdItemItem) {
24- asdChildChild.add (asdItemItemItem);
25+ asdChildChild! .add (asdItemItemItem);
2526 }
26- asdChild.add (asdChildChild);
27+ asdChild! .add (asdChildChild);
2728 }
28- asd.add (asdChild);
29+ asd! .add (asdChild);
2930 }
3031
3132 qaz = jsonRes['qaz' ] == null ? null : [];
3233
3334 for (var qazItem in qaz == null ? [] : jsonRes['qaz' ]) {
34- qaz.add (qazItem);
35+ qaz! .add (qazItem);
3536 }
3637
3738 qwe = jsonRes['qwe' ] == null ? null : [];
3839
3940 for (var qweItem in qwe == null ? [] : jsonRes['qwe' ]) {
40- List <List <Zxc >> qweChild = qweItem == null ? null : [];
41+ List <List <Zxc ?>?> ? qweChild = qweItem == null ? null : [];
4142 for (var qweItemItem in qweChild == null ? [] : qweItem) {
42- List <Zxc > qweChildChild = qweItemItem == null ? null : [];
43+ List <Zxc ?> ? qweChildChild = qweItemItem == null ? null : [];
4344 for (var qweItemItemItem in qweChildChild == null ? [] : qweItemItem) {
44- qweChildChild.add (
45+ qweChildChild! .add (
4546 qweItemItemItem == null ? null : Zxc .fromJson (qweItemItemItem));
4647 }
47- qweChild.add (qweChildChild);
48+ qweChild! .add (qweChildChild);
4849 }
49- qwe.add (qweChild);
50+ qwe! .add (qweChild);
5051 }
5152 }
5253
5354 @override
5455 String toString () {
5556 return '{"asd": $asd , "qaz": $qaz , "qwe": $qwe }' ;
5657 }
58+
59+ String toJSON () => this .toString ();
5760}
5861
5962class Zxc {
60- int zxc;
63+ int ? zxc;
6164
6265 Zxc .fromParams ({this .zxc});
6366
@@ -69,4 +72,6 @@ class Zxc {
6972 String toString () {
7073 return '{"zxc": $zxc }' ;
7174 }
75+
76+ String toJSON () => this .toString ();
7277}
0 commit comments