-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Add a function type like () -> Unit to the default types that Gallery can display. This will enhance the Composable manual test review experience.
In addition, the following points should be kept in mind to create a more meaningful UI Catalog.
- Provide some kind of feedback when an event occurs.
- Display Snackbar.
- Displays detailed information about the invoked event.
- Support events with arguments and return value. This has a significant effect when MVI is employed.
- It would be even better to have a UI like BottomSheet (or Drawer, Dialog) that lists the events that have occurred.
@Composable () -> Unit, so that lambdas such as A can also be accepted. It is very common for UI components to provide a Slot argument.- It would be better if the size, position, and number of elements to be placed were editable. This is because a Slot may have child elements of various sizes.
Usage example
val `MyButton with onEvent parameter` by story {
// `lambdaParameter()` function by
val onClick: /* () -> Unit */ by lambdaParameter()
// With type parameter
val onIntent: (MyIntent) -> Unit by lambdaParameter<MyIntent, Unit>()
// With return value
val getMyData: /* () -> MyData */ by lambdaParameter<MyData>()
// With event label
// - This is useful to distinguish between multiple parameters of a function type.
val onClickWithLabel: /* () -> Unit */ by parameter(label = "onClick" /* Might as well have it set up automatically. */)
MyButton(
onClick = onClick,
)
MyScreen(
onIntent = onIntent,
getMyData = getMyData,
)
} Metadata
Metadata
Assignees
Labels
No labels