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 double? height;
  final Color c;
  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: [
                Expanded(
                  child: AppText(
                    name,
                    color: Colors.black,
                    textAlign: TextAlign.start, // from TextAlign.center
                    fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5,
                    textOverflow: TextOverflow.ellipsis,
                  ),
                ),
                AppText(
                  ' (' + count.toString() + ')',
                  color: Colors.black,
                  textAlign: TextAlign.center,
                  fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
                  fontWeight: FontWeight.bold,
                )
              ],
            ),
          ),
        ],
      ),
    );
  }

  Widget dot(Color c) {
    return Container(
        padding: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 2),
        margin: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 1),
        decoration: BoxDecoration(color: c, shape: BoxShape.circle));
  }
}
