Skip to content

Commit

Permalink
Add FVM config to example, update example
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirtex committed Jul 26, 2022
1 parent f3ae0f1 commit 0752f9d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 27 deletions.
1 change: 1 addition & 0 deletions example/.fvm/flutter_sdk
File renamed without changes.
22 changes: 16 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
final List<HostModel> _hosts = <HostModel>[];

double progress = 0.0;

@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -38,16 +40,24 @@ class _MyHomePageState extends State<MyHomePage> {
child: SingleChildScrollView(
child: Column(
children: [
LinearProgressIndicator(value: progress),
ElevatedButton(
onPressed: () {
final scanner = LanScanner(debugLogging: true);
setState(() {
progress = 0.0;
_hosts.clear();
});

final scanner = LanScanner(debugLogging: true);
final stream = scanner.icmpScan(
'192.168.0',
progressCallback: (progress) {
if (kDebugMode) {
print('progress: $progress');
}
scanThreads: 20,
progressCallback: (newProgress) {
setState(() {
progress = newProgress;
});

print('progress: $progress');
},
);

Expand All @@ -62,6 +72,7 @@ class _MyHomePageState extends State<MyHomePage> {
ListView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: _hosts.length,
itemBuilder: (context, index) {
final host = _hosts[index];

Expand All @@ -71,7 +82,6 @@ class _MyHomePageState extends State<MyHomePage> {
),
);
},
itemCount: _hosts.length,
),
],
),
Expand Down
27 changes: 6 additions & 21 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,7 @@ packages:
name: dart_ping
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.2"
dart_ping_ios:
dependency: transitive
description:
name: dart_ping_ios
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "7.0.1"
fake_async:
dependency: transitive
description:
Expand All @@ -76,13 +69,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_icmp_ping:
dependency: transitive
description:
name: flutter_icmp_ping
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
flutter_lints:
dependency: "direct dev"
description:
Expand All @@ -98,10 +84,10 @@ packages:
lan_scanner:
dependency: "direct main"
description:
name: lan_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
path: "C:\\Users\\hjozw\\OneDrive\\Dokumenty\\Development\\Flutter\\lan_scanner"
relative: false
source: path
version: "3.5.0"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -192,5 +178,4 @@ packages:
source: hosted
version: "2.1.2"
sdks:
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=1.20.0"
dart: ">=2.17.0 <3.0.0"
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies:
cupertino_icons: ^1.0.2

lan_scanner:
path: C:\Users\hjozw\OneDrive\Dokumenty\Development\Flutter\lan_scanner

dev_dependencies:
flutter_test:
Expand Down
8 changes: 8 additions & 0 deletions example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
Expand All @@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

0 comments on commit 0752f9d

Please sign in to comment.