Skip to content

Commit cf776f9

Browse files
authored
Merge pull request #24 from osociety/dev
Dev -> Main
2 parents 187acb5 + 887efbc commit cf776f9

File tree

11 files changed

+141
-12
lines changed

11 files changed

+141
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 1.0.4
4+
5+
1. Use network_tools v4.0.1 to fix path issue in flutter.
6+
37
## 1.0.3
48

59
1. Consume latest version of network_tools v4.0.0

example/lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import 'package:flutter/material.dart';
22
import 'package:network_tools_flutter/network_tools_flutter.dart';
3+
import 'package:path_provider/path_provider.dart';
34

45
Future<void> main() async {
5-
await configureNetworkTools(enableDebugging: true);
6+
WidgetsFlutterBinding.ensureInitialized();
7+
final appDocDirectory = await getApplicationDocumentsDirectory();
8+
await configureNetworkTools(appDocDirectory.path, enableDebugging: true);
69
runApp(const MyApp());
710
}
811

example/macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import FlutterMacOS
66
import Foundation
77

8+
import path_provider_foundation
89

910
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
11+
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
1012
}

example/macos/Podfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
PODS:
22
- FlutterMacOS (1.0.0)
3+
- path_provider_foundation (0.0.1):
4+
- Flutter
5+
- FlutterMacOS
36

47
DEPENDENCIES:
58
- FlutterMacOS (from `Flutter/ephemeral`)
9+
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
610

711
EXTERNAL SOURCES:
812
FlutterMacOS:
913
:path: Flutter/ephemeral
14+
path_provider_foundation:
15+
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
1016

1117
SPEC CHECKSUMS:
1218
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
19+
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
1320

1421
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
1522

