diff --git a/packages/stac_core/lib/annotations/annotations.dart b/packages/stac_core/lib/annotations/annotations.dart new file mode 100644 index 00000000..0b3ece7b --- /dev/null +++ b/packages/stac_core/lib/annotations/annotations.dart @@ -0,0 +1,3 @@ +library; + +export 'stac_screen.dart'; diff --git a/packages/stac_core/lib/annotations/stac_screen.dart b/packages/stac_core/lib/annotations/stac_screen.dart new file mode 100644 index 00000000..b8261afe --- /dev/null +++ b/packages/stac_core/lib/annotations/stac_screen.dart @@ -0,0 +1,20 @@ +/// Annotation to mark methods that return StacWidget instances. +/// +/// This annotation is used to identify screen-level widgets in the Stac framework. +/// Methods that return StacWidget should be annotated with this to indicate +/// they represent screen definitions. +/// +/// Example usage: +/// ```dart +/// @StacScreen(screenName: 'home') +/// StacWidget buildHomeScreen() { +/// return StacWidget(jsonData: {'type': 'scaffold', 'body': '...'}); +/// } +/// ``` +class StacScreen { + /// Creates a [StacScreen] annotation with the given screen name. + const StacScreen({required this.screenName}); + + /// The name identifier for this screen. + final String screenName; +} diff --git a/packages/stac_core/lib/core/core.dart b/packages/stac_core/lib/core/core.dart index 2b585799..9b3c3f1d 100644 --- a/packages/stac_core/lib/core/core.dart +++ b/packages/stac_core/lib/core/core.dart @@ -2,3 +2,4 @@ library; export 'stac_action.dart'; export 'stac_widget.dart'; +export '../annotations/annotations.dart'; diff --git a/packages/stac_core/lib/stac_core.dart b/packages/stac_core/lib/stac_core.dart index faf36892..694a0c44 100644 --- a/packages/stac_core/lib/stac_core.dart +++ b/packages/stac_core/lib/stac_core.dart @@ -1,6 +1,7 @@ library; export 'actions/actions.dart'; +export 'annotations/annotations.dart'; export 'core/core.dart'; export 'foundation/foundation.dart'; export 'widgets/widgets.dart';