showNotification function

void showNotification({
  1. required dynamic message,
  2. required dynamic error,
})

Implementation

void showNotification({required message, required error}) =>
  showSimpleNotification(
    Container(
      height: 50,
      width: 328,
      padding: const EdgeInsets.all(8),
      decoration: BoxDecoration(
          color: error ? hexToColor(redColor) : hexToColor(greenColor),
          borderRadius: BorderRadius.circular(4.0)
      ),
      child: Row(
        children: [
          error ? const Icon(FontAwesomeIcons.xmark, size: 10, color: Colors.white,)
              : const Icon(FontAwesomeIcons.checkDouble, size: 10, color: Colors.white,),
          const SizedBox(width: 18,),
          Center(
            child: Text(
              message,
              maxLines: 3,
              overflow: TextOverflow.ellipsis,
              style: blackTextStyle.copyWith(
                  color: Colors.white,
                  fontSize: 14,
                  fontWeight: FontWeight.w400
              ),
            ),
          ),
        ],
      ),
    ),
    background: Colors.white,
    elevation: 0,
    duration: const Duration(seconds: 3),
  );