Is AngularDart 4 compatible with Dart 2 & build_runner 0.8? - dart

Currently on
Dart VM version: 2.0.0-dev.49.0
angular ^4.0.0
Linux
Dartium
One of the upgrade requirement for Dart 2 upgrade # https://webdev-dartlang-org-dev.firebaseapp.com/dart-2 is to use build_runner 0.8 which from the error code is not compatible with Angular4.
My pubspec.yaml looks like
name: JRapha
description: A web app that uses AngularDart Components
version: 0.0.1
environment:
sdk: '>=2.0.0-dev.49.0 <2.0.0'
dependencies:
angular: ^4.0.0
dev_dependencies:
angular_test: ^1.0.0
test: ^0.12.30
build_runner: ^0.8.2
build_test: ^0.10.1
build_web_compilers: ^0.3.6
web:
compiler:
debug: dartdevc
The Error when running pub get
Because angular_compiler >=0.2.1 <0.3.0+1 depends on build ^0.10.0 and no versions of angular_compiler match >0.3.0+1 <0.4.0, angular_compiler >=0.2.1 <0.3.0+1 or >0.3.0+1 <0.4.0 requires build ^0.10.0.
And because angular >=4.0.0-beta <5.0.0-alpha depends on angular_compiler ^0.3.0, angular >=4.0.0-beta <5.0.0-alpha requires build ^0.10.0 or angular_compiler 0.3.0+1. And because angular_compiler 0.3.0+1 depends on build >=0.10.0 <0.12.0 and build_web_compilers >=0.2.1 depends on build ^0.12.0, angular >=4.0.0-beta <5.0.0-alpha is incompatible with
build_web_compilers >=0.2.1.
So, because JRapha depends on both angular ^4.0.0 and build_web_compilers ^0.3.6, version solving
failed.
Is there a solution to running AngularDart4 with Dart v2?

No, it is not compatible.
Only AngularDart v5 is compatible with Dart2 and build_runner.

Related

Dart Webdev Dev Compiler not running since upgrade to 2.3.2

