Skip to content

Commit

Permalink
handle case where tournament description is null
Browse files Browse the repository at this point in the history
  • Loading branch information
julien4215 committed Aug 29, 2024
1 parent 8474de8 commit 1913546
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/src/model/broadcast/broadcast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class BroadcastTournamentData with _$BroadcastTournamentData {
required BroadcastTournamentId id,
required String name,
required String? imageUrl,
required String description,
required String? description,
required BroadcastTournamentInformation information,
}) = _BroadcastTournamentData;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/broadcast/broadcast_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ BroadcastTournamentData _tournamentDataFromPick(
id: pick('id').asBroadcastTournamentIdOrThrow(),
name: pick('name').asStringOrThrow(),
imageUrl: pick('image').asStringOrNull(),
description: pick('description').asStringOrThrow(),
description: pick('description').asStringOrNull(),
information: (
format: pick('info', 'format').asStringOrNull(),
timeControl: pick('info', 'tc').asStringOrNull(),
Expand Down
17 changes: 9 additions & 8 deletions lib/src/view/broadcast/broadcast_overview_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@ class BroadcastOverviewTab extends ConsumerWidget {
),
],
),
Expanded(
child: Markdown(
data: description,
onTapLink: (text, url, title) {
if (url == null) return;
launchUrl(Uri.parse(url));
},
if (description != null)
Expanded(
child: Markdown(
data: description,
onTapLink: (text, url, title) {
if (url == null) return;
launchUrl(Uri.parse(url));
},
),
),
),
],
);
},
Expand Down

0 comments on commit 1913546

Please sign in to comment.