import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';

import 'label.dart';

class DashboardSliderItemWidget extends StatelessWidget {
  final DashboardModel item;

  DashboardSliderItemWidget(this.item);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Row(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            Container(
              margin: EdgeInsets.symmetric(
                  horizontal: SizeConfig.widthMultiplier! * 1),
              child: Label(
                firstLine: Utils.getLabelFromKPI(item.kPIName!),
                secondLine: Utils.getNameFromKPI(item.kPIName!),
              ),
            ),
          ],
        ),
        new Container(
            height: SizeConfig.heightMultiplier! *
                (SizeConfig.isHeightVeryShort
                    ? 16
                    : SizeConfig.isHeightShort
                        ? 14
                        : SizeConfig.isHeightLarge
                            ? 15
                            : 13),
            child: ListView(
                scrollDirection: Axis.horizontal,
                children:
                    List.generate(item.summaryoptions!.length, (int index) {
                  return GetActivityCard(item.summaryoptions![index]);
                })))
      ],
    );
  }
}
