Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/foundation.dart' show visibleForTesting;
import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
import 'messages.g.dart' as messages;

Expand Down Expand Up @@ -36,7 +37,11 @@ messages.StorageDirectory _convertStorageDirectory(

/// The Android implementation of [PathProviderPlatform].
class PathProviderAndroid extends PathProviderPlatform {
final messages.PathProviderApi _api = messages.PathProviderApi();
/// Creates an instance of [PathProviderAndroid].
PathProviderAndroid({@visibleForTesting messages.PathProviderApi? api})
: _api = api ?? messages.PathProviderApi();

final messages.PathProviderApi _api;

/// Registers this class as the default instance of [PathProviderPlatform].
static void registerWith() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:pigeon/pigeon.dart';
package: 'io.flutter.plugins.pathprovider',
),
dartOut: 'lib/messages.g.dart',
dartTestOut: 'test/messages_test.g.dart',
copyrightHeader: 'pigeons/copyright.txt',
),
)
Expand All @@ -31,7 +30,7 @@ enum StorageDirectory {
documents,
}

@HostApi(dartHostTestHandler: 'TestPathProviderApi')
@HostApi()
abstract class PathProviderApi {
@TaskQueue(type: TaskQueueType.serialBackgroundThread)
String? getTemporaryPath();
Expand Down

This file was deleted.

Loading