go-flutter simpleDemo issues on stable

Created on 1 Apr 2019  Â·  10Comments  Â·  Source: go-flutter-desktop/go-flutter

Flutter version

Flutter 1.2.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8661d8aecd (6 weeks ago) • 2019-02-14 19:19:53 -0800
Engine • revision 3757390fa4
Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

Steps to Reproduce

  1. ~/code/go-flutter/example/simpleDemo$ go build main.go
  2. ~/code/go-flutter/example/simpleDemo$ ./main

image

I ran the simpleDemo with flutter stable on macOS 10.14.4. Clicking on the button doesn't increase the button count. Clicking into the textfields doesn't allow text input.

image

Does go-flutter only work with the beta version of flutter?

bug

Most helpful comment

I haven't looked at the code, but the click behaviors described here sound like the kinds of things that happen when the scaling for drawing and the scaling for mouse input don't match, FWIW.

All 10 comments

The stocks app has warnings:

~/code/go-flutter/example/stocks$ ./main
go-flutter: ApplicationWindowDimension is deprecated, use WindowInitialDimensions(x, y).
[ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(89)] Could not create a resource context for async texture uploads. Expect degraded performance. Set a valid make_resource_current callback on FlutterOpenGLRendererConfig.
[ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(89)] Could not create a resource context for async texture uploads. Expect degraded performance. Set a valid make_resource_current callback on FlutterOpenGLRendererConfig.
flutter: Observatory listening on http://127.0.0.1:50300/
go-flutter: no method handler registered for method 'SystemChrome.setSystemUIOverlayStyle' on channel 'flutter/platform'
go-flutter: no method handler registered for method 'SystemSound.play' on channel 'flutter/platform'
go-flutter: failed to pop route after escape key press: failed to decode envelope: unexpected end of JSON input
go-flutter: no method handler registered for method 'HapticFeedback.vibrate' on channel 'flutter/platform'

I can click into a stock, however clicking the back button doesn't return to the main screen. After pressing esc, I land on the main screen however the only widget responsive to clicks are the stocks. portfolios, the plus button, and the hamburger menu don't respond to clicks.

When I click and hold on a stock, the wrong stock is selected. After clicking and holding on AAIT, AAME is purchased (two stocks down). AAOI is even further off, that purchases AAOJ
image

The sample from https://github.com/google/flutter-desktop-embedding works as expected. Button clicks increase the counter. Text input is functional.
image

There are two issues:

I ran the simpleDemo with flutter stable on macOS 10.14.4. Clicking on the button doesn't increase the button count. Clicking into the textfields doesn't allow text input.

  • In the simpleDemo, a demo plugin is registered: manualInputPlugin. This plugin blocks the main thread. Until a number is typed in the console, the simpleDemo will not update its view.
    @GeertJohan should we handle the getNumber function in a goroutine?

When I click and hold on a stock, the wrong stock is selected. After clicking and holding on AAIT, AAME is purchased (two stocks down). AAOI is even further off, that purchases AAOJ

  • There is an offset in the glfw MouseButtonCallback?? (A bit surprised)
    The stock demo is rarely updated, @GeertJohan should we delete the stock demo?

Does go-flutter only work with the beta version of flutter?

Development and Testing are made on the beta channel, but go-flutter should work with the stable channel.

The manualInputPlugin shouldn't block the main thread anymore, as method calls are now handled concurrently from the main thread, so the blocking wait for input is in a different goroutine and different thread.

Concerning examples: I'd like to move both examples into their own repository and keep them maintained. Thoughts @Drakirus?

There can be breaking differences between stable and beta channels of flutter. It's best to stick with the beta channel for go-flutter for now.

After pulling the repo, the manualInputPlugin isn't blocking the main thread, and the first issue described disappear.
@bootstraponline can you please try to update go-flutter to the latest revision, and tell us if the issue persists. (Using the both flutter's stable and beta channels).

As for the examples, moving them in their own repo is a good idea.

I pulled master and tried both the stable/beta channel. Pushing the plus button doesn't do anything.

I haven't looked at the code, but the click behaviors described here sound like the kinds of things that happen when the scaling for drawing and the scaling for mouse input don't match, FWIW.

@stuartmorgan thanks for the help!
@bootstraponline can you try the fix/ScreenScalingMouseEvent branch ?

Auch, yes the scaling is applied twice.
The fix/ScreenScalingMouseEvent branch is bugged as well, the calculation that remains is wrong.

float64(widthPx / width) vs float64(widthPx) / float64(width)

I've pushed a fix to master, it has no regressions on desktops where pixel to screencoordinates ratio == 1, which is most of the cases. But I cannot test if the fix properly works for you, @bootstraponline, so I'll leave this issue open until we have confirmation.

It works!! Thanks for fixing.

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ohsory1324 picture ohsory1324  Â·  4Comments

ghost picture ghost  Â·  6Comments

MathiasDeWeerdt picture MathiasDeWeerdt  Â·  4Comments

lohnn picture lohnn  Â·  6Comments

atresnjo picture atresnjo  Â·  4Comments