fix: Applock screen completely broken

This commit is contained in:
Krille 2023-09-22 08:26:43 +02:00
parent 40f6fe17be
commit 100548b265
No known key found for this signature in database
3 changed files with 7 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/widgets/layouts/login_scaffold.dart'; import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
import 'package:fluffychat/widgets/matrix.dart';
import '../../config/themes.dart'; import '../../config/themes.dart';
import '../../widgets/mxc_image.dart'; import '../../widgets/mxc_image.dart';
import 'homeserver_app_bar.dart'; import 'homeserver_app_bar.dart';
@ -19,6 +20,7 @@ class HomeserverPickerView extends StatelessWidget {
final identityProviders = controller.identityProviders; final identityProviders = controller.identityProviders;
final errorText = controller.error; final errorText = controller.error;
return LoginScaffold( return LoginScaffold(
enforceMobileMode: Matrix.of(context).client.isLogged(),
appBar: AppBar( appBar: AppBar(
titleSpacing: 12, titleSpacing: 12,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,

View file

@ -14,6 +14,7 @@ class LoginView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return LoginScaffold( return LoginScaffold(
enforceMobileMode: Matrix.of(context).client.isLogged(),
appBar: AppBar( appBar: AppBar(
leading: controller.loading ? null : const BackButton(), leading: controller.loading ? null : const BackButton(),
automaticallyImplyLeading: !controller.loading, automaticallyImplyLeading: !controller.loading,

View file

@ -6,22 +6,23 @@ import 'package:url_launcher/url_launcher_string.dart';
import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/themes.dart'; import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/utils/platform_infos.dart'; import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/matrix.dart';
class LoginScaffold extends StatelessWidget { class LoginScaffold extends StatelessWidget {
final Widget body; final Widget body;
final AppBar? appBar; final AppBar? appBar;
final bool enforceMobileMode;
const LoginScaffold({ const LoginScaffold({
Key? key, Key? key,
required this.body, required this.body,
this.appBar, this.appBar,
this.enforceMobileMode = false,
}) : super(key: key); }) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final isMobileMode = Matrix.of(context).client.isLogged() || final isMobileMode =
!FluffyThemes.isColumnMode(context); enforceMobileMode || !FluffyThemes.isColumnMode(context);
final scaffold = Scaffold( final scaffold = Scaffold(
key: const Key('LoginScaffold'), key: const Key('LoginScaffold'),
appBar: appBar == null appBar: appBar == null