swlabels 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 61

SWLabels #

SWLabels is a tool for conveniently printing text on SpriteWidget objects

It is very convenient for use in the following cases:

  • for debugging when it is more convenient to see information directly on the screen, instead of using logs or a debugger
  • to temporarily display the state of the application (for example, the score and life in games), while the graphics are not yet developed

You can see an swlabels_example of using SWLabels, and also watch a demo video. This is an example work record.

A screenshot is taken from this example:


In the left part you can see two SWLabels with the headings "Status" and "Ball positions". The first of them shows the current status of the application. In the second - the coordinates of all the balls that continuously moving. To the right is SWLabels with the heading "Terminal". He is so named because the lines in it will scroll up, as in ordinary terminals.

Lines in SWLabels are called text Labels (SWLabel objects). Information in them can be displayed different ways:

  • at the end of the list with the name of the label. The following output by name will replace existing text.
  • by coordinates with the name of the label. The following output will also replace existing text.
  • at the end of the list without specifying a label name. In this case, as soon as the number of rows reaches the maximum, the lines will scroll up. This is a mode resembling a terminal or a log

For more details, see the example in the repository swlabels_example

Changelog #

0.2.0 #

  • Documentation is improved

0.1.5 #

  • Fix bad link

0.1.4 #

  • Fix bad link and add image

0.1.3 #

  • Added demo video and link to an example

0.1.2 #

  • Improvements for publishing

0.1.1 #

  • Refactoring

0.1.0 #

  • Improvements for publishing

0.0.5 #

  • Improvements for publishing

0.0.4 #

  • Improvements for publishing

0.0.3 #

  • Added example
  • Bug fixes for publishing

0.0.2 #

  • Change folder structure
  • Bug fixes for publishing

0.0.1 #

  • Start version


SWLabels example #

You can view and download an example of working with this module from the repository at Github: swlabels_example.

You can also watch a demo video. This is an example work record:

Watch the video

Use this package as a library

1. Depend on it

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

  swlabels: ^0.2.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:swlabels/swlabels.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart


  • swlabels that is a package requiring null.

Health suggestions

Format lib/src/sw_labels.dart.

Run flutter format to format lib/src/sw_labels.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
meta ^1.1.8 1.1.8 1.2.2
spritewidget ^0.9.24 0.9.24
Transitive dependencies
collection 1.14.12 1.14.13
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies