import 'package:car_customer_app/extensions/int_extensions.dart';
import 'package:car_customer_app/views/dashboard/widgets/ad_widget.dart';
import 'package:car_customer_app/views/dashboard/widgets/appointment_slider_widget.dart';
import 'package:car_customer_app/views/dashboard/widgets/my_branches_widget.dart';
import 'package:car_customer_app/views/dashboard/widgets/view_all_widget.dart';
import 'package:flutter/material.dart';

class HomeFragment extends StatelessWidget {
  const HomeFragment({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: double.infinity,
      height: double.infinity,
      child: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.only(top: 8, left: 21, right: 21, bottom: 21),
          child: Column(
            mainAxisSize: MainAxisSize.max,
            children: [
              ViewAllWidget(title: "Upcoming Appointment".toUpperCase(), subTitle: "View All"),
              const AppointmentSliderWidget(),
              20.height,
              ViewAllWidget(title: "My Recent Service Providers".toUpperCase(), subTitle: "View All"),
              const ServiceProviderWidget(),
              20.height,
              ViewAllWidget(title: "My Active Ads".toUpperCase(), subTitle: "View All"),
              // todo: we will replace this count with the sublist of ads
              const AdWidget(count: 1),
              20.height,
              ViewAllWidget(title: "My Recommended Ads".toUpperCase(), subTitle: "View All"),
              const AdWidget(count: 2),
            ],
          ),
        ),
      ),
    );
  }
}
