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

Make Rating List Clickable in Flutter

I am making a Rating List Criteria for My Flutter App. I have a list of criteria from a API call, and in the Flutter App I make a ListView.Builder inside of a showModalBottomSheet ListView.builder( itemCount: itemListApi.length, shrinkWrap:…
Anele
  • 162
  • 1
  • 3
  • 21
1
vote
2 answers

Flutter video_player - passing video file as parameter without errors

I'm attempting to create a page in my app which renders a video background, using video_player. I want to pass a video file into my video player widget, and I have followed the docs and this article for passing in a value, but I still have the…
1
vote
1 answer

My flutter app is not running after adding screenshot package

After adding the screenshot package on my flutter app,my app can not be build and it gives me this error : : Error: Undefined name 'View'. screenshot.dart:154 context == null ? fallBackView : View.maybeOf(context) ?? fallBackView; …
1
vote
0 answers

Problem updating flutter from 2.10.2 to 3.10.0

When i execute my flutter application it don't install and get a lot of error after updating flutter from 2.10.2 to 3.10.0 : Error: 'AssetManifest' is imported from both 'package:flutter/src/services/asset_manifest.dart' and…
1
vote
1 answer

Sqflite flutter warning

I am facing this warning using the sqflite package *** sqflite warning *** You are changing sqflite default factory. Be aware of the potential side effects. Any library using sqflite will have this factory as the default for all operations. ***…
Bhumika
  • 11
  • 3
1
vote
0 answers

The mutability of each PendingIntent object is required for all apps targeting Android 12 or newer (API level 31). Learn more

I got this error after adding in manifest file in android flutter project before this one app still working file but after added I got error on google play console and application crashing on android version 13 and 12 , I couldn't understand that…
row first
  • 11
  • 1
1
vote
1 answer

ARCore_Flutter_plugin, your device isn't compatible with this version (Google Play Services for AR)

I'm working on a flutter project and I want to use arcore_flutter_plugin, the AR part is one of the essential requirements of my app, I'm new to this, so I tried to run the basic example attached with the plugin documentation, I followed each step…
1
vote
1 answer

Prevent headless opening of inappwebview in android flutter url_launcher plugin

I have a requirement to open the in app web browser in flutter and for that I used the plugin url_launcher (https://pub.dev/packages/url_launcher). After the integration in iOS it opens up the inapp browser as expected with a closable option.…
Selvarathinam Vinoch
  • 1,080
  • 3
  • 13
  • 23
1
vote
1 answer

how to solve C:\flutter\bin\flutter.bat --no-color pub get Error: Unable to find git in your PATH.?

when i want to get dependencies i recieved this error i tried to fix with put path into enviroment variables but it didn`t work.
1
vote
0 answers

why the flutter listview is not updating if it places in obx while the data in modal and controller is updating

in view file the controller is initialized as SelectCalenderController selectCalenderController = Get.put(SelectCalenderController()); Here is the code for view file listview builder Obx(() { log("list view 1…
1
vote
1 answer

Trying to implement shopping cart using riverpod

I'm trying to build remote shopping cart "I will add CRUD requests later" For now I'm just trying to build it using Riverpod NotifierProvider in the first stage. I can fill my cart successfully However, I'm facing this error while displaying my…
Mohammed M
  • 101
  • 6
1
vote
0 answers

flutter pub get keeps running endlessly

Flutter pub get just keeps running endlessly and refusing to launch the app. It seems pub.dartlang.org site is down. Am I the only one experiencing this or is there something I'm doing wrong? Help please. Tried launching flutter app using vs code…
danapk
  • 19
  • 1
1
vote
1 answer

Flutter Search Bar It does not work properly

hi all I'm trying to create a search bar but I can't I'm quite new I have a list in a CartModel class that I display in a FruitsPage class but I can't filter the search result. CartModel class CartModel extends ChangeNotifier { final List _shopItems…
sams
  • 43
  • 6
1
vote
0 answers

Library not loaded: @rpath/Flutter.framework/Flutter

I am using Xcode 14.3. iOS: 16.3 Device Flutter version: 2.10.5 While running in device compile successfully but run time it crash and error is: Library not loaded: @rpath/Flutter.framework/Flutter. also Library not loaded:…
krishnendra
  • 673
  • 7
  • 8
1
vote
2 answers

How to make the tab in flutter?

I want to make this design using tab in flutter. But when I'm trying to make it using tab controller but when we not select another one then it's background should be grey I'm trying it but it is not working. So, you can help me in this.