Improve
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 84;
|
||||
static const String engine =
|
||||
"Flutter 2.8.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 77d935af4d (4 weeks ago) • 2021-12-16 08:37:33 -0800\nEngine • revision 890a5fca2e\nTools • Dart 2.15.1\n";
|
||||
static const String buildAt = "2022-01-16 15:21:07.640484";
|
||||
static const int modifications = 3;
|
||||
static const int build = 85;
|
||||
static const String engine = "Flutter 2.8.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 77d935af4d (5 weeks ago) • 2021-12-16 08:37:33 -0800\nEngine • revision 890a5fca2e\nTools • Dart 2.15.1\n";
|
||||
static const String buildAt = "2022-01-18 13:38:59.083528";
|
||||
static const int modifications = 1;
|
||||
}
|
||||
|
||||
@@ -17,9 +17,8 @@ class _PingPageState extends State<PingPage>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
late TextEditingController _textEditingController;
|
||||
late TextEditingController _textEditingControllerResult;
|
||||
late MediaQueryData _media;
|
||||
late String _result;
|
||||
late Ping _ping;
|
||||
Ping? _ping;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -34,7 +33,6 @@ class _PingPageState extends State<PingPage>
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
_media = MediaQuery.of(context);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -58,7 +56,7 @@ class _PingPageState extends State<PingPage>
|
||||
void doPing() {
|
||||
_result = '';
|
||||
_ping = Ping(_textEditingController.text.trim());
|
||||
_ping.stream.listen((event) {
|
||||
_ping!.stream.listen((event) {
|
||||
final resp = event.response.toString();
|
||||
if (resp == 'null') return;
|
||||
_result += '$resp\n';
|
||||
@@ -86,7 +84,7 @@ class _PingPageState extends State<PingPage>
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
_ping.stop();
|
||||
if (_ping != null) _ping!.stop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
@@ -120,10 +118,7 @@ class _PingPageState extends State<PingPage>
|
||||
}
|
||||
|
||||
Widget _buildResult() {
|
||||
return SizedBox(
|
||||
height: _media.size.height * 0.47,
|
||||
child: _buildInput(_textEditingControllerResult, hint: 'Result here.'),
|
||||
);
|
||||
return _buildInput(_textEditingControllerResult, hint: 'Result here.');
|
||||
}
|
||||
|
||||
Widget _buildInput(TextEditingController controller, {int maxLines = 20, String? hint}) {
|
||||
|
||||
@@ -182,6 +182,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
|
||||
Widget _buildLaunchPage() {
|
||||
return ExpansionTile(
|
||||
textColor: priColor,
|
||||
tilePadding: EdgeInsets.zero,
|
||||
childrenPadding: EdgeInsets.zero,
|
||||
title: const Text(
|
||||
@@ -192,6 +193,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
constraints: BoxConstraints(maxWidth: _media.size.width * 0.35),
|
||||
child: Text(
|
||||
tabs[_launchPageIdx],
|
||||
style: textStyle,
|
||||
textScaleFactor: 1.0,
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
@@ -202,6 +204,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
title: Text(
|
||||
e,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: _theme.textTheme.bodyText2!.color!.withAlpha(177)),
|
||||
),
|
||||
trailing: _buildRadio(tabs.indexOf(e)),
|
||||
|
||||
Reference in New Issue
Block a user