mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +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:logging/logging.dart';
|
||||
import 'package:nc_photos/account.dart';
|
||||
import 'package:nc_photos/string_extension.dart';
|
||||
import 'package:to_string/to_string.dart';
|
||||
import 'package:xml/xml.dart';
|
||||
|
||||
|
@ -25,7 +26,7 @@ class Response {
|
|||
/// Content of the response body, String if isResponseString == true during
|
||||
/// request, Uint8List otherwise
|
||||
@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;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,6 @@ part of 'api.dart';
|
|||
extension _$ResponseToString on Response {
|
||||
String _$toString() {
|
||||
// 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…
Reference in a new issue