part of '../dashboard_page.dart';

extension SmallLayoutDashboardPage on DashboardPageState {
  Widget _buildSmallContent(AmbitoTheme theme) {
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        _bioDiversityPart(theme),
        theme.verticalSpacer,
        _fundingPart(theme),
      ],
    );
  }

  Widget _buildSmallCard(
      Color background, String image, String title, String link) {
    final AmbitoTheme theme = getTheme(context);

    return InkWell(
      onHover: (hovered) {},
      highlightColor: Colors.transparent,
      splashColor: Colors.transparent,
      focusColor: Colors.transparent,
      hoverColor: Colors.transparent,
      onTap: () {
        Get.toNamed(link);
      },
      child: Padding(
        padding: const EdgeInsets.only(bottom: 10),
        child: Container(
          width: double.infinity,
          height: 120,
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(10),
            image: DecorationImage(
              image: AssetImage(image),
              fit: BoxFit.cover,
            ),
          ),
          child: Column(
            children: [
              const Expanded(child: SizedBox()),
              Container(
                height: 80,
                decoration: BoxDecoration(
                  color: theme.currentColorScheme.outline
                    ..withValues(alpha: .6),
                  borderRadius: const BorderRadius.only(
                      bottomLeft: Radius.circular(10),
                      bottomRight: Radius.circular(10)),
                ),
                width: double.infinity,
                child: Column(
                  mainAxisSize: MainAxisSize.max,
                  mainAxisAlignment: MainAxisAlignment.center,
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    Text(
                      title,
                      textAlign: TextAlign.center,
                      style: theme.labelMedium.copyWith(
                        color: theme.currentColorScheme.onPrimary,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
