Update
This commit is contained in:
parent
f2d808f5d3
commit
41b191bdd3
6 changed files with 80 additions and 30 deletions
|
@ -1,8 +1,11 @@
|
|||
import 'package:desktopapp/classes/stream_element.dart';
|
||||
import 'package:desktopapp/utils/requests.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class StreamElementCard extends StatelessWidget {
|
||||
StreamElementCard({Key? key, required this.streamElement}) : super(key: key);
|
||||
const StreamElementCard({Key? key, required this.streamElement})
|
||||
: super(key: key);
|
||||
|
||||
final StreamElement streamElement;
|
||||
|
||||
|
@ -25,15 +28,29 @@ class StreamElementCard extends StatelessWidget {
|
|||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
DateFormat.jms().format(streamElement.date),
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Icon(
|
||||
icon,
|
||||
size: 30,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
streamElement.message,
|
||||
style: TextStyle(fontSize: 16),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
streamElement.message,
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
if (streamElement.type == StreamElementType.alert)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.send),
|
||||
onPressed: () async {
|
||||
await Requests.sendAlert(streamElement.message);
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
|
|
@ -43,7 +43,7 @@ class _HomePageState extends State<HomePage> {
|
|||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await Mailer.disconnect();
|
||||
await Mailer.disconnect(streamController: controller);
|
||||
setState(() {
|
||||
connected = false;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue