lexicon 0.1.1 lexicon: ^0.1.1 copied to clipboard
AT Protocol standard Lexicon objects for Dart and Flutter.
// Copyright 2023 Shinya Kato. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.
import 'package:lexicon/lexicon.dart';
void main() {
final lexicon = LexiconDoc.fromJson({
'lexicon': 1,
'id': 'app.bsky.feed.like',
'defs': {
'main': {
'type': 'record',
'description': 'A declaration of a like.',
'key': 'tid',
'record': {
'type': 'object',
'required': ['subject', 'createdAt'],
'properties': {
'subject': {'type': 'ref', 'ref': 'com.atproto.repo.strongRef'},
'createdAt': {'type': 'string', 'format': 'datetime'}
}
}
}
}
});
print(lexicon.id);
print(lexicon.description);
print(lexicon.defs);
}