craft_kit 0.1.2
craft_kit: ^0.1.2 copied to clipboard
Swipeable card stacks with spring physics, per-direction behaviors, undo and a Dock-style genie, plus an OTP input and remembered-email suggestions.
0.1.2 #
- Fixed (web): undoing or rewinding a card that was consumed with the genie did
nothing and left the deck stuck. On the default CanvasKit renderer,
disposing an
ImageShaderalso disposes the picture it was made from, so the picture kept for the undo was already gone. The shader now gets its own reference on the web. - A card whose picture can no longer be drawn now comes back without the genie instead of leaving the deck half restored.
0.1.1 #
- Fixed: the genie effect never ran in release and profile builds (every consumed card fell back to the plain shrink). Capturing the card read a debug-only value that throws outside debug mode.
0.1.0 #
- Initial release.
- Remembered emails:
RememberedEmailStore,StorageRememberedEmailStore,EmailFieldController,EmailSuggestionEngine,RememberedEmailField,EmailSuggestionsView,EmailValidator,EmailInputFormatter, and the pluggableCraftStorage. - OTP input:
OtpCodeFieldandOtpCodeControllerwith paste, autofill and a processing / success / failure lifecycle;OtpStyle,OtpAnimationSpec,OtpHaptics,OtpLabels. - Swipeable cards:
SwipeCardStackandSwipeCardController, a spring-physics engine with:- a behavior per direction: dismiss, consume into a
SwipeTarget, spring back after running a task, or send to the back (SwipeBehavior); SwipeReactionfor buttons that react to a card approaching and arriving;- releases judged by projected position, velocity handed to the animation, interruptible at any moment, and rubber-banding toward closed directions;
SwipePhysics(smooth, snappy, bouncy, or custom springs),SwipeHaptics, grab-point tilt, and per-direction progress for flicker-free overlays;SwipeStackLayout(CascadeLayoutincluded) andSwipeCardInfofor any stack look,itemKeybased deck identity, undo, reset,onNeedMore,onPreload, keyboard, and screen-reader actions. Cards are built once and moved with transforms, soitemBuilderis not called while a card moves.SwipeBehavior.undo: dragging a direction springs the card back and brings the previous card back (nothing happens with nothing to bring back).SwipeCardController.rewind({count, stagger}): brings swiped cards back one after another. Returning cards keep moving when another is placed above them, so quick undos never jump.SwipeConsumeEffect.genie(withSwipeTarget.genieLag): a consumed card funnels into the centre point of its target like the macOS Dock minimize effect, and back out on undo. Pictures kept for undoing are bounded and always released.SwipeCardStack.initialIndexandSwipeCardController.jumpTo(key): start at, or move to, any card without animating the ones in between. The cards before it count as swiped andundobrings them back from above. For saved positions and for following an outside change such as a player.SwipeStampOverlayandSwipeStamp: the classic overlay, a coloured frame and a rotated word (LIKE, NOPE) in the corner, fading in with the drag.SwipeIntentOverlayandSwipeIntent: a ready-made drag overlay (a colour wash rising from the edge the card heads to, and a badge that arms when releasing would commit), drawn purely from the live progress.- A card keeps its state as it moves from the back of the stack to the top and out, and a swipe rebuilds only the cards whose role changed.
- Fixed: a card grabbed low flipped its tilt when released, and a card returned by undo did not keep the tilt it left with.
- a behavior per direction: dismiss, consume into a
- Fixed: the first build after
runAppor a hot restart could trip a!_dirtyassertion when a listener above anOtpCodeFieldrebuilt on the field's first snapshot. Snapshots are now always announced at the end of the frame. OtpCodeController.showSuccessAndWait()returns a future that completes when the success animation ends.OtpStyle.canvasVerticalPadding(default 44) andOtpStyle.resultGlow(defaultOtpResultGlow.classic).OtpStyle.fromThemenow selects a tighter field height and a gradient-tinted result glow, and has fuller light/dark surfaces and result gradients.const OtpStyle()is unchanged.StorageRememberedEmailStore.onCorruptDatareports discarded data; loading now recovers from any decode error.RememberedEmailField:invalidEmailMessage,autovalidateMode,textInputActionandsuggestionPadding.