isGoogleMapsUrl static method

bool isGoogleMapsUrl(
  1. String url
)

Validates if a URL is likely to be a Google Maps URL

Implementation

static bool isGoogleMapsUrl(String url) {
  final List<String> validPatterns = <String>[
    'google.com/maps',
    'maps.google.com',
    'maps.google.', // For international domains
    'google.co.', // For country domains
    'google.ca/maps',
    'google.co.uk/maps',
    'google.com.au/maps',
    'goo.gl/maps',
    'maps.app.goo.gl',
    'plus.codes',
    'maps.google.co.',
  ];

  return validPatterns.any(
    (String pattern) => url.toLowerCase().contains(pattern),
  );
}