Since I have moved from Dart 2.1.0 to 2.3.2 "webdev serve" runs successfully, but when I run the project, it gets a 404 on "main.digests". I updated my dev dependencies of build_runner, build_web_compiler, and webdev to the latest versions, and the issue still occurs.
It still builds in dart2js fine. Even if it is "webdev serve --release" it works.
Here is a copy of my pubspec:
environment:
sdk: '>=2.3.2 <3.0.0'
dependencies:
analyzer: any
intl: any
stagexl: 1.4.0+2
stagexl_particle: ^0.4.0
uuid: ^1.0.3
dependency_overrides:
stagexl:
git: https://github.com/AndrewLugg/StageXL.git
dev_dependencies:
build_runner: ^1.6.1
build_web_compilers: ^2.1.1
webdev: ^2.2.0
and here is my build.yaml
targets:
$default:
builders:
build_web_compilers|entrypoint:
generate_for:
- web/app/**.dart
options:
dart2js_args:
- --fast-startup
- --no-source-maps
- --show-package-warnings
- --trust-primitives
- --trust-type-annotations
- --omit-implicit-checks
Here is a copy of the error:
http://localhost:53322/webdev/src/serve/injected/client.js:2693
GET http://localhost:53322/app/main.digests 404 (Not Found)
Uncaught Instance of 'minified:b0' client.js:367
Any help would be greatly appreciated.
This problem disappeared once we upgraded to Dart SDK 2.5.2, there was no real explanation to why this happened.

How to add a swagger dependency in pubspec.yaml of flutter

I'm a new developers with flutter, and i want to use "swagger" in my application. I add the dependencies of swagger in pubspec.yaml, but there's always an error.
pubspec.yaml:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
english_words: ^3.1.0
swagger: ^1.0.0
when i clicked Packages get, this is the following output:
Running "flutter packages get" in my_first_app...
Because my_first_app depends on swagger ^1.0.0 which doesn't match any versions, version solving failed.
pub get failed (1)
Process finished with exit code 1
How can i use swagger in my Flutter application?
You probably should use instead
open_api: ^2.0.1
swagger is deprecated and not compatible with Dart 2 and the requested version 1.0.0 doesn't exist at all.
From https://pub.dartlang.org/packages/swagger#-readme-tab-

Error after running "flutter upgrade"

I am getting the following error after running flutter upgrade:
Because every version of flutter_test from sdk depends on path 1.5.1 and flutter_advanced_networkimage >=0.2.9+1 depends on path ^1.6.0, flutter_test from sdk is incompatible with flutter_advanced_networkimage >=0.2.9+1.
So, because testapp depends on both flutter_advanced_networkimage ^0.2.10 and flutter_test any from sdk, version solving failed.
pub upgrade failed (1)
My pubspec.yaml:
name: testapp
description: A new Flutter application.
dependencies:
flutter:
sdk: flutter
device_info: "^0.2.0"
shared_preferences: "^0.4.1"
flutter_parallax: "^0.1.1"
cached_network_image: "^0.4.1"
connectivity: "^0.3.1"
chewie: "^0.6.0"
flutter_statusbarcolor: "^0.0.3"
fluro: "^1.3.1"
carousel_slider: "^0.0.4"
flutter_advanced_networkimage: "^0.2.10"
flutter_sticky_header: "^0.3.0"
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
I'm trying to get it working for hours, please help
I assume you are using the beta channel.
I think this doesn't happen in dev channel.
To switch to the dev channel run in a command line shell
flutter channel dev
flutter doctor
and try again.
I've had similar problems. My problem like this:
Because every version of flutter_test from sdk depends on http 0.12.0
and flutter_cache_manager 0.1.2 depends on http ^0.11.3+14,
flutter_test from sdk is incompatible with flutter_cache_manager
0.1.2. And because no versions of flutter_cache_manager match >0.1.2 <0.2.0, flutter_test from sdk is incompatible with
flutter_cache_manager ^0.1.2.
Here's how I solved it:
dependencies:
...
dependency_overrides:
http: ^0.12.0
so, I thank you can try it:
dependencies:
...
dependency_overrides:
path: ^1.6.0

Problems with Dart sqljocky

I want to use Dart in future for developing because its very functionally.
Ive started a Project but I am getting errors if i am impporting mysqljocky.
name: WebInterface
description: A web app for the popular minecraft plugin
version: 0.0.1
#homepage: https://www.example.com
#author: LarsE <email#example.com>
environment:
sdk: '>=1.24.0 <2.0.0'
dependencies:
angular: ^4.0.0
angular_components: ^0.8.0
sqljocky: ^0.14.1
dev_dependencies:
angular_test: ^1.0.0
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
test: ^0.12.0
transformers:
- angular:
entry_points:
- web/main.dart
- test/**_test.dart
- test/pub_serve:
$include: test/**_test.dart
- dart_to_js_script_rewriter
# Uncomment the following in sdk 1.24+ to make pub serve
# use dartdevc (webdev.dartlang.org/tools/dartdevc).
#web:
# compiler:
# debug: dartdevc
I am getting everytime this error:
Working dir: E:\WebAuction\WebInterface
"C:\Program Files\Dart\dart-sdk\bin\pub.bat" get
Resolving dependencies...
Package dart_style has no versions that match >=0.2.10 <2.0.0 derived from:
- angular 4.0.0 depends on version >=0.1.8 <2.0.0
- code_builder 1.0.3 depends on version >=0.2.10 <2.0.0
Process finished with exit code 1
You can't access MySQL from code running in the browser.
This is why this attempt causes an error message.
This is not related to Dart, but how SQL databases work.
You need to expose a REST API or similar on a server that forwards queries and commands to the database running on the server.
Dart server frameworks like Aqueduct, Angel, Jaguar, Shelf, can be used for that, but the server doesn't need to be written in Dart. There are lots of other solutions.
From Angular you can access the REST API using HTTP requests.

About AngularDart, How to solve angular_router: ^2.0.0-alpha incompatibility with angular 5.0.0-alpha?

Today I started trying advice from #matanlurey in git#676 (https://github.com/dart-lang/angular/issues/676). In my project pubspec.yaml file:
environment:
sdk: '>=1.24.0 <2.0.0'
dependencies:
angular: ^5.0.0-alpha
angular_components: ^0.9.0-alpha
angular_forms: ^1.0.1-alpha
angular_router: ^2.0.0-alpha
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
sass_builder: ^1.0.0
but Resolving dependencies...
Incompatible version constraints on angular:
- angular_components 0.9.0-alpha depends on version 5.0.0-alpha
- angular_forms 1.0.1-alpha depends on version ^5.0.0-alpha
- angular_router 2.0.0-alpha depends on version ^4.0.0
- huastecappadmin depends on version ^5.0.0-alpha
Process finished with exit code 1
Any Idea?
You can try to add
dependency_overrides:
angular: ^5.0.0-alpha
but it might not work.
In this case you'd need to wait until an update for angular_router that is compatible with Angular 5 is released.
See also https://github.com/dart-lang/angular/issues/676

Resources