diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index edf20eb..73ad2e8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,8 @@ + android:icon="@mipmap/ic_launcher" + android:usesCleartextTraffic="true"> get playerStateStream { return player.playerStateStream; } diff --git a/lib/views/lcd.dart b/lib/views/lcd.dart index 9d6ecdc..b32f1cf 100644 --- a/lib/views/lcd.dart +++ b/lib/views/lcd.dart @@ -11,12 +11,16 @@ class LCD extends StatefulWidget { } class _LCDState extends State { + static const _lcdOnColor = Colors.amber; + static const _lcdOffColor = Color.fromARGB(255, 255, 219, 110); + Color _lcdColor = _lcdOffColor; + @override Widget build(BuildContext context) { return Container( - decoration: const BoxDecoration( - color: Colors.amber, - border: Border( + decoration: BoxDecoration( + color: _lcdColor, + border: const Border( top: BorderSide(width: 3.0, color: Colors.black), left: BorderSide(width: 3.0, color: Colors.black), bottom: BorderSide( @@ -35,23 +39,39 @@ class _LCDState extends State { style: const TextStyle( color: Colors.black, ), - child: Consumer(builder: (context, sb, child) { - if (sb.currentCall != null) { - return FutureBuilder( - future: sb.currentCall?.tg, - builder: (BuildContext context, - AsyncSnapshot tgi) { - return Text( - '${tgi.data?.name ?? sb.currentCall!.call.talkgroup}${tgi.data?.learned ?? false ? ' 📓' : ''}'); - }); - } - - return const Text(''); - }), + child: lcdContents(), ), ), )); } + + void lcdOn() { + setState(() { + _lcdColor = _lcdOnColor; + }); + } + + void lcdOff() { + setState(() { + _lcdColor = _lcdOffColor; + }); + } + + Widget lcdContents() { + return Consumer(builder: (context, sb, child) { + if (sb.currentCall != null) { + lcdOn(); + return FutureBuilder( + future: sb.currentCall?.tg, + builder: (BuildContext context, AsyncSnapshot tgi) { + return Text( + '${tgi.data?.name ?? sb.currentCall!.call.talkgroup}${tgi.data?.learned ?? false ? ' 📓' : ''}'); + }); + } + + return const Text(''); + }); + } } class ScannerLabel extends StatefulWidget {