holderWithColor function

Widget holderWithColor(
  1. String title,
  2. String value,
  3. dynamic color
)

Implementation

Widget holderWithColor(String title, String value, var color) {
  return Padding(
    padding: const EdgeInsets.only(bottom: 4.0),
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Padding(
          padding: const EdgeInsets.only(right: 8.0),
          child: Container(
            width: 20,
            height: 10,
            decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(100),
                color: Color(int.parse(color
                    .toString()
                    .substring(color.toString().indexOf("("),
                    color.toString().indexOf(")"))
                    .replaceAll("(", "")
                    .toString()))),
          ),
        ),
        Expanded(
          child: TextWidget(
            text: title,
            color: greenIntColor,
            fontSize:
            title == "Total balance" || title == "Total Amount" ? 14 : 12,
            fontWeight: title == "Total balance" || title == "Total Amount"
                ? FontWeight.w500
                : FontWeight.w300,
            textAlign: TextAlign.start,
          ),
        ),
        TextWidget(
          text: value.toString(),
          color: greenIntColor,
          fontSize: title == "Total balance" || title == "Total Amount"
              ? 20
              : title == "Consuming rate"
              ? 13
              : value == "calculating...."
              ? 13
              : 13,
          fontWeight: title == "Total balance" || title == "Total Amount"
              ? FontWeight.w600
              : title == "Consuming rate"
              ? FontWeight.w600
              : FontWeight.w500,
          textAlign: TextAlign.end,
        ),
      ],
    ),
  );
}