import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:responsive_builder/responsive_builder.dart';

import 'custom_appBar.dart';
import 'custom_drawer.dart';

class MainLayout extends StatelessWidget {
  final Widget child;
  final bool isDesktop;

  const MainLayout({required this.child, required this.isDesktop, Key? key})
    : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFFf5f5f5),
      appBar: CustomAppBar(isDesktop: isDesktop),
      drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
      body: Padding(
        padding:
            isDesktop
                ? EdgeInsets.symmetric(
                  horizontal: MediaQuery.of(context).size.width * 0.1,
                  vertical: 0,
                )
                : EdgeInsets.zero,
        child: child,
      ),
    );
  }
}
