Search packages, repositories and app categories

Package detailsv3.0.0

multiline

Provides convenient access to multiline String records with method extensions.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
299
Likes
26
Pub points
150

Install package

flutter pub add multiline

Package Overview

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

The multiline package enhances Flutter and Dart applications by providing method extensions for working with multiline strings. It simplifies the handling of multi-line text data, enabling developers to easily access, manipulate, and process string records across various platforms. With intuitive syntax and minimal boilerplate, it improves readability and maintainability when dealing with complex text content such as templates, configuration blocks, or formatted output. The package is lightweight and compatible with all major Flutter platforms.

Use cases

  • Parsing structured text blocks
  • Handling template strings
  • Processing configuration data
  • Formatting log or debug output
  • Working with code snippets in tests

Key features

  • Method extensions for multiline strings
  • Clean syntax for accessing line-by-line data
  • Supports all Flutter platforms
  • Lightweight and easy to integrate
  • No external dependencies

Suitable for

  • Developers working with text-heavy apps
  • Teams needing consistent multiline string handling
  • Projects involving code generation or templating
  • Test environments requiring formatted string assertions

Considerations

  • Not intended for large-scale text processing
  • Limited to string manipulation, not full parsing
  • Best suited for small to medium-sized multiline content

Original README

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

multiline

Actions Status Coverage Pub Code size License: WTFPL effective_dart GitHub stars

About

Provides convenient access to multiline String records with method extensions.
Useful for templates, mockups and SQL queries.

Just use the symbol "|" to indicate the beginning of a line.
Beautiful code formatting using some useful extensions to the String methods.

Available method extensions:

  • multiline() - return formatted with pipeline symbol "|" String.

  • multilineSplit() - splits the string and returns a Iterable<String> of substrings.

You can use custom "pipeline" and "join" symbols.

For example

import 'package:multiline/multiline.dart'; // <= import package

void main() {
  /// Return formatted with pipeline symbol "`|`" [String].
  final string =
    '''
    |/*
    | * List of books and the number of
    | * authors associated with each book
    | */
    |SELECT
    |      `books`.`title` AS `Title`,
    |       count(*)       AS `Authors`
    |FROM  `books`
    |JOIN  `authors`
    |  ON  `books`.`isbn` = `authors`.`isbn`
    |GROUP BY
    |      `books`.`title`
    |ORDER BY
    |      `books`.`title` ASC
    |;
    '''.multiline();
  print(string);

  /// Splits the string and returns a [Iterable] of substrings.
  final iterable =
    '''
    | * One
    | * Two
    | * Three
    '''.multilineSplit();
  iterable.forEach(print);
}

Coverage

Changelog

Refer to the Changelog to get all release notes.

Maintainers

Plague Fox

License

WTFPL

Categories

Source repository

Projects using this package

No data available yet.