destiny icon indicating copy to clipboard operation
destiny copied to clipboard

Assert usage in dart code

Open donpui opened this issue 2 years ago • 0 comments

We have several places where we use assert in dart flutter code: https://github.com/LeastAuthority/destiny/blob/cdc4b6964b74eba6a6ab3a079161b9212eba8a49/lib/views/shared/file_picker.dart#L107

All asserts: https://github.com/LeastAuthority/destiny/search?q=assert%28

If file is not selected (User cancel selection file), so this statement becomes false: assert(result?.files.length == 1);

image

Not fully sure if we should use here assert and just rewrite exception handling.

To may understanding, we have not enabled asserts in release mode.

donpui avatar Dec 18 '22 09:12 donpui