social_media_recorder 1.1.12 copy "social_media_recorder: ^1.1.12" to clipboard
social_media_recorder: ^1.1.12 copied to clipboard

A Flutter package for both android and iOS which provides Audio recorder from microphone to a given file path through Button to record voice like social media Button

example/main.dart

import 'package:flutter/material.dart';
import 'package:social_media_recorder/audio_encoder_type.dart';
import 'package:social_media_recorder/screen/social_media_recorder.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowMaterialGrid: false,
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Padding(
          padding: const EdgeInsets.only(top: 140, left: 4, right: 4),
          child: Align(
            alignment: Alignment.centerRight,
            child: SocialMediaRecorder(
              // maxRecordTimeInSecond: 5,
              startRecording: () {
                // function called when start recording
              },
              stopRecording: (_time) {
                // function called when stop recording, return the recording time
              },
              sendRequestFunction: (soundFile, _time) {
                //  print("the current path is ${soundFile.path}");
              },
              encode: AudioEncoderType.AAC,
            ),
          ),
        ),
      ),
    );
  }
}
166
likes
140
points
642
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for both android and iOS which provides Audio recorder from microphone to a given file path through Button to record voice like social media Button

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

animated_text_kit, cupertino_icons, flutter, path_provider, permission_handler, provider, record

More

Packages that depend on social_media_recorder