Merge branch 'rizzek/fix-applock-on-landscape-issue589' into 'main'

Fix Blank LockScreen on wide screen dimensions

Closes #589

See merge request famedly/fluffychat!609
This commit is contained in:
Krille Fear 2021-12-07 07:31:06 +00:00
commit 8e4ca84415
2 changed files with 10 additions and 1 deletions

View File

@ -10,7 +10,14 @@ import 'package:fluffychat/widgets/matrix.dart';
class OnePageCard extends StatelessWidget {
final Widget child;
const OnePageCard({Key? key, required this.child}) : super(key: key);
/// This will cause the "isLogged()" check to be skipped and force a
/// OnePageCard without login wallpaper. This can be used in situations where
/// "Matrix.of(context) is not yet available, e.g. in the LockScreen widget.
final bool forceBackgroundless;
const OnePageCard(
{Key? key, required this.child, this.forceBackgroundless = false})
: super(key: key);
static const int alpha = 12;
static num breakpoint = FluffyThemes.columnWidth * 2;
@ -19,6 +26,7 @@ class OnePageCard extends StatelessWidget {
final horizontalPadding =
max<double>((MediaQuery.of(context).size.width - 600) / 2, 24);
return MediaQuery.of(context).size.width <= breakpoint ||
forceBackgroundless ||
Matrix.of(context).client.isLogged()
? child
: Container(

View File

@ -30,6 +30,7 @@ class _LockScreenState extends State<LockScreen> {
supportedLocales: L10n.supportedLocales,
home: Builder(
builder: (context) => OnePageCard(
forceBackgroundless: true,
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,