update logger view

fix login issue
hmxc
小赖 4 years ago
parent ef909e6486
commit a897a6380a

@ -74,6 +74,7 @@ class SignFunc {
static Future<UserInfoModel> getUserInfo() async { static Future<UserInfoModel> getUserInfo() async {
BaseModel baseModel = await NetUtil().get(API.user.userProfile); BaseModel baseModel = await NetUtil().get(API.user.userProfile);
if (baseModel.data == null) return null;
return UserInfoModel.fromJson(baseModel.data); return UserInfoModel.fromJson(baseModel.data);
} }

@ -48,6 +48,32 @@ class _LoggerSuccessDetail extends StatefulWidget {
} }
class __LoggerSuccessDetailState extends State<_LoggerSuccessDetail> { class __LoggerSuccessDetailState extends State<_LoggerSuccessDetail> {
_buildTable(Map<String, dynamic> tableData) {
return Table(
border: TableBorder(
horizontalInside: BorderSide(color: Colors.black12),
verticalInside: BorderSide(color: Colors.black12),
),
children: [
TableRow(
decoration: BoxDecoration(color: Colors.black12),
children: [
'Key'.text.make().p2(),
'Value'.text.make().p2(),
],
),
...tableData.entries.map((e) {
return TableRow(
children: [
e.key.text.make().p2(),
e.value.toString().text.make().p2(),
],
);
}).toList(),
],
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -67,7 +93,7 @@ class __LoggerSuccessDetailState extends State<_LoggerSuccessDetail> {
].row(), ].row(),
), ),
ListTile(title: 'headers'.text.make()), ListTile(title: 'headers'.text.make()),
widget.response.request?.headers.toString().text.make(), _buildTable(widget.response.request.headers),
ListTile(title: 'queryParameters'.text.make()), ListTile(title: 'queryParameters'.text.make()),
(widget.response.request?.queryParameters ?? '') (widget.response.request?.queryParameters ?? '')
.toString() .toString()
@ -77,7 +103,7 @@ class __LoggerSuccessDetailState extends State<_LoggerSuccessDetail> {
(widget.response.request?.data ?? '').toString().text.make(), (widget.response.request?.data ?? '').toString().text.make(),
ListTile(title: 'Response'.text.bold.size(22).make()), ListTile(title: 'Response'.text.bold.size(22).make()),
ListTile(title: 'headers'.text.make()), ListTile(title: 'headers'.text.make()),
widget.response?.headers.toString().text.make(), _buildTable(widget.response.headers.map),
ListTile(title: 'data'.text.make()), ListTile(title: 'data'.text.make()),
(widget.response?.data ?? '').toString().text.make(), (widget.response?.data ?? '').toString().text.make(),
], ],

Loading…
Cancel
Save