multiline 1.0.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

multiline #

chatroom icon MIT License Pub

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() - for multiline string (don't be afraid to use, it's fast enough)

  • multilineSplit() - to get a listing of strings

  • multilineAsync() - for asynchronously getting a multiline string

  • multilineSplitAsync() - for asynchronously getting a stream with lines

For example: #

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

void main() {
   // for multiline string (don't be afraid to use, it's fast enough)
   final String string = '''
   |Hello
   |  multiline!
   '''.multiline();

   // to get a listing of strings
   final Iterable<String> stringIterable = '''
   |Hello
   |  multiline!
   '''.multilineSplit();

   // for asynchronously getting a multiline string
   final Future<String> stringAsync = '''
   |Hello
   |  multiline!
   '''.multilineAsync();

   // for asynchronously getting a stream with lines
   final Stream<String> stringStream = '''
   |Hello
   |  multiline!
   '''.multilineSplitAsync();
}

Changelog #

Refer to the Changelog to get all release notes.

1.0.1+1 #

2020-04-25

Disable most dev_dependencies.

1.0.1 #

2020-04-25

Fixed algorithm for some empty lines.

1.0.0 #

2020-04-25

Initial Version of the library.

example/main.dart

// ignore_for_file: unused_local_variable

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

void main() {
  // for multiline string (don't be afraid to use, it's fast enough)
  final String string = '''
   |Hello
   |  multiline!
   '''
      .multiline();

  // to get a listing of strings
  final Iterable<String> stringIterable = '''
   |Hello
   |  multiline!
   '''
      .multilineSplit();

  // for asynchronously getting a multiline string
  final Future<String> stringAsync = '''
   |Hello
   |  multiline!
   '''
      .multilineAsync();

  // for asynchronously getting a stream with lines
  final Stream<String> stringStream = '''
   |Hello
   |  multiline!
   '''
      .multilineSplitAsync();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  multiline: ^1.0.1+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:multiline/multiline.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
39
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
Dev dependencies
test any