I have a project that i am trying to connect to graphql API in flutter and I have tried installing the graphql flutter package and i am getting the below error when i attempt building the project. I have tried playing the sdk versions but all the same error
Writing result bundle at path:
/var/folders/71/5s_xdvm50d1bcj4q8zf_41j40000gp/T/flutter_tools.l4Y5sf/flutter_ios_build_temp_dir1J1YUm/t
emporary_xcresult_bundle
../../flutter/.pub-cache/hosted/pub.dartlang.org/graphql-5.1.2/lib/src/links/websocket_link/websocket_cli
ent.dart:577:7: Error: The non-abstract class 'GraphQLWebSocketChannel' is missing implementations for
these members:
- WebSocketChannel.ready
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class GraphQLWebSocketChannel extends StreamChannelMixin<dynamic>
^^^^^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-2.3.0/lib/src/channel.dart:56:22:
Context: 'WebSocketChannel.ready' is defined here.
final Future<void> ready = Future.value();
^^^^^
Failed to package /Users/nazehabel/mobile-projects/aysquared.
Command PhaseScriptExecution failed with a nonzero exit code
note: Building targets in dependency order
my install version is graphql-5.1.1
and I keep seeing it referenced error from the graphql-5.1.2
version and it's the same thing happening for graphql_flutter: ^5.1.0
which throws the same error referencing the graphql_flutter: ^5.1.2
from my local cache pubspec and i was wondering what i need to change to get one of them work with the right version not referencing a different cache version.
Below is my pubspec.yaml
description: A new Flutter project.
module:
androidX: true
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0
environment:
sdk: '>=2.17.5 <4.0.0'
flutter: '>=2.5.3 <3.0.0'
dependencies:
cupertino_icons: ^1.0.2
dio: ^4.0.6
file_picker: ^5.2.4
flutter:
sdk: flutter
flutter_dotenv: ^5.0.2
flutter_riverpod: ^2.0.2
flutter_screenutil: ^5.6.0
flutter_secure_storage: ^7.0.1
flutter_smart_dialog: ^4.8.0
flutter_spinkit: ^5.1.0
flutter_svg: ^1.1.6
freezed: ^2.2.1
freezed_annotation: ^2.2.0
get_it: ^7.2.0
hooks_riverpod: ^2.1.1
image_picker: ^0.8.6
intl: ^0.17.0
intl_phone_number_input: ^0.7.1
oktoast: ^3.3.1
provider: ^6.0.5
riverpod_annotation: ^1.0.4
sliding_up_panel: ^2.0.0+1
timer_count_down: ^2.2.1
url_launcher: ^6.1.7
visibility_detector: ^0.3.3
syncfusion_flutter_charts: ^20.4.42
syncfusion_localizations: ^20.4.42
desktop_window: ^0.4.0
localization: ^2.1.0
flutter_localizations:
sdk: flutter
fl_chart: ^0.55.2
percent_indicator: ^4.2.2
charts_flutter: ^0.12.0
pinput: ^2.2.21
google_fonts: ^3.0.1
dropdown_button2: ^1.9.2
dotted_line: ^3.1.0
flutter_staggered_grid_view: ^0.6.2
trash_themes: ^0.0.2
graphql: ^5.1.1
graphql_flutter: ^5.1.0
flutter_native_splash:
android: true
ios: true
image: assets/images/logo-white.png
android_gravity: center
ios_content_mode: center
color: "#FFFFFF"
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: ^2.3.2
riverpod_generator: ^1.0.4
flutter_native_splash: ^2.1.6
flutter_lints: ^2.0.0
flutter:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
# - assets/images
- .env
- assets/images/
- assets/images/categories_images/
- assets/images/grocery_images/
- assets/images/beverages_images/
- assets/icons/
- assets/icons/account_icons/
- assets/fonts/
fonts:
- family: Gilroy
fonts:
- asset: assets/fonts/gilroy/Gilroy-Regular.ttf
- asset: assets/fonts/gilroy/Gilroy-SemiBold.ttf
- asset: assets/fonts/gilroy/Gilroy-Bold.otf
I have tried following the solution here graphql_flutter Error: The non-abstract class 'GraphQLWebSocketChannel' is missing implementations and pod deintegrate
,pod install
, flutter clean
, flutter pub cache repair
, etc and none of it didn't work for me either