From 22b202131af8e9dc6b961630a1f09ec0f5e8095c Mon Sep 17 00:00:00 2001 From: stp2003 <100586951+stp2003@users.noreply.github.com> Date: Fri, 23 Feb 2024 15:29:04 +0530 Subject: [PATCH] responsive added --- lib/features/auth/screen/login_screen.dart | 3 ++- lib/responsive/responsive.dart | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 lib/responsive/responsive.dart diff --git a/lib/features/auth/screen/login_screen.dart b/lib/features/auth/screen/login_screen.dart index b9b6010..a07c273 100644 --- a/lib/features/auth/screen/login_screen.dart +++ b/lib/features/auth/screen/login_screen.dart @@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:lottie/lottie.dart'; import 'package:reddit/core/common/sign_in_button.dart'; import 'package:reddit/features/auth/controller/auth_controller.dart'; +import 'package:reddit/responsive/responsive.dart'; import '../../../core/common/loader.dart'; import '../../../core/constants/constants.dart'; @@ -59,7 +60,7 @@ class LoginScreen extends ConsumerWidget { ), ), const SizedBox(height: 20), - const SignInButton(), + const Responsive(child: SignInButton()), ], ), ); diff --git a/lib/responsive/responsive.dart b/lib/responsive/responsive.dart new file mode 100644 index 0000000..e49adc0 --- /dev/null +++ b/lib/responsive/responsive.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; + +class Responsive extends StatelessWidget { + final Widget child; + + const Responsive({ + super.key, + required this.child, + }); + + @override + Widget build(BuildContext context) { + return Center( + child: ConstrainedBox( + constraints: const BoxConstraints( + maxWidth: 600, + ), + child: child, + ), + ); + } +}