Why is "flutter pub get" command suggesting to update internal dependencies?

112 views Asked by At

Why is flutter pug get command showing and suggesting updating some internal dependencies which I directly do not use in my pubspec.yaml file?

Below is the result of flutter pug get command.

Resolving dependencies... (1.2s)
  _fe_analyzer_shared 64.0.0 (65.0.0 available)
  analyzer 6.2.0 (6.3.0 available)
  coverage 1.6.4 (1.7.2 available)
  dart_style 2.3.2 (2.3.4 available)
  ffi 2.1.0 (2.1.2 available)
  flutter_web_auth_2 2.2.1 (3.1.1 available)
  flutter_web_auth_2_platform_interface 2.1.4 (3.1.0 available)
  hotreloader 3.0.6 (4.1.0 available)
  http 1.0.0 (1.2.0 available)
  image 4.1.3 (4.1.4 available)
  js 0.6.7 (0.7.0 available)
  matcher 0.12.16 (0.12.16+1 available)
  material_color_utilities 0.5.0 (0.8.0 available)
  meta 1.10.0 (1.11.0 available)
  package_info_plus 4.2.0 (5.0.1 available)
  path 1.8.3 (1.9.0 available)
  pointycastle 3.7.3 (3.7.4 available)
  smart_auth 1.1.1 (2.0.0 available)
  test 1.24.9 (1.25.1 available)
  test_api 0.6.1 (0.7.0 available)
  test_core 0.5.9 (0.6.0 available)
  time 2.1.3 (2.1.4 available)
  uuid 3.0.7 (4.3.3 available)
  vm_service 11.10.0 (14.0.0 available)
  web 0.3.0 (0.4.2 available)
  web_socket_channel 2.4.0 (2.4.3 available)
Got dependencies!
26 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.`

My pubspec.yaml file contains the dependencies listed below:

 environment:
       sdk: '>=3.0.0 <4.0.0'
     
     dependencies:
       flutter:
         sdk: flutter
       flutter_native_splash: ^2.3.9
       fpdart: ^1.1.0
       flutter_hooks: ^0.20.4
       hooks_riverpod: ^2.4.9
       riverpod_annotation: ^2.3.3
       freezed_annotation: ^2.4.1
       intl: ^0.19.0
       json_annotation: ^4.8.1
       modddels_annotation_fpdart: ^0.2.0
       ulid: ^2.0.0
       flex_color_scheme: ^7.3.1
       google_fonts: ^6.1.0
       theme_extensions_builder_annotation: ^3.0.0
       responsive_framework: ^1.1.1
       go_router: ^13.0.1
       shared_preferences: ^2.2.2
       pinput: ^3.0.1
       firebase_core: ^2.24.2
       firebase_auth: ^4.16.0
       isar: ^4.0.0-dev.14
       isar_flutter_libs: ^4.0.0-dev.14
       path_provider: ^2.1.2
       appwrite: ^11.0.1
     
     dev_dependencies:
       flutter_test:
         sdk: flutter
       build_runner: ^2.4.8
       freezed: ^2.4.6
       json_serializable: ^6.7.1
       custom_lint: ^0.5.8
       flutter_lints: ^3.0.1
       riverpod_generator: ^2.3.9
       riverpod_lint: ^2.3.7
       flutter_gen_runner: ^5.4.0
       modddels: ^0.2.0
       theme_extensions_builder: ^3.0.1
       go_router_builder: ^2.4.1

I should be only concerned about dependencies I use in pubspec.yaml file only. Why it is showing some internal dependencies like above-mentioned dependencies?

1

There are 1 answers

0
WizardKing On

Those are additional dependencies used by the packages you declare in your pubspec.yaml file.

For example https://pub.dev/packages/flutter_native_splash uses ansicolor, args, flutter, flutter_web_plugins, html, image, js, meta, path, universal_io, xml, yaml in their package

flutter pub get command ensures that all these dependencies are up to date and compatible with each other which includes direct or indirectly used dependencies.

So you no need to worry about it.