pikapika/lib/basic/config/VolumeController.dart

29 lines
716 B
Dart
Raw Normal View History

2021-09-29 23:57:09 +00:00
/// 音量键翻页
import 'package:flutter/material.dart';
import '../Common.dart';
import '../Method.dart';
const propertyName = "volumeController";
late bool volumeController;
Future<void> initVolumeController() async {
volumeController = (await method.loadProperty(propertyName, "false")) == "true";
}
String volumeControllerName() {
return volumeController ? "" : "";
}
Future<void> chooseVolumeController(BuildContext context) async {
String? result =
await chooseListDialog<String>(context, "音量键控制翻页", ["", ""]);
if (result != null) {
var target = result == "";
await method.saveProperty(propertyName, "$target");
volumeController = target;
}
}