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

feat: support web in package:platform #862

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion pkgs/platform/lib/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

// Core interfaces & classes.
export 'src/interface/local_platform.dart';
export 'src/interface/local_platform.dart'
if (dart.library.js_interop) 'src/interface/local_platform_web.dart';
export 'src/interface/platform.dart';
export 'src/testing/fake_platform.dart';
56 changes: 56 additions & 0 deletions pkgs/platform/lib/src/interface/local_platform_web.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'platform.dart';

/// `Platform` implementation that .
class LocalPlatform extends Platform {
/// Creates a new [LocalPlatform].
const LocalPlatform();

@override
int get numberOfProcessors => 0;

@override
String get pathSeparator => '/';

@override
String get operatingSystem => 'TODO'; // see web.window.navigator.platform

@override
String get operatingSystemVersion => 'TODO';

@override
String get localHostname => 'TODO';

@override
Map<String, String> get environment => {};

@override
String get executable => 'TODO';

@override
String get resolvedExecutable => 'TODO';

@override
Uri get script => Uri.base;

@override
List<String> get executableArguments => [];

@override
String? get packageConfig => 'TODO';

@override
String get version => 'TODO';

@override
bool get stdinSupportsAnsi => false;

@override
bool get stdoutSupportsAnsi => false;

@override
String get localeName => 'TODO';
}