basics 0.8.1 icon indicating copy to clipboard operation
basics: ^0.8.1 copied to clipboard

A Dart library containing convenient extension methods on basic Dart objects.

Dart CI pub package package 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.

import 'package:basics/basics.dart';

Then use the methods directly on objects in your dart code.

import 'package:basics/basics.dart';

main() async {
  const numbers = <int>[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.

60
likes
130
pub points
86%
popularity

Publisher

verified publisher icongoogle.dev

A Dart library containing convenient extension methods on basic Dart objects.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

More

Packages that depend on basics