Pub | pub points | Likes | Popularity | CI | License |
---|---|---|---|---|---|
Flutter API wrapper for Open Brewery DB.
Open Brewery DB is a free dataset and API with public information on breweries, cideries, brewpubs, and bottleshops. The goal of Open Brewery DB is to maintain an open-source, community-driven dataset and provide a public API. It is our belief that public information should be freely accessible for the betterment of the beer community and the happiness of web developers and data analysts.
List Breweries | Get Brewery | Search Brewery |
---|---|---|
Add package:
dependencies:
open_brewery_db: ^0.0.6
Run in your project directory
$ flutter pub get
Import it
import 'package:open_brewery_db/open_brewery_db.dart';
Future<Brewery> getBrewery({required String id})
OpenBreweryDb.getBrewery(id: "sierra-nevada-brewing-co-chico")
Future<List<Brewery>> listBreweries({
String? byCity,
LatLng? byDist,
String? byName,
String? byState,
String? byPostal,
BreweryType? byType,
int? byPage,
int? perPage,
List<SortFieldType> sortFields = const [],
Sort? sortOrder,
})
OpenBreweryDb.listBreweries(
byCity: "Sacramento",
sortFields: [SortFieldType.name],
sortOrder: Sort.asc,
),
OpenBreweryDb.listBreweries(
byState: "California",
byCity: "San Diego",
sortFields: [SortFieldType.street],
sortOrder: Sort.desc,
),
OpenBreweryDb.listBreweries(
byDist: LatLng(latitude: 38.5816, longitude: -121.4944), // Sacramento, CA
),
Future<List<Brewery>> searchBreweries({
required String query,
})
OpenBreweryDb.searchBreweries(query: "Sierra Nevada")
OpenBreweryDb.searchBreweries(query: "Chico California")
Future<Brewery>
Future<List<Brewery>>
final String? id;
final String? name;
final String? breweryType;
final String? street;
final String? address_2;
final String? address_3;
final String? city;
final String? state;
final String? countyProvince;
final String? postalCode;
final String? country;
final String? longitude;
final String? latitude;
final String? phone;
final String? websiteUrl;
final String? updatedAt;
final String? createdAt;
- Add documentation comments
- Add autocomplete endpoint
- Write thorough tests for
get brewery
(simple tests are implemented for now) - Write thorough tests for
list breweries
(simple tests are implemented for now) - Write thorough tests for
search breweries
(simple tests are implemented for now)
Pull requests are very much welcomed!