This commit is contained in:
ImBenji
2024-04-14 05:05:08 +01:00
parent 564c8853ec
commit 8cc4016836
20 changed files with 1082 additions and 384 deletions

View File

@@ -42,6 +42,21 @@ class TfL_Dataset_TestState extends State<TfL_Dataset_Test> {
ibus_display _ibus_display = ibus_display();
@override
void initState() {
// TODO: implement initState
super.initState();
Future.delayed(Duration.zero, () async {
try {
await LiveInformation().announcementModule.getBundleBytes();
} catch (e) {
Navigator.popAndPushNamed(context, "/");
print("Sent back to initial startup");
}
});
}
@override
Widget build(BuildContext context) {
@@ -56,7 +71,7 @@ class TfL_Dataset_TestState extends State<TfL_Dataset_Test> {
if (defaultTargetPlatform == TargetPlatform.android) {
shouldCurve = true;
} else {
} else if (defaultTargetPlatform == TargetPlatform.windows && !kIsWeb){
rotated = _selectedIndex == 2;
print("Window size: ${MediaQuery.of(context).size}");
@@ -156,295 +171,289 @@ class TfL_Dataset_TestState extends State<TfL_Dataset_Test> {
child: RotatedBox(
quarterTurns: rotated ? 3 : 0,
child: FittedBox(
child: Container(
alignment: Alignment.topCenter,
fit: BoxFit.fitWidth,
constraints: const BoxConstraints(
maxWidth: 411.4,
maxHeight: 850.3,
),
child: Container(
constraints: const BoxConstraints(
maxWidth: 411.4,
maxHeight: 850.3,
decoration: BoxDecoration(
borderRadius: shouldCurve ? const BorderRadius.only(
bottomLeft: Radius.circular(15),
bottomRight: Radius.circular(15),
) : null,
border: Border.all(
color: Colors.white70,
width: 2,
),
color: Colors.grey.shade900,
),
child: Container(
margin: const EdgeInsets.all(6),
decoration: BoxDecoration(
borderRadius: shouldCurve ? const BorderRadius.only(
bottomLeft: Radius.circular(15),
bottomRight: Radius.circular(15),
) : null,
border: Border.all(
color: Colors.white70,
width: 2,
child: Column(
children: [
if (!hideUI)
Container(
margin: const EdgeInsets.all(6),
child: _ibus_display,
),
color: Colors.grey.shade900,
),
margin: const EdgeInsets.all(6),
if (!hideUI)
Container(
width: double.infinity,
height: 2,
color: Colors.white70,
),
Expanded(
child: Container(
child: Column(
margin: const EdgeInsets.all(8),
children: [
decoration: BoxDecoration(
border: Border.all(
color: Colors.white70,
width: 2,
),
color: Colors.grey.shade900,
borderRadius: hideUI && shouldCurve ? const BorderRadius.only(
bottomLeft: Radius.circular(7),
bottomRight: Radius.circular(7),
) : null,
),
if (!hideUI)
Container(
child: ClipRRect(
margin: const EdgeInsets.all(6),
child: _ibus_display,
),
if (!hideUI)
Container(
width: double.infinity,
height: 2,
color: Colors.white70,
),
Expanded(
child: Container(
margin: const EdgeInsets.all(8),
decoration: BoxDecoration(
border: Border.all(
color: Colors.white70,
width: 2,
),
color: Colors.grey.shade900,
borderRadius: hideUI && shouldCurve ? const BorderRadius.only(
bottomLeft: Radius.circular(7),
bottomRight: Radius.circular(7),
) : null,
// curved corners
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(7),
bottomRight: Radius.circular(7),
),
child: ClipRRect(
// curved corners
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(7),
bottomRight: Radius.circular(7),
),
child: Pages[_selectedIndex],
)
),
child: Pages[_selectedIndex],
)
),
),
if (!hideUI)
Container(
width: double.infinity,
height: 2,
color: Colors.white70,
),
if (!hideUI)
Container(
width: double.infinity,
height: 2,
color: Colors.white70,
),
if (!hideUI)
Container(
height: 50,
if (!hideUI)
Container(
height: 50,
child: Row(
child: Row(
children: [
children: [
Expanded(
child: Stack(
children: [
Container(
alignment: Alignment.center,
margin: const EdgeInsets.all(10),
child: Text(
"Home",
style: GoogleFonts.teko(
color: Colors.white70,
fontSize: 20,
fontWeight: FontWeight.bold,
),
)
),
Positioned.fill(
child: ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 0;
});
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
),
child: Container()
),
)
],
),
),
Container(
width: 2,
height: double.infinity,
color: Colors.white70,
),
Expanded(
child: Stack(
children: [
Container(
Expanded(
child: Stack(
children: [
Container(
alignment: Alignment.center,
margin: const EdgeInsets.all(10),
child: Text(
"Routes",
"Home",
style: GoogleFonts.teko(
color: Colors.white70,
fontSize: 20,
fontWeight: FontWeight.bold,
),
)
),
Positioned.fill(
child: ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 1;
});
},
),
Positioned.fill(
child: ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 0;
});
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
child: Container()
),
child: Container()
),
)
],
),
),
Container(
width: 2,
height: double.infinity,
color: Colors.white70,
),
Expanded(
child: Stack(
children: [
Container(
alignment: Alignment.center,
margin: const EdgeInsets.all(10),
child: Text(
"Routes",
style: GoogleFonts.teko(
color: Colors.white70,
fontSize: 20,
fontWeight: FontWeight.bold,
),
)
],
),
),
),
Positioned.fill(
child: ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 1;
});
},
Container(
width: 2,
height: double.infinity,
color: Colors.white70,
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.transparent,
Expanded(
child: Stack(
children: [
Container(
alignment: Alignment.center,
margin: const EdgeInsets.all(10),
child: Text(
"Display",
style: GoogleFonts.teko(
color: Colors.white70,
fontSize: 20,
fontWeight: FontWeight.bold,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
)
),
child: Container()
),
Positioned.fill(
child: ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 2;
});
},
)
],
),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.transparent,
Container(
width: 2,
height: double.infinity,
color: Colors.white70,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
Expanded(
child: Stack(
children: [
Container(
alignment: Alignment.center,
margin: const EdgeInsets.all(10),
child: Text(
"Display",
style: GoogleFonts.teko(
color: Colors.white70,
fontSize: 20,
fontWeight: FontWeight.bold,
),
)
),
Positioned.fill(
child: ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 2;
});
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
child: Container()
),
)
],
),
),
),
Container(
width: 2,
height: double.infinity,
color: Colors.white70,
),
Expanded(
child: Stack(
children: [
Container(
alignment: Alignment.center,
margin: const EdgeInsets.all(10),
child: Text(
"Settings",
style: GoogleFonts.teko(
color: Colors.white70,
fontSize: 20,
fontWeight: FontWeight.bold,
),
)
child: Container()
),
Positioned.fill(
child: ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 3;
});
},
)
],
),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.transparent,
Container(
width: 2,
height: double.infinity,
color: Colors.white70,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
Expanded(
child: Stack(
children: [
Container(
alignment: Alignment.center,
margin: const EdgeInsets.all(10),
child: Text(
"Settings",
style: GoogleFonts.teko(
color: Colors.white70,
fontSize: 20,
fontWeight: FontWeight.bold,
),
)
),
Positioned.fill(
child: ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 3;
});
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
),
child: Container()
),
)
],
),
),
child: Container()
),
)
],
),
),
],
],
),
)
),
)
],
],
)
),
)
),
),
),