79269701

Date: 2024-12-10 20:31:15
Score: 0.5
Natty:
Report link

for this question the library flutter_recorder has the solution, check this simple snipped code

/project/pubspec.yaml

dependencies:

  ...

  flutter_recorder: ^0.9.2

/project/lib/main.dart

import 'package:flutter_recorder/flutter_recorder.dart';

....

class _YourWiget extends State<MainWidget>{
  final _recorder = Recorder.instance
  
  ...

  void dispose() async {
    super.dispose();

    // Good practices, stop the recording when the widget isn't showing
    _recorder.stop();
    
    ...

  }

  void initState(){
    super.initState();
    // init recorder library
    _recorder.init();
    // start recording
    _recorder.start();
    
   ...

  }
}

see the pub.dev page to configure the android, ios and macos permissions : https://pub.dev/packages/flutter_recorder

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Sr. Coffe