updated Dart sample to align with best practices