cactoos_dart 2.7.0+0 copy "cactoos_dart: ^2.7.0+0" to clipboard
cactoos_dart: ^2.7.0+0 copied to clipboard

Cactoos Dart is a collection of object-oriented primitives for Dart.

example/main.dart

import 'package:cactoos_dart/cactoos_dart.dart';

void main() async {
  print('###################### Text ######################');

  print(UpperCaseText(PlainText('hello world'))); // prints: HELLO WORLD.

  print(LowerCaseText(PlainText('HELLO WORLD'))); // prints: hello world.

  print(CapitalizedText(PlainText('hello world'))); // prints: Hello World.

  print(TrimmedText(PlainText('  hello world  '))); // prints: hello world.

  print('###################### Boolean Values ######################');

  print(True().value()); // prints true.

  print(False().value()); // prints false.

  print('###################### Ternary ######################');

  print(
    Ternary(
      condition: Number(1).greaterThan(Number.zero()),
      left: Number(1),
      right: Number.zero(),
    ).value(),
  ); // prints 1.

  print(
    Ternary(
      condition: Number(1).lessThan(Number.zero()),
      left: Number(1),
      right: Number.zero(),
    ).value(),
  ); // prints 0.

  print('###################### Mapped Future ######################');

  print(
    await MappedFuture(
      src:
          () => MappedFuture(
            src: () => Future.value('  hello world  '),
            map: (text) => TrimmedText(PlainText(text)),
          ),
      map: (text) => '${UpperCaseText(text)}',
    ),
  ); // prints HELLO WORLD.
}
0
likes
160
points
5
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Cactoos Dart is a collection of object-oriented primitives for Dart.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

equatable

More

Packages that depend on cactoos_dart