flutter_audio_recorder
flutter_audio_recorder copied to clipboard
[fix] a nicer error handling instead of app crash
Main Change
- Now the app won't crash in case the string path represents an invalid URL (probably due to spaces in path).
- The plugin will return a Flutter error instead.
Tip 💡
Try not to use force unwrap !
unless you want the app to crash. For example, in let dic = call.arguments as! [String : Any]
it's still forgiven because this dictionary must exist, unless there's an integration error. Although I personally prefer to use safe unwrap (if let
/ guard let
) in these cases as well.
This PR fixes this issue: https://github.com/rmbrone/flutter_audio_recorder/issues/30