fixes and ui.dart

This commit is contained in:
2024-06-08 12:55:58 +02:00
parent 95d51c82e9
commit 243a274480
9 changed files with 277 additions and 230 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:simplecloudnotifier/utils/toaster.dart';
import 'package:simplecloudnotifier/utils/ui.dart';
import 'package:toastification/toastification.dart';
class DebugActionsPage extends StatefulWidget {
@@ -17,36 +18,40 @@ class _DebugActionsPageState extends State<DebugActionsPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
FilledButton(
style: FilledButton.styleFrom(textStyle: const TextStyle(fontSize: 20)),
UI.button(
big: false,
onPressed: () => Toaster.success("Hello World", "This was a triumph!"),
child: const Text('Show Success Notification'),
text: 'Show Success Notification',
),
FilledButton(
style: FilledButton.styleFrom(textStyle: const TextStyle(fontSize: 20)),
SizedBox(height: 4),
UI.button(
big: false,
onPressed: () => Toaster.info("Hello World", "This was a triumph!"),
child: const Text('Show Info Notification'),
text: 'Show Info Notification',
),
FilledButton(
style: FilledButton.styleFrom(textStyle: const TextStyle(fontSize: 20)),
SizedBox(height: 4),
UI.button(
big: false,
onPressed: () => Toaster.warn("Hello World", "This was a triumph!"),
child: const Text('Show Warn Notification'),
text: 'Show Warn Notification',
),
FilledButton(
style: FilledButton.styleFrom(textStyle: const TextStyle(fontSize: 20)),
SizedBox(height: 4),
UI.button(
big: false,
onPressed: () => Toaster.error("Hello World", "This was a triumph!"),
child: const Text('Show Info Notification'),
text: 'Show Info Notification',
),
FilledButton(
style: FilledButton.styleFrom(textStyle: const TextStyle(fontSize: 20)),
SizedBox(height: 4),
UI.button(
big: false,
onPressed: () => Toaster.simple("Hello World"),
child: const Text('Show Simple Notification'),
text: 'Show Simple Notification',
),
SizedBox(height: 20),
FilledButton(
style: FilledButton.styleFrom(textStyle: const TextStyle(fontSize: 20)),
UI.button(
big: false,
onPressed: _sendTokenToServer,
child: const Text('Send FCM Token to Server'),
text: 'Send FCM Token to Server',
),
],
),

View File

@@ -4,6 +4,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:simplecloudnotifier/components/layout/scaffold.dart';
import 'package:simplecloudnotifier/state/request_log.dart';
import 'package:simplecloudnotifier/utils/toaster.dart';
import 'package:simplecloudnotifier/utils/ui.dart';
class DebugRequestViewPage extends StatelessWidget {
final SCNRequest request;
@@ -55,17 +56,13 @@ class DebugRequestViewPage extends StatelessWidget {
Expanded(
child: Text(title, style: TextStyle(fontWeight: FontWeight.bold)),
),
IconButton(
icon: FaIcon(
FontAwesomeIcons.copy,
),
UI.buttonIconOnly(
iconSize: 14,
padding: EdgeInsets.fromLTRB(0, 0, 4, 0),
constraints: BoxConstraints(),
onPressed: () {
Clipboard.setData(new ClipboardData(text: value));
Clipboard.setData(new ClipboardData(text: title));
Toaster.info("Clipboard", 'Copied text to Clipboard');
},
icon: FontAwesomeIcons.copy,
),
],
),