Dart implementation of sprintf