|
|
@ -1,8 +1,10 @@
|
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
import 'package:flutter/material.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/box_view.dart';
|
|
|
|
import 'package:power_logger/src/view/table_view.dart';
|
|
|
|
import 'package:power_logger/src/view/table_view.dart';
|
|
|
|
import 'package:power_logger/src/view/title_view.dart';
|
|
|
|
import 'package:power_logger/src/view/title_view.dart';
|
|
|
|
|
|
|
|
import 'package:pretty_json/pretty_json.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class DioResponseView extends StatefulWidget {
|
|
|
|
class DioResponseView extends StatefulWidget {
|
|
|
|
final Response data;
|
|
|
|
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
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
@ -75,6 +87,7 @@ class _DioResponseViewState extends State<DioResponseView> {
|
|
|
|
TitleView(title: Text('Response')),
|
|
|
|
TitleView(title: Text('Response')),
|
|
|
|
_buildMap(widget.data.headers.map),
|
|
|
|
_buildMap(widget.data.headers.map),
|
|
|
|
_buildStatus(),
|
|
|
|
_buildStatus(),
|
|
|
|
|
|
|
|
_buildData(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|