Running angular_components with Dart SDK 2.1.0-dev - angular-dart

I have installed the latest Dart SDK 2.1.0-dev.7.1 to try out Material design examples:
https://github.com/dart-lang/angular_components/tree/master/examples
The sample that fails in the following is:
angular_components/examples/material_card_example
I have git cloned the repo and when running webdev serve in one of the samples I get:
webdev could not run for this project.
You must have a dependency on `build_runner` in `pubspec.yaml`.
# pubspec.yaml
dev_dependencies:
build_runner: >=0.8.10 <2.0.0
You must have a dependency on `build_web_compilers` in `pubspec.yaml`.
# pubspec.yaml
dev_dependencies:
build_web_compilers: >=0.3.6 <0.5.0
Do you know how to run the samples?

Related

Getting error in flutter compilation like : carousel_slider-4.2.0/lib/carousel_slider.dart:311:29: Error: Member not found: 'trackpad'

I am getting error while compiling flutter app
Anyone can help?
Here is full error :
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/carousel_slider-4.2.0/lib/carousel_slider.dart:311:29: Error: Member not found: 'trackpad'.
PointerDeviceKind.trackpad
Here are dependencies from yaml file
`
version: 1.0.0+1
environment:
sdk: ">=2.16.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
carousel_slider: ^4.2.0
video_player:
`
Welcome Rohan!
This issue is because of the introduction of the new trackpad gestures in version 3.3.0-0.0.pre of flutter as documented here: https://docs.flutter.dev/release/breaking-changes/trackpad-gestures looks like carousel_slider has been update to use it.
You have two options:
Upgrade your flutter SDK to 3.3.0-0.0.pre or greater
Or downgrade carousel_slider: 4.1.0
Clean pub cache folder by command bellow
flutter pub cache repair
And download all dependencies by following command in your project directory
flutter pub cache repair
IMPORTANT
All libraries will be downloaded from the internet from the scratch and this will take some time depends how many libraries are you using
you should declare carousel_slider: 4.1.1 in pubspec.yaml
instead of carousel_slider: ^4.1.1 because with ^ sign flutter will try to use latest version in pub.dev

Error when running flutter pub run build_runner build --delete-conflicting-outputs

I'm trying to integrate a smart contract into my flutter and I'm referring to this example. I have included all the dependencies and dev_dependencies in the first step and I'm stuck in the second step where this error occurs where the system could not find the path to builders.dart in the web3dart package.
After updating Flutter to version 2.5.2, there were some conflicts even though no code was changed, therefore I use any in pubspec.yaml.
dependencies:
flutter:
sdk: flutter
moor: ^4.5.0
provider: ^5.0.0
path_provider: any
path: ^1.8.0
dev_dependencies:
flutter_test:
sdk: flutter
moor_generator: any
build_runner: any
flutter_launcher_icons: any
For me, I had to downgrade to web3dart: ^2.3.5 from ^2.4.1 (pubspec.yaml)
Ran flutter pub get
But the web3dart-2.4.1 folder remained in .../flutter/.pub-cache/hosted/pub.dartlang.org/
The problem was that build_runner was still looking in the 2.4.1 folder
So I removed everything from the .../flutter/.pub-cache/hosted/pub.dartlang.org/web3dart-2.4.1 folder and moved everything from the .../flutter/.pub-cache/hosted/pub.dartlang.org/web3dart-2.3.5 folder into the .../flutter/.pub-cache/hosted/pub.dartlang.org/web3dart-2.4.1 folder
Closed Android Studio
Reopened it and ran flutter pub run build_runner build
And it worked
CAUTION: DO NOT RUN FLUTTER PUB UPDATE BEFORE RUNNING FLUTTER PUB RUN BUILD_RUNNER BUILD
When I ran flutter pub update, it pulled a completed different web3dart version (2.4.0) into .../pub.dartlang.org/, which has the same bug in it.
Your folder version may be different, but if you can get the web3dart-2.3.5 version and find which folder build_runner is looking in (by running it in Terminal and reading the error message), you can put the good code into there and it should work

Flutter pub get info about a package from command line

I need to get the latest version(just number, not a package) of a certain package hosted on pub.dev from the command line.
Something like npm view url-loader version from npm.
Can not find any analogues so far.
I'm creating a script that automatically changes the version in pubspec.yaml to the latest+1 and publishes the package. The only option i have found so far is to download the html contents of the package web page on pub.dev and search for the version there which does not seem to be very consistent.
Simply let the version in pubspec.yml blank. like:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons:

"Please upgrade your dependency to build_web_compilers: ">=2.0.0", but it already is

I have an AngularDart-based web project. When I'm try webdev serve, I get this:
[SEVERE] Support for dartdevc in build_web_compilers < 2.0.0 has been removed.
Please upgrade your dependency to:
dev_dependencies:
build_web_compilers: ">=2.0.0"
[SEVERE] Exception: dartdevc is no longer supported by this version
However, I already have the dependency set to "2.0.0 and newer". Here is my pubspec.yaml file:
name: myproject
description: My Description
environment:
sdk: '>=2.3.3 <3.0.0'
dependencies:
angular: ^5.2.0
angular_components: ^0.13.0
dev_dependencies:
angular_test: ^2.2.0
build_runner: ^1.5.0
build_test: ^0.10.3
build_web_compilers: ^2.0.0
pedantic: ^1.0.0
test: ^1.5.1
I tried pub get, pub upgrade, pub activate global webdev, even pub cache repair.
In general, I seem to have problems with dependencies when creating AngularDart projects, even when I use versions from the Dart docs. Is there a magic way to know exactly which version numbers to use?
Try deleting your .dart_tool directory, rerun pub get and try again.
That directory is where dart stores all of the dependencies and artifacts of the build process. Sometimes it can get in an odd state.
Whenever your Dart build is misbehaving in ways that defy explanation, it is good practice to delete the .dart_tool directory first and build clean to see if that fixes it.

Flutter: packages not added into flutter SDK

We are working on Flutter v1.7.8+hotfix.4, using VS Code added a new package called english_words. the package is updated with all required files in the app but SDK, not updated flutter/packages, here we are unable to see the package folder.
Due to the above issues getting an error from main.dart file
Target of URI doesn't exist 'package:english_words/english_words.dart'.
pubspec.yaml
dependencies:
flutter_test:
sdk: flutter
english_words: ^3.1.5
run flutter packages get got response exit code 0
run flutter pub get or pub get no error.
reload/rebuild the app using flutter run but packages not updated.
pubspec.yaml, pubspec.lock, .packages updated fine.
tried from VS Code Tool click get Packages not solved.
Check if you have this in your pubsec.yaml file
dependencies:
flutter:
sdk: flutter
english_words: ^3.1.5
In you code there is dev_dependencies. Replace this dependency