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
Run in your project directory
$ flutter pub get
Import it
import 'package:open_brewery_db/open_brewery_db.dart';
Usage
Get Brewery by Id
Usage
Future<Brewery> getBrewery({required String id})
Example
OpenBreweryDb.getBrewery(id: "sierra-nevada-brewing-co-chico")
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,
})
Examples
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
),
Search Breweries
Usage
Future<List<Brewery>> searchBreweries({
required String query,
})
Examples
OpenBreweryDb.searchBreweries(query: "Sierra Nevada")
OpenBreweryDb.searchBreweries(query: "Chico California")
Data
Future<Brewery>
Future<List<Brewery>>
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;
Roadmap
x
Add documentation commentsget brewery
(simple tests are implemented for now)list breweries
(simple tests are implemented for now)search breweries
(simple tests are implemented for now)
Additional information
Pull requests are very much welcomed!