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.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "webf-native-ui-dev" with this command: npx skills add first-fluke/fullstack-starter/first-fluke-fullstack-starter-webf-native-ui-dev

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 defineCustomElement to 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 build method; use state management.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

frontend-code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

backend-development

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

developer-workflow

No summary provided by upstream source.

Repository SourceNeeds Review