• Stars
    star
    171
  • Rank 220,939 (Top 5 %)
  • Language
    Dart
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Flutter's mini-program development framework by parsing HTML、CSS and JS / Dart.

中文文档

Flutter MiniProgram

A Flutter's mini-program development framework by parsing HTML、CSS and JS / Dart. This Project is inspired by FlutterHtmlView.

Features

  • Convert html tags to flutter widgets
  • Support use css to rendering flutter widgets
  • Support template compile and data binding

Framework

View layer

The view layer of the framework is written by html and css, and the view layer of the page is defined by the .html file, which is displayed by the component. The data of the logical layer is reflected into a view, and the events of the view layer are sent to the logical layer. A Component is the basic building block of a view.

<template>
    <view class="container">
        <text>{{message}}</text>
        <view class="m-10">
            <button type="primary" onTap="onEvaluateJavascript()">evaluateJavascript</button>
        </view>
    </view>
</template>

<script>
Page({
    config: {
        "navigationBarTitleText": "Flutter MiniProgram - JS-API"
    },
    data: {
        message: "Hello Flutter's MiniProgram"
    },
    onLoad() {

    },
    methods: {
        onEvaluateJavascript: function() {
            log('onEvaluateJavascript');
        }
    }
});
</script>

<style>
.container {
    padding: 10px;
}
.m-10 {
    margin: 10px;
}
</style>

Logic Layer

The logic layer of the mini-program development framework is developed using JS / Dart syntax, and the organization of the view logic and native plugin calls are done through the Dart / Flutter plugin. The logic layer processes the data and sends it to the view layer, while accepting event feedback from the view layer.

Page({
    config: {
        "navigationBarTitleText": "Flutter MiniProgram - JS-API"
    },
    data: {
        message: "Hello Flutter's MiniProgram"
    },
    onLoad() {

    },
    methods: {
        onEvaluateJavascript: function() {
            log('onEvaluateJavascript');
        }
    }
});

Component

Supported Tags

  • view/div: 视图容器
  • icon: 图标
  • text: 文本
  • br: 换行符
  • hr: 水平分隔线
  • p: 段落
  • h1 ~ h6: 标题
  • a: 链接
  • button: 按钮
  • input: 输入框
  • checkbox: 复选框
  • switch: 单选开关
  • slider: 滑块
  • image: 图片
  • video: 视频
  • table: 表格
  • list-view: 列表
  • web-view: 网页容器

View

A view container, equivalent to the div tag of the Web or the View component of React Native.

API

Attribute name Types Defaults Description
class String Custom style name
style String Inline style
onTap EventHandle Click event
onLongTap EventHandle Long press event

More Repositories

1

mui-demo

一个关于mui的demo仓库。
JavaScript
574
star
2

zhaomenghuan.github.io

匠心博客
HTML
53
star
3

vue-webpack-template

Template for wepack2 + vue2.
JavaScript
13
star
4

learn-javascript

Demos for learning javascript.
HTML
9
star
5

app-package-parser

A app package parser for .apk or .ipa file.
JavaScript
7
star
6

pop

This a pop model bases on Native Javascript.
CSS
6
star
7

AlibcSDKApplication

一个基于5+ SDK和阿里百川电商SDK的5+ plugin拓展。
Java
6
star
8

android-plugin-framework

Android 插件化框架原理研究
Java
6
star
9

flutter_toast

A Toast plugin for Flutter.
Ruby
3
star
10

xframework

面向 evergreen browsers 的前端组件化开发框架.
JavaScript
3
star
11

learn-angular

一个关于angular学习的demo集合
HTML
3
star
12

flutter_virtual_app

A Flutter plugin based VirtualApp.
Java
3
star
13

eggjs-boilerplate

A boilerplate project based on Egg.js Framework.
JavaScript
2
star
14

learn-android

Android 学习的demo仓库。
Java
2
star
15

HelloFlutter

An example App for Flutter Framework.
Dart
2
star
16

learn-ios

iOS 开发学习案例
1
star
17

awesome-theia

A curated list of awesome things related to Theia.
1
star
18

package-check-version

A package for a npm package checks version, comparing with local package.json's version.
JavaScript
1
star
19

vue-plugin-template

一个基于 webpack 的 Vue.js 插件开发工程模板.
JavaScript
1
star
20

chrome-extension-template

Chrome 拓展开发模板
JavaScript
1
star
21

javascript_runtime

A JavaScript Runtime implementation based on Dart language.
Dart
1
star
22

ProcessMessenger

Android 进程通信
Java
1
star