Skip to content

Instantly share code, notes, and snippets.

Last active February 22, 2020 23:37
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A simple project demonstrating how to build an online radio app using Flutter
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter_radio/flutter_radio.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
_MyAppState createState() => new _MyAppState();
class _MyAppState extends State<MyApp> {
String url = "";
bool isPlaying = false;
bool isVisible = true;
void initState() {
Future<void> audioStart() async {
await FlutterRadio.audioStart();
print('Audio Start OK');
Widget build(BuildContext context) {
return new MaterialApp(
title: 'IndieXL Online Radio',
debugShowCheckedModeBanner: false,
home: new Scaffold(
appBar: new AppBar(
title: const Text('IndieXL Online Radio'),
backgroundColor: Colors.blueGrey.shade900,
centerTitle: true,
body: Container(
color: Colors.blueGrey.shade900,
child: new Column(
children: <Widget>[
flex: 7,
child: Icon(, size: 250,
color: Colors.white,
flex: 2,
child: Padding(
padding: const EdgeInsets.only(right: 40),
child: Align(
child: IconButton(icon: isPlaying? Icon(
size: 80,
color: Colors.white,
: Icon(
color: Colors.white,
size: 80,
onPressed: (){
setState(() { url);
isPlaying = !isPlaying;
isVisible = !isVisible;
SizedBox(height: 50,)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment