Skip to content

Commit fc8512c

Browse files
Merge pull request #359 from StacDev/mn/stac-screen-annotation-cli
Add StacScreen annotation and annotations barrel; re-export in barrels
2 parents 0cf7c4b + ecc851d commit fc8512c

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
library;
2+
3+
export 'stac_screen.dart';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/// Annotation to mark methods that return StacWidget instances.
2+
///
3+
/// This annotation is used to identify screen-level widgets in the Stac framework.
4+
/// Methods that return StacWidget should be annotated with this to indicate
5+
/// they represent screen definitions.
6+
///
7+
/// Example usage:
8+
/// ```dart
9+
/// @StacScreen(screenName: 'home')
10+
/// StacWidget buildHomeScreen() {
11+
/// return StacWidget(jsonData: {'type': 'scaffold', 'body': '...'});
12+
/// }
13+
/// ```
14+
class StacScreen {
15+
/// Creates a [StacScreen] annotation with the given screen name.
16+
const StacScreen({required this.screenName});
17+
18+
/// The name identifier for this screen.
19+
final String screenName;
20+
}

packages/stac_core/lib/core/core.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ library;
22

33
export 'stac_action.dart';
44
export 'stac_widget.dart';
5+
export '../annotations/annotations.dart';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
library;
22

33
export 'actions/actions.dart';
4+
export 'annotations/annotations.dart';
45
export 'core/core.dart';
56
export 'foundation/foundation.dart';
67
export 'widgets/widgets.dart';

0 commit comments

Comments
 (0)