design: Make homepicker page nicer

This commit is contained in:
Krille Fear 2021-10-16 10:28:50 +02:00
parent e879278186
commit 4a8d50c201

View File

@ -1,5 +1,6 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:flutter/cupertino.dart';
import 'package:vrouter/vrouter.dart';
import '../homeserver_picker.dart';
@ -126,37 +127,35 @@ class HomeserverPickerView extends StatelessWidget {
const Expanded(child: Divider()),
]),
},
Row(
children: [
if (controller.passwordLoginSupported)
Expanded(
Center(
child: _LoginButton(
onPressed: () =>
VRouter.of(context).to('login'),
icon: const Icon(Icons.login_outlined),
icon: Icon(
CupertinoIcons.lock_open_fill,
color: Theme.of(context)
.textTheme
.bodyText1
.color,
),
labelText: L10n.of(context).login,
),
),
if (controller.registrationSupported &&
controller.passwordLoginSupported)
const SizedBox(width: 12),
if (controller.registrationSupported &&
// Registration is broken on matrix.org
Matrix.of(context)
.client
.homeserver
.host !=
'matrix-client.matrix.org')
Expanded(
if (controller.registrationSupported)
Center(
child: _LoginButton(
onPressed: controller.signUpAction,
icon:
const Icon(Icons.add_box_outlined),
icon: Icon(
CupertinoIcons.person_add,
color: Theme.of(context)
.textTheme
.bodyText1
.color,
),
labelText: L10n.of(context).register,
),
),
],
),
]
.map(
(widget) => Container(
@ -216,11 +215,10 @@ class _LoginButton extends StatelessWidget {
return OutlinedButton.icon(
style: OutlinedButton.styleFrom(
minimumSize: const Size(256, 56),
side: BorderSide(
color: Theme.of(context).textTheme.bodyText1.color,
textStyle: const TextStyle(fontWeight: FontWeight.bold),
backgroundColor: Theme.of(context).backgroundColor,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7)),
),
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(90))),
onPressed: onPressed,
icon: icon,
label: Text(