1
0

Updating some more UI

Dieser Commit ist enthalten in:
Chaoscaot 2023-01-27 15:51:34 +01:00
Ursprung 8eb655b8c6
Commit 2484560ced
7 geänderte Dateien mit 66 neuen und 56 gelöschten Zeilen

Datei anzeigen

@ -82,7 +82,7 @@ class CreateEventDialog extends HookConsumerWidget {
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
), ),
), ),
TextButton( FilledButton(
onPressed: () async { onPressed: () async {
final event = await ref.read(eventRepositoryProvider.future).then( final event = await ref.read(eventRepositoryProvider.future).then(
(value) => value.createEvent( (value) => value.createEvent(

Datei anzeigen

@ -136,12 +136,12 @@ class AddFightDialog extends HookConsumerWidget {
], ],
), ),
actions: [ actions: [
TextButton( ElevatedButton(
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: const Text("Cancel")), child: const Text("Cancel")),
TextButton( FilledButton(
onPressed: canCreate onPressed: canCreate
? () async { ? () async {
final nav = Navigator.of(context); final nav = Navigator.of(context);

Datei anzeigen

@ -131,13 +131,13 @@ class EventFightList extends HookConsumerWidget {
], ],
), ),
actions: [ actions: [
TextButton( ElevatedButton(
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: const Text("Cancel"), child: const Text("Cancel"),
), ),
ElevatedButton( FilledButton(
onPressed: () async { onPressed: () async {
final selectedFights = fights.value final selectedFights = fights.value
.where((element) => selected.value .where((element) => selected.value
@ -285,7 +285,7 @@ class EventFightList extends HookConsumerWidget {
], ],
), ),
const Spacer(), const Spacer(),
FloatingActionButton.extended( FilledButton.icon(
onPressed: () { onPressed: () {
showDialog( showDialog(
context: context, context: context,

Datei anzeigen

@ -125,6 +125,7 @@ class LoadedEventScreen extends HookConsumerWidget {
final accepted = await showDialog( final accepted = await showDialog(
context: context, context: context,
builder: (context) => AlertDialog( builder: (context) => AlertDialog(
icon: const Icon(Icons.warning),
title: const Text("Unsaved changes"), title: const Text("Unsaved changes"),
content: const Text( content: const Text(
"You have unsaved changes. Do you want to discard them?"), "You have unsaved changes. Do you want to discard them?"),

Datei anzeigen

@ -60,9 +60,7 @@ class EditEventScreen extends HookConsumerWidget {
appBar: AppBar( appBar: AppBar(
title: const Text('Loading'), title: const Text('Loading'),
), ),
body: const Center( body: const LinearProgressIndicator(),
child: CircularProgressIndicator(),
),
); );
} }
final eventData = snapshot.data as EventExtended; final eventData = snapshot.data as EventExtended;

Datei anzeigen

@ -52,9 +52,43 @@ class HomeScreen extends HookConsumerWidget {
final navRailIndex = useState(0); final navRailIndex = useState(0);
return Scaffold( 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( appBar: AppBar(
title: const Text('Home'), title: const Text('Home'),
automaticallyImplyLeading: false,
actions: [ actions: [
IconButton( IconButton(
onPressed: () { onPressed: () {
@ -95,44 +129,17 @@ class HomeScreen extends HookConsumerWidget {
), ),
], ],
), ),
body: Row( body: Padding(
children: [ padding: const EdgeInsets.all(8.0),
NavigationRail( child: IndexedStack(
elevation: 1, index: navRailIndex.value,
destinations: const [ children: const [
NavigationRailDestination( //ServerListComponent(),
icon: Icon(Icons.calendar_today), EventListComponent(),
label: Text('Events'), Placeholder(),
), //ModListComponent(),
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(),
],
),
),
],
), ),
); );
} }

Datei anzeigen

@ -39,14 +39,18 @@ class EventListComponent extends HookConsumerWidget {
final currentEvent = data.indexWhere((element) => element.isCurrent); final currentEvent = data.indexWhere((element) => element.isCurrent);
return ListView( return ListView(
children: [ children: [
FloatingActionButton.extended( Row(
onPressed: () { children: [
showDialog( FilledButton.icon(
context: context, onPressed: () {
builder: (context) => const CreateEventDialog()); showDialog(
}, context: context,
label: const Text("Create Event"), builder: (context) => const CreateEventDialog());
icon: const Icon(Icons.add), },
label: const Text("Create Event"),
icon: const Icon(Icons.add),
),
],
), ),
const SizedBox( const SizedBox(
height: 16, height: 16,