chore: Hide homepage button if not preset
This commit is contained in:
parent
bfbcd31f35
commit
9f5794004e
1 changed files with 11 additions and 11 deletions
|
|
@ -91,6 +91,7 @@ class SignInPage extends StatelessWidget {
|
||||||
itemCount: publicHomeservers.length,
|
itemCount: publicHomeservers.length,
|
||||||
itemBuilder: (context, i) {
|
itemBuilder: (context, i) {
|
||||||
final server = publicHomeservers[i];
|
final server = publicHomeservers[i];
|
||||||
|
final homepage = server.homepage;
|
||||||
return RadioListTile.adaptive(
|
return RadioListTile.adaptive(
|
||||||
value: server,
|
value: server,
|
||||||
radioScaleFactor:
|
radioScaleFactor:
|
||||||
|
|
@ -104,19 +105,18 @@ class SignInPage extends StatelessWidget {
|
||||||
title: Row(
|
title: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text(server.name ?? 'Unknown')),
|
Expanded(child: Text(server.name ?? 'Unknown')),
|
||||||
SizedBox.square(
|
if (homepage != null)
|
||||||
dimension: 32,
|
SizedBox.square(
|
||||||
child: IconButton(
|
dimension: 32,
|
||||||
icon: const Icon(
|
child: IconButton(
|
||||||
Icons.open_in_new_outlined,
|
icon: const Icon(
|
||||||
size: 16,
|
Icons.open_in_new_outlined,
|
||||||
),
|
size: 16,
|
||||||
onPressed: () => launchUrlString(
|
),
|
||||||
server.homepage ??
|
onPressed: () =>
|
||||||
'https://${server.name}',
|
launchUrlString(homepage),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
subtitle: Column(
|
subtitle: Column(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue