Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Flutter CostNew to Visual Studio Code? Get it now.
Flutter Cost

Flutter Cost

Antaerio

|
12 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Flutter Import Cost Calculator

A Visual Studio Code extension that shows the size impact of imported packages in Flutter/Dart projects.

Features

  • Displays the size of imported Flutter packages directly in your editor
  • Shows both raw and gzipped sizes of packages
  • Caches results to minimize API calls and improve performance
  • Highlights large packages that may impact your app size
  • Works with both direct and transitive dependencies

Extension Screenshot

How It Works

This extension:

  1. Detects import statements in your Flutter/Dart files
  2. Calculates the size impact of each imported package
  3. Shows the size information inline in your editor
  4. Highlights packages that exceed configured size thresholds

The extension uses two methods to calculate package sizes:

  1. API Mode (default): Uses the pub.dev API to get package information and estimates sizes based on available data
  2. Download Mode: Downloads and analyzes packages to get actual size information (more accurate but slower)

Requirements

  • Visual Studio Code 1.70.0 or newer
  • For Download Mode: Dart SDK installed and available in PATH

Extension Settings

This extension contributes the following settings:

  • flutterImportCost.enabled: Enable/disable the Flutter Import Cost Calculator
  • flutterImportCost.showInStatusBar: Show total import cost in status bar
  • flutterImportCost.sizeCutoff: Size in KB above which to highlight large packages
  • flutterImportCost.useActualDownload: Download and analyze packages instead of using API estimates (more accurate but slower)

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Flutter Cost"
  4. Click Install

Usage

  1. Open any Dart file in a Flutter project
  2. The extension will automatically analyze import statements and display size information
  3. Hover over the size information to see additional details
  4. Use the command "Calculate Flutter Import Costs" to manually refresh calculations

Development

If you want to contribute to this extension:

  1. Clone the repository
  2. Run npm install
  3. Open the project in VS Code and press F5 to launch extension development host
  4. Make changes and test them in the development host window

Building From Source

# Clone the repository
git clone https://github.com/antaerio/FlutterCost.git
cd flutter-cost

# Install dependencies
npm install

# Compile the extension
npm run compile

# Package the extension
npx vsce package

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Known Issues

  • Size calculations are estimates and may not perfectly match the actual impact on app size
  • Transitive dependencies may not be fully accounted for in API Mode
  • Packages with platform-specific implementations may show different sizes than what's used in your actual build

Release Notes

0.1.0

  • Initial release
  • Basic import cost calculation
  • Inline display of package sizes
  • Caching system for performance
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft