Giter Club home page Giter Club logo

Comments (3)

ardera avatar ardera commented on September 13, 2024 1

Can i build in docker on my desktop ?

have not tried that yet, and I've never used docker before so I'm afraid I can't tell. It builds really fast though on the Pi 4, so there's probably no reason to cross-compile.

How long does the build take on a rasp pi 4 ?

About 2 seconds on a Pi 4. The embedder is pretty lightweight.

Whats the approach to write a plugin. for example connectivity or Video / Audio ?
I use libwebrtc and can build for rapi pi currently.

That's a little bit more complicated. Depending on the library (more specifically, the C-features the library uses) it's also possible to build a dart interface to that library using the dart FFI. That may be preferable, since communication via platform channels can be annoying at times, and isn't that fast. (40ms 700us between message being sent from flutter and message being received in flutter-pi).

If you can't use the dart FFI, you have to build a plugin for flutter-pi. That shouldn't be that hard to do. I'll probably create a wiki page for that in this repo. If you don't want to wait for that, you can also look how at the implementation of the services-plugin (for example) which implements the platform-side of the flutter services library.

flutter-pi plugins are statically compiled with the rest of the flutter-pi sources. If you want to create a new plugin, just create some source files somewhere in the flutter-pi sources and add these sources to the Makefile.

Your plugin only needs to implement 2 functions: an init and deinit function. Inside these you can register/unregister listeners to platform channels. You tell flutter-pi about your plugin by adding your

  • plugin name
  • reference to your init function
  • reference to your deinit function

to the hardcoded_plugins table in the pluginregistry file.

The specifics of how to register/unregister listeners and how to respond, decode platform messages are documented in the pluginregistry.h and platformchannel.h headers.

Keep in mind flutter-pi, although it's mostly stable, is not really production-ready.

from flutter-pi.

ardera avatar ardera commented on September 13, 2024 1

That build times are really encouraging.
Dart ffi is what I am working on now.

I am sorry I just tried using dart ffi with flutter-pi, it's not working. Outputs the following error:

[ERROR:engine/src/flutter/shell/common/shell.cc(199)]
  Dart Error: error: import of dart:ffi is not supported in the current Dart runtime

I just investigated and this is because dart ffi does not yet support ARM fully: dart-lang/sdk#36309

from flutter-pi.

gedw99 avatar gedw99 commented on September 13, 2024

Thanks @ardera

That build times are really encouraging.
Dart ffi is what I am working on now.

Will get back to you once I have something worked up and need tips

from flutter-pi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.