Skip to content

Instantly share code, notes, and snippets.

@suragch
Last active November 2, 2021 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suragch/df9fd1c587ef755ea9adfe6140d8295a to your computer and use it in GitHub Desktop.
Save suragch/df9fd1c587ef755ea9adfe6140d8295a to your computer and use it in GitHub Desktop.
Steaming audio in Flutter with Just Audio (setup)
import 'package:audio_video_progress_bar/audio_video_progress_bar.dart';
import 'package:flutter/material.dart';
import 'page_manager.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
late final PageManager _pageManager;
@override
void initState() {
super.initState();
_pageManager = PageManager();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
const Spacer(),
const ProgressBar(
progress: Duration.zero,
total: Duration.zero,
),
IconButton(
icon: const Icon(Icons.play_arrow),
iconSize: 32.0,
onPressed: () {},
),
],
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment