Search categories, packages and repositories

Package detailsv0.10.0

basics

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

AndroidiOSWebmacOSWindowsLinux
30-day downloads
27K
Likes
113
Pub points
160

Install package

flutter pub add basics

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The basics package is a Dart library that provides convenient extension methods for fundamental Dart objects, enhancing their usability with intuitive, reusable functionality. It simplifies common operations on core types like String, int, and List, promoting cleaner and more expressive code. Designed by Google, it aligns with Dart best practices and supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux. The library is lightweight and ideal for developers seeking to improve code readability without adding complexity.

Use cases

  • Simplifying string manipulations
  • Enhancing numeric operations
  • Improving list handling
  • Writing more readable code
  • Streamlining repetitive tasks

Key features

  • Extension methods on core Dart types
  • Lightweight and performant
  • Platform-agnostic
  • Well-documented
  • Consistent with Dart conventions

Suitable for

  • Dart beginners
  • Experienced Dart developers
  • Cross-platform app development
  • Code quality improvement
  • Minimalist utility libraries

Considerations

  • Limited to basic types
  • No runtime dependencies
  • Not intended for complex logic
  • Requires Dart 2.12 or higher
  • Best used in conjunction with other utilities

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package