mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
new: prefer temperature device (#285)
This commit is contained in:
@@ -190,6 +190,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
//_buildDiskIgnorePath(),
|
||||
_buildDeleteServers(),
|
||||
_buildTextScaler(),
|
||||
_buildPreferTemperatureDeviceList(),
|
||||
//if (isDesktop) _buildDoubleColumnServersPage(),
|
||||
].map((e) => CardX(child: e)).toList(),
|
||||
);
|
||||
@@ -1153,4 +1154,37 @@ class _SettingPageState extends State<SettingPage> {
|
||||
trailing: StoreSwitch(prop: _setting.containerParseStat),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPreferTemperatureDeviceList() {
|
||||
void onSubmitted(String s) {
|
||||
final list = s.split('\n');
|
||||
_setting.preferTemperatureDevs.put(list);
|
||||
context.pop();
|
||||
}
|
||||
return ListTile(
|
||||
title: Text(l10n.preferTemperatureDeviceList),
|
||||
subtitle: Text(l10n.preferTemperatureDeviceListTip, style: UIs.textGrey),
|
||||
trailing: const Icon(Icons.keyboard_arrow_right),
|
||||
onTap: () {
|
||||
final list = _setting.preferTemperatureDevs.fetch();
|
||||
final listStr = list.join('\n');
|
||||
final ctrl = TextEditingController(text: listStr);
|
||||
context.showRoundDialog(
|
||||
title: Text(l10n.preferTemperatureDeviceList),
|
||||
child: Input(
|
||||
autoFocus: true,
|
||||
controller: ctrl,
|
||||
maxLines: 3,
|
||||
onSubmitted: onSubmitted,
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => onSubmitted(ctrl.text),
|
||||
child: Text(l10n.ok),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user