Using preview package of hydrated_bloc - flutter

I want to use the 9.0.0-dev version of the hydrated_bloc package.
If I run pub get on my pubspec.yaml:
dependencies:
flutter:
sdk: flutter
hydrated_bloc: ^9.0.0-dev.3
I get the message Latest available version is: 8.1.0
How can I get the prereleases?

That is the version found on pud.dev.
If you want to use the latest dev package you could point to the github repo instead
hydrated_bloc:
git:
url: https://github.com/felangel/bloc.git
ref: master
path: packages/hydrated_bloc/

Related

Importing packages from GitHub in pubspec yaml, requires pubspec.yaml file which isnt in the repository

I have issues using flutter pub get with a repository package in my pubspec.yaml file.
dependencies:
flutter:
sdk: flutter
flutter_stripe:
git:
url: https://github.com/flutter-stripe/flutter_stripe.git
ref: poc-use-expensive-androidview
Following the steps provided https://dart.dev/tools/pub/dependencies#git-packages.
However, I am getting the error
Could not find a file named "pubspec.yaml" in https://github.com/flutter-stripe/flutter_stripe.git 7934151fefed73c6a22c253de3a1f1c9d46decc2.
pub get failed (1; Could not find a file named "pubspec.yaml" in https://github.com/flutter-stripe/flutter_stripe.git 7934151fefed73c6a22c253de3a1f1c9d46decc2.)
I have no idea what I am suppose to put for the pubspec.yaml which is not present in the repository. And it works fine if you call the package as it is using flutter pub add flutter_stripe.
The reason I am required to use an unofficial branch is because one of the fields provided by the package is not working correctly, and the suggested solution is to use this branch.
Sorry, my bad, I didnt know that the root of the Hosted package isn't the final path. I was required to add a path to the packages, which can then be found in ./packages/stripe.
flutter_stripe:
git:
url: https://github.com/flutter-stripe/flutter_stripe.git
ref: poc-use-expensive-androidview
path: ./packages/stripe
For anyone who has the same issue as me... or maybe i'm just noob
If you look at the packages of the git project you can see more then one package: https://github.com/flutter-stripe/flutter_stripe/tree/main/packages
You have to choose the package(s) you need.

flutter pubspec.yaml - select package version from git

I need get package form github
I know how to do it
dart_vlc:
dart_vlc_ffi:
git:
url: https://github.com/alexmercerind/dart_vlc.git
path: ffi
ref: master
But my problem
it's get old version .. I need latest version
and I have one questions
how I can select version from tags (like use dart_vlc v0.1.8 from github)
This issue is fixed in the latest version of dart_vlc.
Mention dependencies as follows in your pubspec.yaml to use the GitHub version of the dart_vlc in your Flutter project.
dependencies:
dart_vlc:
git:
url: https://github.com/alexmercerind/dart_vlc.git
ref: master
dependency_overrides:
dart_vlc_ffi:
git:
url: https://github.com/alexmercerind/dart_vlc.git
ref: master
path: ffi

amplify_flutter any which doesn't exist (could not find package amplify_flutter at https://pub.dartlang.org),

I am trying implement amplify-flutter from this document but when i run pub get it showing "depends on amplify_flutter any which doesn't exist (could not find package amplify_flutter at https://pub.dartlang.org), version solving failed."https://github.com/aws-amplify/amplify-flutter/blob/master/example/pubspec.yaml
You can use amplify_flutter from github!
dependencies:
amplify_flutter:
git:
url: git://github.com/aws-amplify/amplify-flutter.git
path: packages/amplify_flutter

Error: Could not resolve the package 'rxdart' in 'package:rxdart/rxdart.dart'

I created an example project inside a my flutter package and inside my example project i did:
dependencies:
flutter:
sdk: flutter
my_package:
path: ../
my_package used rxdart and i received an error after run my example project
Error: Could not resolve the package 'rxdart' in
'package:rxdart/rxdart.dart'.
I ran flutter packages get but the error is still here.
I just ran into the same issue. To solve it follow these steps:
Kill your app if it's running
Run flutter clean in both your main project directory and your my_package directory
Run flutter pub get in both your main project directory and your my_package directory
Now when you build your app you should be all set.
Check first, if you added rxdart package to your pubspec.yaml as shown below:
dependencies:
flutter:
sdk: flutter
rxdart: ^0.24.1
Run flutter pub get

How to determine the tag to Downgrade flutter from 2.0? Cannot build project anymore

I just updated my flutter and my project is not building anymore. I am getting the following error
Because project depends on progress_hud >=0.1.1 which requires SDK
version >=1.23.0 <2.0.0, version solving failed.
pub upgrade failed (1)
Now I read this link here which states that I should checkout that specific Tag. How do I know which Tag is associated with which branch ? Essentially I would like anything closer less than 2.0. Preferably 1.9 or something like that. How do I determine which tag that is?
Don't downgrade your Dart version, there is an issue with that package, it doesn't have the constraints updated : https://github.com/rcpassos/progress_hud/blob/master/pubspec.yaml
As you can see these constraints:
environment:
sdk: ">=1.23.0 <2.0.0"
Doesn't allow to build your app, you have two options:
wait for the owner to update the constraints
Use a fork from another user with the constraints updated, like
this:
Instead of this :
dependencies:
progress_hud: ^1.0.0
Use this:
dependencies:
progress_hud:
git: https://github.com/LampeMW/progress_hud/
Don't Downgrade Flutter. Instead add following tags in
pubspec.yaml
dependency_overrides:
shared_preferences: ">=0.5.12+4"
place your problematic packages lower versions.