holder function

Widget holder(
  1. String title,
  2. dynamic value
)

Implementation

Widget holder(String title, var value) {
  return Padding(
    padding: const EdgeInsets.only(top: 4.0),
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        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: value.toString() == "Success"? 0xff228B22 :value.toString().contains("Extremely high ~ ")?0xffFF0000:
          value.toString().contains("High ~ ")?0xffFF0000:
          value.toString().contains("Moderate ~ ")?yellowIntColor: greenIntColor,
          fontSize: title == "Total balance" || title == "Total Amount"
              ? 20
              : title == "Consuming rate"
              ? 12
              : value == "calculating...."
              ? 10
              : 12,
          fontWeight: title == "Total balance" || title == "Total Amount"
              ? FontWeight.w600
              : title == "Consuming rate" || value.toString() == "Success"
              ? FontWeight.w600
              : FontWeight.w400,
          textAlign: TextAlign.end,
        ),
      ],
    ),
  );
}