2023-08-15 11:05:27 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2024-02-12 00:22:25 +01:00
|
|
|
import 'package:revanced_manager/gen/strings.g.dart';
|
2023-08-15 11:05:27 +02:00
|
|
|
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
2024-01-14 23:29:24 +01:00
|
|
|
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_switch_list_tile.dart';
|
2023-08-15 11:05:27 +02:00
|
|
|
|
|
|
|
class SEnablePatchesSelection extends StatefulWidget {
|
|
|
|
const SEnablePatchesSelection({super.key});
|
|
|
|
|
|
|
|
@override
|
2023-12-23 04:47:12 +01:00
|
|
|
State<SEnablePatchesSelection> createState() =>
|
|
|
|
_SEnablePatchesSelectionState();
|
2023-08-15 11:05:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
final _settingsViewModel = SettingsViewModel();
|
|
|
|
|
|
|
|
class _SEnablePatchesSelectionState extends State<SEnablePatchesSelection> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-01-14 23:29:24 +01:00
|
|
|
return HapticSwitchListTile(
|
2023-08-15 11:05:27 +02:00
|
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
2024-02-12 00:22:25 +01:00
|
|
|
title: Text(
|
|
|
|
t.settingsView.enablePatchesSelectionLabel,
|
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.w500,
|
2023-08-15 11:05:27 +02:00
|
|
|
),
|
|
|
|
),
|
2024-02-12 00:22:25 +01:00
|
|
|
subtitle: Text(t.settingsView.enablePatchesSelectionHint),
|
2023-08-15 11:05:27 +02:00
|
|
|
value: _settingsViewModel.isPatchesChangeEnabled(),
|
|
|
|
onChanged: (value) async {
|
|
|
|
await _settingsViewModel.showPatchesChangeEnableDialog(value, context);
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|