import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../controller/login_controller.dart';
import '../widgets/my_login_widget.dart';

class LoginPage extends GetView<LoginController> {
  static const String namedRoute = '/login-page';
  const LoginPage({super.key});

  @override
  Widget build(BuildContext context) {
    var logCtrl = controller;
    var displayWidth = MediaQuery.of(context).size.width;
    var displayHeight = MediaQuery.of(context).size.height;
    return SafeArea(
      child: Scaffold(
        body: Container(
          height: displayHeight,
          width: displayWidth,
          padding: const EdgeInsets.symmetric(
            horizontal: 16.0,
            vertical: 100.0,
          ),
          color: Colors.blue.shade100,
          child: SingleChildScrollView(
            child: MyLoginWidget(
              onButtonPressed: () => logCtrl.login(),
              signInOnTab: () => logCtrl.goToSignInPage(),
              logCtrl: logCtrl,
            ),
          ),
        ),
      ),
    );
  }
}
