SimpleCloudNotifier/flutter/lib/pages/debug/debug_actions.dart

73 lines
2.4 KiB
Dart
Raw Normal View History

2024-05-31 23:21:24 +02:00
import 'package:flutter/material.dart';
2024-06-15 21:29:51 +02:00
import 'package:simplecloudnotifier/utils/notifier.dart';
2024-05-31 23:21:24 +02:00
import 'package:simplecloudnotifier/utils/toaster.dart';
2024-06-08 12:55:58 +02:00
import 'package:simplecloudnotifier/utils/ui.dart';
2024-05-31 23:21:24 +02:00
class DebugActionsPage extends StatefulWidget {
@override
_DebugActionsPageState createState() => _DebugActionsPageState();
}
class _DebugActionsPageState extends State<DebugActionsPage> {
@override
Widget build(BuildContext context) {
return Container(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
2024-06-08 12:55:58 +02:00
UI.button(
big: false,
2024-05-31 23:21:24 +02:00
onPressed: () => Toaster.success("Hello World", "This was a triumph!"),
2024-06-08 12:55:58 +02:00
text: 'Show Success Notification',
2024-05-31 23:21:24 +02:00
),
2024-06-08 12:55:58 +02:00
SizedBox(height: 4),
UI.button(
big: false,
2024-05-31 23:21:24 +02:00
onPressed: () => Toaster.info("Hello World", "This was a triumph!"),
2024-06-08 12:55:58 +02:00
text: 'Show Info Notification',
2024-05-31 23:21:24 +02:00
),
2024-06-08 12:55:58 +02:00
SizedBox(height: 4),
UI.button(
big: false,
2024-05-31 23:21:24 +02:00
onPressed: () => Toaster.warn("Hello World", "This was a triumph!"),
2024-06-08 12:55:58 +02:00
text: 'Show Warn Notification',
2024-05-31 23:21:24 +02:00
),
2024-06-08 12:55:58 +02:00
SizedBox(height: 4),
UI.button(
big: false,
2024-05-31 23:21:24 +02:00
onPressed: () => Toaster.error("Hello World", "This was a triumph!"),
2024-06-08 12:55:58 +02:00
text: 'Show Info Notification',
2024-05-31 23:21:24 +02:00
),
2024-06-08 12:55:58 +02:00
SizedBox(height: 4),
UI.button(
big: false,
2024-05-31 23:21:24 +02:00
onPressed: () => Toaster.simple("Hello World"),
2024-06-08 12:55:58 +02:00
text: 'Show Simple Notification',
2024-05-31 23:21:24 +02:00
),
SizedBox(height: 20),
2024-06-08 12:55:58 +02:00
UI.button(
big: false,
2024-06-02 16:27:03 +02:00
onPressed: _sendTokenToServer,
2024-06-08 12:55:58 +02:00
text: 'Send FCM Token to Server',
2024-06-02 16:27:03 +02:00
),
2024-06-15 21:29:51 +02:00
SizedBox(height: 20),
UI.button(
big: false,
onPressed: () => Notifier.showLocalNotification('', 'TEST_CHANNEL', "Test Channel", "Channel for testing", "Hello World", "Local Notification test", null),
2024-06-15 21:29:51 +02:00
text: 'Show local notification',
),
2024-05-31 23:21:24 +02:00
],
),
),
),
);
}
2024-06-02 16:27:03 +02:00
void _sendTokenToServer() {
//TODO
}
2024-05-31 23:21:24 +02:00
}