Questions tagged [flutter-dependencies]

For questions relating to the use of and issues with any use of flutter-specific dependencies in dart's pubspec.yaml

Dependencies are one of the core concepts of the pub package manager. A dependency is another package that your package needs in order to work. Dependencies are specified in your pubspec. You list only immediate dependencies — the software that your package uses directly. Pub handles transitive dependencies for you.

For each dependency, you specify the name of the package you depend on and the range of versions of that package that you allow. You can also specify the source, which tells pub how to locate the package, and any additional description that the source needs to find the package.

Here is an example of specifying a dependency:

dependencies:
  transmogrify: ^1.0.0

This YAML code creates a dependency on the transmogrify package using the default source (pub.dev) and allowing any version from 1.0.0 to 2.0.0 (but not including 2.0.0). See the version constraints section of this page for syntax details.

If you want to specify a source, the syntax looks a bit different:

dependencies:
  transmogrify:
    hosted:
      name: transmogrify
      url: http://some-package-server.com
    version: ^1.0.0

This YAML code creates a dependency on the transmogrify package using the hosted source. Everything under the source key (here, just a map with a url: key) is the description that gets passed to the source. Each source has its own description format, which is described in the dependency sources section of this page. The version constraint is optional but recommended.

Use this long form when you don’t use the default source or when you have a complex description that you need to specify. But in most cases, you’ll just use the simple packagename: version form.

Dependency sources

Pub can use the following sources to locate packages:

SDK
Hosted packages
Git packages
Path packages
6510 questions
2
votes
2 answers

How to validate drop down in flutter

I've created on the dropdown and i want to validate that dropdown. when a user doesn't select an item from drop-down then it will show a validation. here is some code I've tried so far. in this code I've created one drop down when I am click submit…
2
votes
1 answer

How to Handle multiple tabs in Flutter WebView?

I am trying to implement Instamojo Payment in my Flutter App using this article: I am using Flutter Webview plugin for it. Now the problem is during the payment process, Instamojo opens another tab for OTP Verification. But this new tab is not…
Raj Dhakad
  • 852
  • 2
  • 17
  • 39
2
votes
0 answers

Will not compile: Dependencies issues after upgrading to Flutter 1.7.8+hotfix.4

This is my first question I'm posting on stackoverflow so please let me know if I need to include any more information or guidelines. Just got brought on to a project and upgraded my flutter to 1.7.8+hotfix.4. It seems like the project was being ran…
KawynSean
  • 21
  • 4
2
votes
1 answer

Can Flutter drag and drop have a dynamic endpoint? or just a predefined targets?

I want to create a drag and drop app, but all of the examples I see have the drop being a predefined target. Is it possible and would I implement a drag and then drop anywhere I release my finger with the same properties and data transfer methods…
2
votes
1 answer

Custom Flutter plugin development for iOS

I am trying to develop a custom Flutter plugin for iOS. The customer has shared a Vendor-specific private SDK (Not available in Cocoapods repo) for interacting with external hardware. SDK is in *.framework format. So I created a new plugin. Inside…
John_S
  • 532
  • 4
  • 10
2
votes
2 answers

Getting this error while creating a new flutter project Error : Could not resolve URL "https://pub.dartlang.org"

I am new to flutter and I came across this error ( Could not resolve URL "https://pub.dartlang.org". ) while creating new flutter project. I Tried "flutter doctor -v" command but it is showing everything is fine, I tried if there is any more…
snehit vaddi
  • 3,854
  • 2
  • 9
  • 13
2
votes
2 answers

How can I read a QR Code from a image in flutter using a package?

I am building an app using flutter where I want to scan an image(that includes QR image). I am using packages available to read QR codes, but not working for me. Is there any package/solution to read a QR code from an image? I Tried…
NiiLx
  • 606
  • 7
  • 18
2
votes
0 answers

calculate the space time complexity of dart and flutter programs

do we have a dart lib readily available to calculate the space-time complexity of dart programs? I am building an automated CI CD pipeline, and to do code quality control we need to implemented complexity checks on the code.
vashishth
  • 2,751
  • 4
  • 38
  • 68
2
votes
1 answer

'StethoHttpClientResponse' is missing implementations for these members: - HttpClientResponse.compressionState in flutter_stetho

I am tried to use flutter_stetho package when it Compile the compiler shown .. Launching lib/main.dart on Android SDK built for x86 in debug mode... Compiler…
Mirror
  • 89
  • 1
  • 3
2
votes
0 answers

Make a App wide progress bar (Across the pages of whole app) and manage its state as required in Flutter using provider

Im trying to make a Custom Progress Indicator widget which i can show or hide in any of the pages(Anywhere across the app). My approach is to bind a provider value for the progress widget and toggle the value as required. But I just don't get where…
Nikhil N
  • 21
  • 1
2
votes
1 answer

FirebaseAuthPlugin.java:9: error: cannot find symbol import androidx.annotation.NonNull;

Note: /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.1/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation…
Midhilaj
  • 4,905
  • 9
  • 45
  • 88
2
votes
2 answers

App keeps crashing when push notification is sent from firebase

I am unable to send notifications to my app from firebase, as it crashes everytime i do so It previously showed error for latest versions of the firebase_messaging plugin, so i kept it empty so that the ide will get the latest packages. These are my…
2
votes
1 answer

How much data can store in flutter_secure_storage?

How much data can store in flutter_secure_storage ? https://pub.dev/packages/flutter_secure_storage#-readme-tab- is that possible to store 10mb of data in flutter_secure_storage?
Midhilaj
  • 4,905
  • 9
  • 45
  • 88
2
votes
1 answer

Can not authenticate a user who is not an administrator

I am building a flutter app and I want users to be able to authenticate using their wordpress credentials. I am using https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/#description and https://github.com/dreamsoftin/flutter_wordpress…
2
votes
1 answer

How to go to second page with page transition in flutter?

I have used the transition.dart library and also made a transition dart file but I am always getting transition when I am coming back from the second page to the first page. But I need transition when I am going to the second page. My code is: …
sagar dhiman
  • 293
  • 2
  • 11