Skip to main content

aplayer 0.0.2 copy "aplayer: ^0.0.2" to clipboard
aplayer: ^0.0.2 copied to clipboard

A packge for simle play link to audio files for flutter web

example/lib/main.dart

import 'dart:html';

import 'package:flutter/material.dart';
import 'package:aplayer/player.dart';
import 'package:aplayer/widget_progress.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final audio = APlayer("test.mp3");

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Wrap(
              children: <Widget>[
                RaisedButton(
                    onPressed: () => audio.stop(), child: Text("stop")),
              ],
            ),
            LinearAudioBar(
              player: audio,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => audio.playPause(),
        child: Icon(Icons.play_arrow),
      ), 
    );
  }
}
0
likes
40
points
35
downloads

Publisher

verified publisherouril.info

Weekly Downloads

A packge for simle play link to audio files for flutter web

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on aplayer