# checkUpdate method

Future<String> checkUpdate(

1. String version

)

Returns an url as String when the app is not up-to-date otherwise empty string

## Implementation

    Future<String> checkUpdate(String version) async {
      try {
        var response = await Dio().get(updateUrl);
        if (response.data.length > 0) {
          var latest = response.data[0];
          String tagName = latest['tag_name'];
          String publishedAt = latest['published_at'];

          // Newer version and at least 2 days old
          if (versionToDouble(tagName) > versionToDouble(version) &&
              DateTime.now().difference(DateTime.parse(publishedAt)).inDays > 2) {
            return latest['html_url'];
          }
        }
      } catch (e) {
        // ignored
      }
      return '';
    }