mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
opt.: custom diskIgnorePath
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -135,6 +136,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_buildDistLogoSwitch(),
|
||||
_buildUpdateInterval(),
|
||||
_buildMaxRetry(),
|
||||
_buildDiskIgnorePath(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
);
|
||||
}
|
||||
@@ -568,4 +570,30 @@ class _SettingPageState extends State<SettingPage> {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDiskIgnorePath() {
|
||||
final paths = _setting.diskIgnorePath.fetch()!;
|
||||
return ListTile(
|
||||
title: Text(_s.diskIgnorePath),
|
||||
trailing: Text(_s.edit, style: textSize15,),
|
||||
onTap: () {
|
||||
showRoundDialog(context: context, child: Input(
|
||||
controller: TextEditingController(text: json.encode(paths)),
|
||||
label: 'JSON',
|
||||
type: TextInputType.visiblePassword,
|
||||
maxLines: 3,
|
||||
onSubmitted: (p0) {
|
||||
try {
|
||||
final list = List<String>.from(json.decode(p0));
|
||||
_setting.diskIgnorePath.put(list);
|
||||
context.pop();
|
||||
showSnackBar(context, Text(_s.success));
|
||||
} catch (e) {
|
||||
showSnackBar(context, Text(e.toString()));
|
||||
}
|
||||
},
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user