Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stable | |
class HintController internal constructor() { | |
private var queue = mutableStateListOf<HintAnchorState>() | |
internal val hint: HintAnchorState? get() = queue.firstOrNull() | |
private val pendingRequests = mutableMapOf<HintAnchorState, Continuation<Unit>>() | |
suspend fun show(hint: HintAnchorState) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
internal fun HintOverlay( | |
anchor: HintAnchorState, | |
onDismiss: () -> Unit, | |
) { | |
Popup( | |
onDismissRequest = onDismiss, | |
// Set focusable to handle back press events | |
properties = remember { PopupProperties(focusable = true) }, | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stable | |
class HintController internal constructor() { | |
internal var hint by mutableStateOf<HintAnchorState?>(null) | |
fun show(hint: HintAnchorState) { | |
this.hint = hint | |
} | |
fun dismiss() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun rememberHintController(overlay: Brush): HintController { | |
return rememberHintController(overlay = LocalHintOverlayBrush provides overlay) | |
} | |
@Composable | |
fun rememberHintController(overlay: Color = HintOverlayColorDefault): HintController { | |
return rememberHintController(overlay = LocalHintOverlayColor provides overlay) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"basics": { | |
"name": "Thomas Edison", | |
"label": "Inventor and Businessman", | |
"picture": "https://example.com/photo.jpg", | |
"email": "thomas.edison@example.com", | |
"phone": "(123) 456-7890", | |
"website": "https://thomasedison.com", | |
"summary": "Prolific inventor and businessman known for developing many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the electric light bulb.", | |
"location": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:http/http.dart' as http; | |
import 'dart:convert'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatefulWidget { | |
const MyApp({Key? key}) : super(key: key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val hintController = rememberHintController() | |
IconButton( | |
modifier = Modifier | |
.hintAnchor(topAppBarActionHintAnchor, CircleShape), | |
onClick = { | |
hintController.show(topAppBarActionHintAnchor) | |
}, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stable | |
class HintController internal constructor() { | |
internal var hint by mutableStateOf<HintAnchorState?>(null) | |
fun show(hint: HintAnchorState) { | |
this.hint = hint | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
School of Nursing, UCH, Ibadan 2025/2026 {O8125777035} Admission Form Is STILL ON SALE.. Call DR.MRS ALICE OGUNSOLA on {O8125777035}.The Management of the school hereby inform the general public of the sales of the general Nursing Admission form into the School of Nursing, Also midwifery, post-basic midwifery form, post-basic nursing form and internship form are still on sale for more information on purchase of the form and admission assistance call Admin Officer{O8125777035} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
internal fun HintsContainer( | |
modifier: Modifier, | |
anchors: () -> List<HintAnchorState>, | |
) { | |
val anchors = anchors() | |
Layout( | |
modifier = modifier | |
.overlayBackground(anchors), |