https://github.com/google/dart-basics
A Dart library containing convenient extension methods on basic Dart objects.
https://github.com/google/dart-basics
Last synced: 6 months ago
JSON representation
A Dart library containing convenient extension methods on basic Dart objects.
- Host: GitHub
- URL: https://github.com/google/dart-basics
- Owner: google
- License: bsd-3-clause
- Created: 2020-02-24T22:58:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-01T15:11:59.000Z (10 months ago)
- Last Synced: 2024-08-04T01:02:26.469Z (9 months ago)
- Language: Dart
- Homepage: https://pub.dev/packages/basics
- Size: 76.2 KB
- Stars: 161
- Watchers: 5
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: contributing.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
- awesome-dart - Basics - A Dart library containing convenient extension methods on basic Dart objects. (Utilities)
README
[](https://github.com/google/dart-basics/actions/workflows/dart.yml)
[](https://pub.dev/packages/basics)
[](https://pub.dev/packages/basics/publisher)This repository contains a collection of useful extension methods on the
built-in objects in Dart, such as String, Iterable, and Object.## Usage
Import the basics library.```dart
import 'package:basics/basics.dart';
```Then use the methods directly on objects in your dart code.
```dart
import 'package:basics/basics.dart';main() async {
const numbers = [2, 4, 8];if (numbers.all((n) => n.isEven)) {
print('All numbers are even.');
}print('sum of numbers is: ${numbers.sum()}');
for (var _ in 5.range) {
print('waiting 500 milliseconds...');
await Future.delayed(500.milliseconds);
}
}
```## Notes
This is not an official Google project.