https://github.com/dart-lang/samples
A collection of Dart code samples by Dart DevRel
https://github.com/dart-lang/samples
Last synced: 8 months ago
JSON representation
A collection of Dart code samples by Dart DevRel
- Host: GitHub
- URL: https://github.com/dart-lang/samples
- Owner: dart-lang
- License: bsd-3-clause
- Created: 2019-09-04T09:13:47.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T11:07:20.000Z (9 months ago)
- Last Synced: 2025-04-06T21:10:05.066Z (9 months ago)
- Language: Dart
- Homepage:
- Size: 757 KB
- Stars: 631
- Watchers: 46
- Forks: 228
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# Dart samples
[](https://github.com/dart-lang/samples/actions?query=branch%3Amain)
A collection of [Dart][dart] programs that illustrate features and best
practices. For a list of community-maintained projects, see [Awesome
Dart][awesome-dart].
## Index
- [command_line](https://github.com/dart-lang/samples/tree/main/command_line) -
A command line app that parses command-line options and fetches from GitHub.
- [extension_methods](https://github.com/dart-lang/samples/tree/main/extension_methods) -
A set of samples that demonstrates the extension methods syntax and shows some
common use cases of the feature.
- [null_safety/calculate_lix](https://github.com/dart-lang/samples/tree/main/null_safety/calculate_lix) -
A sample app that calculates the 'lix' readability index with an
implementation that uses the tech preview of Dart's new null safety feature.
- [ffi](https://github.com/dart-lang/samples/tree/main/ffi) - A series of
simple examples demonstrating how to call C libraries from Dart.
- [isolates](https://github.com/dart-lang/samples/tree/main/isolates) - Command line
applications that demonstrate how to work with Concurrency in Dart using isolates.
The examples read and parse JSON content in a worker isolate, and return the result to
the main isolate.
- [native_app](https://github.com/dart-lang/samples/tree/main/native_app) - A
command line application that can be compiled to native code using
`dart compile exe`.
- [server](https://github.com/dart-lang/samples/tree/main/server) - Examples
of running Dart on the server.
- [package_constraint_solver](https://github.com/dart-lang/samples/tree/main/package_constraint_solver) - Demonstrates best-practices for publishing packages on pub.dev.
## More samples
- [Pop, Pop, Win!][pop-pop-win] **(Dart team)** - An implementation of
Minesweeper in Dart.
## Contributing
See the [Contributing guide][contributing] for details on how to contribute.
[dart]: https://dart.dev
[awesome-dart]: https://github.com/yissachar/awesome-dart
[contributing]: https://github.com/dart-lang/samples/blob/main/CONTRIBUTING.md
[pop-pop-win]: https://github.com/dart-lang/sample-pop_pop_win
[dart-tutorials]: https://dart.dev/tutorials