import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';

class VitalSignItem extends StatelessWidget {
  final String des;
  final String lastVal;
  final String unit;
  final String imagePath;
  final double height;
  final double width;

  const VitalSignItem(
      {Key? key,
      required this.des,
      this.lastVal = 'N/A',
      this.unit = '',
      this.height = 0,
      this.width = 0,
      required this.imagePath})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return RoundedContainer(
      // margin: 0.025 * SizeConfig.realScreenWidth!,
      // height: 0.15 * SizeConfig.realScreenHeight!,
      // width: 0.45 * SizeConfig.realScreenWidth!,
      child: Container(
        padding: EdgeInsets.all(5),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Expanded(
              child: Container(
                padding: EdgeInsets.only(top: 8),
                child: Row(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: <Widget>[
                    Expanded(
                      child: Container(
                        padding: EdgeInsets.only(left: 8, right: 8),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          mainAxisAlignment: MainAxisAlignment.start,
                          children: [
                            AppText(
                              "$lastVal",
                              fontFamily: 'Poppins',
                              fontSize: SizeConfig.textMultiplier! * 1.4,
                              fontWeight: FontWeight.bold,
                              color: Color(0xFF2E303A),
                              margin: 0,
                            ),
                            Expanded(
                              child: Column(
                                children: [
                                  AppText(
                                    "$unit",
                                    fontFamily: 'Poppins',
                                    fontSize: SizeConfig.textMultiplier! * 1.2,
                                    fontWeight: FontWeight.w700,
                                    color: Color(0xFFD02127),
                                    margin: 0,
                                  ),
                                ],
                              ),
                            ),
                          ],
                        ),
                      ),
                    ),
                    Container(
                        child: Image.asset(
                      imagePath,
                      width: 40,
                      height: 40,
                    ))
                  ],
                ),
              ),
            ),
            Container(
              width: double.infinity,
              child: Column(
                children: [
                  Align(
                    alignment: Alignment.topRight,
                    child: Icon(
                      EvaIcons.eye,
                    ),
                  ),
                  Align(
                    alignment: Alignment.topLeft,
                    child: Container(
                      margin: EdgeInsets.only(left: 5, right: 5),
                      child: AppText(
                        "$des",
                        color: Color(0xFF2E303A),
                        fontSize: SizeConfig.textMultiplier! * 1.3,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
