Flutter on desktop?

2,010 views
Skip to first unread message

Mark McLaren

unread,
Sep 16, 2017, 10:02:57 PM9/16/17
to Flutter Dev
The Flutter FAQ says:

Can I use Flutter to build desktop apps?
We are focused on mobile-first use cases. However, Flutter is open source and we encourage the community to use Flutter in a variety of interesting ways.

Does anyone know of a project focused on getting Flutter to run on desktop operating systems?  That is, being able to compile a Flutter app to a Windows or MacOS desktop application?

Thanks

Adam Barth

unread,
Sep 16, 2017, 11:09:17 PM9/16/17
to Mark McLaren, Flutter Dev
There's some work going on to create an embedding API, which will make it easier to embed the Flutter engine in other platforms.  That work will probably be useful for bringing up the engine on WIndows and MacOS.  However, I'm not aware of any projects focused specifically on bringing Flutter to Windows or MacOS at the moment.

Adam

Ian Hickson

unread,
Sep 16, 2017, 11:14:22 PM9/16/17
to Adam Barth, Mark McLaren, Flutter Dev
There's two areas of work that would be needed to make Flutter work on a new kind of platform. One part of the work is in the engine, which is C++, and involves hooking up the engine to the new platform (speaking to Windows or macOS APIs, compiling the engine to run on those platforms, etc). The other part is making the framework be able to handle the conventions of that platform (e.g. implementing Windows widgets, or handling clicking a mouse or typing on a physical keyboard, etc). Currently neither the engine nor the framework are intended to work well on desktop, because we are focused on making a good mobile experience.

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

--
Ian Hickson

😸

Joe Blue

unread,
Sep 17, 2017, 12:56:34 AM9/17/17
to Flutter Dev
Can you add URLs to the relevant code please. This looks like a great idea but knowing where to start would be great.

Also Fuscia ( spelling ) supports flutter and so looking at the Fuscia code that is based on Lincoln see might help.
I think android 8.0 made the move to libc too if I recall.

Adam Barth

unread,
Sep 17, 2017, 2:19:25 AM9/17/17
to Joe Blue, Flutter Dev
On Sat, Sep 16, 2017 at 9:56 PM Joe Blue <joeb...@gmail.com> wrote:
Can you add URLs to the relevant code please. This looks like a great idea but knowing where to start would be great.

Mark McLaren

unread,
Sep 17, 2017, 9:10:48 AM9/17/17
to Ian Hickson, Adam Barth, Flutter Dev
Hi Ian,

Thanks for your response.  On MacOS the Flutter engine can run the Flutter test suite in 'headless' mode so it seems you have already done *some* of the work of integrating with a desktop OS.

To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--

--
Ian Hickson

😸

Joe Blue

unread,
Sep 18, 2017, 6:38:35 AM9/18/17
to Mark McLaren, Ian Hickson, Adam Barth, Flutter Dev
Hey Ian, Mark

Thanks for the link,

Are there any  instructions for running headless on OSX anywhere ? 

Also its a hack but i am curiosu if anyone has tried the old ARC approach ?

Google no longer supports them as Chrome Apps.




To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--

--
Ian Hickson

😸

--
You received this message because you are subscribed to a topic in the Google Groups "Flutter Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flutter-dev/Dnau_zk-TaE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flutter-dev...@googlegroups.com.

Ian Hickson

unread,
Sep 18, 2017, 1:21:05 PM9/18/17
to Joe Blue, Mark McLaren, Adam Barth, Flutter Dev
"headless" is what we call the engine that runs when you run "flutter test".

Joe Blue

unread,
Sep 19, 2017, 6:45:45 AM9/19/17
to Ian Hickson, Mark McLaren, Adam Barth, Flutter Dev
ah ok.

Wil have a play then and see how i go.

Anatoly Pulyaevskiy

unread,
Nov 16, 2017, 3:24:26 AM11/16/17
to Flutter Dev
Hi everyone.

I'm looking for some help embedding Flutter in a macOS app.
What I have so far:
1. GLFW (3.3, latest)
2. Built engine, took FlutterEmbedder.framework
3. Created xcode project. Added GLFW and FlutterEmbedder to libs

Everything builds, but when I run the app I get a runtime error: EXC_BAD_ACCESS on initializing of ResourceMapping, it seems.
Actual resource is icudtl.dat (included in the FlutterEmbedder.framework)

Not sure how to troubleshoot this error and wondering if anyone can help with this?

Full stack trace is below:

