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

Flutter: Firestore search using filters on two fields

I writing a mobile application that requires to search for a document that has two fields that satisfy the search query. I got the original idea of searching in Firestore from this answer I tried to modify it to get achieve my required result but…
1
vote
1 answer

Not able to build an APK in flutter

FAILURE: Build failed with an exception. Where: Build file '/Users/prashantsingh/.pub-cache/hosted/pub.dev/file_picker-5.3.3/android/build.gradle' line: 24 What went wrong: A problem occurred evaluating project ':file_picker'. No signature of…
1
vote
1 answer

SDK flutter packages conflict

The current Dart SDK version is 3.0.6. Because date_time_picker >=2.0.0 depends on intl ^0.17.0 and date_time_picker <2.0.0 doesn't support null safety, every version of date_time_picker requires intl ^0.17.0. And because every version of…
1
vote
0 answers

How to play videos and manage URLs seamlessly in Flutter

Basically, in my Flutter application, I am creating video player functionality. For that, I am using the video_player and chewie packages. However, as per the requirement, I want to play the video seamlessly. For example, if a user sets the video…
Shirsh Shukla
  • 5,491
  • 3
  • 31
  • 44
1
vote
1 answer

flutter dependency error suggest me changes in this file

This is my pubspec.yaml file. name: hydrabadi_rishte description: A new Flutter project. #version: 1.0.1+2 version: 1.0.2+3 environment: sdk: ">=2.18.6 <3.0.0" flutter: ">=2.12.0" dependencies: flutter: sdk: flutter dropdown_button2: …
1
vote
0 answers

How to change the Flutter AboutDialog Buttonlabels?

Im trying to use the AboutDialog but I want to change the button labels fitting to another language. This is how the class gets the String value for the labeling: TextButton( child: Text(MaterialLocalizations.of(context).closeButtonLabel), …
Yuki
  • 255
  • 1
  • 2
  • 9
1
vote
1 answer

How to count some data in List flutter

I'm making a point of sales application where there will be a list of items to be purchased along with the number of items and prices. but I'm having problems in making the total calculation. this is my code to add data to List final List
Ardabily
  • 17
  • 3
1
vote
0 answers

Current Dart SDK version incompatible with null safety dependencies

I'm currently working on my first app. When I try to import 'package:flutter_google_maps/location_service.dart'; I'm given this message: [myapp] flutter pub add flutter_google_maps The current Dart SDK version is 3.0.6. Because myapp depends on…
audaciity
  • 11
  • 1
1
vote
1 answer

Action Buttons not showing in notification when application is in background in real device, using awesome_notifications package in Flutter

I am using awesome_notifications package in my flutter application to show notifications and I am triggering my notifications using firebase_messaging , so whenever firebase cloud messaging is triggered I get notification on my device. The ISSUE I…
1
vote
1 answer

My flutter app is crashing (keep stopping) if user give location permission as "Allow all the time". Problem is only in Android 13 devices

My flutter app is crashing (keep stopping) if user give location permission as "Allow all the time". Problem is only in Android 13 devices, its working in all other versions. Problem started after upgrading compileSdkVersion 31 targetSdkVersion…
1
vote
2 answers

Flutter windows app from windows runner does not save the new file to a path in windows

I am trying to save a file to a path in windows using path_provider: 2.0.14. and everything works fine in debug, even when I use the app that is running by the command "flutter run --release -d windows" I mention this app is intended only for…
1
vote
1 answer

How to block user sign in if account already exists with other provider?

Flow step: Sign in with twitter mail@gmail.com (successfully) Sign in with google mail@gmail.com (successfully rewrite provider to google) Sign in with twitter again mail@gmail.com (failed, account already exist with different provider) i'm so…
1
vote
1 answer

Carousal slider image is not taking width properly in flutter

I want like this And I got this CarouselSlider( options: CarouselOptions( onPageChanged: (index, reason) { setState(() { _current = index; …
Jaini Shah
  • 45
  • 3
1
vote
1 answer

Cannot build Flutter Application due to errors

I have installed all the dependencies necessary for my flutter application but it is still throwing the errors below. Iam using flutter version…
1
vote
4 answers

How to run one particular Flutter Project in older version

i have multiple project that are running in latest stable flutter version but i want one of my project to run on 3.7.12 i downloaded both latest and 3.7.12 and updated the path of both the versions now all projects are running in latest version ,how…
yadhu
  • 15
  • 4