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

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<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));
            }),
          );
        }),
      )
1
likes
150
points
23
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

Documentation

API reference

License

MIT (license)

Dependencies

dart_ping, dio, dns_client, equatable, flutter, json_annotation

More

Packages that depend on radio_browser_flutter