Skip to content

Commit

Permalink
Merge pull request #24 from osociety/dev
Browse files Browse the repository at this point in the history
Dev -> Main
  • Loading branch information
git-elliot authored Sep 24, 2023
2 parents 187acb5 + 887efbc commit cf776f9
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 1.0.4

1. Use network_tools v4.0.1 to fix path issue in flutter.

## 1.0.3

1. Consume latest version of network_tools v4.0.0
Expand Down
5 changes: 4 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import 'package:flutter/material.dart';
import 'package:network_tools_flutter/network_tools_flutter.dart';
import 'package:path_provider/path_provider.dart';

Future<void> main() async {
await configureNetworkTools(enableDebugging: true);
WidgetsFlutterBinding.ensureInitialized();
final appDocDirectory = await getApplicationDocumentsDirectory();
await configureNetworkTools(appDocDirectory.path, enableDebugging: true);
runApp(const MyApp());
}

Expand Down
2 changes: 2 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import FlutterMacOS
import Foundation

import path_provider_foundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
7 changes: 7 additions & 0 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
PODS:
- FlutterMacOS (1.0.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)

EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

Expand Down
18 changes: 18 additions & 0 deletions example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
6FAAE479752EBB508C6EA525 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -381,6 +382,23 @@
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";
showEnvVarsInLog = 0;
};
6FAAE479752EBB508C6EA525 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C87B1A810202F6F98C39C119 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
96 changes: 92 additions & 4 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
ffi:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -247,17 +255,17 @@ packages:
dependency: transitive
description:
name: network_tools
sha256: "872d76529329e43b52a837852f7e4c49b4fdf65be7dedc3ee5722ea135fcad08"
sha256: "84cd355e2d9db58456a05b7ebd4021fcbe42241043b7e6157bff2a0853054dd4"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "4.0.1"
network_tools_flutter:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.0.4"
version: "1.0.3"
path:
dependency: transitive
description:
Expand All @@ -266,6 +274,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.8.3"
path_provider:
dependency: "direct main"
description:
name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
url: "https://pub.dev"
source: hosted
version: "2.2.1"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
platform:
dependency: transitive
description:
name: platform
sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102
url: "https://pub.dev"
source: hosted
version: "3.1.2"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
url: "https://pub.dev"
source: hosted
version: "2.1.6"
process_run:
dependency: transitive
description:
Expand Down Expand Up @@ -391,6 +463,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
win32:
dependency: transitive
description:
name: win32
sha256: c97defd418eef4ec88c0d1652cdce84b9f7b63dd7198e266d06ac1710d527067
url: "https://pub.dev"
source: hosted
version: "5.0.8"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2"
url: "https://pub.dev"
source: hosted
version: "1.0.3"
yaml:
dependency: transitive
description:
Expand All @@ -401,4 +489,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.1.0 <4.0.0"
flutter: ">=2.5.0"
flutter: ">=3.7.0"
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ dependencies:
cupertino_icons: ^1.0.2
# Debugging and error logging.
logging: ^1.2.0
network_tools_flutter:
network_tools_flutter:
path: ../../network_tools_flutter
path_provider: ^2.1.1

dev_dependencies:
flutter_test:
Expand Down
9 changes: 7 additions & 2 deletions lib/src/host_scanner_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class HostScannerFlutter {
i.toString(),
limit.toString(),
timeoutInSeconds.toString(),
resultsInAddressAscendingOrder.toString()
resultsInAddressAscendingOrder.toString(),
dbDirectory,
enableDebugging.toString()
]);
} else if (message is List<String>) {
progressCallback
Expand All @@ -71,7 +73,6 @@ class HostScannerFlutter {
/// Will search devices in the network inside new isolate
@pragma('vm:entry-point')
static Future<void> _startSearchingDevices(SendPort sendPort) async {
configureNetworkTools();
if (Platform.isIOS) {
DartPingIOS.register();
}
Expand All @@ -85,6 +86,10 @@ class HostScannerFlutter {
final int lastSubnetIsolate = int.parse(message[2]);
final int timeoutInSeconds = int.parse(message[3]);
final bool resultsInAddressAscendingOrder = message[4] == "true";
final String dbDirectory = message[5];
final bool enableDebugging = message[6] == "true";
await configureNetworkTools(dbDirectory,
enableDebugging: enableDebugging);

/// Will contain all the hosts that got discovered in the network, will
/// be use inorder to cancel on dispose of the page.
Expand Down
5 changes: 3 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: network_tools_flutter
description: Extended features of network_tools package for flutter framework supporting iOS and Android
version: 1.0.3
version: 1.0.4
issue_tracker: https://github.com/osociety/network_tools_flutter/issues
repository: https://github.com/osociety/network_tools_flutter

Expand Down Expand Up @@ -39,7 +39,8 @@ dependencies:
logging: ^1.2.0
# Deal with internationalized/localized messages and more.
intl: ^0.18.0
network_tools: ^4.0.0
network_tools: ^4.0.1
path_provider: ^2.1.1
universal_io: ^2.2.0

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion test/host_scan_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void main() {
// Fetching interfaceIp and hostIp
setUpAll(() async {
HttpOverrides.global = FakeResponseHttpOverrides();
await configureNetworkTools();
await configureNetworkTools('build');
//open a port in shared way because of portscanner using same,
//if passed false then two hosts come up in search and breaks test.
server =
Expand Down
2 changes: 1 addition & 1 deletion test/port_scan_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
// Fetching interfaceIp and hostIp
setUpAll(() async {
HttpOverrides.global = FakeResponseHttpOverrides();
await configureNetworkTools();
await configureNetworkTools('build');
//open a port in shared way because of hostscanner using same,
//if passed false then two hosts come up in search and breaks test.
server =
Expand Down

0 comments on commit cf776f9

Please sign in to comment.