Coder Social home page Coder Social logo

m-kilic / presentation-displays Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vnapnic/presentation-displays

0.0 0.0 0.0 56.86 MB

The flutter plugin supports running on two screens. It's basically a tablet connected to another screen via an HDMI or Wireless

Home Page: https://pub.dev/packages/presentation_displays

License: BSD 2-Clause "Simplified" License

Ruby 5.27% Objective-C 1.69% Kotlin 20.05% Dart 55.37% Swift 17.63%

presentation-displays's Introduction

presentation_displays

Supported mobile platforms iOS and Android

Flutter plugin supports to run on two screens. It's basically a tablet connected to another screen via an HDMI or Wireless

Idea: We create a Widget by using Flutter code and pass it to Native code side then convert it to FlutterEngine and save it to FlutterEngineCache for later use.

Next, we define the Display by using displayId and we will define the UI flutter that needs to display by grabbing FlutterEngine in FlutterEngineCache and transferring it to Dialog Presentation as a View.

We provide methods to get a list of connected devices and the information of each device then transfer data from the main display to the secondary display.

Simple steps:

  • Create Widgets that need to display and define them as a permanent router when you configure the router in the Flutter code.

  • Get the Displays list by calling displayManager.getDisplays ()

  • Define which Display needs to display For instance: displays [1] .displayId Display the index 2.

  • Display it on Display with your routerName as presentation displayManager.showSecondaryDisplay (displayId: displays [1] .displayId, routerName: "presentation")

  • Transmit the data from the main display to the secondary display by displayManager.transferDataToPresentation (" test transfer data ")

  • The secondary screen receives data

@override
Widget build (BuildContext context) {
    return SecondaryDisplay (
        callback: (argument) {
        setState (() {
        value = argument;
        });
    }
    );
}
  • wesetup new entry point for secondary display so we can decided what we need to call for initialization. Works only for android for now
@pragma('vm:entry-point')
void secondaryDisplayMain() {
 /// do something that don't break plugin registration here.
}

Upgrade version 1.0.0

  • Able to package android release build. Works fine in example app.

  • Tested example app in android tab and ios tab and things work as expected. Ensure the devices have USB C 3.0 and above else HDMI out is not supported.

  • In case of iOS, please refer to example app app delegate. There are few lines of code which needs to be added to your app's app delegate as well for this to work fine in iOS.

  • Updated optional issues and null checks

  • Added option to hide second display from the first

  • WIP support second main in iOS for extended display

  • WIP Send data back from 2nd to 1st display

You can take a look at our example to learn more about how the plugin works

Test on Sunmi-D2 device

The example app running in android

presentation-displays's People

Contributors

vnapnic avatar hig-dev avatar ebramtawfik avatar harrynguyen-vmo avatar fbernaly avatar ravindran-a avatar fuadreza avatar m-kilic avatar ziakhan110 avatar

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.