import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:habitrack_app/pages/dashboard_hydration_subpage.dart';
import 'package:habitrack_app/pages/dashboard_task_subpage.dart';
import 'package:habitrack_app/pages/dashboard_timer_subpage.dart';
import 'package:habitrack_app/pages/reset_subpage.dart';

class DashboardPage extends ConsumerStatefulWidget {
  const DashboardPage({super.key});
  @override
  ConsumerState<DashboardPage> createState() => _DashboardPageState();
}

class _DashboardPageState extends ConsumerState<DashboardPage> {
  @override
  Widget build(BuildContext context) {
    //final items = ref.watch(itemsProvider);

    //final len = items.value!.length;
    return Scaffold(
      appBar: AppBar(
        title: Text(
          'Dashboard',
          textScaler: const TextScaler.linear(1.4),
          style: Theme.of(context).textTheme.bodyMedium!.copyWith(
                color: Theme.of(context).colorScheme.onSecondary,
              ),
        ),
        backgroundColor: Theme.of(context).colorScheme.secondary,
      ),
      body: ColoredBox(
        color: Theme.of(context).colorScheme.primaryContainer,
        child: SizedBox(
          width: MediaQuery.of(context).size.width,
          child: const Column(
            children: [
              SubpageHydrationButton(),
              SubpageTaskButton(),
              SubpageTimerButton(),
              ResetSubpageButton(),
            ],
          ),
        ),
      ),
    );
  }
}
