Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Support #2466

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address lints
Levi-Lesches committed Nov 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit dc0b64476a99ffa148fd38df1773c498da73bec9
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export "web_mock.dart"
if (dart.library.js_interop) "web_real.dart";
export 'web_mock.dart'
if (dart.library.js_interop) 'web_real.dart';
10 changes: 7 additions & 3 deletions flutter_local_notifications/lib/src/web_mock.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import 'package:flutter_local_notifications_platform_interface/flutter_local_notifications_platform_interface.dart';

/// A stub implementation of the web plugin, for non-web platforms.
class WebFlutterLocalNotificationsPlugin extends FlutterLocalNotificationsPlatform {
Future<bool?> initialize() async { return null; }
class WebFlutterLocalNotificationsPlugin
extends FlutterLocalNotificationsPlatform
{
/// Initializes the plugin.
Future<bool?> initialize() async => null;

Future<bool> requestNotificationsPermission() async { return false; }
/// Requests permission to use the plugin.
Future<bool> requestNotificationsPermission() async => false;
}