Skip to content

Commit

Permalink
feat: support web in package:platform
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Feb 18, 2025
1 parent 0b2bd3f commit b9fd63f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
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';

@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';
}

0 comments on commit b9fd63f

Please sign in to comment.