mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-03-15 04:23:17 +08:00
json text
This commit is contained in:
3
devtools_options.yaml
Normal file
3
devtools_options.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
description: This file stores settings for Dart & Flutter DevTools.
|
||||||
|
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||||
|
extensions:
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:proxypin/ui/component/json/theme.dart';
|
import 'package:proxypin/ui/component/json/theme.dart';
|
||||||
|
|
||||||
@@ -31,34 +30,23 @@ class JsonText extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var jsnParser = JsnParser(json, colorTheme, indent);
|
var jsnParser = JsnParser(json, colorTheme, indent);
|
||||||
var future =
|
var textList = jsnParser.getJsonTree();
|
||||||
compute((message) => message.getJsonTree(), jsnParser).catchError((error) => <Text>[Text(error.toString())]);
|
|
||||||
|
|
||||||
return FutureBuilder(
|
Widget widget;
|
||||||
future: future,
|
if (textList.length < 1500) {
|
||||||
builder: (context, snapshot) {
|
widget = Column(crossAxisAlignment: CrossAxisAlignment.start, children: textList);
|
||||||
if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) {
|
} else {
|
||||||
var textList = snapshot.data as List<Text>;
|
widget = SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
Widget widget;
|
height: MediaQuery.of(context).size.height - 160,
|
||||||
if (textList.length < 2000) {
|
child: ListView.builder(
|
||||||
widget = Column(crossAxisAlignment: CrossAxisAlignment.start, children: textList);
|
physics: const BouncingScrollPhysics(),
|
||||||
} else {
|
controller: trackingScroll(),
|
||||||
widget = SizedBox(
|
cacheExtent: 1000,
|
||||||
width: double.infinity,
|
itemBuilder: (context, index) => textList[index],
|
||||||
height: MediaQuery.of(context).size.height - 160,
|
itemCount: textList.length));
|
||||||
child: ListView.builder(
|
}
|
||||||
physics: const BouncingScrollPhysics(),
|
return SelectionArea(child: widget);
|
||||||
controller: trackingScroll(),
|
|
||||||
cacheExtent: 1000,
|
|
||||||
itemBuilder: (context, index) => textList[index],
|
|
||||||
itemCount: textList.length));
|
|
||||||
}
|
|
||||||
return SelectionArea(child: widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Container();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///滚动条
|
///滚动条
|
||||||
|
|||||||
@@ -161,8 +161,8 @@ class RequestSequenceState extends State<RequestSequence> with AutomaticKeepAliv
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final requestId = view.elementAt(index).requestId;
|
final requestId = view.elementAt(index).requestId;
|
||||||
|
|
||||||
// 确保每个 requestId 对应唯一的 GlobalKey
|
final key = GlobalKey<RequestRowState>();
|
||||||
final key = indexes.putIfAbsent(requestId, () => GlobalKey<RequestRowState>());
|
indexes[requestId] = key;
|
||||||
|
|
||||||
return RequestRow(
|
return RequestRow(
|
||||||
index: sortDesc ? view.length - index : index,
|
index: sortDesc ? view.length - index : index,
|
||||||
@@ -173,6 +173,7 @@ class RequestSequenceState extends State<RequestSequence> with AutomaticKeepAliv
|
|||||||
onRemove: (request) {
|
onRemove: (request) {
|
||||||
setState(() {
|
setState(() {
|
||||||
view.remove(request);
|
view.remove(request);
|
||||||
|
indexes.remove(requestId);
|
||||||
});
|
});
|
||||||
widget.onRemove?.call([request]);
|
widget.onRemove?.call([request]);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: proxypin
|
|||||||
description: ProxyPin
|
description: ProxyPin
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
version: 1.1.8+18
|
version: 1.1.9+19
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.2 <4.0.0'
|
sdk: '>=3.0.2 <4.0.0'
|
||||||
|
|||||||
Reference in New Issue
Block a user