halildurmus / win32

Access common Win32 APIs directly from Dart using FFI — no C required!
https://win32.pub
BSD 3-Clause "New" or "Revised" License
763 stars 123 forks source link

None of the examples run. It is wonderful that some hyper advanced flutter guy can run this. But for noobs it is frustrating and useless #331

Closed PeterNierop closed 2 years ago

PeterNierop commented 2 years ago

Error: Couldn't resolve the package 'ffi' in 'package:ffi/ffi.dart'. Error: Couldn't resolve the package 'win32' in 'package:win32/win32.dart'. example/hello.dart:8:8: Error: Not found: 'package:ffi/ffi.dart' import 'package:ffi/ffi.dart'; ^ example/hello.dart:10:8: Error: Not found: 'package:win32/win32.dart' import 'package:win32/win32.dart'; ^ example/hello.dart:14:10: Error: Getter not found: 'WM_DESTROY'. case WM_DESTROY: ^^^^^^^^^^ example/hello.dart:15:7: Error: Method not found: 'PostQuitMessage'. PostQuitMessage(0); ^^^^^^^^^^^^^^^ example/hello.dart:18:10: Error: Getter not found: 'WM_PAINT'. case WM_PAINT: ^^^^^^^^ example/hello.dart:19:25: Error: 'PAINTSTRUCT' isn't a type. final ps = calloc(); ^^^^^^^^^^^ example/hello.dart:19:18: Error: Method not found: 'calloc'. final ps = calloc(); ^^^^^^ example/hello.dart:20:19: Error: Method not found: 'BeginPaint'. final hdc = BeginPaint(hWnd, ps); ^^^^^^^^^^

timsneath commented 2 years ago

Guides on how to use packages is can be found here: https://dart.dev/guides/packages

If you're in the folder root, you'll run dart pub get to download its dependencies, and then you can run:

dart example\hello.dart

to run an example.