import 'package:flutter/material.dart';
import '../constant/status_code/status_code_constants.dart';
import '../shared/shared_snack_bar.dart';

void showSnackBarResponseByStatusCode(BuildContext context, int statusCode,
    String successMessage, String failedMessage) async {
  if (statusCode == StatusCodeConstants.OK ||
      statusCode == StatusCodeConstants.CREATED) {
    showSuccessTopSnackBarCustom(context, successMessage);
  } else {
    showErrorTopSnackBarCustom(context, failedMessage);
  }
}

void showSnackBarResponseByStatusCodeNoIcon(BuildContext context, int statusCode,
    String successMessage, String failedMessage) async {
  if (statusCode == StatusCodeConstants.OK ||
      statusCode == StatusCodeConstants.CREATED) {
    showNoIconTopSnackBar(context, successMessage,Colors.green, Colors.white);
  } else {
    showNoIconTopSnackBar(context, failedMessage, Colors.red, Colors.white);
  }
}
