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 build error: Error parsing package

I get this error anytime i try to open the apk i get after running flutter build apk, "Error parsing package" In my AndroidManifest.xml there is android:exported="true" but still gives same issue This is what i get from the terminal Font asset…
Precious Oladele
  • 123
  • 1
  • 1
  • 6
1
vote
0 answers

Flutter Usb serial

I am a beginner in flutter. Currently I'm trying to write some code that will allow me to establish a connection between my thermal printer and my Android phone through my USB cable. At the moment I am using the USB Serial library. When I modify the…
1
vote
0 answers

Flutter Logger Package not printing Emoji, colors

I am using flutter Logger Package logger: ^2.0.1 I am using all the default settings they mentioned var logger = Logger( printer: PrettyPrinter( methodCount: 2, // Number of method calls to be displayed errorMethodCount: 8, //…
1
vote
0 answers

Flutter: update dependencies in build.gradle

I keep dependencies in pubscpec.yaml updated with flutter pub upgrade --major-versions but I never know how to update dependencies in android/build.gradle: dependencies { classpath 'com.android.tools.build:gradle:7.2.0' classpath…
Dani
  • 3,128
  • 2
  • 43
  • 91
1
vote
0 answers

How can I add Custom sound for Awesome Notification package as native resource file in IOS For Flutter App

I want to add resource file for custom sound, i'm using awesome_notification package this is my code import 'package:awesome_notifications/awesome_notifications.dart'; import 'package:flutter/material.dart'; import 'notifcation_model.dart'; class…
1
vote
0 answers

App is crashing in release mode but working fine in debug mode Flutter

My app is working fine in debug mode but when I am making a release apk then I am getting this error and my app is crashing just after the apk is installed. Initially my app was working fine in release mode also but after using the package…
1
vote
0 answers

Error run flutter project in IOS - Error (Xcode): Target debug_unpack_ios failed: Exception: Binary

I am getting the error below when compiling Flutter projects (I have already created a project from scratch and I have the same error). I started having this error after deleting some files to free up space on my Mac. I have already reinstalled…
1
vote
1 answer

Cannot run flutter project with cloud_firestore dependency

I created a new project, with the default main page, and added a few dependencies to the pubspec.yaml file. I noticed that if I have cloud_firestore in the dependencies list my app won't run and I get a lot of errors. This issue started randomly,…
1
vote
1 answer

Error while executing pub get even after having ssh key

Git error. Command: `git clone --mirror git@github.com:open-runtime/aot_monorepo.git /Users/tarun/.pub-cache/git/cache/aot_monorepo-7a0b3d0f0477d2766d0540e8a0101f937bb7f0bf` stdout: stderr: Cloning into bare repository…
1
vote
0 answers

how to back on bottombar home tab on click arrow of circle tab

class DashBoard extends StatefulWidget { static const route = '/dashboard'; const DashBoard({super.key}); @override _DashBoardState createState() => _DashBoardState(); } class _DashBoardState extends State { var…
1
vote
1 answer

Dart 3 get doc in collection across a routing system

I'm trying to get the return of a Future<> function across my routing system. I got an error: The non-nullable local variable 'page' must be assigned before it can be used raised by the return of my class RouteGenerator. My RouteGenerator.dart…
1
vote
2 answers

How to download URL using youtube_explode_dart package in 2023?

I want to download videos using audioOnly from youtube using URL, I am using youtube_explode_dart for this purpose, but the code method has migrated now, I cant figure out despite checking documentation of package, that how to download audio…
user22030129
1
vote
1 answer

Flutter: How to implement in app update feature when new version of app is available in google play store

I have been struggling with a concept regarding in app update notification to the user in flutter framework. I mean when you deploy a new version of an existing mobile app in google play store or in the apple app store, the user should get the…
1
vote
1 answer

flutter_math_fork dependency keeps adding itself back to project - Flutter

I added flutter_math_fork to my project but after now I don't have any use of it. I have removed it from pubspec.yaml but it still shows here Resolving dependencies... flutter_math_fork 0.5.0 (0.7.1 available) and after updating flutter to latest…
1
vote
0 answers

Agora Error: A value of type 'void Function(LocalInvitation)' can't be assigned to a variable of type 'void Function(LocalInvitation, String)'

After adding Agora to the project it shows this error when I try to run the project. /C:/Users/syedi/AppData/Local/Pub/Cache/hosted/pub.dev/agora_uikit-1.3.3/lib/controllers/rtm_client_event_handler.dart:76:7: Error: A value of type 'void…