example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
33CC10EB2044A3C60003C045 /* Resources */,
241241
33CC110E2044A8840003C045 /* Bundle Framework */,
242242
3399D490228B24CF009A79C7 /* ShellScript */,
243+
6FAAE479752EBB508C6EA525 /* [CP] Embed Pods Frameworks */,
243244
);
244245
buildRules = (
245246
);
@@ -381,6 +382,23 @@
381382
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
382383
showEnvVarsInLog = 0;
383384
};
385+
6FAAE479752EBB508C6EA525 /* [CP] Embed Pods Frameworks */ = {
386+
isa = PBXShellScriptBuildPhase;
387+
buildActionMask = 2147483647;
388+
files = (
389+
);
390+
inputFileListPaths = (
391+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
392+
);
393+
name = "[CP] Embed Pods Frameworks";
394+
outputFileListPaths = (
395+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
396+
);
397+
runOnlyForDeploymentPostprocessing = 0;
398+
shellPath = /bin/sh;
399+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
400+
showEnvVarsInLog = 0;
401+
};
384402
C87B1A810202F6F98C39C119 /* [CP] Check Pods Manifest.lock */ = {
385403
isa = PBXShellScriptBuildPhase;
386404
buildActionMask = 2147483647;

example/pubspec.lock

Lines changed: 92 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ packages:
113113
url: "https://pub.dev"
114114
source: hosted
115115
version: "1.0.0"
116+
ffi:
117+
dependency: transitive
118+
description:
119+
name: ffi
120+
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
121+
url: "https://pub.dev"
122+
source: hosted
123+
version: "2.1.0"
116124
flutter:
117125
dependency: "direct main"
118126
description: flutter
@@ -247,17 +255,17 @@ packages:
247255
dependency: transitive
248256
description:
249257
name: network_tools
250-
sha256: "872d76529329e43b52a837852f7e4c49b4fdf65be7dedc3ee5722ea135fcad08"
258+
sha256: "84cd355e2d9db58456a05b7ebd4021fcbe42241043b7e6157bff2a0853054dd4"
251259
url: "https://pub.dev"
252260
source: hosted
253-
version: "4.0.0"
261+
version: "4.0.1"
254262
network_tools_flutter:
255263
dependency: "direct main"
256264
description:
257265
path: ".."
258266
relative: true
259267
source: path
260-
version: "1.0.4"
268+
version: "1.0.3"
261269
path:
262270
dependency: transitive
263271
description:
@@ -266,6 +274,70 @@ packages:
266274
url: "https://pub.dev"
267275
source: hosted
268276
version: "1.8.3"
277+
path_provider:
278+
dependency: "direct main"
279+
description:
280+
name: path_provider
281+
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
282+
url: "https://pub.dev"
283+
source: hosted
284+
version: "2.1.1"
285+
path_provider_android:
286+
dependency: transitive
287+
description:
288+
name: path_provider_android
289+
sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1"
290+
url: "https://pub.dev"
291+
source: hosted
292+
version: "2.2.0"
293+
path_provider_foundation:
294+
dependency: transitive
295+
description:
296+
name: path_provider_foundation
297+
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
298+
url: "https://pub.dev"
299+
source: hosted
300+
version: "2.3.1"
301+
path_provider_linux:
302+
dependency: transitive
303+
description:
304+
name: path_provider_linux
305+
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
306+
url: "https://pub.dev"
307+
source: hosted
308+
version: "2.2.1"
309+
path_provider_platform_interface:
310+
dependency: transitive
311+
description:
312+
name: path_provider_platform_interface
313+
sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c"
314+
url: "https://pub.dev"
315+
source: hosted
316+
version: "2.1.1"
317+
path_provider_windows:
318+
dependency: transitive
319+
description:
320+
name: path_provider_windows
321+
sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
322+
url: "https://pub.dev"
323+
source: hosted
324+
version: "2.2.1"
325+
platform:
326+
dependency: transitive
327+
description:
328+
name: platform
329+
sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102
330+
url: "https://pub.dev"
331+
source: hosted
332+
version: "3.1.2"
333+
plugin_platform_interface:
334+
dependency: transitive
335+
description:
336+
name: plugin_platform_interface
337+
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
338+
url: "https://pub.dev"
339+
source: hosted
340+
version: "2.1.6"
269341
process_run:
270342
dependency: transitive
271343
description:
@@ -391,6 +463,22 @@ packages:
391463
url: "https://pub.dev"
392464
source: hosted
393465
version: "0.1.4-beta"
466+
win32:
467+
dependency: transitive
468+
description:
469+
name: win32
470+
sha256: c97defd418eef4ec88c0d1652cdce84b9f7b63dd7198e266d06ac1710d527067
471+
url: "https://pub.dev"
472+
source: hosted
473+
version: "5.0.8"
474+
xdg_directories:
475+
dependency: transitive
476+
description:
477+
name: xdg_directories
478+
sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2"
479+
url: "https://pub.dev"
480+
source: hosted
481+
version: "1.0.3"
394482
yaml:
395483
dependency: transitive
396484
description:
@@ -401,4 +489,4 @@ packages:
401489
version: "3.1.2"
402490
sdks:
403491
dart: ">=3.1.0 <4.0.0"
404-
flutter: ">=2.5.0"
492+
flutter: ">=3.7.0"

example/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ dependencies:
3636
cupertino_icons: ^1.0.2
3737
# Debugging and error logging.
3838
logging: ^1.2.0
39-
network_tools_flutter:
39+
network_tools_flutter:
4040
path: ../../network_tools_flutter
41+
path_provider: ^2.1.1
4142

4243
dev_dependencies:
4344
flutter_test:

lib/src/host_scanner_flutter.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ class HostScannerFlutter {
5050
i.toString(),
5151
limit.toString(),
5252
timeoutInSeconds.toString(),
53-
resultsInAddressAscendingOrder.toString()
53+
resultsInAddressAscendingOrder.toString(),
54+
dbDirectory,
55+
enableDebugging.toString()
5456
]);
5557
} else if (message is List<String>) {
5658
progressCallback
@@ -71,7 +73,6 @@ class HostScannerFlutter {
7173
/// Will search devices in the network inside new isolate
7274
@pragma('vm:entry-point')
7375
static Future<void> _startSearchingDevices(SendPort sendPort) async {
74-
configureNetworkTools();
7576
if (Platform.isIOS) {
7677
DartPingIOS.register();
7778
}
@@ -85,6 +86,10 @@ class HostScannerFlutter {
8586
final int lastSubnetIsolate = int.parse(message[2]);
8687
final int timeoutInSeconds = int.parse(message[3]);
8788
final bool resultsInAddressAscendingOrder = message[4] == "true";
89+
final String dbDirectory = message[5];
90+
final bool enableDebugging = message[6] == "true";
91+
await configureNetworkTools(dbDirectory,
92+
enableDebugging: enableDebugging);
8893

8994
/// Will contain all the hosts that got discovered in the network, will
9095
/// be use inorder to cancel on dispose of the page.

pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: network_tools_flutter
22
description: Extended features of network_tools package for flutter framework supporting iOS and Android
3-
version: 1.0.3
3+
version: 1.0.4
44
issue_tracker: https://github.com/osociety/network_tools_flutter/issues
55
repository: https://github.com/osociety/network_tools_flutter
66

@@ -39,7 +39,8 @@ dependencies:
3939
logging: ^1.2.0
4040
# Deal with internationalized/localized messages and more.
4141
intl: ^0.18.0
42-
network_tools: ^4.0.0
42+
network_tools: ^4.0.1
43+
path_provider: ^2.1.1
4344
universal_io: ^2.2.0
4445

4546
dev_dependencies:

test/host_scan_flutter_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void main() {
1414
// Fetching interfaceIp and hostIp
1515
setUpAll(() async {
1616
HttpOverrides.global = FakeResponseHttpOverrides();
17-
await configureNetworkTools();
17+
await configureNetworkTools('build');
1818
//open a port in shared way because of portscanner using same,
1919
//if passed false then two hosts come up in search and breaks test.
2020
server =

0 commit comments

Comments
 (0)