From 948a511afdadfaef007831382ff989fc7f7a23c3 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Wed, 27 Jan 2021 15:50:14 +0800 Subject: [PATCH] update image,audio,video type --- example/lib/main.dart | 7 +++++++ lib/src/view/dio_response_view.dart | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/example/lib/main.dart b/example/lib/main.dart index 22acde5..79b932d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -44,6 +44,13 @@ class _MyHomePageState extends State { .catchError((e) { LoggerData.addData(e); }); + + Dio() + .get( + "https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png") + .then((e) { + LoggerData.addData(e); + }); Future.delayed( Duration(milliseconds: 300), () => PowerLogger.init(context), diff --git a/lib/src/view/dio_response_view.dart b/lib/src/view/dio_response_view.dart index 678c092..072e5f9 100644 --- a/lib/src/view/dio_response_view.dart +++ b/lib/src/view/dio_response_view.dart @@ -1,4 +1,6 @@ import 'dart:convert'; +import 'dart:io'; +import 'dart:typed_data'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; @@ -105,6 +107,12 @@ class _DioResponseViewState extends State { ), ); break; + case ContentType.IMAGE: + return Text("IMAGE"); + case ContentType.AUDIO: + return Text("AUDIO"); + case ContentType.VIDEO: + return Text("VIDEO"); default: break; }