← スキル一覧に戻る

webf-native-ui-dev
by first-fluke
webf-native-ui-devは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。
⭐ 141🍴 21📅 2026年1月23日
SKILL.md
name: webf-native-ui-dev description: Develop custom native UI libraries based on Flutter widgets for WebF. Create reusable component libraries that wrap Flutter widgets as web-accessible custom elements.
WebF Native UI Dev
This skill guides the development of custom native UI components for WebF (Web on Flutter). It bridges Flutter widgets to standard HTML custom elements.
Concept
WebF allows you to render HTML/CSS using Flutter's rendering engine. This skill helps you expose complex Flutter widgets as <custom-element> tags usable in HTML.
Workflow
- Create Flutter Widget: Build the widget using standard Flutter code.
- Define Element Class: Create a class extending
WidgetElement. - Register Custom Element: Use
defineCustomElementto map the tag name to the class.
Example
import 'package:webf/webf.dart';
import 'package:flutter/material.dart';
// 1. Define the Element
class FlutterButtonElement extends WidgetElement {
FlutterButtonElement(BindingContext? context) : super(context);
@override
Widget build(BuildContext context, List<Widget> children) {
return ElevatedButton(
onPressed: () {
// Dispatch custom event to JS
dispatchEvent(Event('click'));
},
child: Text(getAttribute('label') ?? 'Click Me'),
);
}
}
// 2. Register (usually in main.dart)
void main() {
WebF.defineCustomElement('flutter-button', (context) => FlutterButtonElement(context));
runApp(MyApp());
}
Usage in HTML
<flutter-button label="Submit Order" id="btn"></flutter-button>
<script>
document.getElementById('btn').addEventListener('click', () => {
console.log('Button clicked via Flutter!');
});
</script>
Best Practices
- Attributes: Map HTML attributes to Widget properties.
- Events: Dispatch standard DOM events from Flutter user interactions.
- Performance: Avoid heavy computations in the
buildmethod; use state management.
スコア
総合スコア
75/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
✓人気
GitHub Stars 100以上
+5
✓最近の活動
1ヶ月以内に更新
+10
✓フォーク
10回以上フォークされている
+5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です

