add fields

This commit is contained in:
Daniel 2024-08-20 12:48:25 -04:00
parent b9f31f45ae
commit 42a4ccedd9

View file

@ -44,29 +44,48 @@ class LCD extends StatelessWidget {
Widget lcdContents() { Widget lcdContents() {
String callTime = ''; String callTime = '';
if (_call != null) { if (_call != null) {
callTime = timeFormat.format(_call.call.dateTime.toDateTime(toLocal: true)); callTime =
timeFormat.format(_call.call.dateTime.toDateTime(toLocal: true));
} }
return FutureBuilder( return FutureBuilder(
future: _call?.tg, future: _call?.tg,
builder: (BuildContext context, AsyncSnapshot<TalkgroupInfo> tgi) { builder: (BuildContext context, AsyncSnapshot<TalkgroupInfo> tgi) {
return Column(mainAxisAlignment: MainAxisAlignment.start, children: [ return Column(
Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
crossAxisAlignment: CrossAxisAlignment.start, Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Text(callTime), crossAxisAlignment: CrossAxisAlignment.start,
Text('${tgi.data?.systemName ?? (_call?.call.system ?? '')}'), children: <Widget>[
Text('Q: $queueLen'), Text(callTime),
]), Text(
Row( '${tgi.data?.systemName ?? (_call?.call.system ?? '')}'),
mainAxisAlignment: MainAxisAlignment.spaceBetween, Text('Q: $queueLen'),
crossAxisAlignment: CrossAxisAlignment.start, ]),
children: <Widget>[ Padding(
Text( padding: EdgeInsets.only(top: 14.0, bottom: 14.0),
'${tgi.data?.name ?? (_call?.call.talkgroup ?? '')}${tgi.data?.learned ?? false ? ' 📓' : ''}'), child: Row(
Text(_call != null ? 'TG: ${_call.call.talkgroup}' : ''), mainAxisAlignment: MainAxisAlignment.spaceBetween,
]) crossAxisAlignment: CrossAxisAlignment.start,
]); children: <Widget>[
Flexible(
child: Text(
'${tgi.data?.name ?? (_call?.call.talkgroup ?? '')}${tgi.data?.learned ?? false ? ' 📓' : ''}',
style: const TextStyle(
fontSize: 20.0,
overflow: TextOverflow.ellipsis,
))),
])),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(_call != null ? 'TG: ${_call.call.talkgroup}' : ''),
Text(_call != null
? '${(_call.call.frequency.toDouble() / 1024 / 1024).toStringAsFixed(4)} MHz'
: ''),
Text(_call != null ? 'S: ${_call.call.source}' : ''),
]),
]);
}); });
} }
} }
@ -74,13 +93,14 @@ class LCD extends StatelessWidget {
class LED extends StatelessWidget { class LED extends StatelessWidget {
final Color _ledColor; final Color _ledColor;
LED(this._ledColor); const LED(this._ledColor, {super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: 20.0, width: 20.0,
height: 20.0, height: 20.0,
margin: const EdgeInsets.only(top: 4.0, right: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: _ledColor, color: _ledColor,
shape: BoxShape.circle, shape: BoxShape.circle,