Flutter graphql/graphql_flutter package throwing : The non-abstract class 'GraphQLWebSocketChannel' is missing implementations - flutter

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

Related

Flutter not able to build release version of application

flutter run works but flutter run --release or flutter run --release --profile returns the error below:
===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x0
version=2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "macos_simarm64"
pid=14192, thread=-1, isolate_group=isolate(0x7f910c011200), isolate=(nil)(0x0)
isolate_instructions=0, vm_instructions=0
Stack dump aborted because InitialRegisterCheck failed.
Dart snapshot generator failed with exit code -6
Here's my pubspec.yaml dependencies:
version: 1.0.0+1
environment:
sdk: ">=2.15.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_native_splash: ^2.1.6
table_calendar: ^3.0.8
image_stack: ^2.1.1
intl: ^0.17.0
shimmer: ^2.0.0
flutter_riverpod: ^1.0.4
auto_route: ^5.0.4
google_fonts: ^3.0.1
pinput: ^2.2.9
mask_text_input_formatter: ^2.3.0
firebase_core: ^1.21.1
dio: ^4.0.6
dio_cache_interceptor: ^3.2.7
dio_cache_interceptor_hive_store: ^3.1.1
http: ^0.13.5
enum_to_string: ^2.0.1
mobile_scanner: ^2.1.0
firebase_auth: ^3.3.19
image_picker: ^0.8.5+3
image_cropper: ^3.0.1
firebase_storage: ^10.2.18
fluttertoast: ^8.0.9
firebase_messaging: ^13.0.1
hive: ^2.2.1
hive_flutter: ^1.1.0
flutter_hooks: ^0.18.5+1
hooks_riverpod: ^1.0.4
local_auth: ^2.1.0
lottie: ^2.1.0
flutter_local_notifications: ^9.7.0
device_info_plus: ^4.0.1
timeago: ^3.2.2
url_launcher: ^6.1.5
focused_menu: ^1.0.5
rxdart: ^0.27.7
rate_my_app: ^1.1.3
infinite_scroll_pagination: ^3.2.0
flutter_offline: ^2.1.0
webview_flutter: ^4.0.1
shared_preferences: ^2.0.15
web_socket_channel: ^2.2.0
fl_chart: ^0.55.2
dev_dependencies:
#flutter_gen_runner:
auto_route_generator: ^5.0.2
firebase_core_platform_interface: ^4.5.1
build_runner: any
flutter_lints: ^2.0.1
flutter_launcher_icons: ^0.11.0
flutter_test:
sdk: flutter
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icons/b2b_logo.png"
flutter:
uses-material-design: true
generate: true
assets:
- assets/images/
- assets/
- assets/animations/
- assets/icons/
fonts:
- family: SnagIcons
fonts:
- asset: assets/fonts/SnagIcons.ttf</summary>
The application from 2 months ago was building successfully but as of last week, I have been getting this issue and reverting the changes i still get the same issue.
Try to switch to flutter dev channel and back to flutter stable.
Do a flutter clean and flutter pub get and try it again.
This occours because of the some updates in the packages
Try entering the below code in the vs code terminal:
flutter clean
flutter pub get
Your flutter code will work like a charm!
Edit:
There are github issues which address this,see if any works for you
https://github.com/flutter/flutter/issues/43707
https://github.com/flutter/flutter/issues/109818
https://github.com/flutter/flutter/issues/43597
So, after raising the issue on the flutter channel, the problem was caused by returning a late variable from a future method so there was a fix in the release of flutter 3.7 which will remedy this problem
You can view the issue here on GitHub

Failed to build build_runner:build_runner:

