Skip to content
pubscout

print_remover

1.1.1, released 8 months ago by zakriakhan.com

Tool to remove all print() and debugPrint() statements from Dart files

$ flutter pub add print_remover
Source repository

What it does

It scans Dart files, deletes print() and debugPrint() calls, supports dry‑run, verbose output, and custom paths.

AI-written summary of version 1.1.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Cleaning code before release
  • Automating CI cleanup
  • Removing debug logs from production builds

Skip it when

  • When you need to keep logs for debugging
  • When you prefer manual review of changes

Strengths

  • Fast and lightweight
  • Supports nested calls and comment‑aware removal
  • Dry‑run and verbose options
  • Programmatic API

Weaknesses

  • Only removes print/debugPrint, not other logging
  • No integration with build systems out of the box
  • Requires Dart SDK

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

Add to dev_dependencies and run `dart pub get`

import 'package:print_remover/print_remover.dart';

void main() async {
  final remover = PrintRemover(path: 'lib', dryRun: true, verbose: true);
  final count = await remover.start();
  print('Found $count print statements');
}

Alternatives

Packages that do the same job and could replace print_remover.

Works with

Packages commonly used together with print_remover: ones it builds on, ones built on it, and its own family.