Skip to content

Commit

Permalink
Only show website on messages if there is a url
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsRefsgaard committed Jun 27, 2023
1 parent 2be7f5b commit 9468154
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 36 deletions.
68 changes: 33 additions & 35 deletions lib/ui/pages/message_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,48 +60,46 @@ class MessageDetailsPage extends StatelessWidget {
style: aboutCardContentStyle.copyWith(
color: Theme.of(context).primaryColor))
: const SizedBox.shrink(),
if(message.message != null)
Text(
locale.translate(message.message!),
style: aboutCardContentStyle,
textAlign: TextAlign.justify,
)
if (message.message != null)
Text(
locale.translate(message.message!),
style: aboutCardContentStyle,
textAlign: TextAlign.justify,
)
],
),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: message.url != null
? Padding(
padding: const EdgeInsets.all(8.0),
child: InkWell(
onTap: () async {
try {
await launchUrl(Uri.parse(message.url!));
} catch (error) {
warning(
"Could not launch message URL - '${message.url!}'");
}
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.public_outlined,
color: Theme.of(context).primaryColor),
Text(
locale.translate('pages.about.study.website'),
style: aboutCardSubtitleStyle.copyWith(
color: Theme.of(context).primaryColor)),
],
),
),
)
: const SizedBox.shrink(),
),
if (message.url != null && message.url!.isNotEmpty)
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: InkWell(
onTap: () async {
try {
await launchUrl(Uri.parse(message.url!));
} catch (error) {
warning(
"Could not launch message URL - '${message.url!}'");
}
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.public_outlined,
color: Theme.of(context).primaryColor),
Text(locale.translate('pages.about.study.website'),
style: aboutCardSubtitleStyle.copyWith(
color: Theme.of(context).primaryColor)),
],
),
),
),
),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/widgets/details_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DetailsBanner extends StatelessWidget {
),
isCarpBanner
? Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Icon(Icons.touch_app,
Expand Down

0 comments on commit 9468154

Please sign in to comment.