open_brewery_db

Last updated:

0 purchases

open_brewery_db Image
open_brewery_db Images
Add to Cart

Description:

open brewery db

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.

Features #



List Breweries
Get Brewery
Search Brewery










Getting started #
Install #
Add package:
dependencies:
open_brewery_db: ^0.0.6
copied to clipboard
Run in your project directory
$ flutter pub get
copied to clipboard
Import it
import 'package:open_brewery_db/open_brewery_db.dart';
copied to clipboard

Usage #
Get Brewery by Id #
Usage
Future<Brewery> getBrewery({required String id})
copied to clipboard
Example
OpenBreweryDb.getBrewery(id: "sierra-nevada-brewing-co-chico")
copied to clipboard

List Breweries #
Usage
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,
})
copied to clipboard
Examples
OpenBreweryDb.listBreweries(
byCity: "Sacramento",
sortFields: [SortFieldType.name],
sortOrder: Sort.asc,
),
copied to clipboard
OpenBreweryDb.listBreweries(
byState: "California",
byCity: "San Diego",
sortFields: [SortFieldType.street],
sortOrder: Sort.desc,
),
copied to clipboard
OpenBreweryDb.listBreweries(
byDist: LatLng(latitude: 38.5816, longitude: -121.4944), // Sacramento, CA
),
copied to clipboard

Search Breweries #
Usage
Future<List<Brewery>> searchBreweries({
required String query,
})
copied to clipboard
Examples
OpenBreweryDb.searchBreweries(query: "Sierra Nevada")
copied to clipboard
OpenBreweryDb.searchBreweries(query: "Chico California")
copied to clipboard

Data #
Future<Brewery>
copied to clipboard
Future<List<Brewery>>
copied to clipboard
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;
copied to clipboard

Roadmap #

✅ 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)


Additional information #
Pull requests are very much welcomed!
OBDB Frequently Asked Questions

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.