Skip to content

Commit

Permalink
responsive added
Browse files Browse the repository at this point in the history
  • Loading branch information
stp2003 committed Feb 23, 2024
1 parent 70e8fc0 commit 22b2021
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/features/auth/screen/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -59,7 +60,7 @@ class LoginScreen extends ConsumerWidget {
),
),
const SizedBox(height: 20),
const SignInButton(),
const Responsive(child: SignInButton()),
],
),
);
Expand Down
22 changes: 22 additions & 0 deletions lib/responsive/responsive.dart
Original file line number Diff line number Diff line change
@@ -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,
),
);
}
}

0 comments on commit 22b2021

Please sign in to comment.