flutter-content-rendering
Skill2 starsChanged 2 months agoMITView on GitHub
Show HTML/links/PDFs in Flutter — viewers, clickable URLs.
In this repository58 other files it gives its agents.
- ad-hoc-script-verificationSkill
- architecture-diagramSkill
- blocked-page-recoverySkill
- cadquery-enclosure-designSkill
- canonical-thumbnailSkill
- circuit-designSkill
- competitor-news-monitorSkill
- component-alternativesSkill
- debugging-hermes-tui-commandsSkill
- docker-container-update-checkSkill
- document-to-action-itemsSkill
- docxSkill
- email-inbox-triageSkill
- embedded-porting-patternsSkill
- ephemeral-file-sharingSkill
- excalidrawSkill
- flash-game-researchSkill
- flutter-android-buildSkill
- github-code-reviewSkill
- githubSkill
- goatcounter-analyticsSkill
- google-oauth-file-pollSkill
- grounded-citationsSkill
- hermes-agent-skill-authoringSkill
- hermes-gateway-slash-commandSkill
- hermes-gateway-supervisionSkill
- jellyseerr-watch-suggestionsSkill
- maintained-fork-publishingSkill
- meeting-action-itemsSkill
- native-mcpSkill
- obsidian-mapsSkill
- pdf-flattenSkill
- pdfSkill
- pdf-surgical-editsSkill
- planSkill
- product-price-monitorSkill
- psp-developmentSkill
- psp-homebrew-testingSkill
- psp-prx-plugin-maintenanceSkill
- python-debugpySkill
- python-webapp-patternsSkill
- reddit-readingSkill
- retro-fansiteSkill
- reverse-proxy-websocket-debuggingSkill
- rss-feedsSkill
- simplify-codeSkill
- sketchSkill
- skit-thumbnailSkill
- spikeSkill
- subagent-driven-developmentSkill
- test-driven-developmentSkill
- usb-device-enumerationSkill
- weekly-review-planningSkill
- wiki-media-asset-pipelineSkill
- windows-c-build-toolchainSkill
- windows-crash-forensicsSkill
- writing-plansSkill
- yt-dlp-anti-botSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
AndroidManifest: add a <queries> block (VIEW intent, http + https schemes) for Android 11+ package visibility, or browser launch can fail …
- Very specific: line 95
After any multi-line edit: dart format <file> — it FAILS loudly on unbalanced braces, making it the fastest corruption detector.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Content Rendering (HTML, links, PDFs, local files)
Package-level quirks for rendering dynamic content in Flutter apps (task descriptions, attachment viewers, rich text). Verified against the Vikunja Flutter app on Flutter 3.44.8 / Dart 3.12 / webview_flutter 4.13.
Clickable links inside rendered HTML
flutter_widget_from_html's HtmlWidget:
- Does NOT auto-linkify bare
https:///www.URLs — they render as inert text. <a href>tags are only tappable whenonTapUrlis supplied.onTapUrlsignature:FutureOr<bool> Function(String url)?— return true = handled.
Recipe (works for plain text or HTML strings):
- Linkify first: wrap bare URLs in
<a href>(regex below), skipping URLs already inside an href attribute. HtmlWidget(linkifyHtml(desc), onTapUrl: (url) => launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication))—url_launcher, already available in most apps.- AndroidManifest: add a
<queries>block (VIEW intent,http+httpsschemes) for Android 11+ package visibility, or browser launch can fail silently.
Copy-paste linkify (mind the raw-string trap — see below):
final RegExp _bareUrlPattern = RegExp(
r'(?<![="])((?:https?://|www\.)[^\s<>]+)',
caseSensitive: false,
);
final RegExp _trailingJunk = RegExp(r'[.,;:!?…)"' r"']+$");
String linkifyHtml(String input) => input.replaceAllMapped(_bareUrlPattern, (m) {
var url = m.group(1)!.replaceAll(_trailingJunk, '');
if (url.isEmpty) return m.group(0)!;
final href = url.startsWith('http') ? url : 'https://$url';
return '<a href="$href">$url</a>';
});WebView (webview_flutter 4.x)
loadFile(): pass'file://$path'. The 4.x Android impl hands the string straight toloadUrl(no prefix added); the legacy impl prefixesfile://itself. The explicit prefix works for both, and the plugin setssetAllowFileAccess(true)for you.setDomStorageEnabledwas REMOVED from the API — DOM storage is always on (AndroidWebViewController ctor enables it).- Pinch zoom is ON by default (ctor:
setBuiltInZoomControls(true),setDisplayZoomControls(false)) — no code needed. - CDN-script pages (Tailwind etc.):
setJavaScriptMode(JavaScriptMode.unrestricted). - Loading UX:
NavigationDelegate(onPageStarted/onPageFinished)+ spinner; WebView stays blank until the first frame. - HTML in a WebView renders CSS/JS/RTL exactly like a browser; a plain
HtmlWidgetview strips styles — choose per use case.
PDFs (flutter_pdfview)
- Android native
PdfRenderer→ handles Hebrew/RTL PDFs and generated docs well. - Needs a real local file path (app-private dirs like applicationSupport work).
- Default view:
PDFView(filePath: path, autoSpacing: true, pageFling: false); errors surface viaonError/onPageError.
Local file download + cache (background_downloader)
- Cache pattern: build the
DownloadTask(same URL/headers as the download), calltask.filePath()— returnsFuture<String>(non-nullable) — thenFile(path).existsSync()to skip re-downloads. - Open a cached local file in an external app:
FileDownloader().openFile(filePath: path, mimeType: mime)(exposes via content URI; plainurl_launcherUri.filedoes NOT work on Android 7+ for app-private files).
Dart raw strings — no escapes
- In a raw string (
r'...'), backslash escaping does NOT exist:r'...\'...'terminates at the quote → parse error (this is NOT a regex bug). - Include both quote types in one regex by concatenating adjacent raw literals
with alternating quotes:
r'[.,;:!?…)"' r"']+$". - The analyzer lint
prefer_adjacent_string_concatenationdemands adjacent literals (no+operator).
Verification
flutter analyzemust reach zero errors in touched files.- After any multi-line edit:
dart format <file>— it FAILS loudly on unbalanced braces, making it the fastest corruption detector.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

