Improved Tournament Detail View and added Refresh button to Home Page

This commit is contained in:
2026-03-04 23:48:09 +01:00
parent 6679c41b48
commit bcc330eb5c
4 changed files with 193 additions and 53 deletions

View File

@@ -14,12 +14,14 @@ class StateProvider extends ChangeNotifier {
notifyListeners();
}
List<Tournament>? _availableTournaments;
void notifyState(){
notifyListeners();
}
Future<List<Tournament>> fetchAvailableTournaments() async {
try {
var response = await http.get(Uri.parse('http://10.0.2.2:3000/tournaments'));
if (response.statusCode == 200) {
final List<dynamic> list = json.decode(response.body);
_availableTournaments = list.map((json) => Tournament.fromJson(json)).toList();
return _availableTournaments!;
}