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
1 answer

Build failed with an exception Execution failed for task ':app:processDebugResources'. >

Launching lib\main.dart on Snap 4G2 in debug mode... Initializing gradle... Resolving dependencies... Gradle task 'assembleDebug'... FAILURE: Build failed with an exception. What went wrong: Execution failed for task…
2
votes
4 answers

D8: Program type already present: android.support.v4.media.MediaBrowserCompat$CustomActionCallback

I am new to flutter and i build a very little app showing current latitude and longitude which required me to add two dependencies in pubspec.yaml :- location and simple_permissions to get current user location and asking for location…
2
votes
0 answers

Firebase Database Error For TimestampsInSnapshotsEnabled

I am getting this error when i will try to get data from firebase without adding any date. Only Want to Show Data Likes "Books" and "Author". Has anyone idea how to resolve that? I am using this this dependencies: cloud_firestore: ^0.9.0 I try to…
2
votes
2 answers

Why does the Flutter build failed with the error Could not resolve all files for configuration ':app:debugRuntimeClasspath'

I wanted to use the flutter video_payer api for displaying a video from the network in my app. I upgraded to the latest version and now, my app won't build. The following error is being displayed- PBI: {"kind":"error","text":"Invoke-customs are only…
user8187389
2
votes
4 answers

How to get this kind of radio button in flutter

I am trying to create a gender selection functionality that contains 3 radio buttons. I have done this code but it is not working as I want it. Radio button container final _radio_colume_container = Container( margin: const EdgeInsets.fromLTRB(50,…
Shubham
  • 61
  • 1
  • 1
  • 6
2
votes
1 answer

Flutter - Getting 64K methods DEX Error from the Flutter project direcory but not from the Android project directory

After I added the next dependecies to my Flutter project: cloud_firestore: ^0.9.0 firebase_auth: ^0.8.0+1 google_sign_in: ^4.0.0 I tried to run the app by clicking the run button in Android Studio but something weird is happening here: Case…
SaloGala
  • 1,904
  • 3
  • 14
  • 19
2
votes
2 answers

Image not loading in Flutter

Trying to load image in flutter but not able to do that, getting following error I/flutter ( 3214): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════ I/flutter ( 3214): The following assertion…
mdDroid
  • 3,135
  • 2
  • 22
  • 34
2
votes
1 answer

Flutter cloud_firestore(0.9.0) package crashes when opening the app

Flutter firebase firestore package crashes when opening the app, here is the log file, E/MethodChannel#plugins.flutter.io/cloud_firestore(28101): Failed to handlemethod call E/MethodChannel#plugins.flutter.io/cloud_firestore(28101):…
chathura
  • 3,362
  • 6
  • 41
  • 68
2
votes
1 answer

Flutter:Error with authorization via Google Firebase

I am begginer in Flutter and faced such a problem.I need to make it so that when logging into my application, my mail is shown in the firebase. I kind of did authorization, but errors appear when I click on the button (login with google). Here is…
2
votes
0 answers

Execution failed for task ':app:processDebugResources'. in flutter

Execution failed for task ':app:processDebugResources'. in flutter Execution failed for task ':app:processDebugResources'. Android resource linking failed Output: …
2
votes
1 answer

Flutter navigator.push() object issue

While passing an object from one class to another class by using Navigator.push(), the object does not get modifying even its declared as not final. Main Screen : Created an object(userBean) and passing to First screen First Screen : displaying the…
2
votes
1 answer

Importing files under the src directory from a dart library

Effective dart says "DON’T import libraries that are inside the src directory of another package." reason being it breaks abstraction and could potentially break your app if the library was to change its underlying implementation. They do not…
jia chen
  • 710
  • 1
  • 6
  • 16
2
votes
1 answer

pincode or zipcode not getting from geocode

I am developing a flutter app. I want to print the pincode zip code of place. I am using geocoder library. The version is geocoder 0.1.1 . I am trying the example shown library page https://pub.dartlang.org/packages/geocoder#-example-tab- The…
Joe
  • 959
  • 2
  • 11
  • 27
2
votes
0 answers

flutter:error facing in console. app is automatically closed?

After add flowing dependency to my app shared_preferences,image_picker,uuid,image,path_provider,font_awesome_flutter,async,http: any,cached_network_image,firebase_storage its showing me error in console page .. my console error is below…
Hitanshu Gogoi
  • 957
  • 3
  • 15
  • 24
2
votes
0 answers

Exception getting access token Flutter google signing

Hello I'm trudging to authenticate users using google_sign_in plugin and firebase oficial plugin, but I'm getting this error when try to authenticate. Here is my code: static Future signInWithGoogle() async { final GoogleSignInAccount…
DAVID TEC
  • 347
  • 1
  • 7
  • 19