Implement settings
This commit is contained in:
@@ -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',
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@@ -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) {
|
||||
|
@@ -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) {
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user