mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-27 09:24:45 +01:00
Fix exception when printing Response
This commit is contained in:
parent
bb7919ff15
commit
8c85f98293
2 changed files with 3 additions and 2 deletions
|
@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:nc_photos/account.dart';
|
import 'package:nc_photos/account.dart';
|
||||||
|
import 'package:nc_photos/string_extension.dart';
|
||||||
import 'package:to_string/to_string.dart';
|
import 'package:to_string/to_string.dart';
|
||||||
import 'package:xml/xml.dart';
|
import 'package:xml/xml.dart';
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ class Response {
|
||||||
/// Content of the response body, String if isResponseString == true during
|
/// Content of the response body, String if isResponseString == true during
|
||||||
/// request, Uint8List otherwise
|
/// request, Uint8List otherwise
|
||||||
@Format(
|
@Format(
|
||||||
r"${kDebugMode ? body.toString().replaceAll(RegExp(r'\n\t'), '').substring(0, 200) : '...'}")
|
r"${kDebugMode ? body.toString().replaceAll(RegExp(r'\n\t'), '').slice(0, 200) : '...'}")
|
||||||
final dynamic body;
|
final dynamic body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,6 @@ part of 'api.dart';
|
||||||
extension _$ResponseToString on Response {
|
extension _$ResponseToString on Response {
|
||||||
String _$toString() {
|
String _$toString() {
|
||||||
// ignore: unnecessary_string_interpolations
|
// ignore: unnecessary_string_interpolations
|
||||||
return "Response {statusCode: $statusCode, headers: ..., body: ${kDebugMode ? body.toString().replaceAll(RegExp(r'\n\t'), '').substring(0, 200) : '...'}}";
|
return "Response {statusCode: $statusCode, headers: ..., body: ${kDebugMode ? body.toString().replaceAll(RegExp(r'\n\t'), '').slice(0, 200) : '...'}}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue