opt: popupmenu item

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-29 12:59:52 +08:00
parent 9c989d0699
commit 203906d9f1
3 changed files with 58 additions and 33 deletions

View File

@@ -12,7 +12,7 @@ class FontSizeSelectPage extends StatefulWidget {
class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
Box setting = GStorage.setting;
List<double> list = List.generate(12, (index) => 0.85 + index * 0.05);
List<double> list = List.generate(16, (index) => 0.85 + index * 0.05);
//[0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35];
late double minSize;
late double maxSize;
@@ -29,8 +29,8 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
setFontSize() {
setting.put(SettingBoxKey.defaultTextScale, currentSize);
Get.forceAppUpdate();
Get.back(result: currentSize);
Get.forceAppUpdate();
}
@override
@@ -38,7 +38,13 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
return Scaffold(
appBar: AppBar(
actions: [
TextButton(onPressed: () => setFontSize(), child: const Text('确定')),
TextButton(
onPressed: () {
currentSize = 1.0;
setFontSize();
},
child: const Text('重置')),
TextButton(onPressed: setFontSize, child: const Text('确定')),
const SizedBox(width: 12)
],
),