This commit is contained in:
@ -1,7 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:f0ckapp/utils/animatedtransition.dart';
|
||||
import 'package:f0ckapp/utils/smartrefreshindicator.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
@ -10,6 +8,8 @@ import 'package:get/get.dart';
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import 'package:f0ckapp/utils/animatedtransition.dart';
|
||||
import 'package:f0ckapp/utils/smartrefreshindicator.dart';
|
||||
import 'package:f0ckapp/controller/media_controller.dart';
|
||||
import 'package:f0ckapp/models/media_item.dart';
|
||||
import 'package:f0ckapp/screens/media_grid.dart';
|
||||
@ -151,7 +151,11 @@ class _DetailViewState extends State<DetailView> {
|
||||
title: Text('f0ck #${currentItem.id.toString()}'),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => Get.back(),
|
||||
onPressed: () {
|
||||
Navigator.canPop(context)
|
||||
? Get.back()
|
||||
: Get.offAllNamed('/');
|
||||
}
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
|
@ -1,10 +1,11 @@
|
||||
import 'package:f0ckapp/utils/animatedtransition.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:f0ckapp/controller/media_controller.dart';
|
||||
import 'package:f0ckapp/controller/localization_controller.dart';
|
||||
import 'package:f0ckapp/utils/animatedtransition.dart';
|
||||
|
||||
class SettingsPage extends StatefulWidget {
|
||||
const SettingsPage({super.key});
|
||||
@ -14,7 +15,8 @@ class SettingsPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SettingsPageState extends State<SettingsPage> {
|
||||
final MediaController controller = Get.find<MediaController>();
|
||||
final MediaController controller = Get.find();
|
||||
final LocalizationController localizationController = Get.find();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -24,12 +26,12 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
SliverAppBar(
|
||||
floating: false,
|
||||
pinned: true,
|
||||
title: const Text('Settings'),
|
||||
title: Text('settings_title'.tr),
|
||||
),
|
||||
SliverList(
|
||||
delegate: SliverChildListDelegate([
|
||||
ListTile(
|
||||
title: const Text("Spaltenanzahl"),
|
||||
title: Text('settings_numberofcolumns_title'.tr),
|
||||
trailing: Obx(
|
||||
() => DropdownButton<int>(
|
||||
value: controller.crossAxisCount.value,
|
||||
@ -38,7 +40,13 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
items: [0, 3, 4, 5].map((int value) {
|
||||
return DropdownMenuItem<int>(
|
||||
value: value,
|
||||
child: Text(value == 0 ? 'auto' : '$value Spalten'),
|
||||
child: Text(
|
||||
value == 0
|
||||
? 'auto'
|
||||
: 'settings_numberofcolumns_columns'.trParams({
|
||||
'count': value.toString(),
|
||||
}),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (int? newValue) async {
|
||||
@ -52,7 +60,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
),
|
||||
const Divider(),
|
||||
ListTile(
|
||||
title: const Text("Seitenwechselanimation"),
|
||||
title: Text('settings_pageanimation_title'.tr),
|
||||
trailing: Obx(
|
||||
() => DropdownButton<PageTransition>(
|
||||
value: controller.transitionType.value,
|
||||
@ -94,10 +102,8 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
|
||||
const Divider(),
|
||||
SwitchListTile(
|
||||
title: const Text("Drawer per Geste öffnen"),
|
||||
subtitle: const Text(
|
||||
"Wähle, ob der Drawer mit einer Wischgeste geschlossen/ geöffnet werden kann.",
|
||||
),
|
||||
title: Text('settings_drawer_title'.tr),
|
||||
subtitle: Text('settings_drawer_subtitle'.tr),
|
||||
value: controller.drawerSwipeEnabled.value,
|
||||
onChanged: (bool value) async {
|
||||
await controller.setDrawerSwipeEnabled(value);
|
||||
@ -106,17 +112,50 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
),
|
||||
const Divider(),
|
||||
ListTile(
|
||||
title: Text("Cache löschen"),
|
||||
title: Text('settings_language'.tr),
|
||||
trailing: Obx(
|
||||
() => DropdownButton<Locale>(
|
||||
value: localizationController.currentLocale.value,
|
||||
dropdownColor: const Color.fromARGB(255, 43, 43, 43),
|
||||
iconEnabledColor: Colors.white,
|
||||
items: const [
|
||||
DropdownMenuItem<Locale>(
|
||||
value: Locale('en', 'US'),
|
||||
child: Text('English'),
|
||||
),
|
||||
DropdownMenuItem<Locale>(
|
||||
value: Locale('de', 'DE'),
|
||||
child: Text('Deutsch'),
|
||||
),
|
||||
DropdownMenuItem<Locale>(
|
||||
value: Locale('fr', 'FR'),
|
||||
child: Text('Français'),
|
||||
),
|
||||
DropdownMenuItem<Locale>(
|
||||
value: Locale('nl', 'NL'),
|
||||
child: Text('Nederlands'),
|
||||
),
|
||||
],
|
||||
onChanged: (Locale? newLocale) async {
|
||||
if (newLocale != null) {
|
||||
await localizationController.changeLocale(newLocale);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
ListTile(
|
||||
title: Text('settings_cache_title'.tr),
|
||||
trailing: ElevatedButton(
|
||||
onPressed: () async {
|
||||
await DefaultCacheManager().emptyCache();
|
||||
if (!mounted) return;
|
||||
Get.snackbar('', 'der Cache wurde geleert.');
|
||||
},
|
||||
child: const Text("Löschen"),
|
||||
child: Text('settings_cache_clear_button'.tr),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
]),
|
||||
),
|
||||
],
|
||||
|
Reference in New Issue
Block a user