/flutter-print

Help insert and remove print(*) statement.

Primary LanguageJavaScriptOtherNOASSERTION


Flutter Print

Support

Flutter Print is an extension created for Visual Studio Code. If you find it useful, please consider supporting it.

Create Widgets and Classes for Flutter Logo Create Widgets and Classes for Flutter Logo

Flutter Print

Easily insert and remove debugPrint('variable: $variable'); statement.

Visual Studio Marketplace Version Visual Studio Marketplace Installs Visual Studio Marketplace Downloads Visual Studio Marketplace Rating GitHub

Tutorial in Portuguese Brazil.

✅ [2022] Como utilizar a extensão Flutter Print para Visual Studio Code?

Usage Examples

This extension overrides the shortcut for Select all occurrences of current selection - Ctrl+Shift+L on Windows and Linux and Cmd+Shift+L on macOS, however you can still use Ctrl+F2 to execute same command.

Settings

The Flutter Print extension has only one configuration option called useDebugPrint which is used to define whether the debugPrint statement will be used instead of the print statement.

Usage

debugPrint for variables or object properties:

With the extension setting useDebugPrint enabled, select the variable or object properties that you want uses debugPrint statement and press Ctrl+Shift+L on Windows, Linux or macOS.

Usage

Print for variables or object properties:

With the extension setting useDebugPrint disabled, select the variable or object properties that you want uses print statement and press Ctrl+Shift+L on Windows, Linux or macOS.

Usage

Remove all print statements:

To remove all print statements and press Win+Shift+D on Windows and Linux or Cmd+Shift+D on macOS.

Usage

With Custom Log Class

Create a custom log class.

import 'dart:developer' as developer;

class Log {
  Log._();

  static void print(String value, {StackTrace? stackTrace}) {
    developer.log(value, name: 'LOG', stackTrace: stackTrace);
  }

  static Object? inspect(Object? object) {
    return developer.inspect(object);
  }
}

Log.print() for variables or object properties:

Select the variable or object properties that you want uses a custom Log.print statement and press Win+Ctrl+L on Windows and Linux or Cmd+Ctrl+L on macOS.

Usage

Log.inspect() for variables:

Select the variable that you want uses a custom Log.inspect statement and press Win+Ctrl+L on Windows and Linux or Cmd+Ctrl+L on macOS.

Usage

That's all, Enjoy!