搜尋套件、儲存庫與 APP 分類

套件詳情v3.0.0

multiline

提供方便的多行字串記錄存取方法擴展。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
299
喜歡數
26
Pub 分數
150

安裝套件

flutter pub add multiline

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

多行字串套件透過為 Flutter 和 Dart 應用程式提供方法擴展,增強了其功能,使處理多行字串更加便利。它簡化了多行文字資料的處理,讓開發者能輕鬆存取、操作和處理跨各種平台的字串記錄。憑藉直覺式的語法和最少的樣板程式碼,該套件在處理範本、設定區塊或格式化輸出等複雜文字內容時,顯著提升程式碼的可讀性和可維護性。該套件輕量且相容所有主要的 Flutter 平台。

適用情境

  • 解析結構化文本塊
  • 處理模板字串
  • 處理設定資料
  • 格式化日誌或除錯輸出
  • 在測試中使用程式碼片段

主要特色

  • 多行字串的方法擴展
  • 用於逐行存取資料的簡潔語法
  • 支援所有 Flutter 平台
  • 輕量且易於整合
  • 無外部依賴

適合對象

  • 開發文字密集型應用程式的開發者
  • 需要一致的多行字串處理的團隊
  • 涉及代碼生成或模板的項目
  • 需要格式化字串斷言的測試環境

使用建議

  • 不適用於大規模文本處理
  • 僅限字串操作,不支援完整解析
  • 最適合中小型多行內容

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。