Updating some more UI
Dieser Commit ist enthalten in:
Ursprung
8eb655b8c6
Commit
2484560ced
@ -82,7 +82,7 @@ class CreateEventDialog extends HookConsumerWidget {
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
FilledButton(
|
||||
onPressed: () async {
|
||||
final event = await ref.read(eventRepositoryProvider.future).then(
|
||||
(value) => value.createEvent(
|
||||
|
@ -136,12 +136,12 @@ class AddFightDialog extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text("Cancel")),
|
||||
TextButton(
|
||||
FilledButton(
|
||||
onPressed: canCreate
|
||||
? () async {
|
||||
final nav = Navigator.of(context);
|
||||
|
@ -131,13 +131,13 @@ class EventFightList extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
ElevatedButton(
|
||||
FilledButton(
|
||||
onPressed: () async {
|
||||
final selectedFights = fights.value
|
||||
.where((element) => selected.value
|
||||
@ -285,7 +285,7 @@ class EventFightList extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
FloatingActionButton.extended(
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
|
@ -125,6 +125,7 @@ class LoadedEventScreen extends HookConsumerWidget {
|
||||
final accepted = await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
icon: const Icon(Icons.warning),
|
||||
title: const Text("Unsaved changes"),
|
||||
content: const Text(
|
||||
"You have unsaved changes. Do you want to discard them?"),
|
||||
|
@ -60,9 +60,7 @@ class EditEventScreen extends HookConsumerWidget {
|
||||
appBar: AppBar(
|
||||
title: const Text('Loading'),
|
||||
),
|
||||
body: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
body: const LinearProgressIndicator(),
|
||||
);
|
||||
}
|
||||
final eventData = snapshot.data as EventExtended;
|
||||
|
@ -52,9 +52,43 @@ class HomeScreen extends HookConsumerWidget {
|
||||
|
||||
final navRailIndex = useState(0);
|
||||
return Scaffold(
|
||||
drawer: NavigationDrawer(
|
||||
selectedIndex: navRailIndex.value,
|
||||
onDestinationSelected: (index) {
|
||||
if (index == 2) {
|
||||
context.go('/settings');
|
||||
return;
|
||||
}
|
||||
navRailIndex.value = index;
|
||||
},
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(28, 16, 16, 10),
|
||||
child: Text(
|
||||
'SteamWar',
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
),
|
||||
const NavigationDrawerDestination(
|
||||
icon: Icon(Icons.calendar_today_outlined),
|
||||
label: Text("Events"),
|
||||
selectedIcon: Icon(Icons.calendar_today),
|
||||
),
|
||||
const NavigationDrawerDestination(
|
||||
icon: Icon(Icons.developer_mode_outlined),
|
||||
label: Text("Mods"),
|
||||
selectedIcon: Icon(Icons.developer_mode),
|
||||
),
|
||||
const Spacer(),
|
||||
const NavigationDrawerDestination(
|
||||
icon: Icon(Icons.settings_outlined),
|
||||
label: Text("Settings"),
|
||||
selectedIcon: Icon(Icons.settings),
|
||||
),
|
||||
],
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text('Home'),
|
||||
automaticallyImplyLeading: false,
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
@ -95,44 +129,17 @@ class HomeScreen extends HookConsumerWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Row(
|
||||
children: [
|
||||
NavigationRail(
|
||||
elevation: 1,
|
||||
destinations: const [
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.calendar_today),
|
||||
label: Text('Events'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.developer_mode),
|
||||
label: Text('Mods'),
|
||||
),
|
||||
],
|
||||
labelType: NavigationRailLabelType.selected,
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Icons.person),
|
||||
onPressed: () {
|
||||
context.go('/settings');
|
||||
},
|
||||
),
|
||||
selectedIndex: navRailIndex.value,
|
||||
onDestinationSelected: (index) {
|
||||
navRailIndex.value = index;
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: IndexedStack(
|
||||
index: navRailIndex.value,
|
||||
children: const [
|
||||
//ServerListComponent(),
|
||||
EventListComponent(),
|
||||
Placeholder(),
|
||||
//ModListComponent(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: IndexedStack(
|
||||
index: navRailIndex.value,
|
||||
children: const [
|
||||
//ServerListComponent(),
|
||||
EventListComponent(),
|
||||
Placeholder(),
|
||||
//ModListComponent(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -39,14 +39,18 @@ class EventListComponent extends HookConsumerWidget {
|
||||
final currentEvent = data.indexWhere((element) => element.isCurrent);
|
||||
return ListView(
|
||||
children: [
|
||||
FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => const CreateEventDialog());
|
||||
},
|
||||
label: const Text("Create Event"),
|
||||
icon: const Icon(Icons.add),
|
||||
Row(
|
||||
children: [
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => const CreateEventDialog());
|
||||
},
|
||||
label: const Text("Create Event"),
|
||||
icon: const Icon(Icons.add),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren