radio_browser_flutter

Last updated:

0 purchases

radio_browser_flutter Image
radio_browser_flutter Images
Add to Cart

Description:

radio browser flutter

Wrapper for https://www.radio-browser.info/
Documentation for the API can be found here
Features #
Contains wrapper methods for the following endpoints:

Stations
Countries
Languages
Tags
Codecs
Server details

Getting started #
Import the package:
import 'package:radio_browser_flutter/radio_browser_flutter.dart';
copied to clipboard
Initialize RadioBrowserClient before using it:
void main() {
RadioBrowserClient.initialize(USER_AGENT);
runApp(const MyApp());
}
copied to clipboard
Please keep the User-Agent descriptive as it helps the API maintainer.
It can be something like <APP_NAME>/<APP_VERSION>.
Usage #
Call the methods exposed by the API by using the client instance:
FutureBuilder(
future: RadioBrowserClient.instance.codecs.fetch(),
builder: ((context, AsyncSnapshot<List<Codec>> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
}
if (snapshot.hasError) {
return Text(snapshot.error?.toString() ?? "Something went wrong");
}
var data = snapshot.data!;
return ListView.builder(
itemCount: data.length,
itemBuilder: ((context, index) {
return ListTile(title: Text(data[index].name));
}),
);
}),
)
copied to clipboard

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.