Add steam message
This commit is contained in:
parent
1351130f83
commit
f2d808f5d3
8 changed files with 226 additions and 68 deletions
44
lib/widgets/components/stream_element_card.dart
Normal file
44
lib/widgets/components/stream_element_card.dart
Normal file
|
@ -0,0 +1,44 @@
|
|||
import 'package:desktopapp/classes/stream_element.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StreamElementCard extends StatelessWidget {
|
||||
StreamElementCard({Key? key, required this.streamElement}) : super(key: key);
|
||||
|
||||
final StreamElement streamElement;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
IconData icon;
|
||||
switch (streamElement.type) {
|
||||
case StreamElementType.log:
|
||||
icon = Icons.info;
|
||||
break;
|
||||
case StreamElementType.alert:
|
||||
icon = Icons.notifications_active;
|
||||
break;
|
||||
}
|
||||
return Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
size: 30,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
streamElement.message,
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue