flutter_sound_suite 2.1.0 copy "flutter_sound_suite: ^2.1.0" to clipboard
flutter_sound_suite: ^2.1.0 copied to clipboard

a flutter sound suite for record and play voice easily, dependencies on dio 4.0.0, intl 0.17.0, uuid 3.0.4 and so on

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_sound_suite/flutter_sound_suite.dart';
import 'package:provider/provider.dart';

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

class FlutterSoundSuiteApp extends StatefulWidget {
  @override
  _FlutterSoundSuiteAppState createState() => _FlutterSoundSuiteAppState();
}

class _FlutterSoundSuiteAppState extends State<FlutterSoundSuiteApp> {
  List<Map> data = [];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Sound Suite Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Sound Suite Demo'),
        ),
        body: ChangeNotifierProvider(
          create: (context) => SoundPlayerModel(),
          child: Container(
            child: ListView.builder(
              itemBuilder: (BuildContext context, int index) {
                Map item = data[index];
                return Card(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(item['fileName']),
                      Text('duration ${item['duration']}'),
                      Card(
                        color: Colors.red.shade50,
                        child: SoundPlayerWidget(
                          filePath: item['filePath'],
                          fileName: item['fileName'],
                          duration: item['duration'],
                        ),
                      ),
                    ],
                  ),
                );
              },
              itemCount: data.length,
            ),
          ),
        ),
        bottomNavigationBar: SafeArea(
          child: Container(
            height: 70,
            child: SoundRecorderWidget(recordComplete:
                (String filePath, String fileName, double duration) {
              setState(() {
                data.add({
                  'filePath': filePath,
                  'fileName': fileName,
                  'duration': duration,
                });
                debugPrint('save to $filePath duration $duration');
              });
            }),
          ),
        ),
      ),
    );
  }
}
6
likes
130
pub points
46%
popularity

Publisher

verified publisherultimate.icu

a flutter sound suite for record and play voice easily, dependencies on dio 4.0.0, intl 0.17.0, uuid 3.0.4 and so on

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dio, flutter, flutter_sound, intl, path_provider, permission_handler, provider, uuid

More

Packages that depend on flutter_sound_suite