mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-20 16:15:47 +08:00
@@ -161,9 +161,14 @@ class RequestEditorState extends State<MobileRequestEditor> with SingleTickerPro
|
||||
return _HttpWidget(
|
||||
key: responseKey,
|
||||
title: Row(children: [
|
||||
Text(response?.protocolVersion ?? '',
|
||||
style: const TextStyle(fontWeight: FontWeight.w500, color: Colors.blue)),
|
||||
const SizedBox(width: 10),
|
||||
Text("${localizations.statusCode}: ", style: const TextStyle(fontWeight: FontWeight.w500)),
|
||||
const SizedBox(width: 10),
|
||||
Text(response?.status.toString() ?? "", style: const TextStyle(color: Colors.blue))
|
||||
Text(response?.status.toString() ?? "",
|
||||
style:
|
||||
TextStyle(color: response?.status.isSuccessful() == true ? Colors.blue : Colors.red))
|
||||
]),
|
||||
readOnly: true,
|
||||
message: response);
|
||||
@@ -179,7 +184,9 @@ class RequestEditorState extends State<MobileRequestEditor> with SingleTickerPro
|
||||
var requestBody = requestKey.currentState?.getBody();
|
||||
String url = currentState.requestUrl.text;
|
||||
|
||||
HttpRequest request = HttpRequest(HttpMethod.valueOf(currentState.requestMethod), Uri.parse(url).toString());
|
||||
HttpRequest request = HttpRequest(HttpMethod.valueOf(currentState.requestMethod), Uri.parse(url).toString(),
|
||||
protocolVersion: this.request?.protocolVersion ?? "HTTP/1.1");
|
||||
|
||||
request.headers.addAll(headers);
|
||||
request.body = requestBody == null ? null : utf8.encode(requestBody);
|
||||
|
||||
|
||||
@@ -18,7 +18,12 @@ class RequestSequence extends StatefulWidget {
|
||||
final Function(List<HttpRequest>)? onRemove;
|
||||
|
||||
const RequestSequence(
|
||||
{super.key, required this.container, required this.proxyServer, this.displayDomain = true, this.onRemove, this.sortDesc});
|
||||
{super.key,
|
||||
required this.container,
|
||||
required this.proxyServer,
|
||||
this.displayDomain = true,
|
||||
this.onRemove,
|
||||
this.sortDesc});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
@@ -154,9 +159,14 @@ class RequestSequenceState extends State<RequestSequence> with AutomaticKeepAliv
|
||||
Divider(thickness: 0.2, height: 0, color: Theme.of(context).dividerColor),
|
||||
itemCount: view.length,
|
||||
itemBuilder: (context, index) {
|
||||
final requestId = view.elementAt(index).requestId;
|
||||
|
||||
// 确保每个 requestId 对应唯一的 GlobalKey
|
||||
final key = indexes.putIfAbsent(requestId, () => GlobalKey<RequestRowState>());
|
||||
|
||||
return RequestRow(
|
||||
index: sortDesc ? view.length - index : index,
|
||||
key: indexes[view.elementAt(index).requestId] ??= GlobalKey(),
|
||||
key: key,
|
||||
request: view.elementAt(index),
|
||||
proxyServer: widget.proxyServer,
|
||||
displayDomain: widget.displayDomain,
|
||||
|
||||
Reference in New Issue
Block a user