Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-01T15:17:17.000Z (5 months ago)
- Last Synced: 2024-06-18T20:25:58.288Z (5 months ago)
- Language: Dart
- Homepage: https://pub.dev/packages/basics
- Size: 76.2 KB
- Stars: 159
- 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
[![Dart CI](https://github.com/google/dart-basics/actions/workflows/dart.yml/badge.svg)](https://github.com/google/dart-basics/actions/workflows/dart.yml)
[![pub package](https://img.shields.io/pub/v/basics.svg)](https://pub.dev/packages/basics)
[![package publisher](https://img.shields.io/pub/publisher/basics.svg)](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.