Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
netrain_flutter_app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邹志胜
netrain_flutter_app
Commits
838d0fe1
Commit
838d0fe1
authored
Jul 09, 2021
by
“Icebear”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加model多级数据嵌套解析
parent
9db868cc
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
2 deletions
+47
-2
LoginApi.dart
netrain_flutter_app/lib/zhangfeng/LoginApi.dart
+0
-1
LoginPage.dart
netrain_flutter_app/lib/zhangfeng/LoginPage.dart
+0
-1
NestModel.dart
netrain_flutter_app/lib/zhangfeng/NestModel.dart
+18
-0
NestModel.g.dart
netrain_flutter_app/lib/zhangfeng/NestModel.g.dart
+28
-0
BaseHttpModel.dart
netrain_flutter_app/lib/zhangfeng/Network/BaseHttpModel.dart
+1
-0
No files found.
netrain_flutter_app/lib/zhangfeng/LoginApi.dart
View file @
838d0fe1
import
'Network/HttpManager.dart'
;
import
'Network/BaseHttpModel.dart'
;
import
'UserModel.dart'
;
import
'Network/SaveModel.dart'
;
/// 所有接口类
class
LoginApi
{
...
...
netrain_flutter_app/lib/zhangfeng/LoginPage.dart
View file @
838d0fe1
import
'package:flutter/material.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
import
'package:netrain_flutter_app/zhangfeng/Network/HttpManager.dart'
;
import
'package:netrain_flutter_app/zhangfeng/UserModel.dart'
;
import
'LoginApi.dart'
;
...
...
netrain_flutter_app/lib/zhangfeng/NestModel.dart
0 → 100644
View file @
838d0fe1
import
'package:json_annotation/json_annotation.dart'
;
part
'NestModel.g.dart'
;
@JsonSerializable
()
class
NestModel
{
final
name
;
final
email
;
final
List
<
NestModel
>
childrens
;
final
NestModel
nest
;
NestModel
(
this
.
name
,
this
.
email
,
this
.
childrens
,
this
.
nest
);
factory
NestModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$NestModelFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$NestModelToJson
(
this
);
}
\ No newline at end of file
netrain_flutter_app/lib/zhangfeng/NestModel.g.dart
0 → 100644
View file @
838d0fe1
// GENERATED CODE - DO NOT MODIFY BY HAND
part of
'NestModel.dart'
;
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
NestModel
_$NestModelFromJson
(
Map
<
String
,
dynamic
>
json
)
{
return
NestModel
(
json
[
'name'
],
json
[
'email'
],
(
json
[
'childrens'
]
as
List
)
?.
map
((
e
)
=>
e
==
null
?
null
:
NestModel
.
fromJson
(
e
as
Map
<
String
,
dynamic
>))
?.
toList
(),
json
[
'nest'
]
==
null
?
null
:
NestModel
.
fromJson
(
json
[
'nest'
]
as
Map
<
String
,
dynamic
>),
);
}
Map
<
String
,
dynamic
>
_$NestModelToJson
(
NestModel
instance
)
=>
<
String
,
dynamic
>{
'name'
:
instance
.
name
,
'email'
:
instance
.
email
,
'childrens'
:
instance
.
childrens
,
'nest'
:
instance
.
nest
,
};
netrain_flutter_app/lib/zhangfeng/Network/BaseHttpModel.dart
View file @
838d0fe1
...
...
@@ -6,6 +6,7 @@ part 'BaseHttpModel.g.dart';
class
BaseHttpModel
{
final
data
;
final
code
;
@JsonKey
(
name:
'message'
)
final
msg
;
BaseHttpModel
(
this
.
data
,
this
.
code
,
this
.
msg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment