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
0 answers

Flutter 3d Model part by part integration

I am working on a project in which i am facing some issues from few days and need help in this regards. The scenario i have is that i have a gym equipment or machine e.g(chest machine) so the designer has provided me a 3d model .glb file and also…
1
vote
1 answer

Streamprovider i am getting this issue "The following ProviderNotFoundException was thrown building ConsumerStreamData

main.dart file contain all the providers return MultiProvider( providers: [ ChangeNotifierProvider(create: (context)=>AppData()), ChangeNotifierProvider(create: (context)=> UtilData()), …
1
vote
0 answers

why my Flutter app is crashing unexpectedly?

I hope you you guys are happy and healthy ...well about me i I am facing an issue with flutter app that it crashes very unexpectedly, this happens when I move from one screen to another. It is not crashing everytime when I am navigating to some…
The Mahi
  • 11
  • 1
  • 1
1
vote
1 answer

how to add straighten(gyro) function in side camera?

How to get Straighten (gyroScope) in side camera? (https://i.stack.imgur.com/BIV5W.jpg) i am using camera: ^0.10.4 this packege in side. 180 degree than center icon is green and other degree than center icon is red. maintain gyro in camera.
1
vote
1 answer

Scroll Controller error when you scroll in page

So, I have menu in my App with category and list of meals. But when I scroll on this page it gives me an error from title. AND IT GIVES THIS ERROR: The PrimaryScrollController is currently attached to more than one С. Page looks like…
AykhanSh
  • 13
  • 3
1
vote
1 answer

LateInitializationError Field '_instance...' has not been initialized with flutter local notification package

I am new to flutter and right now I'm trying to implement local notification on android on button click (With the local notification package). I tried multiple tutorials with different approaches but I end up always getting the same…
1
vote
1 answer

Google Mob Ad BannerAdWidgetState in Flutter Application returning errors

In my flutter application I am trying to implement google_mobile_ads in the pubspec.yaml I have added the following: google_mobile_ads: ^1.0.1 I have created a banner_ad_widget.dart with the following: class BannerAdWidget extends StatefulWidget { …
A_K
  • 731
  • 3
  • 15
  • 40
1
vote
0 answers

My Flutter app no longer runs on Android after upgrade from Flutter 3.0.5 to 3.7.9

I just upgraded to Flutter 3.7.9 and now cannot run the app on Android. On iOS and web the app runs fine If I revert to Flutter 3.0.5, the Android app runs fine (that's also on a different branch since a bunch of dependencies broke with 3.7.9 and…
Nikko
  • 163
  • 2
  • 11
1
vote
0 answers

Flutter App on two multi windows desktop is supported? (WindowsOS) not MacOS } Linux

Im trying to find flutter package support multi windows on Windows OS.. there are packages for other operating systems but not Windows Like this:https://pub.dev/packages/multi_window Expecting to be able to click a button or something to open…
1
vote
0 answers

Testing Error: PlatformException(channel-error, Unable to establish connection on channel., null, null) on Flutter

I am writing integration tests for my flutter application which uses firebases' fireflutter. I have a very basic Unit Test that just loads the application void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); …
Sian
  • 11
  • 1
1
vote
0 answers

Flutter Bottom Navigator Scroll up

I have a list of blog posts in the body and bottom navigation bar. I have to show the navigator button either page scroll up or down. When we click on the button then navigator should pop up. Like this. I have written the code but it is not…
1
vote
1 answer

can we build an app for both wear OS and watch OS using flutter?

can we build an app for both wear OS and watch OS using flutter, to get heart rate, blood oxygen, step count, blood pressure, etc. For design, there is only dependency for wear OS (wear plugin) in pub.dev. I can't find any dependency for both wear…
1
vote
0 answers

Closure call with mismatched arguments: function '_CameraPageState.takePicture..'

I have been trying to finish navigation for my flutter app, but I keep getting "NoSuchMethodError: Closure call with mismatched arguments: function' _CameraPageState.takePicture..". This error occurs after taking a picture and using the use…
1
vote
0 answers

Parameter format not correct

I am new to flutter and on running my pre-build application I face the below issue. Please help me to grow more in flutter. Error Displayed on Console: Launching lib\main.dart on Android SDK built for x86 in debug mode... Running Gradle task…
1
vote
0 answers

flutter save api response to sqflite database causes error Invalid argument [Instance of 'Photo'] with type List

I was trying to save from API call List of Pets which contain String values and Pets Image URL list but when I try to save to sqflite database I got an error Invalid argument [Instance of 'Photo'] with type List. response from postman looks like…
Abu Qudama
  • 59
  • 1
  • 7