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

ConnectivityPlugin.java uses or overrides a deprecated API

I installed the latest Flutter and dart and Android Studio. I have login page before login I checked internet available or not using connectivity plugin. when running flutter run application working well. when running flutter build apk after that…
user11065582
2
votes
0 answers

How to stop automatically audio playing when we receive a call or play a video in Flutter?

I build flutter app with local assets audio playing. How to stop automatically audio playing (streaming) when we receive a call or play a video? I used audioplayers 0.7.8 to build application. pubspec.yaml: environment: sdk: ">=2.1.0…
Sivakumar
  • 21
  • 4
2
votes
2 answers

Does anyone know how to implement a search bar with tabs like that similar to instagram using flutter?

I want to know how to build a search bar where it filters the users search input into groups or tabs such as people, tags, places just like what instagram has but I don't know how to do this!
2
votes
2 answers

Flutter: How to know item position inside a listview?

I have a list view of items but I would love to know how I can find its current position inside a listview, does anyone know?
2
votes
1 answer

How can I parse and replace a word as a hashtag link when user types some text using flutter?

I want when a user types some text to make a post. But the thing is when the user types a hashtag (e.g. #avengers) I can parse and replace that hashtag with a link or ontap widget... Same goes with URL links
2
votes
1 answer

Kotlin null pointer exception when trying to get context from Registar in Flutter

I'm trying to create a Flutter Plugin that uses a native Android sdk I'm able to compile the .aar libraries of the sdk and use them in the project but the sdk requires me to get the context of the main activity here is the error im getting…
Derek Hannah
  • 537
  • 7
  • 23
2
votes
1 answer

Flutter :- How to parse the JSON from the model class in flutter?

I am parsing the JSON like from key and values like below code in flutter Future login() async { var body = json.encode({"MOB": "1112223330", "KEY": "123456"}); return http.post( Uri.encodeFull( …
Ravindra Kushwaha
  • 7,846
  • 14
  • 53
  • 103
2
votes
1 answer

Receiver FCM notification click event

How can I receive the notification click event on flutter? I write this code on main.dart but the onMessage handling events doesn't work. This code block doesn't work on background too. When the app working on background onMessage function doesn't…
2
votes
3 answers

Flutter doesn't run on Android after install Firebase

If I add the firebase_core to my flutter project, it doesn't run on Android. In iOS it's ok. I have this gradle error. Launching lib/main.dart on Android SDK built for x86 in debug mode... Initializing gradle... Resolving…
Flutter Dev
  • 21
  • 1
  • 2
2
votes
1 answer

How to Scroll two Horizontal ListView at the same time?

1)I have three ListView.builder, one inside questionsListWidget which scrolls horizontally orange in color. 2)Second list i have in studentsListWidget which scrolls vertically which in blue(Network image) and yellow(ListView.builder). 3)Now my…
2
votes
1 answer

How to catch flutter app crash on Startup

i need to catch app crash log, this app crash happen when running/debug at AndroidStudio on startup (still not yet a signed apk). i have tried using sentry, but i does not catch any error. i have tried to test print text at try-catch on main.dart…
questionasker
  • 2,536
  • 12
  • 55
  • 119
2
votes
3 answers

How to fix app crash on recieving FCM Push Notification built on Flutter

I have built an app on Flutter and was trying to send Push Notifications through FCM. Earlier it was working but after changing the version of Firebase messaging the app crashes as soon as I send a push notification. I haven't made any changes in…
2
votes
2 answers

Version conflict

I'm getting version conflicts on UUID. Basically, cached_network_image depends on uuid 2.0.0 while the socket packages depend on uuid 1.0.3 uuid: ^1.0.3 cached_network_image: ^0.6.2 socket_io: ^0.9.0+1 socket_io_common: any socket_io_common_client:…
Kevin
  • 321
  • 1
  • 2
  • 14
2
votes
1 answer

Flutter SocketException problem with large images on ios

I have a method for posting image to a django-rest api. It works good for small size images. But when it comes to 900 KB or more (Like ios images), it takes some time and gives me this error(Also this problme is just occur when I use an ios device.…
artick
  • 175
  • 1
  • 13
2
votes
2 answers

flutter app crashing after adding flutter_firebase_ui

When I added these two libraries my app is not working, it is showing close app dialog only image_picker: 0.4.12+1 #^0.5.0+3 flutter_firebase_ui: ^0.0.13 registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)…
Midhilaj
  • 4,905
  • 9
  • 45
  • 88