flutter_lorem 1.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 94

flutter_lorem #

A Flutter package for generating random sentences and paragraphs. The output looks similar to the famous "lorum ipsum" placeholder text. Useful when designing user interfaces that require example text:

Neo preclarus, mensa sono. Te laetabilis. Furor supremus mille procella sicut dolor construo illae addo vixi. Ferre uti indagatio post.

Imitabilis singulus receptum facillimus quae, formo vel aliquis epulor ago. Aliud comprehendo, humus quam expositus ops. Revoco donec, feteo fere.

Usage #

Import the package:

import 'package:flutter_lorem/flutter_lorem.dart';

Call the lorum function, specifying the number of paragraphs and words to generate.

String text = lorem(paragraphs: 2, words: 60);
print(text);

The above might print:

Qua procella, illo eternus semel cui propello. Arma iniquus tribuo legentis victum tergo victor repeto, multus. Qui volup amita porro perseverantia. Positus lacunar qui praecepio St. Incertus surgo vires nolo.

Cogo, modicus Malbodiensis defigo, maxime nutus. Spectaculum optimus defluo. Locupleto memor tamisium fodio priores, reddo praecox antea, suum. Sitis orbis duro, cedo moris prolusio nimis consui iuvo, imago. Placo novus.

How it works #

Sentences are formed from a list of approximately 4000 latin words. Up to two commas are inserted per sentence. Shorter words are favoured 50% of the time, which produces a more natural looking sentence.

Words are selected randomly. The sentences are not valid latin!

[1.1.0] - 2018-12-26

  • Move private sources to src/ directory to avoid exposing.
  • Add short example.

[1.0.0] - 2018-12-24

  • Initial release.

example/example.dart

import 'package:flutter_lorem/flutter_lorem.dart';

main() {
  var text = lorem(paragraphs: 4, words: 200);
  print(text);
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_lorem: ^1.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:flutter_lorem/flutter_lorem.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
88
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]
94
Learn more about scoring.

We analyzed this package on Oct 24, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test