ux 0.19.0
ux: ^0.19.0 copied to clipboard
Flutter toolkit for fluid, native-feeling UIs. Includes frame-accurate keyboard height tracking via FFI with interactive dismiss, bezier utilities, and layout primitives.
0.19.0 #
- Android media projection is opt-in. Screen sharing and playback capture
run inside a
mediaProjectionforeground service, and Google Play asks every app that declares one for a media projection declaration. An app declaresScreenShareService,AudioProjectionService,FOREGROUND_SERVICEandFOREGROUND_SERVICE_MEDIA_PROJECTIONonly when itspubspec.yamlsetsux: enable_media_projection: true, or Gradle runs with-Pux.enable_media_projection=true. Without them,XScreenSourcesBackend.available()is false on Android,startSharethrowsunsupported, andXAudioCapture.sources()lists no playback. Breaking: an app that shares its screen or captures playback on Android setsux: enable_media_projection: true. - Android photo library access is opt-in per media kind. Google Play asks
every app that declares
READ_MEDIA_IMAGESorREAD_MEDIA_VIDEOfor a photo and video permissions declaration. An app whosepubspec.yamlsetsux: enable_gallery_photos: truedeclaresREAD_MEDIA_IMAGES, one that setsux: enable_gallery_videos: truedeclaresREAD_MEDIA_VIDEO, and either declaresREAD_MEDIA_VISUAL_USER_SELECTEDandREAD_EXTERNAL_STORAGEwithmaxSdkVersion32;-Pux.enable_gallery_photos=trueand-Pux.enable_gallery_videos=truedo the same from Gradle.XGalleryasks for and lists only the kinds the app's merged manifest declares, so an app that reads photos alone isgrantedonREAD_MEDIA_IMAGES. An app's own<uses-permission>lines merge beside ux's, so an app that opts in removes its ownREAD_MEDIA_IMAGES,READ_MEDIA_VIDEO,READ_MEDIA_VISUAL_USER_SELECTEDandREAD_EXTERNAL_STORAGE. Breaking: an app whose merged manifest declares neitherREAD_MEDIA_IMAGESnorREAD_MEDIA_VIDEOgets the newXGalleryPermission.unavailablefrompermission()andrequestPermission(), no albums or assets, and aMediaPickerPageplaceholder without an action, and aswitchoverXGalleryPermissionhandlesunavailable.
0.18.0 #
XUrl.matchreads links with one Dart detector on every platform. It reads web links and emails in Dart, the same on every platform, as Apple'sNSDataDetectorreads common link shapes and by the rules below. Breaking:XUrl.debugDetect,UrlMatchKind.wireByteandUrlMatchKind.fromByteare removed, and macOS and Windows link no phones.- Scheme links. A scheme link's host ends before a sub-delimiter, a
~, a parenthesis, or dots before a?or:, and a link may start in the text after it:see https://a.com,b.com xlinkshttps://a.comandhttp://b.com. A writtentel:URI is a web link whose URL is its text:call tel:+15551234567 nowlinkstel:+15551234567. Awebcal:URI whose body is one/is no link:see webcal:/ xlinks nothing. - Where a link ends. A
)the link does not open ends it where only.,,,;,!,', parentheses,?and:follow it:(https://docs.flutter.dev/setup)?linkshttps://docs.flutter.dev/setup. A link ends before a trailing”,’or…, and a bare host starts after a“:see “https://example.com/a” xlinkshttps://example.com/a. Where a character other than a letter, mark, digit or_follows it, a link ends before its trailing symbols and punctuation from the first non-ASCII one:see example.com/a-😀 xlinkshttp://example.com/a-. Text past fullwidth parentheses that continues a link's path links nothing:https://example.com/a(1)/x?m=a@b.comlinkshttps://example.com/aalone. - Hosts. A host with no scheme links where its last label is a
top-level domain on IANA's list, version 2026101500:
banlu.applinkshttp://banlu.app. The top-level domain matches written in lowercase or as its Unicode label, or in any case for com, edu, gov, net and org:see EXAMPLE.APP xlinks nothing. A host's labels are Unicode 17.0.0's letters, marks and digits with-or_inside:see example.bücher.app xlinkshttp://example.bücher.app. Before the top-level domain, Korean letters stand in any host, Chinese, Japanese and Thai letters only in one whose first label iswww, and Lao, Khmer and Myanmar letters in none. An ASCII label right before a top-level domain in one of these scripts makes no link:see example.ไทย nowlinks nothing. A host, with a scheme or without, ends before letters of these scripts glued to it:http://example.com然后linkshttp://example.com. A host with no scheme that a letter, mark or digit outside these scripts follows directly, or a letter after a., is no link:see example.com.Then youlinks nothing. A host right before://is that scheme's text:1.tg://a.io/a xlinkstg://a.io/a. - IP addresses and ports. A bare IPv4 address links where neither its
first number nor any number of two or more digits in it starts with
0, and no.and ASCII digit follow it:ip 010.168.1.1 xlinks nothing. A port of fullwidth digits reads as its ASCII digits:see example.com:80 xlinkshttp://example.com:80. - Emails. An email's local part is the run of ASCII letters, digits,
.,_,%,+and-before its@, wherever the run starts:see a|b@x.comlinksmailto:b@x.com. Its domain is two or more ASCII labels, the last a top-level domain on IANA's list in any case:mail ops@example.zzz nowlinks nothing. A bidi control between two of an email's characters stays in it. Where an@has no such local part or domain, the text after it reads as any text does:mail ops@Bücher.de nowlinkshttp://Bücher.de. - Invisible and bidi characters. No link holds an invisible space,
such as a zero-width space: a web link or email ends before one, the
text it cuts off starts no link, and a phone holding one does not link:
see https://exam\u200Bple.com xlinkshttps://exam. A format character inside a word starts no bare host unless Chinese, Japanese, Korean, Thai, Lao, Khmer or Myanmar letters precede it:ข้อมูล\u2060example.comlinkshttp://example.com. A web link keeps a bidi control of its text in its URL, an email or phone whose text holds one takes its scheme and its text for its URL, andXUrl.launchrefuses a URL holding one:mail ops\u061C@example.com.linksmailto:ops\u061C@example.com. - Phones. On iOS and Android alone,
XUrl.matchadds the phones the platform's detector reads,NSDataDetector's on iOS andPatterns.PHONE's on Android, where one starts the text or follows a space with(,+or0, its number holds seven digits or more and it overlaps no web link or email:call +40 712 345 678 nowlinkstel:+40712345678. A phone's URL istel:and its number, without an extension:call +1 (555) 123-4567 ext. 89 nowlinkstel:+15551234567. - Long texts. No web link or email spans a space, tab, LF, FF or CR,
and a text of more than 4,096 UTF-16 units links nothing past its last
such character at or before its 4,096th unit:
'x ' * 2047 + 'https://example.com'links nothing.
- Scheme links. A scheme link's host ends before a sub-delimiter, a
- A screen can claim back that pops nothing.
Screen.claimsBacksays that the screen'shandleBacktakes back now, as a home's does while it closes a search. While back goes to a screen that claims it, the oneScreenStackState.backTopnames or else home,XRouter.canPopandScreenStackState.canPophold, so on Android 13 and later system back and a predictive back reach itshandleBackrather than the OS. A screen whose claim changes emits, where it is aListenable, or callsXRouter.pagesChanged. - A camera page showing an error leaves the picker's camera cell in view.
A
CameraPagecovers its picker's camera cell only while it flies the cell's preview, so the cell shows under a camera page with an error, as after a failed capture, through its exit and on the frame it leaves. - A video's preview player lives while any compose shows it.
ComposeEntry.retainVideoholds an entry's preview player, loading it for the first hold, andComposeEntry.releaseVideodrops a hold, disposing the player with the last. EachComposePageholds the player of the video it shows, so a compose reopened on a video while an earlier compose on it leaves keeps its player after the earlier one is disposed. Breaking:ComposeEntry.disposeVideois replaced byComposeEntry.releaseVideo. - A picker's compose entries live until the last screen showing them
leaves.
ComposeEntry.retainadds a hold on an entry andComposeEntry.releasedrops one, disposing the entry with the last.MediaPickerPageand eachComposePage.borrowedhold the entries they share, so a compose page popped with its picker in one event, as on sign-out, paints its entries through its exit. - A leaving screen takes no taps. A screen leaving a
ScreenStacktakes no pointer through its pop animation, so a tap on a dismissed screen's button reaches the screen under it. A screen takes taps as it enters and while a back gesture drives it or springs it back. - A screen with no pop animation leaves at once. A screen leaving a
ScreenStackwith no pop animation to run, as with a zerotransitionDuration, leaves in the build that drops it, so it builds and paints no frame after its pop. A leaving screen'sonRemoved, and the stack's, run after the frame it leaves in. - A
ScreenHeroflies. AScreenHeroregisters with theScreenStackaround it. When a screen is pushed over another or popped off it, a hero on one that shares its tag with a hero on the other flies from its place to the other's over the transition, in theOverlayaround the stack; a pop that a back gesture drives does not fly, and a flight lands as either screen hides.ScreenHeroControllertakes a hero's state inregisterandunregister, flies heroes between two slots withflyand lands the flights from or to a slot withland, andScreenSlot.maybeOffinds the slot whose screen holds a context. Breaking:ScreenHeroController.registerandunregistertake the hero's state alone, andScreenHeroController.snapshot,ScreenHeroController.maybeStartFlightsandScreenHeroState.globalRectare removed. - macOS and Windows report Reduce Motion.
XAccessibility.reduceMotion(package:ux/accessibility.dart) holds whether the OS asks apps to reduce motion where Flutter's embedder does not report it, and follows its changes while the app runs: on macOS the Reduce motion setting,NSWorkspace'saccessibilityDisplayShouldReduceMotion, read again on eachaccessibilityDisplayOptionsDidChangeNotification, and on Windows Animation effects off,SPI_GETCLIENTAREAANIMATION, read again on eachWM_SETTINGCHANGE. On iOS, Android and Linux, whose FlutterAccessibilityFeaturescarry the setting, it stays false. - A link written with non-ASCII text opens before iOS 17 and macOS 14. On
iOS and macOS,
XUrl.launchpercent-encodes a link's UTF-8 bytes outside RFC 3986's URL characters, a#after the first and a[or]outside the authority before opening it, and keeps a%that two hex digits follow, sohttps://zh.wikipedia.org/wiki/北京_(城市)openshttps://zh.wikipedia.org/wiki/%E5%8C%97%E4%BA%AC_(%E5%9F%8E%E5%B8%82)andhttps://example.com/aé%20bopenshttps://example.com/a%C3%A9%20b. - A video export cancelled as it starts ends cancelled. On iOS and macOS,
XVideoExportSession.cancelfailsdonewithcancelledand leaves no file whenever it comes afterXVideoExporter.start, right after it included, on the pass-through and the re-encoding path, as on Android and Windows. - Windows captures from cameras.
uxAvailableCameraslists Windows's video capture devices, each as the back lens with asensorOrientationof 0, as macOS lists an external camera, andXCameraControllerpreviews, takes JPEG photos and records H.264/AAC MP4s on Windows through Media Foundation's capture engine, writingux_camera_<GUID>.jpgand.mp4in the temporary directory. Flash and orientation locks succeed and change nothing. The permission checks answer whether Windows's Privacy & security settings let desktop apps use the camera and the microphone, and the requests answer the same, since Windows shows no prompt, first opening the camera's or the microphone's privacy page where it is denied;openSystemSettingsopens the camera's privacy page. Where Media Foundation is missing,uxAvailableCamerasthrowsno_camera. - Windows shares files.
XFiles.shareon Windows opens the Windows share window over the app's window and hands it the file, titled withtitleor else the file's name. The window places itself, sosourceRectis ignored, asmimeTypeis;shareanswers false when the app has no window.XFiles.supportsShareis true on Windows. - Windows encrypts uploads natively.
XCrypto.aesCtrEncryptRangeandXCrypto.aesCtrByteson Windows run AES-256-CTR through CNG off the platform thread: AES in ECB mode, with AES-NI where the CPU has it, encrypts the counter blocks into the keystream XORed over the data, andaesCtrEncryptRangereads the file's range itself, so only ciphertext crosses the channel.XCrypto.isSupportedis true on Windows. - The AES-CTR counter carries across all 128 bits on iOS and macOS.
XCrypto.aesCtrEncryptRangeandXCrypto.aesCtrByteson iOS and macOS carry the counter from its low 64 bits into its high 64 bits where they wrap, so their ciphertext equalsencryptChunk's for everyivandpos, as on Android and Windows. - A cancelled video export ends. On iOS and macOS, cancelling an export
that re-encodes with a
transformwhile it runs failsdonewithcancelledand deletes the partial file, as on Android and Windows. - A video keeps its speed when it starts playing. On iOS and macOS,
XVideoPlayerController.playplays at the speedsetPlaybackSpeedlast set, a speed set while paused included, so the speed holds after a pause and when a looping video restarts, as on Android and Windows. - A video that already failed to load fails
initialize. On iOS and macOS,XVideoPlayerController.initializeandXVideoPlayerBackend.initializefail at once withdecode_failedand the load's error when the video failed to load beforeinitializewas called, as when it fails whileinitializewaits. - A video that fails to load before
initializereports it on Windows. On Windows, a player whose video fails to load beforeinitializeemits anXVideoPlayerErrorwithplayback_failedand the load's error, andinitializethen fails withdecode_failed, as on iOS and macOS. - A video streams over http(s) on Windows. On Windows,
XVideoPlayerController.networkandXVideoPlayerBackend.createtake an http(s) URL, which Media Foundation's media engine streams, as on iOS, macOS and Android. - A second dispose of a video player is a no-op.
MethodChannelXVideoPlayerBackend.disposeInstancecompletes when the platform answers that the player is already disposed, asXVideoPlayerBackend.disposeInstancedocuments.XVideoPlayerController.disposefails with any other error the platform answers, once it has disposed the controller. - Windows pastes images and files.
XClipboard.readFileson Windows answers the path and name of each file an Explorer copy put on the clipboard.XClipboard.readImageanswers the bytes of the clipboard'sPNGformat, or a bitmap the clipboard holds asCF_DIBV5orCF_DIB, uncompressed at 1 to 32 bits a pixel, encoded as PNG, with alpha where a V4 or V5 header has an alpha mask.XClipboard.hasMediaanswers whether the clipboard holds any of these without reading them. - Windows takes dropped files.
XDropon Windows reports a drag of files over the app's window, at Flutter's logical coordinates, and delivers the dropped files and folders, answering copy while a drop region is active and none otherwise. A file a source offers only as a virtual file, such as an Outlook attachment or an image from a browser, is written to%TEMP%\ux_drops\<GUID>\<name>and delivered withisTemporaryCopy.XDrop.startZipon Windows zips a dropped folder in an isolate into<temp>\ux_drops\<uuid>\<folder>.zip, deflated, with the folder as the archive's root and zip64 records past 4 GiB or 65,535 entries, reporting the fraction of bytes read; a cancel answers null and a failure throws, and either removes that directory. - Windows shows toasts.
XNotificationson Windows shows a toast under the process's explicit AppUserModelID, with the title and the body as its lines; a later toast with the same id and thread replaces it,cancelByThreadremoves a thread's toasts andcancelAllall of them.requestPermissionanswers whether toasts are enabled for the app and emitsauthorization. A click restores and raises the app's window and reachesonTapwith the toast's data, through the COM class the host names with the new C APIXPluginCApiSetToastActivator; a click after the app has exited starts it. Every method of a process with no AppUserModelID fails withno_app_user_model_id. - Windows reports focus and keeps the display awake.
XWindow.focusedfollowsWM_ACTIVATEAPPon the app's window, starting from whether the app holds the foreground, andkeepAwakeholds the display on withSetThreadExecutionStateuntil it is released or the window is destroyed. - XWindow logs focus. Each focus event logs
focused: <bool>at info level, taggedwindow. - Windows probes images.
XImageProbe.sizeandXImageProbe.thumbnailanswer on Windows through WIC, upright with the image's orientation applied, for every format an installed codec decodes, HEIC and HEIF included where Windows has the HEIF and HEVC extensions, and null for a file none decodes.XImageProbe.supportedis true on Windows, and the file dialog'simage/*filter there allows heic and heif. - Windows extracts video frames and exports videos.
XFiles.videoThumbnailandvideoThumbnailsdecode through Media Foundation the frame nearest each time, within 500 ms, upright, scaled tomaxWidthor baked with the transform and overlay as on Apple platforms.XVideoExporterre-encodes every request on Windows to an H.264/AAC MP4, trimmed from the trim start exactly, without audio when muted, and with the transform and overlay drawn upright, atvideoBitrateor else the source's bitrate, at least 0.1 bit per pixel per frame. Progress runs from 0 to 1,doneanswers the path, the size and the duration, andcanceldeletes the partial file and fails withcancelled. Where Windows has no Media Foundation, each fails with its error. - Windows plays videos.
XVideoPlayerController.fileplays on Windows through Media Foundation's Media Engine into a Flutter texture.initializeanswers the display size and the duration, withrotationQuarterTurns0 since the frames arrive upright, and fails withdecode_failedfor a file Windows cannot decode, an H.264 video stored at most 32 pixels wide or 16 tall among them. Play, pause, seek, looping, volume and speed act as on the other platforms, and the player reports its state, size, completion and errors. Where Media Foundation is missing, as on a Windows N edition without the Media Feature Pack,initializefails withcreate_failedwhile the rest of the plugin works. - A video player logs its metadata.
XVideoPlayerController.initializelogsinitializedat info level, taggedvideo, with the player's handle, size, duration and quarter turns. - Windows picks, opens, saves and reveals files.
XFiles.pickand the newXFiles.pickMultiple, which returns the picked files in order or an empty list when the user cancels and which Windows alone serves, open the Windows file dialog, filtered by extension.XFiles.openlaunches the file's associated application through Windows's checks for a downloaded file,saveCopycopies through the save dialog, andshowInFolderselects the file in Explorer.supportsSaveCopyandsupportsShowInFolderare true on Windows. - ux has a Windows plugin. The pubspec declares
windows: pluginClass: XPluginCApi, built asux_plugin.dllon the Windows SDK alone, for Windows 10 1903 or later.XUrl.launchopens a URL with the handler Windows has for its scheme, andopenAppSettingsanswers false.windows/testholds the plugin's native tests. - Avatar editors close on accept.
ComposeResult.imageBytesis aFuture<Uint8List>encoded afterComposePagepops, so the caller shows progress where the image lands; it fails with aFormatExceptionwhen the image cannot be decoded.MediaPickerPage.maxImageExtentandComposePage.maxImageExtentbound the longest edge of those bytes. Breaking:ComposeResult.imageBytesis a future, andComposeEntry.resolveImageBytesis replaced byComposeEntry.captureImage. - Avatar editors confirm with the app's primary button.
ComposePagelaysMediaHost.confirmButtonfull width under the editing tools wherever no caption field sends the edit. Breaking: hosts implementMediaHost.confirmButton, andMediaCommandsBar.onConfirmis removed. - Network video players open without blocking the UI on iOS and macOS.
The player loads the video's rotation once the header has downloaded, and
initializereports it with the size and duration. - A video player's size is its display size.
XVideoPlayerValue.size,XVideoPlayerMetadata.sizeandXVideoPlayerSizeChanged.sizeare the dimensions after the track's rotation on every platform, so a portrait recording reports portrait.rotationQuarterTurnsis the correctionXVideoPlayerViewapplies to the texture: the track's rotation on iOS and macOS, 0 on Android, where the texture arrives upright. Size a box fromsizealone, without swapping it on odd turns. - A disposed video player stays disposed. A native player created after
XVideoPlayerController.disposeis disposed at once, and no listener hears from the controller afterdispose. A call the native side answers afterdispose,initializeincluded, changes nothing and fails withXVideoPlayerException('disposed'). Disposing a player while itsinitializewaits for the video fails thatinitializewithXVideoPlayerException('disposed'). - A disposed compose entry stays disposed. A
ComposeEntrydisposed while its video, crop poster, draw overlay or composite is still loading neither notifies nor changes its state, and releases a poster that arrives late.ComposeEntry.captureImagereturns null once the entry is disposed. The lastComposeEntry.releaseVideodrops the player and notifies before the native player finishes tearing down. - A compose entry captures the edits its preview is still rendering.
ComposeEntry.composedImageandComposeEntry.captureImagewait for the render of the current edits, and a render an edit overtakes is discarded. - A video compose entry decodes its crop poster once. Tools opened together share the one poster.
- A compose entry deletes the draw overlays it keeps. A video
ComposeEntrywrites its draw overlay PNG into the temporary directory'sux_composefolder. It deletes the PNG when a later draw apply replaces or clears it and when the entry is disposed, a PNG still being written included.ComposePage's submit hands the overlay over withComposeResult.videoEditthroughComposeEntry.handOverVideoEdit, and the receiver deletesVideoEditValues.overlay's file once used. - A media surface ready again after its open flight shows its live pixels.
A
MediaFlightSurfacewhosereadyturns false afterGalleryTransition's open flight captures it, and true again once the flight ends, shows its live pixels as it turns ready, with no snapshot of the flight over them. - An image behind its own repaint boundary takes over from the open flight's
snapshot. When an image in a
MediaFlightSurfacesits behind aRepaintBoundaryof its own and decodes afterGalleryTransition's open flight ends, the flight hands its snapshot off to the image as it decodes. - A camera cell that leaves the tree has no rect.
CameraCellSource.rectis null from the moment the picker drops its camera cell, so aCameraPagethat leaves in that frame, as one a sign-out removes together with its picker does, closes toward where the cell was as it opened. - The screen that shows holds focus, so keys reach it. When a
ScreenStack's top screen shows, its focus scope takes focus if focus is in the stack, on a scope around it, or nowhere, as whenXAppstarts, and asks for no keyboard. A stack inside a screen other than the top one, such as a coveredSheetScreen's, draws no focus into itself from outside it. Tab moves to the screen's first control, and Enter and Space activate it.XApp's default shortcuts, actions and text-editing shortcuts sit above its overlay, so they reach entries a host inserts throughoverlayKey. - Esc goes back. Esc pops the top screen where it
isModal, and otherwise goes toXRouter.backDispatcher, as system back does. Esc in a focused text field unfocuses it, and a handler nearer the focus takes Esc first; one disabled for it, such as aScaffold's with no drawer open, hands Esc on to the nearest enabled one around it, through the dispatcherActions.invokewould use for that one. AScreenStackwith no modal screen to pop hands Esc on to the one around it, so Esc in a modalSheetScreenpops the sheet. AnActionDispatcheran app sets on anActionsunderXAppinvokes the actions under it in place ofXApp's, so it must pass eachinvokeActionandinvokeActionIfEnabledcall for aDismissIntentto the dispatcherActions.ofgives for a context above itsActions, with the action, intent and context as given. One that invokes the action itself leaves Esc in a focused text field inside aScaffoldat theScaffold's disabled action, so Esc neither unfocuses the field nor goes back. - A
ScreenShellkeeps screens it hosts but does not show.ScreenShell.hostedlists every screen a shell hosts andpagesthe ones it shows. A hosted screen left out ofpagesstays mounted offstage with its State, unpainted, out of hit testing and focus, its tickers muted. It hides, shows again and leaves at once, without a transition, and focus inside it goes back to the shell.ScreenShell.pagesChangedtells the router that the shown screens changed outside a push or a pop, and the router re-renders and recomputes the active screen, the system-back state and the orientations.XRouter.hostedlists every screen the router holds, andXRouter.pagesthe shown ones.popAllpops hidden screens too, and a push equal to a screenhomehosts asks it toScreenShell.showthat screen. - A
ScreenShellplaces its hosted screens and hosts screens beside it.ScreenShell.placewraps a hosted screen's slot to lay out where it draws, under the window'sMediaQuery. A screenScreenShell.isBesidemarks moves no focus as it comes and goes, except that focus inside one that leaves goes to the shell. Tab and Shift+Tab cross between the shell and the screen, and the screen takes no edge-swipe or predictive-back drag, so back goes to the shell rather than the screen. A screen keeps its State when its placement, its beside mark or the shape of its transition changes.ScreenStacktakeshidden,besideandplace. - A back gesture moves a screen with the finger. The iOS edge swipe
moves a screen by the finger's travel since the touch went down.
ScreenSlot.curved(context, animation, curve)isanimationoncurve: while a back gesture drives the slot it is the gesture's own progress, and once the gesture lets go, or the screen leaves, it runs the curve from where the screen shows to where the transition settles.ScreenTransitionstake their curves through it. The spring back returns over 150 ms on the transition's curve. - A back gesture its screen stops taking is cancelled. An iOS edge swipe
or a predictive back that its screen stops taking before it lets go springs
the screen back over 150 ms, and its release or commit pops nothing. A
screen stops taking it as
canPopturns false throughXRouter.pagesChanged, and as it stops being shown: as it or a screen it sits in is covered, hidden, popped or leaves. A predictive back is cancelled too once back goes to another screen, as when aScreenStackinside its screen starts showing a page. An edge swipe is cancelled ascanSwipeBackturns false too, while a predictive back goes on and its commit goes back throughhandleBack, as system back does. A screen that leaves during one goes from where the gesture left it. - A predictive back asks the screen's
handleBack. Android's predictive back drags a screen only where itscanSwipeBackholds, as the iOS edge swipe does; on any other screen it goes back as system back does, throughhandleBack. A predictive back's commit asks the screen'shandleBackbefore it pops, and one thathandleBackconsumes springs the screen back over 150 ms. - Back inside a
SheetScreengoes to its nested page. System back on aSheetScreenwith a nested page asks that page'shandleBack, and pops the page only wherehandleBackdeclines and itscanPopholds. - One back goes to one screen. A predictive back, system back and Esc no
ScreenStacktakes go to the screenScreenStackState.backTopnames in the outermostScreenStack: the oneScreenStackState.nestedTopnames, the top screen of the innermostScreenStackthat shows a screen above its home inside the shown screens, and where it names none, the top unpopped screen covering the ones under it, pushed or hosted by aScreenShell. OfScreenStacks that each show a page above their home, none inside another, such as two side by side or one in a screen and one in the screen shown beside it, back goes to the page pushed last. An iOS edge swipe goes to the screen whose edge it starts on, an unpopped one shown in everyScreenStackaround it, and to none while aScreenStackinside that screen, or inside a screen shown beside it, shows a screen above its home. So a predictive back on a sheet asks its nested page'shandleBackonce, and one on a page pushed over the sheet pops that page alone. - System back asks the screen back goes to.
XRouter.backDispatcherasks thehandleBackof the screenScreenStackState.backTopnames in the router'sScreenStack, then pops it where itscanPopholds, and leaves back to the OS where it does not. WherebackTopnames none, back goes to thehandleBackof the bottom screen ofXRouter.pages. So system back on aScreenShellshowing a covering screen it hosts asks that screen, as a predictive back does, and not the shell. - The framework takes back wherever back has a screen to go to.
XRouter.canPop, which the router hands toSystemNavigator.setFrameworkHandlesBack, holds where the screenScreenStackState.backTopnames can pop, and where back goes to the bottom screen ofXRouter.pageswhile a screen shows beside it.ScreenStackState.canPopholds the same for anyScreenStack, and the outermost one tells theNavigationNotificationlisteners around it after each frame in which it changes, by a change in it or in aScreenStackinside it. So on Android 13 and later a back gesture on a page that aScreenStackin the router's home shows goes to the page, not to the OS. - A back gesture reads
canSwipeBackas it starts. The iOS edge swipe reads the screen'scanSwipeBackas the touch goes down or the trackpad pan starts, as Android's predictive back reads it as the gesture starts, so a screen whosecanSwipeBackchanges needs no router rebuild. The edge swipe reads it again as it moves and lifts, and adds no semantics node. - A
ScreenBackHandleroutside anyScreenStacktakes the back gestures. AScreenBackHandlerwith noScreenStackaround it, as one a host builds over aNavigatorroute's own slot, takes the iOS edge swipe and the predictive back for its slot while it is enabled; the rules that give one back to one screen hold where aScreenStackis around it. - An
XAppover anotherXRoutershows that router's screens. AnXApprebuilt with anotherroutershows that router's screens, which take no State from the old router's, and the old router's screens leave the tree. AnXAppover a router whose screens left the tree shows them again. Across a change ofdefaultTargetPlatform, anXAppkeeps its router's screens and their State. - A media caption is what the host's caption field holds.
ComposeResult.captionis whatMediaHost.captionreads from the item's caption controller when the page submits, in the host's own type: the host trims it and keeps what its field holds beside the text, such as formats. Breaking: hosts implementMediaHost.caption, andComposeResult.captionis anObject?. - A pane builds only its own children. A pane's children rebuild in a
BuildScopeof itsPaneElement's own as the pane lays out, soPane.buildChildandPane.flushLayoutSyncbuild no widget outside the pane: one dirty beside a pane laid out in a post-frame callback rebuilds on the next frame. swipelab_webpcomes from GitHub. ux depends onswipelab_webpfrom the git repository https://github.com/swipelab/swipelab_webp, so it resolves with no sibling checkout. A host that also depends onswipelab_webpnames the same git source or overrides it.
0.17.0 #
media.dartholds one snapshot flight.GalleryTransitionusesMediaFlightSurfacefor current media pixels,MediaFlightChromefor stationary controls, andHiddenMediafor source visibility.kMediaFlightDurationis the shared 300 ms camera, compose and gallery route duration.GallerySource.borderRadiussupplies the source shape. Picker snapshots retain the full bitmap so image quality upgrades preserve framing. Without an opening snapshot, media fades at its destination. Breaking:GalleryOpenTransition,GalleryCloseTransition,kGalleryOpenChrome,kGalleryOpenPosition,kGalleryOpenBounds,kGalleryOpenPushed,kGalleryOpenCopyAlpha,kGalleryCloseSpatialandkGalleryCloseChromeare removed; hosts useGalleryTransitionand implementGallerySource.borderRadius.
0.16.0 #
media.dartholds the live picker camera cell.MediaPickerPageshows a two-row preview with granted or limited photo access, lends itsCameraSessiontoCameraPage, and sends captures throughComposePagewith the picker's filter, purpose and submission handler.CameraCellandCameraCellSourcecarry the animated preview between grid and camera; cancellation returns to the picker with its gallery selection intact.CameraPagesupports borrowed sessions and image-only or video-only capture. Permission views use host colours, text and strings, and foreground return refreshes camera and photo access.XCameraControllerexposescameraPermissionGranted()without prompting or opening a session, andrequestCameraPermission()with a Settings fallback. New development dependency:cupertino_iconsfor test fonts. Breaking: hosts implementMediaStrings.cameraAccessRationale,photoAccessTitle,allowPhotoAccess,openSettings,limitedPhotosRationaleandmanage, renderScreen.buildTransitionand callScreen.onRemovedafter exit (throughXRouter/ScreenStackor a Navigator route usingScreenSlotwithmaintainState: true), and declare Androidandroid.permission.CAMERA, AppleNSCameraUsageDescriptioninInfo.plist, and macOScom.apple.security.device.camerain debug and release entitlements; customXCameraBackendimplementations supplycameraPermissionGranted()andrequestCameraPermission().
0.15.0 #
media.dartholds the media picker and the camera.MediaPickerPagewith its albums screen, grid cell, selected strip, permission views,SelectionContextandThumbnailCache;CameraPagewith the shutter, flash and photo/video controls,CameraThumbandnormalizeCameraCapture.MediaHostgainslifecycleandisWideScreen. New dependencies:collection, andswipelab_webpfrom the sibling checkout../swipelab_webp, so the package ispublish_to: none. Breaking: aMediaHostimplements the two new members.
0.14.0 #
media.dartholds the compose page.ComposePageandComposeEntrywith the crop and draw tool screens and the video trim scrubber; the gallery open and close transition withGallerySource;DismissCarrier,HiddenMediaController, the video painters,XMediaand the gallery timing constants.MediaHostgainspush,captionController,captionFieldandkeyboardInsets. New dependencies:path,path_provider. Breaking: aMediaHostimplements the four new members.
0.13.0 #
media.dartholds the image editors.Editorwith its crop, draw and text tools:CropImageLayer,DrawImageLayer,EntityLayer, their gestures, controls and painters,Animator,CameraFitand the text entity model.MediaHostgainsinsetsand the textfamily. New dependencies:flutter_svg,vector_math. The brush illustrations ship as package assets.
0.12.0 #
media.dart.MediaHost, through which the media flow reads the hosting app's colours, type, icons and strings, withTouch,CountOdometer,MediaCommandsBar,MicPermissionBanner, the EXIF orientation reader andVideoEditValues.
0.11.0 #
ux.dartis pure. It exports core, reactive, navi, anim and the geometry helpers, and compiles for the web. Each native component is imported from its own library:audio.dart,camera.dart,screen_sources.dart,video.dart,image.dart,clipboard.dart,crypto.dart,notifications.dart,secure_store.dart,window.dart,drop.dart,file.dart,gallery.dart,keyboard.dart,scanner.dart,shortcuts.dart,url.dart,sensor.dart,crash.dart,log.dart,app_group.dart. Breaking: add the library a symbol lives in.
0.10.0 #
- Apple host executables export dart:ffi process symbols. Keyboard,
sensor, and URL-detect entry points are looked up in the process; the
host app's release strip keeps globals (
STRIP_STYLE = non-global). XAudioCapturepicks its source.sources()lists the hardware inputs the OS names plus, on macOS and Android 10+, oneplaybacksource for what the device plays;start({sourceId})opens it. OmittingsourceIdis the default microphone under the platform voice processing. A microphone id opens that input, also under voice processing; the playback id taps the output raw — macOS through an audio-onlySCStreamunder the screen-recording grant, Android through a media-projection consent the plugin asks for itself. iOS lists no playback source. Frames stay mono 16 kHz Int16 of 320 samples, one source at a time: changing source isstopthenstart, and an id naming nothing throwsunknown_source.XAudioCapture.start({voiceProcessing}). The default microphone and a microphone id capture under the platform voice processing whenvoiceProcessingis true (the default): Apple enables the voice-processing I/O unit, Android recordsVOICE_COMMUNICATIONwith echo cancellation. False leaves the microphone raw — no echo cancellation and no output ducking. A playback tap stays raw.Sheetarbitrates drags against the attached scroll view by that view's own axis. A down-drag scrolls a list with content left in that direction from every snap, while an up-drag from a non-expanded snap expands the sheet first. The same gesture hands off at an edge. A reversed list (a chat transcript) scrolls toward older content on a down-drag; sheet-chrome drags move the sheet, decided by the pointer that opens the gesture; and a displaced sheet keeps the gesture until it returns to its snap.- Darwin sources unified and moved to Swift Package Manager. iOS and macOS
now build from one package at
darwin/ux/(sharedDarwinSource: true);ios/andmacos/are gone, as are both podspecs — the plugin no longer supports CocoaPods. Consumers on a recent Flutter get SPM automatically and canpod deintegrate.ZIPFoundationis now an SPM dependency (macOS only). Removes the podspec copy-mirror ofdarwin/{Camera,Video,File}intoClasses/*-shared, which existed only because CocoaPods cannot glob through symlinks — SPM reads the shared sources directly, so they can no longer go stale between builds. XGallery.saveToLibrary(path, kind, mimeType?): add a file on disk to the system photo library. iOS requests add-only authorization (.addOnly"Allow Adding Photos?" prompt) thenperformChanges; Android inserts viaMediaStoreunderPictures/<app>/Movies/<app>(IS_PENDINGflow on API 29+,WRITE_EXTERNAL_STORAGE+ public-dir copy + media-scan below). ReturnsXGallerySaveStatus {saved, denied}; hard failures throw.XGallery.supportsSaveToLibrarygates UI (iOS / Android).XFiles.saveCopy(path, mimeType?): save a user-visible copy of any file. iOS presents the system export picker ("Save to Files"); Android inserts into the Downloads collection (API 29+) or copies into public Downloads behind aWRITE_EXTERNAL_STORAGEgrant (<29); macOS presents anNSSavePaneland copies to the chosen destination. ReturnsXFileSaveStatus {saved, cancelled, denied}. Gated byXFiles.supportsSaveCopy(iOS / Android / macOS).XFiles.supportsShare: capability gate for the existingsharesheet (iOS / Android / macOS).FakeXGalleryBackend: implementssaveToLibrary, records calls insavedToLibrary, outcome overridable viaonSaveToLibrary.XScreenSources: the displays and windows a screen-share picker offers, as one snapshot overux/screen_sources(macOS 14+).list(allowedDisplayIds:, allowedWindowIds:, thumbnailWidth:, thumbnailHeight:)intersects the caller's allow-sets with what is on screen and returns each survivor as an id, kind, title, owning application, source pixel dimensions and an aspect-fit PNG thumbnail; a source whose thumbnail fails to render comes back with a nullthumbnailPng, andthumbnail_failedis thrown only when no requested source rendered.listnever prompts —hasPermission/requestPermissionare explicit.XScreenSourcesBackend.instanceis settable andFakeXScreenSourcesBackendships inpackage:ux/testing.dart.XCameraEffects: none / blur / dim behind the person on the outgoing camera track, overux/camera_effects(+/events) (macOS 12+).setEffect(trackId, effect)hands the local video track to the native processor andclear()gives it back its own frames;status(idle/applying/active/failed) is the processor's account of the frames. Compositing is Core Image with a Vision person mask, and a failure falls back to the last good effected frame or black, never the raw input. The host app supplies its camera stack by conforming toCameraEffectsBridgeand callingCameraEffects.install(_:); without it commands answerintegration_unavailable.XCameraEffectsBackend.instanceis settable andFakeXCameraEffectsBackendships inpackage:ux/testing.dart.
0.9.0 #
XScanner: new platform-view widget for QR-code (and forward-compat barcode) scanning. iOS usesAVCaptureMetadataOutput(no extra pod); Android uses CameraX preview + ZXing decoder (com.google.zxing:core:3.5.3, ~470 KB jar, no Play Services dep).XScannerPermission.requestCamera()requests OS permission first; decoded payloads stream throughEventChannel('ux/scanner/events').
0.8.0 #
Log: pretty, production-ready logger. Static entry (Log.d/i/w/e/f/t), scoped loggers viaLog.tag('KB'), lazy messages (Log.d(() => expensive)), structuredfields, ANSI-coloredConsoleSink,DeveloperSinkfor DevTools,MemorySinkring buffer (tests + breadcrumbs),NoopSink. Sinks fan out via+with per-sinkminLevel; throwing sinks can't take down the pipeline.Log.configure: one-call setup that also wiresFlutterError.onError,PlatformDispatcher.onError, and isolate errors throughLog.e. Pair of log-then-rethrow is deduped via anExpandomark so crash handlers don't double-report. Override thecaptureCrasheshook to customise or pass() {}to opt out.XKeyboard: adaptive-learning debug output now usesLog.tag('KB').dinstead ofprint, lazy-built so the formatted line is only constructed when debug level is enabled.
0.7.0 #
AutoMap<K, V>: insertion-ordered collection with O(1) lookup by key and by index. Backed by aList<V>+Map<K, int>kept in sync by four mutation methods (add,addAll,remove,clear); both fields are private so callers cannot break the invariant. ExtendsIterable<V>forwhere/map/firstWhere/ etc.removeis O(n) to preserve order; every other op is O(1).
0.6.0 #
XFile: new module for handing files to the OSXFile.share(path, {title, mimeType, sourceRect})— iOSUIActivityViewController, macOSNSSharingServicePicker, AndroidIntent.ACTION_SENDvia FileProvider.sourceRectanchors the popover on iPad / macOS.XFile.open(path, {mimeType})— in-app preview where possible: iOSQLPreviewController, macOSQLPreviewPanel(preview on top of the app, no foreground loss), AndroidIntent.ACTION_VIEWwith MIME inference fromMimeTypeMap+ a fallback set of text/code extensions so unknown types still resolve totext/plaininstead ofapplication/octet-stream.
- macOS: new platform. Plugin registry +
FilePlugin; keyboard and sensor plugins remain iOS-only. - Android: ships a FileProvider under
${applicationId}.ux.fileproviderscoped toux_share/in the app cache — host apps don't need manifest plumbing. - iOS:
XWindowhelper (keyWindow/topViewController) inNativePlugin.swift, shared between keyboard and file plugins.
0.5.0 #
XSensor.orientation: accelerometer-driven physical device rotation, independent of the OS auto-rotate setting or UI orientation lockAppInfo: version + buildNumber surfaceXKeyboard: focus tracking integration
0.4.0 #
package:ux/testing.dart: new entry point for test-only utilitiesmatchesTextGolden(path, {update}):matchesGoldenFile-style matcher for plain-text snapshots (RPC responses, log output, formatted data). Writes on first run or whenupdate: true; compares byte-for-byte otherwise. Runtime stays flutter_test-free — depends only onpackage:matcher. For flutter_test users, passupdate: autoUpdateGoldenFilessoflutter test --update-goldensregenerates text goldens too.
0.3.0 #
XKeyboard: fix interactive dismiss race conditions — keyboard height no longer gets stuck when rapidly dismissing and re-focusingXKeyboard: handle zero-duration keyboard notifications (instant snap)XKeyboard: gate adaptive learning debug output behindkDebugMode- Example: rewrite as chat UI demonstrating
ListenableBuilder, scroll freeze, and interactive dismiss - Example: modernize Android project (v2 embedding, AGP 8.7, Gradle 8.11)
0.2.0 #
XKeyboard: sampled native animation curves (iOS & Android) with adaptive learningXKeyboard: interactive dismiss via pan gesture- Android: keyboard height tracking via JNI/FFI bridge
0.1.1 #
- Bezier utilities
0.0.3 #
- Action Plan
0.0.2 #
- BendBox