Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter error with dart:mirrors #6

Open
stephane-segning opened this issue May 21, 2021 · 1 comment
Open

Flutter error with dart:mirrors #6

stephane-segning opened this issue May 21, 2021 · 1 comment

Comments

@stephane-segning
Copy link

stephane-segning commented May 21, 2021

I want to use rsocket with my Flutter App.

Expected Behavior

I shall import shelf normally

import 'package:rsocket/shelf.dart';

Actual Behavior

Simply importing this library in a Flutter project causes problem.

import 'dart:mirrors';

So as this library is using it inside route, Flutter crashes.

Steps to Reproduce

To reproduce it, just import the library inside a Flutter project:

import 'package:rsocket/shelf.dart';

Possible Solution

We might use reflectable instead of dart:mirrors as said in the Library here.

Your Environment

rsocket: ^0.1.2
Flutter 2.0.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 1d9032c7e1 (3 weeks ago) • 2021-04-29 17:37:58 -0700
Engine • revision 05e680e202
Tools • Dart 2.12.3

@amondnet
Copy link

@stephane-segning

//import 'package:rsocket/shelf.dart';
import 'package:rsocket/payload.dart';
import 'package:rsocket/rsocket_connector.dart';

void main() async {
  var rsocket =
  await RSocketConnector.create().connect('tcp://127.0.0.1:42252');

  var result = await rsocket.requestResponse!(Payload.fromText('text/plain', 'Ping'));
  print(result.getDataUtf8());
  /* rsocket.requestStream(Payload.fromText('Ping', '')).listen((payload) {
    print(payload.getDataUtf8());
  }, onDone: () {
    print('done');
  });*/
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants