Home

Awesome

<p align="center"> <a href="https://openwebf.com"> <picture> <img src="./website/static/img/openwebf.png" width="200"/> </picture> </a> </p> <h1 align="center"> <a href="https://openwebf.com" alt="openwebf-site">OpenWebF</a> </h1> <p align="center"> <b>Build flutter apps with HTML/CSS and JavaScript.</b><br/> Building Flutter apps that are friendly to web developers </p> <p align="center"> <a href="https://openwebf.com/docs/tutorials/getting-started/quick-start"> <b>Getting Started</b> </a> | <a href="https://openwebf.com/docs/tutorials/guides-for-web-developer/overview"> <b>Guides For Web Developers</b> </a> | <a href="https://openwebf.com/docs/tutorials/guides-for-flutter-developer/overview"> <b>Guides For Flutter/Mobile Developers</b> </a> </p> <p align="center"> <a aria-label="X" href="https://x.com/HelloAndyCall" target="_blank"> <img alt="" src="https://img.shields.io/badge/Twitter-black?style=for-the-badge&logo=Twitter"> </a> <a aria-label="Discord-Link" href="https://discord.gg/DvUBtXZ5rK" target="_blank"> <img alt="" src="https://img.shields.io/badge/Discord-black?style=for-the-badge&logo=discord"> </a> <a aria-label="Pub Package" href="https://pub.dev/packages/webf"> <img alt="" src="https://img.shields.io/badge/Flutter-02569B?style=for-the-badge&logo=flutter&logoColor=white" /> </a> </p>

WebF presents a high-performance, cutting-edge web rendering engine built on top of Flutter, empowering web applications to operate natively within the Flutter ecosystem.

Join Our Mission

We envision providing web developers with an innovative web rendering engine, surpassing WebView in performance and adaptability across both mobile and desktop platforms.

WebF's journey is ambitious and enduring. We believe in the strength of collective effort. If you share our dream of a superior alternative to WebView for the future, your expertise could be invaluable to us.

Further, financial contributions can pave the way for erstwhile members of the Kraken team to rejoin our mission, bolstering our developmental pace and potential.

If you or your team are interested in supporting us, please contact @andycall on our Discord channel.

How to use

All front-end frameworks based on the WhatWG DOM standard are supported; this time, we are using Vue as an example.

1. Use vue-cli to generate your front-end project

ES6 modules are not supported yet, so Vite is not supported.

vue create app
cd app
npm run serve

And the Vue development server will be hosted at http://<yourip>:8080/.

2. Add webf as a dependency for your flutter apps.

packages.yaml

dependencies:
  webf: <lastest version>

import

import 'package:webf/webf.dart';
import 'package:webf/devtools.dart';

init

void main() {
  runApp(MyApp());
}

3. Add the WebF widget to run your web applications.

@override
Widget build(BuildContext context) {
  final MediaQueryData queryData = MediaQuery.of(context);
  final Size viewportSize = queryData.size;

  return Scaffold(
      body: Center(
    child: Column(
      children: [
        WebF(
          devToolsService: ChromeDevToolsService(), // Enable Chrome DevTools Services
          viewportWidth: viewportSize.width - queryData.padding.horizontal, // Adjust the viewportWidth
          viewportHeight: viewportSize.height - queryData.padding.vertical, // Adjust the viewportHeight
          bundle: WebFBundle.fromUrl('http://<yourip>:8080/'), // The page entry point
        ),
      ],
    ),
  ));
}

4. Run

flutter run
<img src="https://user-images.githubusercontent.com/4409743/217754470-697b6998-4451-483c-b26e-bdb2740f3ea1.png" width="800" style="display: block; margin: 0 auto;" />

How it works

WebF provides a rendering engine which follows the W3C standards like web browsers do. It can render HTML/CSS and execute JavaScript. It's built on top of the flutter rendering pipelines and implements its own layout and painting algorithms.

With WebF, Web Apps and Flutter Apps share the same rendering context. It means that you can use Flutter Widgets to define your HTML elements and embed your Web App as a Flutter Widget in your flutter apps.

<img src="https://user-images.githubusercontent.com/4409743/186230941-83b0aa1c-59d1-4d8d-be10-958a3ae64114.jpg" width="800" style="display: block; margin: 0 auto;" />

Contributors

<a href="https://github.com/openwebf/webf/graphs/contributors"><img src="https://opencollective.com/webf/contributors.svg?width=890&button=false" /></a>

👏 Contributing PRs Welcome

By contributing to WebF, you agree that your contributions will be licensed under its Apache-2.0 License.

Read our contributing guide and let's build a better WebF project together.

Thank you to all the people who already contributed to OpenWebF and OpenKraken!

Copyright (c) 2022-present, The OpenWebF authors.