Skip to content

Commit c1bd945

Browse files
committed
feat(authentication): add responsive authentication layout
- Create AuthLayout widget for centering and constraining authentication content - Enable scrolling for smaller screens - Improve visual experience on larger screens
1 parent f1bddb4 commit c1bd945

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/constants/app_constants.dart';
3+
import 'package:ui_kit/ui_kit.dart';
4+
5+
/// {@template auth_layout}
6+
/// A responsive layout for authentication pages.
7+
///
8+
/// It centers the content and constrains its width for a better
9+
/// visual experience on larger screens, while allowing it to be
10+
/// scrollable on smaller screens.
11+
/// {@endtemplate}
12+
class AuthLayout extends StatelessWidget {
13+
/// {@macro auth_layout}
14+
const AuthLayout({required this.child, super.key});
15+
16+
/// The child widget to display within the layout.
17+
final Widget child;
18+
19+
@override
20+
Widget build(BuildContext context) {
21+
return Padding(
22+
padding: const EdgeInsets.all(AppSpacing.lg),
23+
child: Center(
24+
child: ConstrainedBox(
25+
constraints: const BoxConstraints(
26+
maxWidth: AppConstants.kMaxAuthWidth,
27+
),
28+
child: SingleChildScrollView(child: child),
29+
),
30+
),
31+
);
32+
}
33+
}

0 commit comments

Comments
 (0)