parent
a18ee64ddb
commit
96a7f1cfdc
@ -1,14 +1,23 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:power_logger/power_logger.dart';
|
||||||
import 'package:power_logger/src/builders/dio_responses_builder.dart';
|
import 'package:power_logger/src/builders/dio_responses_builder.dart';
|
||||||
import 'package:power_logger/src/builders/dio_error_builder.dart';
|
import 'package:power_logger/src/builders/dio_error_builder.dart';
|
||||||
import 'package:power_logger/src/parser/unfocus_parser.dart';
|
import 'package:power_logger/src/parser/unfocus_parser.dart';
|
||||||
|
|
||||||
///LoggerDataParser
|
///LoggerDataParser
|
||||||
class LoggerDataParser {
|
class LoggerDataParser {
|
||||||
static Widget builder(dynamic data) {
|
static Widget builder(LoggerInnerData data) {
|
||||||
if (data is DioError) return DioErrorBuilder(data: data);
|
if (data.rawData is DioError)
|
||||||
if (data is Response) return DioResponseBuilder(data: data);
|
return DioErrorBuilder(
|
||||||
return UnfocusParser(data: data);
|
data: data.rawData,
|
||||||
|
date: data.date,
|
||||||
|
);
|
||||||
|
if (data.rawData is Response)
|
||||||
|
return DioResponseBuilder(
|
||||||
|
data: data.rawData,
|
||||||
|
date: data.date,
|
||||||
|
);
|
||||||
|
return UnfocusParser(data: data.rawData, tag: data.tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue