mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
new & opt
new: support set maxRetryCount of server reconnection opt: server detail UI opt: server provider opt: `ssh` page on Android
This commit is contained in:
@@ -32,6 +32,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
late int _selectedColorValue;
|
||||
late int _launchPageIdx;
|
||||
late int _termThemeIdx;
|
||||
late double _maxRetryCount;
|
||||
late double _updateInterval;
|
||||
|
||||
@override
|
||||
@@ -49,6 +50,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_launchPageIdx = _setting.launchPage.fetch()!;
|
||||
_termThemeIdx = _setting.termColorIdx.fetch()!;
|
||||
_updateInterval = _setting.serverStatusUpdateInterval.fetch()!.toDouble();
|
||||
_maxRetryCount = _setting.maxRetryCount.fetch()!.toDouble();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -66,6 +68,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_buildLaunchPage(),
|
||||
_buildDistLogoSwitch(),
|
||||
_buildTermTheme(),
|
||||
_buildMaxRetry(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
),
|
||||
);
|
||||
@@ -286,4 +289,48 @@ class _SettingPageState extends State<SettingPage> {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMaxRetry() {
|
||||
return ExpansionTile(
|
||||
textColor: primaryColor,
|
||||
title: Text(
|
||||
_s.maxRetryCount,
|
||||
style: textSize13,
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
trailing: Text('${_maxRetryCount.toInt()} ${_s.times}'),
|
||||
children: [
|
||||
Slider(
|
||||
thumbColor: primaryColor,
|
||||
activeColor: primaryColor.withOpacity(0.7),
|
||||
min: 0,
|
||||
max: 10,
|
||||
value: _maxRetryCount,
|
||||
onChanged: (newValue) {
|
||||
setState(() {
|
||||
_maxRetryCount = newValue;
|
||||
});
|
||||
},
|
||||
onChangeEnd: (val) {
|
||||
_setting.maxRetryCount.put(val.toInt());
|
||||
},
|
||||
label: '${_maxRetryCount.toInt()} ${_s.times}',
|
||||
divisions: 10,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
_maxRetryCount == 0.0
|
||||
? Text(
|
||||
_s.maxRetryCountEqual0,
|
||||
style: const TextStyle(color: Colors.grey, fontSize: 12),
|
||||
textAlign: TextAlign.center,
|
||||
)
|
||||
: const SizedBox(),
|
||||
const SizedBox(
|
||||
height: 13,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user