Skip to content

Commit de89e5b

Browse files
authored
Undo bump to 0.1.4 (flutter#19)
Package stable versions should only depend on sdk stable versions.
1 parent d3ccbfc commit de89e5b

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 0.1.4
3+
## 0.1.3-dev.4
44

55
Bump SDK constraint to `>= 2.6.0-dev.8.2` which contains the new API of `dart:ffi`.
66

example/main.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import 'dart:ffi';
2+
3+
import 'package:ffi/ffi.dart';
4+
5+
main() {
6+
// Allocate and free some native memory with malloc and free.
7+
final pointer = allocate<Uint8>();
8+
pointer.value = 3;
9+
print(pointer.value);
10+
free(pointer);
11+
12+
// Use the Utf8 helper to encode null-terminated Utf8 strings in native memory.
13+
final String myString = "😎👿💬";
14+
final Pointer<Utf8> charPointer = Utf8.toUtf8(myString);
15+
print("First byte is: ${charPointer.cast<Uint8>().value}");
16+
print(Utf8.fromUtf8(charPointer));
17+
free(charPointer);
18+
}

pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: ffi
2-
version: 0.1.4
2+
version: 0.1.3-dev.4
33
author: Dart Team <[email protected]>
44
homepage: https://github.com/dart-lang/ffi
55
description: Utilities for working with Foreign Function Interface (FFI) code.
66

77
environment:
88
sdk: '>=2.6.0-dev.8.2 <3.0.0'
9-
documentation: https://pub.dev/documentation/ffi/
109

1110
dependencies:
1211

0 commit comments

Comments
 (0)