foursquare 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

Foursquare for Dart #

This is a Dart package for accessing Foursquare API endpoints and Foursquare-related objects. Both userless and authenticated access is supported.

Getting Started #

Add this git as a dependency in pubspec.yaml of your Flutter project.

dependencies:
  foursquare: '^0.0.2'

Import the package into your project.

import 'package:foursquare/foursquare.dart';

...

void main() async {
  // Used for userless requests
  API userless = await API.userless(
    'FOURSQUARE_CLIENT_ID', 
    'FOURSQUARE_CLIENT_SECRET');

  // Used for authenticated requests
  API authed = await API.authed('OAUTH_ACCESS_TOKEN');

  Venue current = await Venue.current(authed, 40, -74);
  print(current.name);
  
  ...

}

TODO #

  • [x] Constructors for userless and authenticated access
  • [x] Basic GET implementation
  • [x] Basic objects - User, Venue
  • [x] Basic API endpoints - user/X, venues/search
  • [ ] Deeper object implementation
  • [ ] Deeper API endpoint implementation
  • [ ] dartdoc documentation

0.0.2 #

  • Adding top photo for Venue
  • Adding Category object
  • Minor updates to links in README

0.0.1 #

  • Initial version
  • Support for users/X, venues/search

example/main.dart

import 'package:foursquare/foursquare.dart';

void main() async {
  // Used for userless requests
  API userless = await API.userless(
    'FOURSQUARE_CLIENT_ID', 
    'FOURSQUARE_CLIENT_SECRET');

  // Used for authenticated requests
  API authed = await API.authed('OAUTH_ACCESS_TOKEN');

  Venue current = await Venue.current(userless, 43.6532, -79.3832);
  print('I am at ${current.name}.');

  User self = await User.get(authed);
  print('I am ${self.firstName} ${self.lastName}.');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  foursquare: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:foursquare/foursquare.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
51
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

We analyzed this package on Nov 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:foursquare/foursquare.dart.

Health suggestions

Fix lib/src/category.dart. (-0.50 points)

Analysis of lib/src/category.dart reported 1 hint:

line 1 col 8: Unused import: 'api.dart'.

Format lib/foursquare.dart.

Run dartfmt to format lib/foursquare.dart.

Format lib/src/api.dart.

Run dartfmt to format lib/src/api.dart.

Format lib/src/user.dart.

Run dartfmt to format lib/src/user.dart.

Format lib/src/venue.dart.

Run dartfmt to format lib/src/venue.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0 0.12.0+2
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6