2023-08-03 22:23:56 +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-03 22:23:56 +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-03 22:23:56 +02:00
|
|
|
|
|
|
|
class SAutoUpdatePatches extends StatefulWidget {
|
|
|
|
const SAutoUpdatePatches({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<SAutoUpdatePatches> createState() => _SAutoUpdatePatchesState();
|
|
|
|
}
|
|
|
|
|
|
|
|
final _settingsViewModel = SettingsViewModel();
|
|
|
|
|
|
|
|
class _SAutoUpdatePatchesState extends State<SAutoUpdatePatches> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-01-14 23:29:24 +01:00
|
|
|
return HapticSwitchListTile(
|
2023-08-03 22:23:56 +02:00
|
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
2024-02-12 00:22:25 +01:00
|
|
|
title: Text(
|
|
|
|
t.settingsView.autoUpdatePatchesLabel,
|
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.w500,
|
2023-08-03 22:23:56 +02:00
|
|
|
),
|
|
|
|
),
|
2024-02-12 00:22:25 +01:00
|
|
|
subtitle: Text(t.settingsView.autoUpdatePatchesHint),
|
2023-08-03 22:23:56 +02:00
|
|
|
value: _settingsViewModel.isPatchesAutoUpdate(),
|
|
|
|
onChanged: (value) {
|
|
|
|
setState(() {
|
|
|
|
_settingsViewModel.setPatchesAutoUpdate(value);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|