Pass Parameter to channel.invokeMethod

213 views
Skip to first unread message

rubFlutter

unread,
Feb 22, 2020, 4:55:43 PM2/22/20
to Desktop Embedding for Flutter
Hi all,
I'm using the `window_size` and I'm stuck on how to pass parameters


This is my code:
await channel.invokeMethod('setWindowFrame');

Stuart Morgan

unread,
Feb 22, 2020, 5:53:16 PM2/22/20
to rubFlutter, Desktop Embedding for Flutter
If you want to learn how invokeMethod works, the MethodChannel API docs or any of the many articles about Flutter plugin development would be the best place to start; nothing about the Dart side is desktop-specific.

If you want examples of using the window_size channel in particular, the implementation of the plugin's Dart API is right there. But that raises the real question: why are you trying to call the method channel directly instead of using the API?

-Stuart

--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-desktop-embedding-dev/e5796619-5f6c-438a-a5e0-c949ebd73b85%40googlegroups.com.

rubFlutter

unread,
Feb 22, 2020, 7:53:51 PM2/22/20
to Desktop Embedding for Flutter
My mistake, I found out how to use this plugin (I hope)
Is this correct?

  setWindowTitle('My App Title');
 
final ret = await getWindowInfo();
 
print(ret.frame.width.toString());
  setWindowMaxSize
(Size(800, 600)); <-- ERROR


By the way, why Am I getting this error in the line above?

[
ERROR:c:\b\s\w\ir\cache\builder\src\flutter\lib\ui\ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method setWindowMaximumSize on channel flutter/windowsize)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
<asynchronous suspension>
#1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
#2      WindowSizeChannel.setWindowMaxSize (package:conferenciacartao/shared/src/window_size_channel.dart:170:28)    
#3      setWindowMaxSize (package:conferenciacartao/shared/src/window_size_utils.dart:60:30)
#4      main (package:conferenciacartao/main.dart:66:3)
<asynchronous suspension>
#5      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:240:25)
#6      _rootRun (dart:async/zone.dart:1126:13)
#7      _CustomZone.run (dart:async/zone.dart:1023:19)
#8      _runZoned (dart:async/zone.dart:1518:10)
#9      runZoned (dart:async/zone.dart:1502:12)
#10     _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:232:5)
#11     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)
#12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)


Em sábado, 22 de fevereiro de 2020 18:53:16 UTC-4, Stuart Morgan escreveu:
If you want to learn how invokeMethod works, the MethodChannel API docs or any of the many articles about Flutter plugin development would be the best place to start; nothing about the Dart side is desktop-specific.

If you want examples of using the window_size channel in particular, the implementation of the plugin's Dart API is right there. But that raises the real question: why are you trying to call the method channel directly instead of using the API?

-Stuart

On Sat, Feb 22, 2020 at 1:55 PM rubFlutter <solu...@gmail.com> wrote:
Hi all,
I'm using the `window_size` and I'm stuck on how to pass parameters


This is my code:
await channel.invokeMethod('setWindowFrame');

--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embedding-dev+unsub...@googlegroups.com.

Stuart Morgan

unread,
Feb 22, 2020, 10:27:31 PM2/22/20
to rubFlutter, Desktop Embedding for Flutter
On Sat, Feb 22, 2020 at 4:53 PM rubFlutter <solu...@gmail.com> wrote:
  setWindowMaxSize(Size(800, 600)); <-- ERROR

By the way, why Am I getting this error in the line above?

ERROR:c:\b\s\w\ir\cache\builder\src\flutter\lib\ui\ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method setWindowMaximumSize on channel flutter/windowsize)
 
Minimum and maximum size aren't implemented for Windows yet; see https://github.com/google/flutter-desktop-embedding/issues/483.

-Stuart
Reply all
Reply to author
Forward
0 new messages