Coder Social home page Coder Social logo

Support for Web and Desktop about application_icon HOT 4 OPEN

ueman avatar ueman commented on June 26, 2024
Support for Web and Desktop

from application_icon.

Comments (4)

ueman avatar ueman commented on June 26, 2024

macOS support should be pretty straight forward as probably most iOS code can be reused.
Web support can be added by reading the web manifest (manifest.json).
I suppose Windows should be pretty straight forward too. Just read the windows/runner/resources/app_icon.ico file. I don't own a windows device, so I would love a PR for this.

I'm not sure about linux though.

from application_icon.

ueman avatar ueman commented on June 26, 2024

Window

Maybe this helps for windows:
https://pub.dev/documentation/win32/latest/win32/LoadIcon.html

A handle for the first parameter can probably be obtained via
GetModuleHandle(nullptr). See https://stackoverflow.com/questions/1749972/determine-the-current-hinstance

Also see https://stackoverflow.com/questions/57688782/copy-hicon-hcursor-in-to-byte-array

A windows implementation can then make use of the dartPluginClass

flutter:
  plugin:
    platforms:
      windows:
        dartPluginClass: ...

from application_icon.

ueman avatar ueman commented on June 26, 2024

Linux

See
https://stackoverflow.com/questions/41690822/how-to-set-executable-application-icon-in-linux-based-qt

Platform specific code can also be loaded via dartPluginClass

On linux the icon can probably load in pure Dart code

from application_icon.

ueman avatar ueman commented on June 26, 2024

Web

There's the manifest.json file which contains links to icons. Though there's no guarantee that an icon is available. As a fallback we could check for favicons (which also doesn't need to exist).

All icons can possibly be an svg.

from application_icon.

Related Issues (3)

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.