to laptptop

This commit is contained in:
ImBenji
2024-02-28 04:56:50 +00:00
parent 2ef40e6b27
commit 675c42d2da
19 changed files with 1758 additions and 151 deletions

View File

@@ -13,31 +13,138 @@ class pages_Home extends StatelessWidget {
return Container(
width: double.infinity,
margin: const EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Text("Home Page"),
ibus_display(),
SizedBox(
height: 10,
Container(
height: 2,
color: Colors.white70,
),
_QuickAnnouncements_IBUS(),
Container(
decoration: BoxDecoration(
color: Colors.grey.shade900,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 2,
spreadRadius: 4
)
]
),
margin: EdgeInsets.all(20),
child: ibus_display(),
SizedBox(
height: 10,
),
QuickAnnouncement(),
Container(
height: 2,
color: Colors.white70,
),
Container(
margin: EdgeInsets.all(20),
child: Container(
decoration: BoxDecoration(
color: Colors.grey.shade900,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 2,
spreadRadius: 4
)
]
),
child: _QuickAnnouncements_IBUS(
backgroundColor: Colors.grey.shade900,
outlineColor: Colors.white70,
),
),
),
Container(
height: 2,
color: Colors.white70,
),
Container(
margin: EdgeInsets.all(20),
height: 300-45,
child: ListView(
scrollDirection: Axis.vertical,
children: [
ElevatedButton(
onPressed: () {
LiveInformation liveInformation = LiveInformation();
liveInformation.announceRouteVariant(liveInformation.getRouteVariant()!);
},
child: Text("Test announcement"),
),
ElevatedButton(
onPressed: () {
LiveInformation liveInformation = LiveInformation();
liveInformation.updateServer();
},
child: Text("Update server"),
),
SizedBox(
width: 100,
child: TextField(
onChanged: (String value) {
LiveInformation liveInformation = LiveInformation();
// liveInformation.documentID = value;
},
),
),
SizedBox(
width: 200,
child: TextField(
onSubmitted: (String value) {
LiveInformation liveInformation = LiveInformation();
liveInformation.queueAnnouncement(AnnouncementQueueEntry(
displayText: value,
audioSources: []
));
},
),
),
ElevatedButton(
onPressed: () {
LiveInformation liveInformation = LiveInformation();
liveInformation.pullServer();
},
child: Text("Pull server"),
),
],
),
),
],
)
@@ -48,8 +155,10 @@ class pages_Home extends StatelessWidget {
class _QuickAnnouncements_IBUS extends StatefulWidget {
final Color backgroundColor;
final Color outlineColor;
_QuickAnnouncements_IBUS({super.key});
_QuickAnnouncements_IBUS({super.key, required this.backgroundColor, required this.outlineColor});
@override
State<_QuickAnnouncements_IBUS> createState() => _QuickAnnouncementsState_IBUS();
@@ -61,16 +170,23 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
int _currentIndex = 0;
_QuickAnnouncementsState_IBUS() {
LiveInformation liveInformation = LiveInformation();
for (ManualAnnouncementEntry announcement in liveInformation.manualAnnouncements) {
announcements.add(
_QuickAnnouncement_IBUS(announcement: announcement, index: liveInformation.manualAnnouncements.indexOf(announcement))
_QuickAnnouncement_IBUS(
announcement: announcement,
index: liveInformation.manualAnnouncements.indexOf(announcement),
outlineColor: Colors.white70
)
);
}
}
@override
Widget build(BuildContext context) {
@@ -78,9 +194,9 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
return Container(
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
color: widget.backgroundColor,
border: Border.all(
color: Colors.black,
color: widget.outlineColor,
width: 2
),
@@ -88,13 +204,19 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
),
padding: const EdgeInsets.all(2),
padding: const EdgeInsets.all(4),
width: double.infinity,
constraints: const BoxConstraints(
maxWidth: 400
),
child: Column(
children: [
Container(
height: 2,
color: Colors.black,
color: widget.outlineColor,
),
if (_currentIndex < announcements.length)
@@ -103,10 +225,10 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
Container(
height: 50,
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
border: const Border.symmetric(
color: widget.backgroundColor,
border: Border.symmetric(
vertical: BorderSide(
color: Colors.black,
color: widget.outlineColor,
width: 2
)
),
@@ -115,7 +237,7 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
Container(
height: 2,
color: Colors.black,
color: widget.outlineColor,
),
if (_currentIndex + 1 < announcements.length)
@@ -124,10 +246,10 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
Container(
height: 50,
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
border: const Border.symmetric(
color: widget.backgroundColor,
border: Border.symmetric(
vertical: BorderSide(
color: Colors.black,
color: widget.outlineColor,
width: 2
)
),
@@ -136,7 +258,7 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
Container(
height: 2,
color: Colors.black,
color: widget.outlineColor,
),
if (_currentIndex + 2 < announcements.length)
@@ -145,10 +267,10 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
Container(
height: 50,
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
border: const Border.symmetric(
color: widget.backgroundColor,
border: Border.symmetric(
vertical: BorderSide(
color: Colors.black,
color: widget.outlineColor,
width: 2
)
),
@@ -157,7 +279,7 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
Container(
height: 2,
color: Colors.black,
color: widget.outlineColor,
),
if (_currentIndex + 3 < announcements.length)
@@ -166,10 +288,10 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
Container(
height: 50,
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
border: const Border.symmetric(
color: widget.backgroundColor,
border: Border.symmetric(
vertical: BorderSide(
color: Colors.black,
color: widget.outlineColor,
width: 2
)
),
@@ -178,16 +300,16 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
Container(
height: 2,
color: Colors.black,
color: widget.outlineColor,
),
Container(
height: 40,
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
border: const Border.symmetric(
color: widget.backgroundColor,
border: Border.symmetric(
vertical: BorderSide(
color: Colors.black,
color: widget.outlineColor,
width: 2
)
),
@@ -205,10 +327,10 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
width: 40,
height: 40,
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
border: const Border.symmetric(
color: widget.backgroundColor,
border: Border.symmetric(
vertical: BorderSide(
color: Colors.black,
color: widget.outlineColor,
width: 2
)
),
@@ -226,7 +348,7 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
height: 40,
child: Icon(
Icons.arrow_upward,
color: Colors.black,
color: widget.outlineColor,
),
),
Positioned.fill(
@@ -258,10 +380,10 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
width: 40,
height: 40,
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
border: const Border.symmetric(
color: widget.backgroundColor,
border: Border.symmetric(
vertical: BorderSide(
color: Colors.black,
color: widget.outlineColor,
width: 2
)
),
@@ -279,7 +401,7 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
height: 40,
child: Icon(
Icons.arrow_downward,
color: Colors.black,
color: widget.outlineColor,
),
),
Positioned.fill(
@@ -314,7 +436,7 @@ class _QuickAnnouncementsState_IBUS extends State<_QuickAnnouncements_IBUS> {
),
Container(
height: 2,
color: Colors.black,
color: widget.outlineColor,
),
]
@@ -333,8 +455,9 @@ class _QuickAnnouncement_IBUS extends StatelessWidget {
final ManualAnnouncementEntry announcement;
final int index;
final Color outlineColor;
const _QuickAnnouncement_IBUS({super.key, required this.announcement, required this.index});
_QuickAnnouncement_IBUS({super.key, required this.announcement, required this.index, required this.outlineColor});
@override
Widget build(BuildContext context) {
@@ -344,48 +467,52 @@ class _QuickAnnouncement_IBUS extends StatelessWidget {
Container(
decoration: BoxDecoration(
color: Colors.lightGreen.shade100,
border: const Border.symmetric(
color: Colors.transparent,
border: Border.symmetric(
vertical: BorderSide(
color: Colors.black,
color: outlineColor,
width: 2
)
),
),
padding: const EdgeInsets.all(5),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5
),
width: double.infinity,
height: 50,
child: Row(
children: [
Text(
announcement.shortName,
style: const TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: "lcd",
height: 1,
child: Transform.translate(
offset: Offset(0, 4),
child: Row(
children: [
Text(
announcement.shortName,
style: GoogleFonts.teko(
fontSize: 25,
color: outlineColor,
)
),
),
Expanded(
child: Container(
Expanded(
child: Container(
alignment: Alignment.centerRight,
alignment: Alignment.centerRight,
child: Text(
(index+1).toString(),
style: const TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: "lcd",
height: 1,
child: Text(
(index+1).toString(),
style: GoogleFonts.teko(
fontSize: 25,
color: outlineColor,
)
),
),
),
)
],
)
],
),
)
),