: Use the Pubspec Assist extension to add packages by name through the Command Palette ( Ctrl+Shift+P / Cmd+Shift+P ).

: Save the file and run flutter pub get in your terminal, or click the "Get Packages" button that appears at the top of your IDE. 3. Using IDE Shortcuts

dependencies: flutter: sdk: flutter http: ^1.1.0 # Paste here Use code with caution.

: Open pubspec.yaml in your project and paste the line under the dependencies: section (ensure it has exactly two spaces of indentation).

This command adds the dependency to your pubspec.yaml and automatically runs flutter pub get to download the package. 2. Manual Method: Editing pubspec.yaml

Modern IDEs provide built-in tools to manage packages without leaving your editor.

: Click on the Installing tab and copy the line under "dependencies".