#1 0x0000000100342be3 in std::__1::char_traits<char>::length(char const*) at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/__string:217
#2 0x00000001003b6058 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(char const*) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/string:1571
#3 0x00000001003b6023 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(char const*) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/string:1569
#4 0x00000001003b6003 in fml::ResourceMappingDarwin::ResourceMappingDarwin(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/platform/darwin/resource_mapping_darwin.mm:12
#5 0x00000001003b613b in fml::ResourceMappingDarwin::ResourceMappingDarwin(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/platform/darwin/resource_mapping_darwin.mm:12
#6 0x000000010039d192 in std::__1::__unique_if<fml::ResourceMappingDarwin>::__unique_single std::__1::make_unique<fml::ResourceMappingDarwin, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/memory:3026
#7 0x000000010039d158 in fml::GetResourceMapping(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/mapping.cc:39
#8 0x000000010039bf2d in fml::icu::ICUContext::SetupMapping(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/icu_util.cc:39
#9 0x000000010039ba89 in fml::icu::ICUContext::ICUContext(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/icu_util.cc:24
#10 0x000000010039b80b in fml::icu::ICUContext::ICUContext(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/icu_util.cc:23
#11 0x000000010039b704 in fml::icu::InitializeICUOnce(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/icu_util.cc:92
#12 0x000000010039d006 in fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0::operator()() const at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/icu_util.cc:99
#13 0x000000010039cfb9 in decltype(std::__1::forward<fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0>(fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0&&) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/type_traits:4323
#14 0x000000010039cfa8 in void std::__1::__call_once_param<std::__1::tuple<fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0&&> >::__execute<>(std::__1::__tuple_indices<>) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/mutex:621
#15 0x000000010039cf86 in std::__1::__call_once_param<std::__1::tuple<fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0&&> >::operator()() [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/mutex:613
#16 0x000000010039cf86 in void std::__1::__call_once_proxy<std::__1::tuple<fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0&&> >(void*) at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/mutex:649
#17 0x00007fff5f54336e in std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) ()
#18 0x000000010039b9d0 in void std::__1::call_once<fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0>(std::__1::once_flag&, fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0&&) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/mutex:666
#19 0x000000010039b8c4 in fml::icu::InitializeICU(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/fml/icu_util.cc:98
#20 0x000000010078d6ec in shell::Shell::InitStandalone(fxl::CommandLine, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/shell/common/shell.cc:85
#21 0x000000010034509c in FlutterEngineRun::$_1::operator()() const at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/shell/platform/embedder/embedder.cc:143
#22 0x0000000100344e79 in decltype(std::__1::forward<FlutterEngineRun::$_1>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<FlutterEngineRun::$_1>(FlutterEngineRun::$_1&&) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/type_traits:4323
#23 0x0000000100344e68 in void std::__1::__call_once_param<std::__1::tuple<FlutterEngineRun::$_1&&> >::__execute<>(std::__1::__tuple_indices<>) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/mutex:621
#24 0x0000000100344e46 in std::__1::__call_once_param<std::__1::tuple<FlutterEngineRun::$_1&&> >::operator()() [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/mutex:613
#25 0x0000000100344e46 in void std::__1::__call_once_proxy<std::__1::tuple<FlutterEngineRun::$_1&&> >(void*) at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/mutex:649
#26 0x00007fff5f54336e in std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) ()
#27 0x000000010033ee92 in void std::__1::call_once<FlutterEngineRun::$_1>(std::__1::once_flag&, FlutterEngineRun::$_1&&) [inlined] at /Users/anatoly/engine/src/buildtools/mac-x64/clang/include/c++/v1/mutex:666
#28 0x000000010033ed38 in ::FlutterEngineRun(size_t, const FlutterRendererConfig *, const FlutterProjectArgs *, void *, FlutterEngine *) at /Users/anatoly/engine/src/out/host_debug_unopt/../../flutter/shell/platform/embedder/embedder.cc:141
#29 0x0000000100001acb in RunFlutter(GLFWwindow*) at /Users/anatoly/Desktop/glfw flutter/glfw flutter/main.cpp:96
#30 0x0000000100001cb9 in main at /Users/anatoly/Desktop/glfw flutter/glfw flutter/main.cpp:116

md9pr...@gmail.com

unread,
Dec 17, 2017, 2:30:19 PM12/17/17
to Flutter Dev
Well,I dont know Flutter well,Iḿ studying Dart at the moment.
But is Flutter so feature rich to compete with things like POlymer in the desktop?
To the kind of work I want to do (ERP/CRM) I would prefer something native like flutter than PWA's

Marcello

Chinmay Garde

unread,
Dec 18, 2017, 1:16:21 AM12/18/17
to Flutter Dev
To add support for Flutter on platforms not supported out of the box, you need to bring your own window toolkit and use the embedder API. This wiki page details the targets to build and shows an extremely simple embedder written using GLFW3 https://github.com/flutter/engine/wiki/Custom-Flutter-Engine-Embedders. I am not aware of any open source projects that attempt to build on this but there have been folks in the Gitter chat channel who have had some success.

@Anatoly: This backtrace indicates that the engine is unable to find the ICU data file when it attempts to bootstrap the file engine. By default, on Mac, the engine will attempt to look for the ICU data file in the same application bundle. Depending on how you are packaging the application on Mac, you may not have an application bundle (for example, a command line app). In such cases, you need to pass the path to ICU data file in the FlutterProjectArgs struct as specified here https://github.com/flutter/engine/blob/0182ed9832ce4923922f085a90838a646e36a20c/shell/platform/embedder/embedder.h#L123. If you are wondering where you can find the ICU data file, a copy is in the FlutterEmbedder.framework vended by the framework target on the Mac.

Chinmay

Anatoly Pulyaevskiy

unread,
Dec 18, 2017, 9:51:31 PM12/18/17
to Flutter Dev
Thanks @Chinmay!

I will be coming back to this topic in about a month and I will try this. Wondering if you're planning to be at DartConf in January? Would be great to have a general discussion about this in person. :)

ged...@gmail.com

unread,
Jan 18, 2018, 2:48:38 AM1/18/18
to Flutter Dev
Anatoly,

If you can throw what you have into GitHub I can try to help.
Have done glfw before.

Keyboard integration should not be too hard as the header file for embedding looks pretty simple

As far as plugins I think many of those can be written in c++ or golang and so work across all desktops. I already have many written in golang for printing etc.

Stuart Morgan

unread,
Feb 23, 2018, 3:39:34 PM2/23/18
to Flutter Dev
On Sunday, December 17, 2017 at 10:16:21 PM UTC-8, Chinmay Garde wrote:
I am not aware of any open source projects that attempt to build on this

For anyone interested in running Flutter on desktop, there is now such an open source project! See https://groups.google.com/forum/#!topic/flutter-dev/x_jicoKAJNE

-Stuart 
Reply all
Reply to author
Forward
0 new messages