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

I try use google_mlkit_text_recognition in flutter app but I got "Errors" with some virables?

I try use google_mlkit_text_recognition in flutter app but I got "Errors" with some virables in flutter? final inputImage = InputImage.fromFilePath(path!.path); final textRecognizer = TextRecognizer(script: TextRecognitionScript.latin); …
1
vote
0 answers

mapEventToState is deprecated and not working anymore

i am Working on Flutter Chat Application and when i tried to implement the MessageBloc i found that mapEventToState is not Working anymore in Version 8.0 of Bloc This is MessageEvent import 'package:chat/chat.dart'; import…
1
vote
2 answers

Can anyone suggest how can I translate the dynamic data to different language which comes from remote API?

I am using flutter_localozation for localizing my app creating .arb files for different languages. However, I am not able to localize the data coming from API, how can I do so?
1
vote
0 answers

Your project requires a newer version of the Kotlin Gradle plugin

i have already tested latest version of kotlin 1.8.20-Beta ,1.8.10 and 1.7.10 also my app breaks. The binary version of its metadata is 1.8.0, expected version is 1.6.0 i leady added a jetifier in android.enableJetifier=true Android studio is…
1
vote
4 answers

pub get failed/exit code: 69

I just downloaded and installed flutter SDK(archive). when I run the "flutter doctor" command on my mac m1 terminal I receive this error. pub get failed/exit code: 69 thank you for guiding me. "flutter doctor" command not work.
1
vote
1 answer

How to solve GoogleFontsFile file, Uint8List bytes error

When i install the google fonts package and i import it, i run the code but i get a particular error that make me to be confuse. /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/google_fonts-4.0.3/lib/src/google_fonts_base.dart:317:42: Error:…
Martins
  • 41
  • 7
1
vote
2 answers

pod conflicting on flutter with this package video_editor

[!] The 'Pods-Runner' target has frameworks with conflicting names: ffmpegkit.xcframework, libavcodec.xcframework, libavdevice.xcframework, libavfilter.xcframework, libavformat.xcframework, libavutil.xcframework, libswresample.xcframework, and…
1
vote
3 answers

Unique device id in flutter

I want to get a device id or any unique number that can not be changed when someone uninstalls the app. This device is for both android and iOS and is in the flutter framework. I want this to manage my device management. Thanks for the help. I tried…
Hassan Gujjar
  • 288
  • 3
  • 13
1
vote
0 answers

Flutter auto_route import as prefix not generated well

I have a class page route AppointmentCreatePage which required a parameter from a class model , but I define this import model as a prefix AppointmentCreatePage class import 'package:project_mobile/features/brand/model/brand_response_model.dart' as…
rooxane.mac
  • 81
  • 2
  • 4
1
vote
1 answer

Error: Couldn't find constructor 'TypeMatcher'. .ancestorStateOfType(const TypeMatcher());

i even done that but errors are still there. i tried to downgrade the flutter version sdk to that project but didn't find the specific version and the ones i found are not…
saad ali
  • 11
  • 4
1
vote
1 answer

The android permission BLUETOOTH_SCAN not working in android 12 in flutter

when I running the my project showing this error `D/BluetoothAdapter(25841): isLeEnabled(): ON I/flutter (25841): Error starting scan. E/flutter (25841): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(startScan,…
Sibi Kumar
  • 72
  • 8
1
vote
1 answer

How to start Flutter app with loading, using state pattern with provider

I'm building my first app, and for state management I'm using ValueChangeNotifier and Provider with the state pattern. But when I start my app, I get the following error: Exception has occurred. FlutterError (setState() or markNeedsBuild() called…
1
vote
2 answers

Unable to Send Sms using Telephony package on flutter

I have been trying to write a simple flutter code and trying to send SMS using telephony. Sending Sms via the default SMS app works (telephony.sendSmsByDefaultApp()) but not sending directly from the app. My code is as follows: import…
1
vote
1 answer

How to show a blinking cursor when textfield is enable?

I am working on the project where pressing edit button enables Textfield. Now, I want that user will now that textfield is enabled by showing a blinking cursor. Is there anyway to do that?
WasimSafdar
  • 1,044
  • 3
  • 16
  • 39
1
vote
3 answers

Modal Bottom sheet route issue in flutter 3.7.0

I have upgraded my flutter version from 3.3.10 to 3.7.0 and now getting the following error. ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart I…
1 2 3
99
100