From d9c728f31034d626392e50a66ba6cb25416900ff Mon Sep 17 00:00:00 2001 From: laiiihz Date: Tue, 26 Jan 2021 18:24:30 +0800 Subject: [PATCH] fix json pretty --- lib/src/view/dio_response_view.dart | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/lib/src/view/dio_response_view.dart b/lib/src/view/dio_response_view.dart index 09d6a42..7a01f84 100644 --- a/lib/src/view/dio_response_view.dart +++ b/lib/src/view/dio_response_view.dart @@ -66,24 +66,14 @@ class _DioResponseViewState extends State { } _buildData() { - if (widget.data.data is Map) - return BoxView( - title: Text('Data'), - child: HighlightView( - prettyJson(widget.data.data), - language: 'json', - theme: atomOneLightTheme, - ), - ); - else - return BoxView( - title: Text('Raw'), - child: HighlightView( - widget.data.data, - language: 'html', - theme: atomOneLightTheme, - ), - ); + return BoxView( + title: Text('Data'), + child: HighlightView( + prettyJson(widget.data.data), + language: 'json', + theme: atomOneLightTheme, + ), + ); } _buildRawData() {