-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
133 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.0.4 | ||
v0.0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
- [x] 增加分类 | ||
v0.0.5 | ||
|
||
- [x] 安卓可以在设置中开启音量键翻页 | ||
|
||
v0.0.4 | ||
|
||
- [x] 增加分类筛选项 | ||
- [x] 升级flutter版本 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/// 音量键翻页 | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
import '../basic/commons.dart'; | ||
import '../basic/methods.dart'; | ||
|
||
const _propertyName = "volumeController"; | ||
late bool volumeController; | ||
|
||
Future<void> initVolumeController() async { | ||
volumeController = (await methods.loadProperty(k: _propertyName)) == "true"; | ||
} | ||
|
||
Future<void> _chooseVolumeController(BuildContext context) async { | ||
String? result = await chooseListDialog<String>( | ||
context, | ||
title: "音量键控制翻页", | ||
values: ["是", "否"], | ||
); | ||
if (result != null) { | ||
var target = result == "是"; | ||
await methods.saveProperty(k: _propertyName, v: "$target"); | ||
volumeController = target; | ||
} | ||
} | ||
|
||
Widget volumeControllerSetting() { | ||
if (Platform.isAndroid) { | ||
return StatefulBuilder(builder: | ||
(BuildContext context, void Function(void Function()) setState) { | ||
return ListTile( | ||
title: const Text("阅读器音量键翻页"), | ||
subtitle: Text(volumeController ? "是" : "否"), | ||
onTap: () async { | ||
await _chooseVolumeController(context); | ||
setState(() {}); | ||
}); | ||
}); | ||
} | ||
return Container(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.