import 'dart:ffi' as ffi; typedef getchar_func = ffi.Int8 Function(); final dylib = ffi.DynamicLibrary.open("/usr/lib/libstdc++.so"); final int Function() getChar = dylib.lookup>('getchar').asFunction(); void main() { int input = getChar(); // There's no `char` in Dart. Use the following to convert your ASCII value // into a [String]: print(String.fromCharCode(input)); }