File size: 947 Bytes
a4ff84b b0336a8 a4ff84b b0336a8 a4ff84b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | // 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 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:web/web.dart' as web;
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.
@override
Future<String?> getPlatformVersion() async {
final version = web.window.navigator.userAgent;
return version;
}
}
|