Performance of empty function on Dart
The compiler will optimize your code through inlining and removing calls to empty functions.
will this function be removed on build?
Not unless you use it only within other asserts. A typical example would be this:
assert(() { test(); return true;}());
If you only use it this way, then yes the function will be removed on build.