From 5edef0200dac109491875733b6691fff9f521a0a Mon Sep 17 00:00:00 2001 From: esche Date: Mon, 12 Jun 2023 23:14:42 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EFrontend-user/lib/refstart=E2=80=9C=20?= =?UTF-8?q?l=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend-user/lib/refstart | 158 ------------------------------------- 1 file changed, 158 deletions(-) delete mode 100644 Frontend-user/lib/refstart diff --git a/Frontend-user/lib/refstart b/Frontend-user/lib/refstart deleted file mode 100644 index a590456..0000000 --- a/Frontend-user/lib/refstart +++ /dev/null @@ -1,158 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:intl/date_symbol_data_local.dart'; -import 'help.dart'; -import 'hints.dart'; -import 'main.dart'; -import 'semesterticket.dart'; -import 'studierendenausweis.dart'; - -class StartScreen extends StatelessWidget { - final now = DateTime.now(); - - @override - Widget build(BuildContext context) { - initializeDateFormatting('de_DE'); - - return Theme( - data: Theme.of(context).copyWith( - textTheme: TextTheme( - bodyMedium: - TextStyle(color: Theme.of(context).colorScheme.secondary))), - child: Scaffold( - appBar: AppBar(title: const Text('Ausweise'), actions: [ - IconButton( - icon: const Icon(Icons.autorenew), - tooltip: 'Tickets aktualisieren', - onPressed: () { - ScaffoldMessenger.of(context).showSnackBar(const SnackBar( - content: Text('Die Tickets werden aktualisiert'))); - }, - ), - IconButton( - icon: const Icon(Icons.help_outline), - tooltip: 'Hilfe öffnen', - onPressed: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => ShowHelp())); - }) - ]), - body: ListView.builder( - itemCount: (now.month == 3 || now.month == 9) ? 6 : 4, - padding: - const EdgeInsets.only(top: 4, bottom: 8, left: 4, right: 4), - itemBuilder: (BuildContext context, int index) { - switch (index) { - case 0: - return Text( - 'Angemeldet als ${Ticket().nachname}, ${Ticket().vorname}'); - case 1: - return GestureDetector( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ShowHints(index))); - }, - child: Card( - semanticContainer: true, - margin: const EdgeInsets.only(top: 4, bottom: 4), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: const [ - Icon(Icons.library_books_outlined), - Padding( - padding: EdgeInsets.all(16.0), - child: Text( - "Hinweise anzeigen", - textAlign: TextAlign.center, - ), - ), - ], - ), - ), - ); - default: - return createTicket(context, index); - } - }), - )); - } - - Widget createTicket(BuildContext context, final int index) { - final bool isSemester = index % 2 == 0; - final bool isWinter = index < 4 - ? now.month >= 10 || now.month <= 3 - : now.month >= 4 && now.month <= 9; - - return GestureDetector( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => isSemester - ? ShowSemester(isWinter, now) - : ShowAusweis(isWinter, now))); - }, - child: Card( - semanticContainer: true, - margin: const EdgeInsets.only(top: 8, bottom: 8, left: 4, right: 4), - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - isSemester - ? 'Semesterticket' - : 'Studierendenausweis', - style: const TextStyle( - fontWeight: FontWeight.w700, fontSize: 18)), - const Icon( - Icons.arrow_forward_ios_outlined, - weight: 100, - ) - ], - ), - const SizedBox(height: 16), - Text((isWinter - ? 'Wintersemester ${now.month > 6 ? now.year : now.year - 1}' - : 'Sommersemester ${now.year}') + - (isSemester - ? '' - : ', Matrikelnummer ${Ticket().matrikel}')), - const SizedBox(height: 24), - Row(children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: const [ - Text('Zuletzt aktualisiert:', - style: TextStyle(fontSize: 10)), - Text('Offline verfügbar bis:', - style: TextStyle(fontSize: 10)), - ]), - const SizedBox( - width: 24, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - DateFormat("EEEE, dd. MMMM yyyy HH:mm", 'de_DE') - .format(now), - style: const TextStyle(fontSize: 10)), - Text( - DateFormat("EEEE, dd. MMMM yyyy 23:59", 'de_DE') - .format(now - .add(Duration(days: isSemester ? 2 : 7))), - style: const TextStyle(fontSize: 10)), - ], - ) - ]), - ]), - ))); - } -}