Refacto of dart sample

Same code but refactored to use more the Dart's concepts