Code Monkey home page Code Monkey logo

maxim-saplin / flutter_python_starter Goto Github PK

View Code? Open in Web Editor NEW
89.0 89.0 15.0 180.22 MB

Bundling Python code with Flutter Desktop apps as self-contained binary, interop with Python self-hosted gRPC service

License: MIT License

Shell 8.56% Dart 44.29% Python 4.30% Swift 1.59% HTML 1.58% CMake 16.11% C++ 19.81% C 1.23% Ruby 2.41% Kotlin 0.10% Objective-C 0.03%
cross-platform dart flutter flutter-python grpc hacktoberfest integration portable python self-contained standalone

flutter_python_starter's People

Contributors

adamjel avatar maxim-saplin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_python_starter's Issues

Working with USB devices via python

So, this is not an issue, but rather question. Does python have access to connected USB devices? I'm mainly interested in desktop platforms. I have a python lib which does some USB device read/write ops and kinda wanted to bring it into standalone flutter desktop app.

windows - run .sh

this is a great project!! i am running something similar on windows with flutter managing a python process and talks to it via websockets and http, and i want to try this out.

can i ask a silly question - are we expected to run the .sh file on WSL in windows?

EDIT: nevermind I see we can install git bash windows.

Work on the TODOs

  1. Proper management of /assets
  • Handle situation when there're already assets defined in pubspec.yaml
  • When building for a specific platform make sure to remove assets from other platforms to save room
  1. Investigate "Do you want the application “app.app” to accept incoming network connections?" request upon first launch, shouldn't be any - fixed, didn't use loopback address when requesting free port from OS
  2. Fix multi instance launch (currently next instance kills old server)
  3. Slow Python startup when launching Flutter app
  • PyInstaller 8-9s, Nuitka 7-8s (M1 Pro)
  • Consider use -onedir arg with PyInstaller and zip/unzip it via Flutter
  1. Awaiting error code on init, see if can be done faster
     // Give couple of seconds to make sure there're no exceptions upon lanuching Python server
     await Future.delayed(const Duration(seconds: 2));
  2. Look into singing (App, Mac) and distribution flow for binaries
  3. Python has been loaded -> check for better probing, e.g. now when you start client it always says all is good
  4. Authentication flow
    • Authentication in the web with JWT passed in server-side cookie via web proxy
  5. Tailor ./example launch.json for 3 platforms
  6. Plugin codegen and build actions into IDE events, e.g. see how to do more convenient update of .proto and Python parts without forgetting-to-run/running scripts manually
  7. server.py, add param to determine if localhost (local only) or [::] (inbouind remote connection) will be used (server.add_insecure_port('[::]:50051'))
  8. When debugging the app may stop silently upon launching due to swallowed exceptions when probing Python
    • VSCode Debug Pane, in the bottom left there's BREAKPOINTs section, disable expcetions
  9. Updte iOS ios/Runner/Info.plist to allow gRPC networking
  10. VScode debugging, sort out auto start of server
        {
            "name": "app (remote server, auto start)",
            "type": "dart",
            "request": "launch",
            "program": "app/lib/main.dart",
            "toolArgs": [
                "--dart-define",
                "useRemote=true",
              ],
            "preLaunchTask": "start server",
            //"postDebugTask": "stop server" // this one kills Flutter UI when doing hot restart, better keep server running to keep host restart working
        },
    
  11. Add Dart alternatives to shell scripts and publish as package to pub.dev

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.