I'm trying to run flutter packages pub run build_runner build --delete-conflicting-outputs to generate freezed files but I'm getting this error.
Failed to build build_runner:build_runner:
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:258:50: Error: The property 'displayString' is defined in multiple extensions for 'TargetKind' and neither is more specific.
- 'TargetKind' is from 'package:meta/meta_meta.dart' ('../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart').
Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.
var kindNames = kinds.map((kind) => kind.displayString).toList()
^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:1950:14: Context: This is one of the extension members.
String get displayString {
^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart:91:14: Context: This is one of the extension members.
String get displayString {
^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:260:36: Error: The getter 'commaSeparatedWithOr' isn't defined for the class 'List<dynamic>'.
- 'List' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'commaSeparatedWithOr'.
var validKinds = kindNames.commaSeparatedWithOr;
^^^^^^^^^^^^^^^^^^^^
pub finished with exit code 1
I'm running this on M1 chip MacOS
Dart/Flutter SDK Version (dart --version) - 2.15.1 (stable)
What package(s) from this repo you are using, and the version - build_runner 1.11.5)
Here is my pubspec.yaml file
name: flutter_app
description: A new Flutter application.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.5+30
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
firebase_core: "^0.7.0" # ^1.0.1
firebase_messaging: "^8.0.0-dev.15"
bloc: ^6.1.1 # ^7.0.0-nullsafety.3
flutter_bloc: ^6.1.2 # ^7.0.0-nullsafety.5
google_fonts: ^1.1.1 # ^2.0.0
flutter_svg: ^0.19.1 # ^0.21.0-nullsafety.0
flutter_screenutil: ^4.0.2+3 # ^5.0.0-nullsafety.9
video_player: ^2.0.0
rudder_sdk_flutter: ^1.0.2
flutter_dotenv: ^5.0.2
easy_localization: ^2.3.0 # ^3.0.0
# Flare animations
flare_flutter: ^2.0.6 # ^3.0.0-nullsafety.0
# Overlays
flutter_portal: ^0.3.0 # ^0.4.0-nullsafety.0
# Charts
fl_chart: ^0.12.2 # ^0.20.1
table_calendar: ^2.3.3 # ^3.0.0-nullsafety.1
url_launcher: ^5.7.10 # ^6.0.2
flutter_inappwebview: ^4.0.0+4 # ^5.1.0+4
html: ^0.14.0+4 # ^0.15.0
permission_handler: ^5.1.0+2
# Flutter widget that can be expanded or collapsed by the user.
expandable: ^4.1.4 # ^5.0.1
infinite_listview: ^1.0.1+1 # - (Not coming)
social_embed_webview: ^0.3.1 # - (Not coming)
# Stepper
flutter_dash: ^0.0.1 # - (Not coming)
timelines: ^0.0.2+1 # - (Temporary git: https://github.com/areille/timelines/tree/null-safety)
scrollable_positioned_list: ^0.1.9 # ^0.2.0-nullsafety.0
shared_preferences: ^0.5.12+4 # ^^2.0.4
logger: ^1.0.0 # ^1.0.0-nullsafety.0
equatable: ^1.2.6 # ^2.0.0
uuid: ^2.1.0 # ^3.0.1
formz: ^0.3.2 # ^0.4.0-nullsafety.0
flutter_hooks: ^0.15.0 # ^0.16.0
hooks_riverpod: ^0.12.2 # ^0.13.1
smooth_page_indicator: ^0.2.1 # ^0.3.0-nullsafety.0
http: ^0.12.2 # ^0.13.0
retry: ^3.0.1 # ^3.1.0
flutter_local_notifications: ^4.0.1+2
freezed_annotation: ^0.12.0
# powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File downloading, Timeout etc
dio: ^3.0.10
# it's a type conversion dio client generator using source_gen and inspired by Chopper and Retrofit (android).
retrofit: ^1.3.4+1
json_serializable: ^3.5.1
json_annotation: ^3.1.1
# A collection of loading indicators animated with flutter
flutter_spinkit: ^4.1.2
fluro: ^1.7.8
rxdart: ^0.25.0
# to discover network connectivity
connectivity: ^2.0.2
flutter_offline: ^1.0.0
jwt_decoder: ^1.0.4
cupertino_icons: ^1.0.0 # 1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.8.0"
retrofit_generator: any
build_runner: any
freezed: any
analyzer: any
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/icon.jpg"
I tried specifying a version for analyzer in pubspec(0.40.7) and then it doesn't throw any error instead just get stuck in a loop and never stops.
Not sure what's wrong here. Any help would be great. Thanks!

how can I increase my flutter web performance and how can i remove leggence in my flutter web?

I build web application in flutter but the performance of my web application is too bad its not smooth its too much leggy what can I do to solve this problem?
give me suggestions
i also try many solutions but these are not working for my flutter web i also make release of my web that's also leggy like my deub mode.
my pub yaml file
name: doctor appointment
description: Oriel Research Therapeutics online services.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# firebase_core: "^0.7.0"
firebase_core: ^1.0.1
# firebase_auth: "^0.20.0+1"
firebase_auth: ^1.0.1
# flutter_signin_button: ^1.1.0
shared_preferences: ^2.0.5
cloud_firestore: ^1.0.4
firebase_storage: ^8.0.6
# The following adds the Cupertino Icons font to your application.
# Use with the Cupertino Icons class for iOS style icons.
cupertino_icons: ^1.0.1
flutter_custom_clippers: ^1.1.2
responsive_builder: ^0.1.2
# velocity_x: ^1.0.1
velocity_x: ^2.6.0
url_launcher: ^6.0.2
provider: ^4.3.2
footer: ^0.0.3
# youtube_player_iframe: ^1.2.0+2
carousel_slider: ^3.0.0
youtube_plyr_iframe: ^2.0.0
get: ^3.25.4
package_info: ^0.4.3+4
modal_progress_hud: ^0.1.3
equatable: ^2.0.0
file_picker: 3.0.0
dio: ^4.0.0
webview_flutter: ^1.0.0
# js: ^0.6.2
page_transition: "^1.1.7+6"
http:
flutter_credit_card: ^2.0.0
font_awesome_flutter: ^9.0.0
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/logos/
- assets/services/
- assets/team/
- assets/images/
Try the below Links. Helped me solve some performance issues by getting rid of page transitions.
https://medium.com/flutter/optimizing-performance-in-flutter-web-apps-with-tree-shaking-and-deferred-loading-535fbe3cd674
https://medium.com/flutter/improving-perceived-performance-with-image-placeholders-precaching-and-disabled-navigation-6b3601087a2b

How to get the matching version of shared preferences, upgradder and other packages?

I have a problem on matters upgrader, it's seems i can't build my apps when it come to difference version off package
here is the problem
Running "flutter pub get" in Mobile7Merge...
Because requests 3.3.0 depends on shared_preferences ^0.5.2 and no versions of requests match >3.3.0 <4.0.0, requests ^3.3.0 requires shared_preferences ^0.5.2.
So, because mobile7 depends on both requests ^3.3.0 and shared_preferences ^2.0.3, version solving failed.
pub get failed (1; So, because mobile7 depends on both requests ^3.3.0 and shared_preferences ^2.0.3, version solving failed.)
here is my pubspec.yaml
name: mobile7
description: Mobile 7
version: 1.0.0+1
environment:
sdk: ">=2.5.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.1
lazy_load_scrollview: ^1.1.0
flutter_appauth: ^0.9.1
flutter_secure_storage: ^3.3.3
fl_chart: ^0.10.1
flutter_datetime_picker: ^1.3.8
intl: ^0.16.1
google_nav_bar: ^2.2.0
line_icons: ^0.2.0
google_fonts: ^1.1.0
equatable: ^1.2.5
bloc: ^6.0.3
flutter_bloc: ^6.0.5
rxdart: ^0.23.1
expandable: ^4.1.4
jiffy: ^3.0.1
requests: ^3.3.0
flutter_html: ^1.0.0
webview_flutter: any
flutter_downloader: ^1.4.4
path_provider: ^1.6.24
permission_handler: ^5.0.1
fluttertoast: ^7.1.1
# flutter_cached_pdfview: ^0.3.0
# flutter_pdfview: ^1.0.0+10
upgrader: ^3.0.0
dio: any
advance_pdf_viewer: ^1.2.0
pinch_zoom: ^0.0.4
dart_date: ^1.0.7
flutter_inappwebview: ^4.0.0+4
shared_preferences: ^2.0.3
# shared_preferences: ^0.5.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- images/
I thought to have two package at the same time, that is 2.0.3 and 0.5.2 but either any of them have solve my problem, i tried to search if i can use two package with the same name but mainly, thos shared_preference are inside request package and upgrader package, i tried to include there on my own
How can i solve this??
Managing dependencies can be a pain some times but I have found this commands can be useful:
flutter pub outdated https://dart.dev/tools/pub/cmd/pub-outdated
flutter pub upgrade --major-versions https://dart.dev/tools/pub/cmd/pub-upgrade#--major-versions

Invalid plugin specification moor_ffi Cannot find the `flutter.plugin.platforms` key in the `pubspec.yaml`

I upgraded flutter to the latest version and now everytime I try build I get this error.
Invalid plugin specification moor_ffi.
Cannot find the flutter.plugin.platforms key in the pubspec.yaml file. An instruction to format the pubspec.yaml
can be found here: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms
I'm not quite sure how to go about fixing this since there isn't much online about this error and I only started using flutter in the past couple of days.
Here is my pubspec.yaml file
name: pattle
description: An easy to use Matrix app.
environment:
sdk: ">=2.6.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
matrix_sdk: ^0.33.0+1
async: ^2.3.0
bloc: ^3.0.0
flutter_bloc: ^3.2.0
provider: ^4.0.1
equatable: ^1.0.1
intl: ^0.17.0
cached_network_image: ^2.2.0+1
flutter_cache_manager: ^1.1.3
path_provider: ^1.6.5
path: ^1.6.4
sentry: ^3.0.1
device_info: ^0.4.1+1
package_info: ^0.4.0+5
# TODO: Use official package when PR is merged
flutter_html:
git:
url: https://github.com/pattle-org/flutter_html.git
ref: 71406a09f9e591f9d35635e6a086007ccc678ae3
flutter_dotenv: ^2.0.1
transparent_image: ^1.0.0
photo_view: ^0.4.2
url_launcher: ^5.1.0
image_picker: ^0.6.1+3
image: ^2.1.4
mime: ^0.9.6+3
shared_preferences: ^0.5.3+4
mdi: ^2.0.0
shimmer: ^1.1.0
flutter_svg: ^0.17.3+1
animations: ^1.0.0+5
characters: ^1.1.0
vibration: ^1.2.4
video_player: '>=0.10.11+1 <2.0.0'
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
firebase_core: ^0.4.0+9
firebase_messaging: ^6.0.13
flutter_local_notifications: ^0.8.4
dependency_overrides:
moor_ffi: 0.5.0
intl: 0.17.0-nullsafety.2
dev_dependencies:
flutter_launcher_icons: ^0.7.2+1
flutter_test:
sdk: flutter
effective_dart: ^1.2.1
intl_translation: ^0.17.9
flutter_icons:
android: true
ios: true
image_path_android: "assets/logo/launcher.png"
image_path_ios: "assets/logo/launcher_full.png"
adaptive_icon_background: "#aa4139"
adaptive_icon_foreground: "assets/logo/launcher_foreground.png"
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
assets:
- .env
- assets/logo/logo.svg
fonts:
- family: CreteRound
fonts:
- asset: assets/fonts/crete_round_regular.ttf
- asset: assets/fonts/crete_round_italic.ttf
style: italic
Any ideas what is causing this?
This may be the answer
https://github.com/simolus3/moor/issues/727#issuecomment-662935493
But I'm not sure what this person means by
add a dependency on the new sqlite3_flutter_libs package
drop the moor_ffi dependency and replace imports with the new package:moor/ffi.dart library
Since I'm very new to flutter
flutter clean; pubdev get
worked for me