diff --git a/app/mobile/lib/presentation/pages/game_wiki_page.dart b/app/mobile/lib/presentation/pages/game_wiki_page.dart index ec81d9d3..485bdac3 100644 --- a/app/mobile/lib/presentation/pages/game_wiki_page.dart +++ b/app/mobile/lib/presentation/pages/game_wiki_page.dart @@ -113,6 +113,11 @@ class _GameWikiPageState extends State final List controllerNames = ['Name', 'Description']; + static late List platforms = []; + static late List genres = []; + + static late String genretoshow = ""; + Future loadGame(int gameId) async { Game game = await gameService.getGame(gameId); List postList = await postService.getPostsByGame(gameId); @@ -128,6 +133,26 @@ class _GameWikiPageState extends State game.relatedPosts = postList; + platforms = []; + + for(var i = 0; i < game.platforms!.length; i++) { + platforms.add(game.platforms![i]); + platforms.add(", "); + } + + platforms.removeLast(); + + genres = []; + + for(var i = 0; i < game.genres!.length; i++) { + genres.add(game.genres![i]); + genres.add(", "); + } + + genres.removeLast(); + + genretoshow = genres.join(""); + return game; } @@ -214,7 +239,7 @@ class _GameWikiPageState extends State fontWeight: FontWeight.w600))), Align( alignment: Alignment.centerLeft, - child: Text(game.genres![0] ?? "-", + child: Text(genres.join("") ?? "-", style: TextStyle( fontSize: 12, fontWeight: FontWeight.w400))), @@ -322,9 +347,10 @@ class _GameWikiPageState extends State style: TextStyle(fontWeight: FontWeight.w500), ), - TextSpan( - text: game.platforms![0], - ) + for (String platform in platforms) + TextSpan( + text: platform, + ), ], )), ),