Dart extention is doing pub get automatically - flutter

Flutter Pub get automatically pops-up and start getting packages. After finishing, it starts again doing the same.
Like we save pubspac.yaml in vscode then dart plugin automatically runs Flutter pub get automatically.

my answer in vs code
steps:
open extension (ctrl + shift + x)
open dart extension
click on the setting icon next to uninstall button
click on extension settings in the menu
search pub get
Dart: Run Pub Get On Pubspec Changes : make it never

Reason : I think you have keep open the pubspec.yaml on vscode, that is why it's keep performing pub get again & again.
Solution : You can close the pubspec.yaml after editing it.

Related

Stuck terminal when creating new flutter project with get_cli?

Here the activation command
flutter pub global activate get_cli
Here the create new project command
get create project:getcli_test
maybe it's too late
it's my solution
after com.yourcompany,
CTRL + Z and enter to continue
create project manually over flutter by using create project
after finished, open terminal and write get init
and
wait a moment
and your project now already configured with get cli
Run these commands
1.flutter pub global deactivate get
2.flutter pub global deactivate getx
3.dart pub global activate get_cli ^1.6.0

"flutter pub get" A required privilege is not held by the client

I keep getting this error on Android Studio flutter project, although flutter doctor command shows no issues!
Cannot create link, path = 'C:\Users\UserName\AppData\Local\Pub\Cache\_temp\dir90f89940\ios\Classes\FLTFirebaseAuthPlugin.m'
(OS Error: A required privilege is not held by the client.
, errno = 1314)
pub get failed (66; , errno = 1314))
I tried with pub upgrade which seams to get dependencies correctly and start updating them, but I didn't know why pub get give this error.
Update
A workaround seems to be running Android Studio as administrator!
I have switched ON developer mode in Windows settings (Settings -> Update & security -> For developers) . It worked for me.
Like so:
I'm using vscode I just opened it as administrator and everything works fine.
If you are using Android Studio:
open Android Studio with "Run as administrator"
Just run your PowerShell in administrator mode
the
cd to your project and run
flutter pub get
I wanted to add this solution because when you have accounts managed by your company this is a common problem.
Just go to your quick acces in Start then:
Right Click > More > Open File Location
When the Explorer Opens Right Click again on the AS Icon (quick access), then:
Properties > Advanced ... > Run as Administrator
So you can run always by default as Administrator.
Regards.-
Just run your IDE whether VS Code or Android Studio as Administrator . It solves the issue
Other temporary solution is that making pub cache and then trying flutter pub get.
https://spikez.tistory.com/439
Solution :
1.  flutter pub get
 
 ==> error will be occurred.
[your flutter sdk folder]\flutter.pub-cache_temp\ dir7d36fb45\macos\Classes\FlutterBluePlugin.h' (OS Error: 지정된 파일을 찾을 수 없습니다. , errno = 2)
copy dir7d36fb45  to [your flutter sdk folder]\flutter.pub-cache\hosted\pub.dartlang.org 
change name dir7d36fb45 to flutter_blue-0.8.0
cd flutter_blue-0.8.0 (created by you)
create pubspec.yaml in flutter_blue-0.8.0 folder
fill below content in pubspec.yaml
now you have done preparing flutter_blue cache  :)
lets do, flutter pub get
maybe it will be work.
I know it is a temporary solution. but I believe it will help you understand how to work pub get..
 
If you need new pubspec.yaml ,
you can find out in here  : https://github.com/pauldemarco/flutter_blue/blob/master/pubspec.yaml

How can I fix Flutter_localizations error on the vscode? - Target of URI doesn't exist

I'm trying to use flutter_localizations and I followed this guide
When I save pubspec.yaml on vscode then pub get is ran.
After that vscode can't find app_localizations.dart file.
But this error messages will disappear when I reopen vscode.
Is there anyone with such a problem like me?
Thanks.
Use this command and Open command palette - command + shift + p on the vscode.
Type Dart: Restart Analysis Server and select it.
This error will be gone.
Usually running
flutter gen-l10n
should be enough, however sometimes I'va found myself using
flutter clean && flutter pub get dependencies && flutter packages get
To clean cache, and get the dependencies(which also generate the l10n). 95% of the time the first command should suffice

Issue with Pub Get via dart extension in VSCode

I've got a problem where running pub get via the VSCode dart extension doesn't actually get the packages. It doesn't return an error but if I attempt to build my project, it will just continuously tell me my pubspec lock has updated since I last ran pub get.
Running flutter pub get via terminal solves the issue straight way.
Has anyone else experienced this with VSCode?
You can
delete pubspec.lock
then
flutter clean
Reinstall Extensions

'flutter pub get' does not work in VSCode

I'm currently developing flutter application with VSCode and want to add some packages. ex) dropdown_menu
I did flutter pub get / flutter packages get / clicking down arrow button in vscode(get Packages)
and this is all I get everytime
PS D:\VSCodeProjects\testt> flutter pub get
Running "flutter pub get" in testt... 0.4s
PS D:\VSCodeProjects\testt>
this is my code in pubspec.
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
dropdown_menu: ^1.1.0
I did turn on / off program( and computer) , restart,
and
flutter clean
flutter packages get
flutter packages upgrade
Does anybody know how to solve??
It's running, by default in vs code whenever you save your .yaml file it runs it under the hood. When you explicitly run it using the command, it takes very less time as the packages are already up to date.
If in doubt, try to use the new packages that you added and they should not give errors.
flutter pub get is meant to be quick especially when you don't have much libraries.
What you see is right there should not be any problem.
But if there is issues where you are going for a specific version and it is not working, this is because pubspec.yaml stores the settings of what version of library but pubspec.lock stores the actual version your app is using.
Judging from your comments of it not showing up. It might be related to this #31115
try the solution and see if it works.
Select the View > Command Palette menubar option
Type "flutter"
Click "flutter get packages"
you can use this in vscode
Pubspec Assist
After typing the package don't forget to save the yaml file or click ctrl + s.