fr_acdd 0.2.0
fr_acdd: ^0.2.0 copied to clipboard
Contract annotations and protobuf extraction for FlowR contract-first pages.
fr_acdd #
Pure Dart annotations and extraction utilities for FlowR contract-first pages.
fr_acdd reads @FrAcddPage, @FrAcddDto, and @FrAcddField annotations
from a contract page, extracts the root and nested DTO definitions, and renders
them as a .proto schema.
Recommended DTO preset:
@FrAcddDto(kind: FrAcddDtoKind.root)
@FrAcddFreezed
class NotificationsScreenDataModel with _$NotificationsScreenDataModel {
const factory NotificationsScreenDataModel({
@FrAcddField(tag: 1)
required String title,
}) = _NotificationsScreenDataModel;
}
@Freezed(...) and legacy @freezed are still accepted, but
@FrAcddFreezed keeps the DTO preset short and explicit.
Route and Figma metadata are copied from the contract doc comments when the
page follows the fr-mvvm-contract convention:
/// Figma: https://www.figma.com/file/...
/// Route: AppRouter.notifications
@FrAcddPage(
mode: FrAcddMode.bffDto,
namespace: 'notifications_page',
)
class NotificationsPage extends StatelessWidget {
const NotificationsPage({super.key});
}
CLI:
fvm dart run fr_acdd:extract_bff_dto --input path/to/xxx_page.dart --output path/to/xxx_page.proto
For protobuf safety, every included root or nested field must declare
@FrAcddField(tag: ...). The extractor will fail fast when tags are missing,
duplicated, or use the reserved range 19000-19999.