72 lines
2.1 KiB
Dart
72 lines
2.1 KiB
Dart
// ignore_for_file: deprecated_member_use
|
|
|
|
import 'package:didvan/views/authentication/widgets/authentication_app_bar.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
class AuthenticationLayout extends StatelessWidget {
|
|
final List<Widget> children;
|
|
final String? appBarTitle;
|
|
|
|
const AuthenticationLayout(
|
|
{Key? key, required this.children, this.appBarTitle})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CustomScrollView(
|
|
slivers: [
|
|
if (appBarTitle != null)
|
|
SliverAppBar(
|
|
automaticallyImplyLeading: false,
|
|
pinned: true,
|
|
toolbarHeight: 56,
|
|
backgroundColor: Theme.of(context).colorScheme.background,
|
|
flexibleSpace: Padding(
|
|
padding: const EdgeInsets.only(
|
|
left: 16,
|
|
right: 16,
|
|
// top: 7,
|
|
),
|
|
child: AuthenticationAppBar(
|
|
title: appBarTitle,
|
|
),
|
|
),
|
|
),
|
|
SliverPadding(
|
|
padding: const EdgeInsets.only(
|
|
// top: appBarTitle == null ? 100 : 44,
|
|
// left: 100,
|
|
// right: 100,
|
|
// bottom: 40,
|
|
),
|
|
sliver: SliverToBoxAdapter(
|
|
child: Column(
|
|
children: [
|
|
const SizedBox(height: 20),
|
|
SvgPicture.asset(
|
|
'lib/assets/images/logos/logo-horizontal-light.svg',
|
|
height: 70,
|
|
),
|
|
Image.asset(
|
|
'lib/assets/icons/login_img.png',
|
|
height: 300,
|
|
width: double.infinity,
|
|
fit: BoxFit.fill,
|
|
)
|
|
],
|
|
)),
|
|
),
|
|
SliverPadding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
sliver: SliverList(
|
|
delegate: SliverChildListDelegate([
|
|
for (var i = 0; i < children.length; i++) children[i],
|
|
]),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|