native_audio_controller 0.0.1 copy "native_audio_controller: ^0.0.1" to clipboard
native_audio_controller: ^0.0.1 copied to clipboard

A Flutter plugin to handle pause/play for running music in background from another app

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:native_audio_controller/native_audio_controller.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({super.key});

  final _nativeAudioControllerPlugin = NativeAudioController();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Center(
              child: Text('Pause or resume Audio plugin writen in kotlin'),
            ),
            ElevatedButton(
              onPressed: () {
                _nativeAudioControllerPlugin.pauseAudio();
              },  
              child: const Text('Pause audio'),
            ),
            ElevatedButton(
              onPressed: () {
                _nativeAudioControllerPlugin.resumeAudio();
              },  
              child: const Text('Resume audio'),
            ),
          ],
        ),
      ),
    );
  }
}
5
likes
150
points
6
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to handle pause/play for running music in background from another app

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on native_audio_controller