This commit is contained in:
@ -4,7 +4,7 @@ import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:f0ckapp/controller/localizationcontroller.dart';
|
||||
import 'package:f0ckapp/controller/mediacontroller.dart';
|
||||
import 'package:f0ckapp/controller/settingscontroller.dart';
|
||||
import 'package:f0ckapp/utils/animatedtransition.dart';
|
||||
|
||||
class SettingsPage extends StatefulWidget {
|
||||
@ -15,8 +15,8 @@ class SettingsPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SettingsPageState extends State<SettingsPage> {
|
||||
final MediaController controller = Get.find();
|
||||
final LocalizationController localizationController = Get.find();
|
||||
final SettingsController settingsController = Get.find<SettingsController>();
|
||||
final LocalizationController localizationController = Get.find<LocalizationController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -34,7 +34,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
title: Text('settings_numberofcolumns_title'.tr),
|
||||
trailing: Obx(
|
||||
() => DropdownButton<int>(
|
||||
value: controller.crossAxisCount.value,
|
||||
value: settingsController.crossAxisCount.value,
|
||||
dropdownColor: const Color.fromARGB(255, 43, 43, 43),
|
||||
iconEnabledColor: Colors.white,
|
||||
items: [0, 3, 4, 5].map((int value) {
|
||||
@ -51,7 +51,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
}).toList(),
|
||||
onChanged: (int? newValue) async {
|
||||
if (newValue != null) {
|
||||
await controller.setCrossAxisCount(newValue);
|
||||
await settingsController.setCrossAxisCount(newValue);
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -62,7 +62,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
title: Text('settings_pageanimation_title'.tr),
|
||||
trailing: Obx(
|
||||
() => DropdownButton<PageTransition>(
|
||||
value: controller.transitionType.value,
|
||||
value: settingsController.transitionType.value,
|
||||
dropdownColor: const Color.fromARGB(255, 43, 43, 43),
|
||||
iconEnabledColor: Colors.white,
|
||||
items: PageTransition.values.map((PageTransition type) {
|
||||
@ -91,7 +91,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
}).toList(),
|
||||
onChanged: (PageTransition? newValue) async {
|
||||
if (newValue != null) {
|
||||
await controller.setTransitionType(newValue);
|
||||
await settingsController.setTransitionType(newValue);
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -102,9 +102,9 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
SwitchListTile(
|
||||
title: Text('settings_drawer_title'.tr),
|
||||
subtitle: Text('settings_drawer_subtitle'.tr),
|
||||
value: controller.drawerSwipeEnabled.value,
|
||||
value: settingsController.drawerSwipeEnabled.value,
|
||||
onChanged: (bool value) async {
|
||||
await controller.setDrawerSwipeEnabled(value);
|
||||
await settingsController.setDrawerSwipeEnabled(value);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
|
Reference in New Issue
Block a user