Skip to main content

is_shapes 0.6.0 copy "is_shapes: ^0.6.0" to clipboard
is_shapes: ^0.6.0 copied to clipboard

What an intersyntactic shape file uses to mark the fields a node is about, and to name a node, point at it exactly or by what it is about, say who wrote it, and take it back.

example/is_shapes_example.dart

// A module's own shape, the way its shape file declares it, with its
// identity marked. Then a node of it taken back.
import 'package:is_shapes/is_shapes.dart';

/// A note: what it is about is when it was written; its text may be edited
/// without it becoming a different note, and its author may take it back.
final class Note implements Withdrawable {
  const Note({required this.sentAt, required this.text});
  @identity
  final DateTime sentAt;
  final String text;
}

void main() {
  // Ids are read back from text where a node arrives; null if malformed.
  final sent = TurnId.parse(
    'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
  );
  final author = ActorId.parse('slack:T0001/U024BE7LH');
  if (sent == null || author == null) return;

  final withdrawal = Withdrawal<Note>(target: sent, by: author);
  print('${withdrawal.by} took back ${withdrawal.target}');
}
0
likes
160
points
1.06k
downloads

Documentation

API reference

Publisher

verified publisherenspyr.co

Weekly Downloads

What an intersyntactic shape file uses to mark the fields a node is about, and to name a node, point at it exactly or by what it is about, say who wrote it, and take it back.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

is_content_id

More

Packages that depend on is_shapes