radio_browser_flutter 0.0.1 copy "radio_browser_flutter: ^0.0.1" to clipboard
radio_browser_flutter: ^0.0.1 copied to clipboard

outdated

Wrapper for radio browser API. Radio Browser API provides endpoints for retrieving online radio information from all over the world.

Wrapper for https://www.radio-browser.info/

Documentation for the API can be found here

Features #

Contains wrapper methods for the following endpoints:

  1. Stations
  2. Countries
  3. Languages
  4. Tags
  5. Codecs
  6. Server details

Getting started #

Import the package:

import 'package:radio_browser_flutter/radio_browser_flutter.dart';

Initialize RadioBrowserClient before using it:

void main() {
  RadioBrowserClient.initialize(USER_AGENT);
  runApp(const MyApp());
}

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<String>> 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]));
        }),
        );
    }),
)
1
likes
0
points
8
downloads

Publisher

unverified uploader

Weekly Downloads

Wrapper for radio browser API. Radio Browser API provides endpoints for retrieving online radio information from all over the world.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dart_ping, dio, dns_client, equatable, flutter, json_annotation

More

Packages that depend on radio_browser_flutter