mirror of
https://github.com/amigan/calls.git
synced 2024-11-21 20:39:47 -05:00
add fields
This commit is contained in:
parent
b9f31f45ae
commit
42a4ccedd9
1 changed files with 40 additions and 20 deletions
|
@ -44,28 +44,47 @@ 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(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(callTime),
|
Text(callTime),
|
||||||
Text('${tgi.data?.systemName ?? (_call?.call.system ?? '')}'),
|
Text(
|
||||||
|
'${tgi.data?.systemName ?? (_call?.call.system ?? '')}'),
|
||||||
Text('Q: $queueLen'),
|
Text('Q: $queueLen'),
|
||||||
]),
|
]),
|
||||||
Row(
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 14.0, bottom: 14.0),
|
||||||
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Flexible(
|
||||||
'${tgi.data?.name ?? (_call?.call.talkgroup ?? '')}${tgi.data?.learned ?? false ? ' 📓' : ''}'),
|
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 ? '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,
|
||||||
|
|
Loading…
Reference in a new issue