import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../../../Constants.dart';
import '../text.dart';

class MedicalProfileItem extends StatelessWidget {
  final String imagePath;
  final String title;
  final String subTitle;
  final bool hasBadge = false;
  bool isEnable;

  MedicalProfileItem({
    @required this.imagePath,
    @required this.title,
    @required this.subTitle,
    hasBadge,
    this.isEnable = true,
  });

  @override
  Widget build(BuildContext context) {
    ProjectViewModel projectViewModel = Provider.of(context);
    return Container(
      height: MediaQuery.of(context).size.height * 0.14,
      margin: EdgeInsets.all(5),
      decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(10), color: Colors.white),
      clipBehavior: Clip.antiAlias,
      child: Stack(
        children: [
          Padding(
            padding: EdgeInsets.all(10),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Texts(title,
                    fontSize: 1.5 * SizeConfig.textMultiplier,
                    color: secondaryColor,
                    fontWeight: FontWeight.bold),
                Texts(
                  subTitle,
                  fontSize: 1.4 * SizeConfig.textMultiplier,
                ),
                Align(
                  alignment: projectViewModel.isArabic
                      ? Alignment.bottomLeft
                      : Alignment.bottomRight,
                  child: Image.asset(
                    "assets/images/medical/$imagePath",
                    height: SizeConfig.heightMultiplier * 5,
                    width: SizeConfig.heightMultiplier * 5,
                  ),
                )
              ],
            ),
          ),
          isEnable
              ? Container()
              : Container(
                  width: double.infinity,
                  height: double.infinity,
                  color: Colors.grey.withOpacity(0.7),
                  child: Icon(
                    Icons.lock_outline,
                    size: 40,
                  ),
                )
        ],
      ),
    );
  }
}
