rowTextComLable method

Widget rowTextComLable({
  1. required ReportFromJSONController controller,
  2. required double width,
  3. double? height,
  4. required dynamic key,
  5. required Type type,
  6. required dynamic value,
})

Implementation

Widget rowTextComLable({
  required ReportFromJSONController controller,
  required double width,
  double? height,
  required key,
  required Type type,
  required value,
}) {
  return Stack(
    children: [
      Container(
        width: width,
        height: height,
        decoration: BoxDecoration(
          color: Colors.grey,
          border: Border.all(
            color: Colors.purple.withOpacity(0.5),
            width: 0.25,
          ),
        ),
        padding: const EdgeInsets.only(left: 10, right: 10, bottom: 5),
        alignment: Alignment.center,
        child: Column(
          children: [
            Text(
              key,
              style: const TextStyle(
                fontWeight: FontWeight.w500,
                fontSize: 11,
                color: Colors.black,
              ),
            ),
            Padding(
              padding: const EdgeInsets.only(left: 10.0),
              child: Text(
                type == DateTime
                    ? value.toString()
                    : type == String
                        ? Features.formatarTextoPrimeirasLetrasMaiusculas(value.toString().replaceAll('_', ' '))
                        : type == double
                            ? Features.toFormatNumber(value.toString().replaceAll('_', ' '))
                            : type == int
                                ? Features.toFormatInteger(
                                    value.toString().replaceAll('_', ' '),
                                  )
                                : value.toString(),
                style: const TextStyle(
                  fontWeight: FontWeight.bold,
                  fontSize: 12,
                  color: Colors.black,
                ),
              ),
            ),
          ],
        ),
      ),
    ],
  );
}