import 'package:flutter/material.dart';
import 'package:school_management_system/screens/login/components/login_form.dart';
import 'package:school_management_system/screens/login/components/login_screen_top_image.dart';
import 'package:school_management_system/screens/main/main_screen.dart';

class LoginScreen extends StatefulWidget {
  const LoginScreen({super.key});

  @override
  State<LoginScreen> createState() => _LoginScreenState();
}

class _LoginScreenState extends State<LoginScreen> {
  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      resizeToAvoidBottomInset: false,
      body: Responsive(
        desktop: Row(
          mainAxisAlignment: MainAxisAlignment.end,
          children: [
            Expanded(
              child: LoginScreenTopImage(),
            ),
            Expanded(
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  SizedBox(
                    width: 350,
                    child: LoginForm(),
                  ),
                ],
              ),
            ),
          ],
        ),
        mobile: MobileLoginScreen(),
      ),
    );
  }
}

class MobileLoginScreen extends StatelessWidget {
  const MobileLoginScreen({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return ListView(
      
     // mainAxisAlignment: MainAxisAlignment.center,
      children: const [
         LoginScreenTopImage(),
        Row(
          children: [
            Spacer(),
            Expanded(
              flex: 8,
              child: LoginForm(),
            ),
            Spacer(),
          ],
        ),
      ],
    );
  }
}
