1
2
import 'package:flutter/material.dart';
import 'package:audioplayers/audioplayers.dart';
Dart file to toggle audio stream in flutter app using the audioplayers package at https://pub.dev/packages/audioplayers. I switched from using the Appbar to a container, because I have more control over the layout of the items and I can control the Appbar padding. One other point of interest to prevent skips in the streaming feed playback resuming after pause, instead of pausing the feed I play a 500 millisecond audio file that then immediately pauses. That replaces the stream and forces it to resume from the latest point.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.