Questions tagged [dart-pub]

Pub is a package manager for Dart applications and libraries.

Pub is a package manager for Dart applications and libraries. You can find packages to use in a project or publish packages to the package repository. Pub automatically keeps track of dependencies to other packages and makes sure that the dependencies use the right version of a package.

Basics:

  • Use pub get to get dependencies
  • Use pub upgrade to upgrade a dependency
  • Use pub publish to make your library available for others

Resources:

1128 questions
6
votes
1 answer

No data from sever API's is not showing on Listview using flutter

I'm fetching data from server APIs, The data is being successfully fetched from the server but the issue is that when the data is provided to Listview it cant be shown. How can I show the data on Listview in a flutter/dart? Following is the code for…
6
votes
3 answers

Error: The parameter 'event' of the method 'AlwaysWinPanGestureRecognizer... when importing color picker package in my project

Welcome I have a problem on importing flutter_colorpicker package when i just import it in my project: import 'package:flutter_colorpicker/flutter_colorpicker.dart'; I gets this…
6
votes
1 answer

EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE - Crashlytics non-fatal error - http request failed

I am trying to load list of products and I am using CachedNetworkImage (or if I also use Image.network) to display image of that particular product. I have used Error Builder property so that if image is giving error then show default asset image…
6
votes
1 answer

Change input text color on DropdownSearch

Is there a way to change the input color of a DropdownSearch widget? The default color is black but I want to change it to grey. I have tried labelStyle: TextStyle(color: Colors.white) but it does not work. This is my DropdownSearch Widget …
user15602150
  • 69
  • 1
  • 4
6
votes
1 answer

How to do test sharding or run in parallel for flutter

Description I can see in test package docs https://pub.dev/packages/test#sharding-tests that there is one param to shard the tests: pub run test --total-shards 3 --shard-index 0 path/to/test.dart pub run test --total-shards 3 --shard-index 1…
Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162
6
votes
1 answer

Flutter : How to prevent rebuild of whole Reorderable Listview?

Currently I'm using flutter package 'Reorderables' to show a reorderable listview which contains several images.These images can be deleted from listview through a button , everything works fine. But the listview rebuild everytime when I delete an…
6
votes
2 answers

flutter moor - update only specified columns without custom query

I want to update only specified columns, when I execute update(table).replace(model) it replaces all data corresponding to primary key. How to update only specified column without writing custom queries.
Ashique bzq
  • 541
  • 2
  • 9
  • 21
6
votes
1 answer

How can I parse the contents of a PDF file in dart?

Is there a way I can parse the contents of PDF files into widgets or something more understandable or perhaps into something that can be modified and again converted to PDF format?
6
votes
3 answers

How to securely store API keys in Flutter?

I'm using the googleapi's Flutter package and to use the Google Drive API, I need to put in credentials. My question is, how can I securely store them in my app so when I publish my app, they can't be taken. I found a cool package,…
Benjamin
  • 5,783
  • 4
  • 25
  • 49
6
votes
4 answers

Flutter: Http post request Error Invalid media type: expected

I am making an http post request using http dependency. I am facing the below error in my response. I am posting my code below: flutter: Error on line 1, column 32: Invalid media type: expected /[^()<>@,;:"\\\/[\]?={} \t\x00-\x1F\x7F]+/. ╷ …
Achin
  • 1,252
  • 4
  • 28
  • 63
6
votes
2 answers

How to copy a content to Clipboard in pure Dart?

I would like to copy a Text to Clipboard in a Dart console App. There is this plugin clipboard_manager but it is specific to flutter. Is there any way to do this in pure Dart?
alexpfx
  • 6,412
  • 12
  • 52
  • 88
6
votes
2 answers

Generating dart file with json_serializable package

According to the json_serializable package installing instructions, you should add the following dependency: dependencies: json_serializable: ^2.0.3 This is my code: import 'package:json_annotation/json_annotation.dart'; part…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
6
votes
0 answers

Flutter - Upload Video to Youtube

In my app I need the ability to take and upload or save a short 5 to 15 second video. I also need to be able to save the video if the user is offline, and upload it when connected to internet. I can create the video file with the plugin…
Dave Lister
  • 441
  • 1
  • 6
  • 12
6
votes
1 answer

Who should be credited as an author in pubspec.yaml?

Can't find any information about this. Is it the creator of the project, all contributors who had their code merged or all contributors who have a certain amount of code in the project? Consider a code base of 500 lines, and the following…
Joel Broström
  • 3,530
  • 1
  • 34
  • 61
6
votes
1 answer

How to organise multi package flutter project and use it as dependency

I would like to organise a flutter project into a multi-package one with following requirements: use one repository for this project able for developers to work on the packages in this repository locally make the packages accessible as dependencies…
Artur Stepniewski
  • 1,401
  • 2
  • 11
  • 10