remove_transformer 1.0.2

  • Readme
  • Changelog
  • Installing
  • 0

Remove Transformer #


A simple dart transformer that removes content from files when building in release mode.

Usage #

Add the dependency and transformer to your pubspec.yaml:

  remove_transformer: ^1.0.0
- remove_transformer

The order of the transformers determines the order they are run so remove_transformer will most likely need to be toward the top. The transformer only runs in release mode.

The transformer will remove content from files when it comes across the following strings.

  • remove:line - removes the entire line
  • remove:start / remove:end - removes all lines from remove:start to remove:end including the entirety of the start and end lines

Examples #

Remove a line #

String content = 'Debug content'; // remove:line

Remove a block #

// remove:start
String str1 = 'Hello World';
String str2 = 'Goodnight Moon';
String str3 = 'err';

The following is an identical representation.

String str1 = 'Hello World'; // remove:start
String str2 = 'Goodnight Moon';
String str3 = 'err'; //remove:end

Change variables #

// remove:start
String mode = 'debug';
String greeting = 'Hello World';
// remove:end
/* remove:line
String mode = 'release';
String greeting = 'Hello';
remove:line */


// remove:start
String mode = 'debug';
String greeting = 'Hello World';
/* remove:end
String mode = 'release';
String greeting = 'Hello';
remove:line */

In debug mode mode and greeting will have the values 'debug' and 'Hello World'. In release mode mode and greeting will have the values 'release' and 'Hello'.

Changelog #

1.0.0 #

  • Initial version

1.0.1 #

  • Updated readme to be compatible with pub

1.0.2 #

  • Ignore files that are not UTF-8 encoded (caught a FormatException when reading the file) such as images

Use this package as a library

1. Depend on it

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

  remove_transformer: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:remove_transformer/remove_transformer.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.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0