When I try to add dependencies in the pubspec.yaml file in flutter web I get an error when trying the
pub get command:
[retgoo_internal] pub get Resolving dependencies... Because every version of aiframework depends on flutter any from sdk which is forbidden, aiframework is forbidden. So, because retgoo_internal depends on aiframework ^1.0.7+12, version solving failed. Flutter users should run `flutter packages get` instead of `pub get`.
and my pubspec.yaml
name: retgoo_internal description: An app built using Flutter for web environment: # You must be using Flutter >=1.5.0 or Dart >=2.3.0 sdk: '>=2.3.0 <3.0.0' dependencies: aiframework: ^1.0.7+12 flutter_web: any flutter_web_ui: any http: any dev_dependencies: build_runner: ^1.4.0 build_web_compilers: ^2.0.0 pedantic: ^1.0.0 dependency_overrides: flutter_web: git: url: https://github.com/flutter/flutter_web path: packages/flutter_web flutter_web_ui: git: url: https://github.com/flutter/flutter_web path: packages/flutter_web_ui
Solution 1: Abbas.M
try changing dependencies to:
dependencies: aiframework: ^1.0.7+12 flutter_web: flutter_web_ui: http:
Solution 2: Mahmoud Salah Eldin
It is not supported yet in flutter web like some packages but only way to solve this problem by take package' source code from github, take codes inside lib file inside package and put it in your project then fix errors may happen inside files by change path import to: import 'package:flutter_web/material.dart'; and some more changes may need to do it.
it worked 100% and so easy :)