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

A flutter package that use for build animated voice recorder as like other social media.

Android && Ios
  1. For Permission Handle:

Follow this

  1. For Record Permission:

Follow this

  1. For Vibrate Permission:

Follow this

Usage #

For init path #

import 'package:social_media_audio_recorder/social_media_audio_recorder.dart';
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  SocialMediaFilePath.init();

  runApp(const MyApp());
}

User RecordButton #

import 'package:social_media_audio_recorder/social_media_audio_recorder.dart';


class Example extends StatefulWidget {
  const Example({Key? key}) : super(key: key);

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> with SingleTickerProviderStateMixin {
  AnimationController? controller;
  bool play = false;
  String filepath = "";

  @override
  void initState() {
    controller = AnimationController(
      vsync: this,
      duration: const Duration(milliseconds: 600),
    );
    super.initState();
  }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      body: SafeArea(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            filepath != ""
                ? Expanded(
                  child: Column(
                    children: [
                      VoiceMessage(
                        audioSrc: filepath,
                        me: true,
                      ),
                    ],
                  ),
                )
                :
            Expanded(child: Container()),
            Row(
              children: [
                Expanded(
                  child: Padding(
                    padding: const EdgeInsets.only(left: 19),
                    child: Container(
                      height: 55,
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(10),
                        color: Colors.white.withOpacity(0.2),
                      ),
                      child: const Padding(
                        padding: EdgeInsets.symmetric(horizontal: 20),
                        child: TextField(
                          maxLines: null,
                          decoration: InputDecoration(
                            border: InputBorder.none,
                          ),
                        ),
                      ),
                    ),
                  ),
                ),
                const SizedBox(width: 4),
                RecordButton(
                  color: Colors.white,
                  controller: controller!,
                  onRecordEnd: (String value) {
                    setState(() {

                      filepath = value;
                    });
                  },
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

28
likes
0
pub points
79%
popularity

Publisher

unverified uploader

A flutter package that use for build animated voice recorder as like other social media.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cupertino_icons, flutter, flutter_vibrate, font_awesome_flutter, lottie, path_provider, permission_handler, record

More

Packages that depend on social_media_audio_recorder