|
|
@ -1,6 +1,7 @@
|
|
|
|
import 'package:akuCommunity/extensions/num_ext.dart';
|
|
|
|
import 'package:akuCommunity/extensions/num_ext.dart';
|
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart' hide Response;
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class LoggerDioSuccess extends StatelessWidget {
|
|
|
|
class LoggerDioSuccess extends StatelessWidget {
|
|
|
@ -10,10 +11,9 @@ class LoggerDioSuccess extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialButton(
|
|
|
|
return MaterialButton(
|
|
|
|
elevation: 10,
|
|
|
|
elevation: 0,
|
|
|
|
highlightElevation: 1,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
onPressed: () {},
|
|
|
|
onPressed: () => Get.to(_LoggerSuccessDetail(response: response)),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -38,3 +38,50 @@ class LoggerDioSuccess extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _LoggerSuccessDetail extends StatefulWidget {
|
|
|
|
|
|
|
|
final Response response;
|
|
|
|
|
|
|
|
_LoggerSuccessDetail({Key key, this.response}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
__LoggerSuccessDetailState createState() => __LoggerSuccessDetailState();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class __LoggerSuccessDetailState extends State<_LoggerSuccessDetail> {
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
|
|
|
title: widget.response.request.path.text.make(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
body: ListView(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
ListTile(
|
|
|
|
|
|
|
|
title: 'Request'.text.bold.size(22).make(),
|
|
|
|
|
|
|
|
trailing: [
|
|
|
|
|
|
|
|
Chip(
|
|
|
|
|
|
|
|
label: widget.response.request.method.text.make(),
|
|
|
|
|
|
|
|
backgroundColor: Colors.lightGreen,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
].row(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ListTile(title: 'headers'.text.make()),
|
|
|
|
|
|
|
|
widget.response.request?.headers.toString().text.make(),
|
|
|
|
|
|
|
|
ListTile(title: 'queryParameters'.text.make()),
|
|
|
|
|
|
|
|
(widget.response.request?.queryParameters ?? '')
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
.make(),
|
|
|
|
|
|
|
|
ListTile(title: 'data'.text.make()),
|
|
|
|
|
|
|
|
(widget.response.request?.data ?? '').toString().text.make(),
|
|
|
|
|
|
|
|
ListTile(title: 'Response'.text.bold.size(22).make()),
|
|
|
|
|
|
|
|
ListTile(title: 'headers'.text.make()),
|
|
|
|
|
|
|
|
widget.response?.headers.toString().text.make(),
|
|
|
|
|
|
|
|
ListTile(title: 'data'.text.make()),
|
|
|
|
|
|
|
|
(widget.response?.data ?? '').toString().text.make(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|