Skip to content

Commit

Permalink
Add web support in the plugin definition
Browse files Browse the repository at this point in the history
  • Loading branch information
rekire committed Feb 8, 2024
1 parent 834396f commit 183593f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion autologin/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class _DemoPageState extends State<DemoPage> {
Widget build(BuildContext context) {
return Column(
children: [
if (isPlatformSupported == false) const Text('⚠️ Platform not supported ⚠️'),
if (isPlatformSupported != true) const Text('⚠️ Platform not supported ⚠️'),
TextFormField(
controller: usernameController,
textInputAction: TextInputAction.next,
Expand Down
8 changes: 4 additions & 4 deletions autologin/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ flutter:
# default_package: autologin_linux
#macos:
# default_package: autologin_macos
#web:
# default_package: autologin_web
web:
default_package: autologin_web
#windows:
# default_package: autologin_windows

Expand All @@ -34,8 +34,8 @@ dependencies:
# path: ../autologin_macos
autologin_platform_interface:
path: ../autologin_platform_interface
#autologin_web:
# path: ../autologin_web
autologin_web:
path: ../autologin_web
#autologin_windows:
# path: ../autologin_windows
flutter:
Expand Down
3 changes: 2 additions & 1 deletion autologin_web/lib/autologin_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import 'dart:html';
import 'dart:js';

import 'package:autologin_platform_interface/autologin_platform_interface.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';

/// The Web implementation of [AutologinPlatform].
class AutologinWeb extends AutologinPlatform {
/// Registers this class as the default instance of [AutologinPlatform]
static void registerWith([Object? registrar]) {
static void registerWith(Registrar registrar) {
AutologinPlatform.instance = AutologinWeb();
}

Expand Down

0 comments on commit 183593f

Please sign in to comment.