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

class RowCounts extends StatelessWidget {
  final name;
  final int count;
  final Color c;
  final double? height;

  RowCounts(this.name, this.count, this.c, {this.height});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
          top: SizeConfig.getHeightMultiplier(height: height) * 0.2,
          bottom: SizeConfig.getHeightMultiplier(height: height) * 0.2),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          dot(c),
          Expanded(
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                AppText(
                  name,
                  color: AppGlobal.appTextColor,
                  fontWeight: FontWeight.w400,
                  textAlign: TextAlign.start,
                  // from TextAlign.center
                  fontSize: 14,
                  letterSpacing: -0.84,

                  textOverflow: TextOverflow.ellipsis,
                ),
                SizedBox(
                  width: 4,
                ),
                AppText(
                  count.toString(),
                  color: AppGlobal.appTextColor,
                  textAlign: TextAlign.center,
                  fontSize: 14,
                  letterSpacing: -0.84,
                  fontWeight: FontWeight.bold,
                )
              ],
            ),
          ),
        ],
      ),
    );
  }

  Widget dot(Color c) {
    return Container(
        padding: EdgeInsets.all(5.0),
        margin: EdgeInsets.all(5.0),
        decoration: BoxDecoration(color: c, shape: BoxShape.circle));
  }
}
