voltron
💡 Introduction
Voltron is Flutter version of Hippy dynamic framework, which contains almost 100% Hippy features. It also has the characteristics of high performance, cross platform, easy learning, etc.
See https://hippyjs.org for details, based on Hippy 3.0
🔨 Getting started
add this line to pubspec.yaml
dependencies:
voltron: ^0.0.1
import package
import 'package:voltron/voltron.dart';
simple example
import 'package:flutter/material.dart';
import 'package:voltron/voltron.dart';
class VoltronPage extends StatefulWidget {
VoltronPage();
@override
State<StatefulWidget> createState() {
return _VoltronPageState();
}
}
class _VoltronPageState extends State<VoltronPage> {
late VoltronJSLoaderManager _loaderManager;
late VoltronJSLoader _jsLoader;
@override
void initState() {
super.initState();
_initVoltronData();
}
void _initVoltronData() async {
var initParams = EngineInitParams();
initParams.debugMode = false;
initParams.enableLog = true;
initParams.coreJSAssetsPath = 'assets/jsbundle/vendor.android.js';
initParams.codeCacheTag = "common";
_loaderManager = VoltronJSLoaderManager.createLoaderManager(
initParams,
(statusCode, msg) {
LogUtils.i(
'loadEngine',
'code($statusCode), msg($msg)',
);
},
);
var loadParams = ModuleLoadParams();
loadParams.componentName = "Demo";
loadParams.codeCacheTag = "Demo";
loadParams.jsAssetsPath = 'assets/jsbundle/index.android.js';
loadParams.jsParams = VoltronMap();
loadParams.jsParams?.push(
"msgFromNative",
"Hi js developer, I come from native code!",
);
_jsLoader = _loaderManager.createLoader(
loadParams,
moduleListener: (status, msg) {
LogUtils.i(
"flutterRender",
"loadModule status($status), msg ($msg)",
);
},
);
}
@override
void dispose() {
super.dispose();
_jsLoader.destroy();
_loaderManager.destroy();
}
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
return !(_jsLoader.back(() {
Navigator.of(context).pop();
}));
},
child: Scaffold(
body: VoltronWidget(
loader: _jsLoader,
),
),
);
}
}
Libraries
- adapter
- adapter/device
- adapter/exception
- adapter/font
- adapter/http
- adapter/preferences
- adapter/resource_loader
- adapter/storage
- adapter/third_party
- bridge
- bridge/bridge_define
- bridge/voltron_api
- bridge/voltron_bridge
- channel
- channel/method_channel
- channel/platform_manager
- devtools/devtools_manager
- devtools/network_inspector
- engine
- engine/bundle
- engine/engine_define
- engine/global_config
- engine/js_api_provider
- engine/js_dimension_checker
- engine/js_engine_context
- engine/js_init_params
- engine/js_instance_context
- engine/js_module_params
- engine/js_render_context
- engine/voltron_js_engine
- inspector
- inspector/dev
- inspector/dev_factory
- inspector/dev_remote_server_data
- inspector/dev_server_callback
- inspector/dev_server_config
- inspector/dev_server_helper
- inspector/dev_server_impl
- inspector/dev_server_impl_disable
- inspector/dev_server_interface
- module
- module/clipboard
- module/console
- module/device_event
- module/dimensions
- module/event_dispatcher
- module/exception
- module/image_loader
- module/module
- module/monitor
- module/net_info
- module/network
- module/promise
- module/storage
- module/time
- module/utils
- module/websocket
- voltron
- voltron/loader