Skip to content

Conversation

@recepkoseoglu
Copy link

No description provided.

@joncevski-saso
Copy link

I get an error:
../lib/src/remote_frame_buffer_client_isolate.dart:89:5: Error: No named parameter with the name 'timeout'.
timeout: initMessage.timeout,
^^^^^^^
if I comment out the timeout then it works.

Copy link
Owner

@Goddchen Goddchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I'd also suggest to issue PRs that only tackle one feature / bug / issue per PR. Makes the whole process easier.

),
),
(final SendPort sendPort) {
num x = details.localPosition.dx /
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
num x = details.localPosition.dx /
final num x = details.localPosition.dx /

num x = details.localPosition.dx /
_remoteFrameBufferWidgetSize.width *
_image.width;
num y = details.localPosition.dy /
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
num y = details.localPosition.dy /
final num y = details.localPosition.dy /

),
),
(final SendPort sendPort) {
num x = details.localPosition.dx /
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
num x = details.localPosition.dx /
final num x = details.localPosition.dx /

num x = details.localPosition.dx /
_remoteFrameBufferWidgetSize.width *
_image.width;
num y = details.localPosition.dy /
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
num y = details.localPosition.dy /
final num y = details.localPosition.dy /

);
}

void _rawKeyEventListener(final RawKeyEvent rawKeyEvent) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format: I prefer those one-liners to be expression methods.

hostname: initMessage.hostName,
password: initMessage.password.toNullable(),
port: initMessage.port,
timeout: initMessage.timeout,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: the current client implementation does not have a timeout parameter. Are you planing on creating a PR in that project as well?

required final String hostName,
required final Option<String> password,
required final int port,
required final Duration? timeout,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I want to avoid all null-aware code in this package. My suggestion would be to make this an Option<Duration> instead.

final Option<String> _password;
final int _port;
final Option<ValueNotifier<Map<String, dynamic>>> _keyEventNotifier;
final Option<bool> _monitorClipBoard;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: can't this be a simple bool? Makes the using code a lot shorter and more readable as well.

final void Function(Object error)? onError,
final String? password,
final int port = 5900,
final ValueNotifier<Map<String, dynamic>>? keyEventNotifier,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: is it a usecase that you need right now? Knowing from outside of this widget, which keys are being pressed? I'd expect that you would just add a surrounding RawKeyboardListener widget (https://api.flutter.dev/flutter/widgets/RawKeyboardListener-class.html) to achieve this.

(final ValueNotifier<Map<String, dynamic>> notifier) {
final Map<String, dynamic> event = notifier.value;
final LogicalKeyboardKey keyboardKey = event['keyboardKey'];
sendPort.send(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: aren't we sending key events twice now?

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

Successfully merging this pull request may close these issues.

3 participants