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), ), ], ) ], ), ), ); } }