isBrowserCompatible method

bool isBrowserCompatible(
  1. String userAgent
)

Determines if the current browser is compatible based on the user agent string.

This method checks if the user agent string contains identifiers for either the Chrome or Edge browser, suggesting that the environment is either a Chrome or Edge browser which are deemed compatible.

@param userAgent The user agent string to be checked for compatibility. @return true if the browser is either Chrome or Edge, otherwise false.

Implementation

bool isBrowserCompatible(String userAgent) =>
    userAgent.toLowerCase().contains('chrome') ||
    userAgent.toLowerCase().contains('edg');