Fixed size on web and changed details design button in desktop and tablet
This commit is contained in:
@@ -6,8 +6,8 @@ import 'package:tm_app/core/theme/colors.dart';
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
import '../widgets/widgets.dart';
|
||||
import '../../../view_models/login_view_model.dart';
|
||||
import '../widgets/widgets.dart';
|
||||
|
||||
class LoginDesktopPage extends StatefulWidget {
|
||||
const LoginDesktopPage({super.key});
|
||||
@@ -40,7 +40,7 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||
child: SizedBox(
|
||||
width: 120.0.w(),
|
||||
width: 526,
|
||||
child: ListenableBuilder(
|
||||
listenable: _viewModel,
|
||||
builder: (context, _) {
|
||||
@@ -79,9 +79,10 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
|
||||
|
||||
BaseButton(
|
||||
isEnabled: _viewModel.isLoginEnabled,
|
||||
onPressed: _viewModel.isLoginEnabled
|
||||
? () => HomeRouteData().go(context)
|
||||
: null,
|
||||
onPressed:
|
||||
_viewModel.isLoginEnabled
|
||||
? () => HomeRouteData().go(context)
|
||||
: null,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ class LoginScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
SizeConfig.init(context);
|
||||
return ResponsiveBuilder(
|
||||
mobile: LoginMobilePage(),
|
||||
mobile: LoginMobilePage(),
|
||||
tablet: LoginTabletPage(),
|
||||
desktop: LoginDesktopPage(),
|
||||
);
|
||||
|
||||
@@ -6,8 +6,8 @@ import 'package:tm_app/core/theme/colors.dart';
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
import '../widgets/widgets.dart';
|
||||
import '../../../view_models/login_view_model.dart';
|
||||
import '../widgets/widgets.dart';
|
||||
|
||||
class LoginTabletPage extends StatefulWidget {
|
||||
const LoginTabletPage({super.key});
|
||||
@@ -35,12 +35,12 @@ class _LoginTabletPageState extends State<LoginTabletPage> {
|
||||
Widget build(BuildContext context) {
|
||||
SizeConfig.init(context);
|
||||
return Scaffold(
|
||||
backgroundColor:AppColors.backgroundColor,
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
body: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||
child: SizedBox(
|
||||
width: 120.0.w(),
|
||||
width: 526,
|
||||
child: ListenableBuilder(
|
||||
listenable: _viewModel,
|
||||
builder: (context, _) {
|
||||
@@ -79,9 +79,10 @@ class _LoginTabletPageState extends State<LoginTabletPage> {
|
||||
|
||||
BaseButton(
|
||||
isEnabled: _viewModel.isLoginEnabled,
|
||||
onPressed: _viewModel.isLoginEnabled
|
||||
? () => HomeRouteData().go(context)
|
||||
: null,
|
||||
onPressed:
|
||||
_viewModel.isLoginEnabled
|
||||
? () => HomeRouteData().go(context)
|
||||
: null,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ class BaseButton extends StatelessWidget {
|
||||
final double? borderWidth;
|
||||
final double? borderRadius;
|
||||
final double? elevation;
|
||||
final double? width;
|
||||
|
||||
const BaseButton({
|
||||
required this.isEnabled,
|
||||
@@ -25,13 +26,14 @@ class BaseButton extends StatelessWidget {
|
||||
this.borderWidth,
|
||||
this.borderRadius,
|
||||
this.elevation,
|
||||
this.width,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
width: width ?? double.infinity,
|
||||
height: 55.0.h(),
|
||||
child: ElevatedButton(
|
||||
onPressed: isEnabled ? onPressed : null,
|
||||
|
||||
Reference in New Issue
Block a user