-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): GUI for organizations, divisions, favorites
- Loading branch information
Showing
14 changed files
with
347 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
wrestling_scoreboard_client/lib/view/screens/home/clubs_view.dart
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
wrestling_scoreboard_client/lib/view/screens/home/competitions_view.dart
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
wrestling_scoreboard_client/lib/view/screens/home/explore.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:wrestling_scoreboard_client/provider/network_provider.dart'; | ||
import 'package:wrestling_scoreboard_client/services/network/remote/web_socket.dart'; | ||
import 'package:wrestling_scoreboard_client/view/screens/home/organizations_view.dart'; | ||
import 'package:wrestling_scoreboard_client/view/widgets/dialogs.dart'; | ||
|
||
class Explore extends ConsumerStatefulWidget { | ||
const Explore({super.key}); | ||
|
||
@override | ||
ConsumerState<ConsumerStatefulWidget> createState() => OrganizationState(); | ||
} | ||
|
||
class OrganizationState extends ConsumerState<Explore> { | ||
@override | ||
void initState() { | ||
super.initState(); | ||
ref.read(dataManagerNotifierProvider).then((dataManager) { | ||
void onRetry() { | ||
Navigator.of(context).pop(); | ||
dataManager.webSocketManager.onWebSocketConnection.sink.add(WebSocketConnectionState.connecting); | ||
} | ||
|
||
WidgetsBinding.instance.addPostFrameCallback((_) { | ||
dataManager.webSocketManager.onWebSocketConnection.stream.distinct().listen((connectionState) { | ||
if (mounted && connectionState == WebSocketConnectionState.disconnected) { | ||
final localizations = AppLocalizations.of(context)!; | ||
showExceptionDialog( | ||
context: context, exception: localizations.noWebSocketConnection, stackTrace: null, onRetry: onRetry); | ||
} | ||
}, onError: (e, [trace]) { | ||
showExceptionDialog(exception: e, context: context, stackTrace: trace, onRetry: onRetry); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final localizations = AppLocalizations.of(context)!; | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text(localizations.explore), | ||
), | ||
body: const OrganizationsView(), | ||
); | ||
} | ||
} |
Oops, something went wrong.