update json format

master
小赖 4 years ago
parent b82684dc15
commit f48027324b

@ -76,6 +76,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_highlight:
dependency: transitive
description:
name: flutter_highlight
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0"
flutter_test:
dependency: "direct dev"
description: flutter
@ -88,6 +95,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.24.0"
highlight:
dependency: transitive
description:
name: highlight
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0"
http_parser:
dependency: transitive
description:
@ -123,6 +137,13 @@ packages:
relative: true
source: path
version: "0.0.1"
pretty_json:
dependency: transitive
description:
name: pretty_json
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
sky_engine:
dependency: transitive
description: flutter

@ -1,8 +1,10 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_highlight/flutter_highlight.dart';
import 'package:power_logger/src/view/box_view.dart';
import 'package:power_logger/src/view/table_view.dart';
import 'package:power_logger/src/view/title_view.dart';
import 'package:pretty_json/pretty_json.dart';
class DioResponseView extends StatefulWidget {
final Response data;
@ -51,6 +53,16 @@ class _DioResponseViewState extends State<DioResponseView> {
);
}
_buildData() {
return BoxView(
title: Text('Params'),
child: HighlightView(
prettyJson(widget.data.data.toString()),
language: 'json',
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -75,6 +87,7 @@ class _DioResponseViewState extends State<DioResponseView> {
TitleView(title: Text('Response')),
_buildMap(widget.data.headers.map),
_buildStatus(),
_buildData(),
],
),
);

@ -6,7 +6,7 @@ class TableView extends StatelessWidget {
Widget _buildTableTitle(String title) {
return Padding(
padding: EdgeInsets.all(5),
child: Text(title),
child: SelectableText(title),
);
}

@ -69,11 +69,25 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_highlight:
dependency: "direct main"
description:
name: flutter_highlight
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
highlight:
dependency: transitive
description:
name: highlight
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0"
http_parser:
dependency: transitive
description:
@ -102,6 +116,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0-nullsafety.1"
pretty_json:
dependency: "direct main"
description:
name: pretty_json
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
sky_engine:
dependency: transitive
description: flutter

@ -12,6 +12,8 @@ dependencies:
sdk: flutter
dio: ^3.0.10
animations: ^1.1.2
pretty_json: ^1.1.0
flutter_highlight: ^0.6.0
dev_dependencies:
flutter_test:

Loading…
Cancel
Save