fluffychat/lib/widgets/layouts/login_scaffold.dart

47 lines
1.2 KiB
Dart
Raw Normal View History

2022-04-15 11:42:59 +02:00
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class LoginScaffold extends StatelessWidget {
final Widget body;
final AppBar? appBar;
const LoginScaffold({
Key? key,
required this.body,
this.appBar,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: appBar?.automaticallyImplyLeading ?? true,
centerTitle: appBar?.centerTitle,
title: appBar?.title,
leading: appBar?.leading,
actions: appBar?.actions,
iconTheme: const IconThemeData(color: Colors.white),
elevation: 0,
scrolledUnderElevation: 0,
backgroundColor: Colors.transparent,
systemOverlayStyle: SystemUiOverlayStyle.light,
),
2022-04-15 11:42:59 +02:00
extendBodyBehindAppBar: true,
2022-04-15 18:42:11 +02:00
extendBody: true,
2022-04-15 11:42:59 +02:00
body: Container(
decoration: const BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
2022-08-06 13:35:59 +02:00
image: AssetImage('assets/login_wallpaper.png'),
2022-04-15 11:42:59 +02:00
),
),
alignment: Alignment.center,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 480),
child: body,
),
),
);
}
}