agent-workspace / flutter /packages /flutter_tools /templates /plugin /lib /projectName_web.dart.tmpl
agent-workspace / flutter /packages /flutter_tools /templates /plugin /lib /projectName_web.dart.tmpl
Download flutter/packages/flutter_tools/templates/plugin/lib/projectName_web.dart.tmpl from luom2645/agent-workspace: direct link, hf CLI and curl.
- Browser
- Download file 950 Bytes
-
https://huggingface.co/luom2645/agent-workspace/resolve/7d4c5ffdb4518a5d7456ef06ab77458fcf42663a/flutter/packages/flutter_tools/templates/plugin/lib/projectName_web.dart.tmpl
- Command line
-
hf download hf://luom2645/agent-workspace@7d4c5ffdb4518a5d7456ef06ab77458fcf42663a/flutter/packages/flutter_tools/templates/plugin/lib/projectName_web.dart.tmpl
-
curl -L -o projectName_web.dart.tmpl https://huggingface.co/luom2645/agent-workspace/resolve/7d4c5ffdb4518a5d7456ef06ab77458fcf42663a/flutter/packages/flutter_tools/templates/plugin/lib/projectName_web.dart.tmpl
950 Bytes
| // In order to *not* need this ignore, consider extracting the "web" version | |
| // of your plugin as a separate package, instead of inlining it in the same | |
| // package as the core of your plugin. | |
| // ignore: avoid_web_libraries_in_flutter | |
| import 'dart:html' as html show window; | |
| import 'package:flutter_web_plugins/flutter_web_plugins.dart'; | |
| import '{{projectName}}_platform_interface.dart'; | |
| /// A web implementation of the {{pluginDartClass}}Platform of the {{pluginDartClass}} plugin. | |
| class {{pluginDartClass}}Web extends {{pluginDartClass}}Platform { | |
| /// Constructs a {{pluginDartClass}}Web | |
| {{pluginDartClass}}Web(); | |
| static void registerWith(Registrar registrar) { | |
| {{pluginDartClass}}Platform.instance = {{pluginDartClass}}Web(); | |
| } | |
| /// Returns a [String] containing the version of the platform. | |
| Future<String?> getPlatformVersion() async { | |
| final version = html.window.navigator.userAgent; | |
| return version; | |
| } | |
| } | |