mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 08:08:19 +08:00
@@ -154,7 +154,7 @@ class RenderParagraph extends RenderBox
|
|||||||
final value = params.text;
|
final value = params.text;
|
||||||
_primary = params.primary;
|
_primary = params.primary;
|
||||||
if (_morePainter case final textPainter?) {
|
if (_morePainter case final textPainter?) {
|
||||||
final textSpan = _moreTextSpan(params.text.style);
|
final textSpan = _moreTextSpan(value.style);
|
||||||
switch (textPainter.text!.compareTo(textSpan)) {
|
switch (textPainter.text!.compareTo(textSpan)) {
|
||||||
case RenderComparison.paint:
|
case RenderComparison.paint:
|
||||||
textPainter.text = textSpan;
|
textPainter.text = textSpan;
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ class Request {
|
|||||||
* config it and create
|
* config it and create
|
||||||
*/
|
*/
|
||||||
Request._internal() {
|
Request._internal() {
|
||||||
|
final enableHttp2 = Pref.enableHttp2;
|
||||||
//BaseOptions、Options、RequestOptions 都可以配置参数,优先级别依次递增,且可以根据优先级别覆盖参数
|
//BaseOptions、Options、RequestOptions 都可以配置参数,优先级别依次递增,且可以根据优先级别覆盖参数
|
||||||
BaseOptions options = BaseOptions(
|
BaseOptions options = BaseOptions(
|
||||||
//请求基地址,可以包含子路径
|
//请求基地址,可以包含子路径
|
||||||
@@ -103,7 +104,7 @@ class Request {
|
|||||||
//Http请求头.
|
//Http请求头.
|
||||||
headers: {
|
headers: {
|
||||||
'user-agent': 'Dart/3.6 (dart:io)', // Http2Adapter不会自动添加标头
|
'user-agent': 'Dart/3.6 (dart:io)', // Http2Adapter不会自动添加标头
|
||||||
if (!Pref.enableHttp2) 'connection': 'keep-alive',
|
if (!enableHttp2) 'connection': 'keep-alive',
|
||||||
'accept-encoding': 'br,gzip',
|
'accept-encoding': 'br,gzip',
|
||||||
},
|
},
|
||||||
responseDecoder: _responseDecoder, // Http2Adapter没有自动解压
|
responseDecoder: _responseDecoder, // Http2Adapter没有自动解压
|
||||||
@@ -127,31 +128,25 @@ class Request {
|
|||||||
..idleTimeout = const Duration(seconds: 15)
|
..idleTimeout = const Duration(seconds: 15)
|
||||||
..autoUncompress = false
|
..autoUncompress = false
|
||||||
..findProxy = ((_) => 'PROXY $systemProxyHost:$systemProxyPort')
|
..findProxy = ((_) => 'PROXY $systemProxyHost:$systemProxyPort')
|
||||||
..badCertificateCallback =
|
..badCertificateCallback = (cert, host, port) => true
|
||||||
(X509Certificate cert, String host, int port) => true
|
|
||||||
: () => HttpClient()
|
: () => HttpClient()
|
||||||
..idleTimeout = const Duration(seconds: 15)
|
..idleTimeout = const Duration(seconds: 15)
|
||||||
..autoUncompress = false, // Http2Adapter没有自动解压, 统一行为
|
..autoUncompress = false, // Http2Adapter没有自动解压, 统一行为
|
||||||
);
|
);
|
||||||
|
|
||||||
late final Uri proxy;
|
|
||||||
if (enableSystemProxy) {
|
|
||||||
proxy = Uri(
|
|
||||||
scheme: 'http',
|
|
||||||
host: systemProxyHost,
|
|
||||||
port: systemProxyPort,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
dio = Dio(options)
|
dio = Dio(options)
|
||||||
..httpClientAdapter = Pref.enableHttp2
|
..httpClientAdapter = enableHttp2
|
||||||
? Http2Adapter(
|
? Http2Adapter(
|
||||||
ConnectionManager(
|
ConnectionManager(
|
||||||
idleTimeout: const Duration(seconds: 15),
|
idleTimeout: const Duration(seconds: 15),
|
||||||
onClientCreate: enableSystemProxy
|
onClientCreate: enableSystemProxy
|
||||||
? (_, config) {
|
? (_, config) {
|
||||||
config
|
config
|
||||||
..proxy = proxy
|
..proxy = Uri(
|
||||||
|
scheme: 'http',
|
||||||
|
host: systemProxyHost,
|
||||||
|
port: systemProxyPort,
|
||||||
|
)
|
||||||
..onBadCertificate = (_) => true;
|
..onBadCertificate = (_) => true;
|
||||||
}
|
}
|
||||||
: Pref.badCertificateCallback
|
: Pref.badCertificateCallback
|
||||||
|
|||||||
Reference in New Issue
Block a user