drdng_utils 1.5.2

SDKflutter
Platformandroidioswindowslinuxmacos

A set of utilities for Flutter development.

drdng_utils

This package contains a collection of useful utilities for Flutter development.

Installation

flutter pub add drdng_utils

Features

Json

Ease Json manipulation.

Logger

A simple logger.

Escape

ANSI escape codes for terminal output.

System

Operating system utilities.

Extensions

T.chain()

A simple way to chain methods.

bool.ifTrue()

Executes a function if the boolean is true.

T?.maybe()

A simple way to handle null values.

List<String>.toDomain()

Converts a string array into a domain by joining dots. Empty strings are ignored.

['com', 'example', 'dev' ,'myapp'].toDomain() // -> 'com.example.dev.myapp'
['com', 'example', '' ,'myapp'].toDomain() // -> 'com.example.myapp'

List<Widget>.separateWith()

Joins a list of widgets with a separator.

[
  Text('Hello'),
  Text('World'),
].separateWith(SizedBox(width: 8, child: Text(' ')))

Iterable.min(), Iterable.max()

Returns the minimum or maximum value of a list.

Iterable<T>.indexedMap()

Maps an iterable with the index.

['a', 'b', 'c'].indexedMap((index, value) => '$index: $value') // -> ('0: a', '1: b', '2: c')