Skip to content

Instantly share code, notes, and snippets.

@korakotlee
korakotlee / LocationPlugin.java
Created April 30, 2019 13:19
LocationPlugin for Flutter
package com.lyokone.location;
import android.Manifest;
import android.app.Activity;
import android.provider.Settings;
import android.content.IntentSender;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
def is_url(string):
"""
Checks if the given string starts with 'http(s)'.
"""
try:
return string.startswith('http://') or string.startswith('https://')
except AttributeError:
return False