opt.: custom diskIgnorePath

This commit is contained in:
lollipopkit
2023-05-26 12:46:47 +08:00
parent 46350b7522
commit c4594559a2
13 changed files with 90 additions and 25 deletions

View File

@@ -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()));
}
},
));
},
);
}
}