header static method

Widget header({
  1. required String header,
  2. required bool isSelected,
  3. required void onTap()?,
  4. required Size screenSize,
})

Implementation

static Widget header(
    {required String header,
    required bool isSelected,
    required void Function()? onTap,
    required Size screenSize}) {
  double headerTextSize = 0.035;
  return GestureDetector(
    onTap: onTap,
    child: Padding(
      padding: const EdgeInsets.only(right: 15.0),
      child: Column(
        children: [
          Text(
            header,
            textAlign: TextAlign.center,
            style: GoogleFonts.cambay(
                fontSize: screenSize.width * headerTextSize,
                color: isSelected ? Colors.green : Colors.black45,
                fontWeight: FontWeight.bold),
          ),
          const SizedBox(
            height: 5.0,
          ),
          Container(
              height: 5.0,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(10.0),
                color: isSelected ? Colors.green : Colors.black26,
              ),
              child: Text(
                header,
                textAlign: TextAlign.center,
                style: GoogleFonts.cambay(
                    fontSize: screenSize.width * headerTextSize,
                    color: Colors.transparent,
                    fontWeight: FontWeight.bold),
              ))
        ],
      ),
    ),
  );
}