mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
f89c742c90
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
44 lines
1.5 KiB
Dart
44 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:revanced_manager/gen/strings.g.dart';
|
|
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_sources.dart';
|
|
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
|
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_switch_list_tile.dart';
|
|
|
|
class SUseAlternativeSources extends StatefulWidget {
|
|
const SUseAlternativeSources({super.key});
|
|
|
|
@override
|
|
State<SUseAlternativeSources> createState() => _SUseAlternativeSourcesState();
|
|
}
|
|
|
|
final _settingsViewModel = SettingsViewModel();
|
|
|
|
class _SUseAlternativeSourcesState extends State<SUseAlternativeSources> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
HapticSwitchListTile(
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
|
title: Text(
|
|
t.settingsView.useAlternativeSources,
|
|
style: const TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
subtitle: Text(t.settingsView.useAlternativeSourcesHint),
|
|
value: _settingsViewModel.isUsingAlternativeSources(),
|
|
onChanged: (value) {
|
|
_settingsViewModel.useAlternativeSources(value);
|
|
setState(() {});
|
|
},
|
|
),
|
|
if (_settingsViewModel.isUsingAlternativeSources())
|
|
const SManageSourcesUI(),
|
|
],
|
|
);
|
|
}
|
|
}
|