Orientação gerada a partir de informações públicas. Apenas para referência.
flutter_jscore é um plugin do Flutter que permite ao Dart avaliar códigos JavaScript usando o motor JavaScriptCore. Ele permite a integração fluida entre Dart e JavaScript, tornando possível executar programas JavaScript diretamente dentro de aplicações Flutter em Android, iOS, macOS, Windows e Linux. Isso é particularmente útil para executar scripts dinâmicos, aproveitar bibliotecas JavaScript existentes ou realizar cálculos do lado do cliente em JavaScript. O plugin fornece uma ponte leve entre os dois ambientes com overhead mínimo.
Casos de uso
Executando código JavaScript em aplicativos Flutter
Integrando bibliotecas JavaScript
Avaliação dinâmica de script
Scripting multiplataforma
Computação do lado do cliente com JS
Principais recursos
Integração do motor JavaScriptCore
Suporte multiplataforma
Interoperabilidade Dart-JavaScript
API simples para avaliação de script
Suporta múltiplas plataformas
Indicado para
Desenvolvedores que precisam de execução de JS no Flutter
Aplicativos que exigem script dinâmico
Projetos usando bibliotecas JS existentes
Desenvolvimento de aplicativos híbridos
tarefas JS críticas para desempenho
Considerações
Limitado ao JavaScriptCore (não ambiente de navegador completo)
Nenhuma manipulação de DOM disponível
Riscos de segurança com scripts não confiáveis
Requer configuração específica da plataforma para alguns recursos
Considerações sobre gerenciamento de memória com scripts de longa execução
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
flutter_jscore
JavaScriptCore for Flutter. The plugin provides the ability to evaluate JavaScript programs from within dart.
Due to the size limitation of pub on package upload, you need to add JavaScriptCore dynamic library to the project by yourself.
You can refer to the example. of course you can refer to webkit to compile it.
Set JscFfi.lib to use the JavaScriptCore dynamic library.
You can get the aar file containing libjsc.so in jsc-android, and add to your project.
Take the libs folder as an example, add it to the build.gradle of the module.
You also need to add libc++_shared.so, because this is a dependency of libjsc.so.
Take the jniLibs folder as an example, add it to the build.gradle of the module.
You can use libjavascriptcoregtk as a dependency, or compile webkitgtk yourself.
The names of dynamic libraries in different Linux distributions may be different. So you need to set JscFfi.lib.
Foreign Function Interface for interoperability with the C programming language. flutter_jscore uses dart:ffi so you don't have to worry about performance loss across programming languages.
If you use it on Linux, you must make sure to have the following dependencies.
libglib-2.0.so.0
libicui18n.so.66
libicuuc.so.66
libdl.so.2
libgio-2.0.so.0
libgobject-2.0.so.0
libpthread.so.0
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libc.so.6
ld-linux-x86-64.so.2
APIs
I don't think there is much to describe, flutter_jscore just makes a simple package. You can refer to the documentation of JavaScriptCore and the documentation on pub.
If you like my project, please in the upper right corner of the project "Star". Your support is my biggest encouragement! ^_^
You can also scan the qr code below or , donation to Author.
If in donation message note name, will be record to the list if you are making open source authors, donation can leave when making project address or personal home page, a link will be added to the list have the effect of promoting each other
The group is not only solve the problem of EasyreFresh, any Flutter related issues can be discussed. Just as its name, craigslist, as long as there is time, group of Lord will help you solve problems together.