Implement settings
Some checks failed
Build Docker and Deploy / Build Docker Container (push) Successful in 51s
Build Docker and Deploy / Run Unit-Tests (push) Failing after 11m17s
Build Docker and Deploy / Deploy to Server (push) Has been skipped

This commit is contained in:
2025-04-19 01:49:28 +02:00
parent 5417796f3f
commit b91ddc172d
33 changed files with 912 additions and 127 deletions

View File

@@ -2,6 +2,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:simplecloudnotifier/api/api_client.dart';
import 'package:simplecloudnotifier/state/app_settings.dart';
import 'package:simplecloudnotifier/state/app_auth.dart';
import 'package:simplecloudnotifier/state/application_log.dart';
import 'package:simplecloudnotifier/utils/notifier.dart';
@@ -67,8 +68,32 @@ class _DebugActionsPageState extends State<DebugActionsPage> {
SizedBox(height: 20),
UI.button(
big: false,
onPressed: () => Notifier.showLocalNotification('', 'TEST_CHANNEL', "Test Channel", "Channel for testing", "Hello World", "Local Notification test", null),
text: 'Show local notification',
onPressed: () => Notifier.showLocalNotification('', 'TEST_CHANNEL', "Test Channel", "Channel for testing", "Hello World", "Local Notification test", null, null),
text: 'Show local notification (generic)',
),
UI.button(
big: false,
onPressed: () => Notifier.showLocalNotification('', 'TEST_CHANNEL', "Test Channel", "Channel for testing", "Hello World", "Local Notification test", null, 0),
text: 'Show local notification (Prio = 0)',
),
UI.button(
big: false,
onPressed: () => Notifier.showLocalNotification('', 'TEST_CHANNEL', "Test Channel", "Channel for testing", "Hello World", "Local Notification test", null, 1),
text: 'Show local notification (Prio = 1)',
),
UI.button(
big: false,
onPressed: () => Notifier.showLocalNotification('', 'TEST_CHANNEL', "Test Channel", "Channel for testing", "Hello World", "Local Notification test", null, 2),
text: 'Show local notification (Prio = 2)',
),
SizedBox(height: 20),
UI.button(
big: false,
onPressed: () {
AppSettings().update((p) => p.reset());
Toaster.success("Success", "AppSettings reset to default");
},
text: 'Reset AppSettings to default',
),
],
),

View File

@@ -11,7 +11,7 @@ class DebugLogsPage extends StatefulWidget {
class _DebugLogsPageState extends State<DebugLogsPage> {
Box<SCNLog> logBox = Hive.box<SCNLog>('scn-logs');
static final _dateFormat = DateFormat('yyyy-MM-dd HH:mm'); //TODO setting
static final _dateFormat = DateFormat('yyyy-MM-dd HH:mm');
@override
Widget build(BuildContext context) {

View File

@@ -6,7 +6,9 @@ class DebugSharedPrefPage extends StatelessWidget {
final SharedPreferences sharedPref;
final List<String> keys;
DebugSharedPrefPage({required this.sharedPref}) : keys = sharedPref.getKeys().toList();
DebugSharedPrefPage({required this.sharedPref}) : keys = sharedPref.getKeys().toList() {
keys.sort((a, b) => a.compareTo(b));
}
@override
Widget build(BuildContext context) {

View File

@@ -13,7 +13,7 @@ class DebugRequestsPage extends StatefulWidget {
class _DebugRequestsPageState extends State<DebugRequestsPage> {
Box<SCNRequest> requestsBox = Hive.box<SCNRequest>('scn-requests');
static final _dateFormat = DateFormat('yyyy-MM-dd HH:mm'); //TODO setting
static final _dateFormat = DateFormat('yyyy-MM-dd HH:mm');
@override
Widget build(BuildContext context) {