parent
a18ee64ddb
commit
96a7f1cfdc
@ -1,14 +1,23 @@
|
||||
import 'package:dio/dio.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_error_builder.dart';
|
||||
import 'package:power_logger/src/parser/unfocus_parser.dart';
|
||||
|
||||
///LoggerDataParser
|
||||
class LoggerDataParser {
|
||||
static Widget builder(dynamic data) {
|
||||
if (data is DioError) return DioErrorBuilder(data: data);
|
||||
if (data is Response) return DioResponseBuilder(data: data);
|
||||
return UnfocusParser(data: data);
|
||||
static Widget builder(LoggerInnerData data) {
|
||||
if (data.rawData is DioError)
|
||||
return DioErrorBuilder(
|
||||
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