Mobile Improvements
Dieser Commit ist enthalten in:
Ursprung
dd94230021
Commit
d38c4bedbd
BIN
assets/images/Icon-maskable-192.png
Normale Datei
BIN
assets/images/Icon-maskable-192.png
Normale Datei
Binäre Datei nicht angezeigt.
Nachher Breite: | Höhe: | Größe: 2.8 KiB |
@ -62,6 +62,32 @@ class EventFightList extends HookConsumerWidget {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AddFightDialog(
|
||||
eventData,
|
||||
() => update(),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
label: const Text("Add Fight"),
|
||||
icon: const Icon(Icons.add),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
context.go("/event/${event.id}/generator");
|
||||
},
|
||||
label: const Text("Generate Fight"),
|
||||
icon: const Icon(Icons.shuffle)),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const SizedBox(width: 16),
|
||||
@ -287,29 +313,6 @@ class EventFightList extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AddFightDialog(
|
||||
eventData,
|
||||
() => update(),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
label: const Text("Add Fight"),
|
||||
icon: const Icon(Icons.add),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
context.go("/event/${event.id}/generator");
|
||||
},
|
||||
label: const Text("Generate Fight"),
|
||||
icon: const Icon(Icons.shuffle)),
|
||||
const SizedBox(width: 8),
|
||||
PopupMenuButton(
|
||||
itemBuilder: (context) {
|
||||
return const [
|
||||
|
@ -22,6 +22,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:steamwar_multitool/src/components/components.dart';
|
||||
import 'package:steamwar_multitool/src/dialogs/dialogs.dart';
|
||||
import 'package:steamwar_multitool/src/types/event.dart';
|
||||
import 'package:steamwar_multitool/src/util/constants.dart';
|
||||
|
||||
import '../../../provider/events.dart';
|
||||
@ -59,11 +60,9 @@ class EventListComponent extends HookConsumerWidget {
|
||||
ListTile(
|
||||
title: Text(
|
||||
data[currentEvent].name,
|
||||
style: Theme.of(context).textTheme.headline6,
|
||||
),
|
||||
subtitle: Text(
|
||||
subtitle: const Text(
|
||||
"Current Event",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
),
|
||||
leading: const Icon(Icons.priority_high),
|
||||
onTap: () {
|
||||
@ -73,33 +72,17 @@ class EventListComponent extends HookConsumerWidget {
|
||||
if (upcomingEvents.isNotEmpty)
|
||||
Text(
|
||||
"Upcoming Events",
|
||||
style: Theme.of(context).textTheme.headline6!,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
...upcomingEvents.map(
|
||||
(e) => ListTile(
|
||||
title: Text(e.name),
|
||||
subtitle: Text(
|
||||
"${kDateFormat.format(e.start)} - ${kDateFormat.format(e.end)}"),
|
||||
leading: const Icon(Icons.event),
|
||||
onTap: () async {
|
||||
context.go("/event/${e.id}");
|
||||
},
|
||||
),
|
||||
(e) => EventTile(e),
|
||||
),
|
||||
if (pastEvents.isNotEmpty)
|
||||
Text(
|
||||
"Past Events",
|
||||
style: Theme.of(context).textTheme.headline6!,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
...pastEvents.map((e) => ListTile(
|
||||
title: Text(e.name),
|
||||
leading: const Icon(Icons.check),
|
||||
subtitle: Text(
|
||||
"${kDateFormat.format(e.start)} - ${kDateFormat.format(e.end)}"),
|
||||
onTap: () async {
|
||||
context.go("/event/${e.id}");
|
||||
},
|
||||
)),
|
||||
...pastEvents.map((e) => EventTile(e)),
|
||||
],
|
||||
);
|
||||
}, error: (err, stack) {
|
||||
@ -111,3 +94,27 @@ class EventListComponent extends HookConsumerWidget {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class EventTile extends StatelessWidget {
|
||||
final ShortEvent e;
|
||||
|
||||
const EventTile(
|
||||
this.e, {
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
title: Text(e.name),
|
||||
subtitle: kOnlyDateFormat.format(e.start) == kOnlyDateFormat.format(e.end)
|
||||
? Text(kOnlyDateFormat.format(e.start))
|
||||
: Text(
|
||||
"${kOnlyDateFormat.format(e.start)} - ${kOnlyDateFormat.format(e.end)}"),
|
||||
leading: Icon(e.isUpcoming ? Icons.event : Icons.check),
|
||||
onTap: () async {
|
||||
context.go("/event/${e.id}");
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -55,35 +55,7 @@ class LoginScreenWidget extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Login'),
|
||||
automaticallyImplyLeading: false,
|
||||
),
|
||||
body: Center(
|
||||
child: SizedBox(
|
||||
width: 200,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Login',
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
),
|
||||
TextField(
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Key',
|
||||
),
|
||||
controller: keyController,
|
||||
obscureText: true,
|
||||
onChanged: (v) => updater.value++,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
FloatingActionButton.large(
|
||||
onPressed: keyController.text.isNotEmpty
|
||||
? () async {
|
||||
void login() async {
|
||||
final dio = Dio(
|
||||
BaseOptions(
|
||||
baseUrl: ref.read(serverUrlProvider),
|
||||
@ -107,7 +79,36 @@ class LoginScreenWidget extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
: null,
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Login'),
|
||||
automaticallyImplyLeading: false,
|
||||
),
|
||||
body: Center(
|
||||
child: SizedBox(
|
||||
width: 200,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Login',
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
),
|
||||
TextField(
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Key',
|
||||
),
|
||||
controller: keyController,
|
||||
obscureText: true,
|
||||
onChanged: (v) => updater.value++,
|
||||
onSubmitted: (v) => login(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
FloatingActionButton.large(
|
||||
onPressed: keyController.text.isNotEmpty ? login : null,
|
||||
child: const Icon(Icons.forward),
|
||||
)
|
||||
],
|
||||
|
@ -64,6 +64,19 @@ class SettingsScreen extends HookConsumerWidget {
|
||||
: null,
|
||||
icon: const Icon(Icons.save),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
showAboutDialog(
|
||||
context: context,
|
||||
applicationIcon: Image.asset(
|
||||
"assets/images/Icon-maskable-192.png",
|
||||
fit: BoxFit.contain),
|
||||
applicationName: "SteamWar MultiTool",
|
||||
applicationVersion: "1.0.0",
|
||||
applicationLegalese: "© 2023 SteamWar.de-Serverteam",
|
||||
);
|
||||
},
|
||||
icon: Icon(Icons.apps))
|
||||
],
|
||||
leading: IconButton(
|
||||
onPressed: () => context.go("/"),
|
||||
|
@ -22,3 +22,5 @@ import 'package:intl/intl.dart';
|
||||
final kDateFormat = DateFormat("dd.MM.yyyy HH:mm:ss");
|
||||
|
||||
final kTimeFormat = DateFormat('HH:mm');
|
||||
|
||||
final kOnlyDateFormat = DateFormat("dd.MM.yyyy");
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren