Download Latest Version v7.31.2 source code.zip (932.1 kB) Google Add to Preferred Sources
Home / v7.31.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-09-28 5.6 kB
v7.31.0 source code.tar.gz 2026-09-28 735.3 kB
v7.31.0 source code.zip 2026-09-28 928.6 kB
Totals: 3 Items   1.7 MB 0

Added

  • File storage - Named disks for keeping files, in the style of Laravel's Storage facade: disk('documents').put('reports/q3.pdf', bytes), or FileStorage.put('notes.txt', 'Hello') for the default disk. Five disks are ready without any configuration: local (the default, in the app's support folder under nylo/), documents, cache, temp (pruned after a day) and assets (the app bundle under assets/, read-only). nylo.configure(disks: ..., defaultDisk: ...) and nylo.addDisks(...) add or replace disks, built with DiskConfig.local (in a DiskRoot: support, documents, cache, temporary, library, downloads or external), DiskConfig.path, DiskConfig.assets, DiskConfig.memory, DiskConfig.scoped (a folder inside another disk) or DiskConfig.custom (your own DiskDriver), and FileStorage.build(config) makes one on demand. On the web, local disks live in memory. Everything is exported from package:nylo_support/ny_core.dart, along with XFile
  • Disk - Reads files with get, bytes, json<T> (decoding models through modelDecoders) and readStream, and writes them with put (a String, bytes or a byte stream), putJson, append and prepend. putFile stores an XFile from image_picker, file_picker or camera, a File, a path or bytes under a random 40-character name with the extension its contents show, streaming it rather than loading it into memory; putFileAs takes the name. Also copy, move, copyToDisk, moveToDisk, delete (one path or many), download (through NyApiService, so your interceptors apply, with onProgress and cancelToken; an existing file is replaced only once the download finishes), exists, missing, directoryExists, size, lastModified, mimeType (from the file's first bytes and its extension), checksum (md5 by default, or sha1, sha224, sha256, sha384 or sha512), path and url for plugins that need a real file, list, files, allFiles, directories, allDirectories, makeDirectory, deleteDirectory, scope (a disk rooted at a folder, e.g. one per user), usage and prune. Paths are relative to the disk, always use /, and .. can never climb above the disk's root. Every failure throws a DiskException that names the disk and path: DiskFileNotFoundException, DiskReadOnlyException, DiskPathTraversalException, DiskCorruptedPathException or DiskNotConfiguredException
  • DiskImage - An ImageProvider for an image on a disk, e.g. CircleAvatar(backgroundImage: DiskImage('avatars/me.jpg')). It reads through the disk, so it works with every driver and with fakes, and writing the file through its disk evicts the cached image, so the new picture shows on the next frame
  • DiskDriver - The interface behind every disk, with LocalDiskDriver, AssetDiskDriver and MemoryDiskDriver built in. testDiskDriver(description, create) runs the contract every built-in writable driver passes against a driver of your own
  • File storage fakes - FileStorage.fake('photos') swaps a disk for an empty in-memory FakeDisk with assertExists, assertMissing, assertCount, assertDirectoryEmpty and assertEmpty. FakeFile.image('avatar.png', width: 64, height: 64) makes a real, decodable PNG as an XFile, and FakeFile.create('invoice.pdf', kilobytes: 120) a file of that many zero bytes with the MIME type its name suggests; both live in memory, so they work inside testWidgets. NyTest.init() makes every writable disk an in-memory fake on first use (read-only disks such as assets stay real), NyTest.reset() empties them and NyTest.dump() lists their files. All exported from package:nylo_support/testing/ny_testing.dart
  • lockRelease(onError:) - An Exception thrown by perform goes to onError(error, stackTrace) once the lock is released, so the caller can react: show what went wrong, undo an optimistic change, or try again. Available on NyBaseState, NyController, StateAction and PageStateActions. Without onError the exception is logged as before, now with its stack trace
  • New dependencies - cross_file (^0.3.5+5, the line image_picker, file_picker and share_plus depend on), mime, crypto and path, for file storage

Fixed

  • An empty Field.date stays empty - The field showed today (or the style's firstDate) while its value was still null, so the form submitted nothing for the date on screen. It now shows nothing until a date is chosen, and the picker still opens on today. It also shows a date set after it opened through setValue, clear empties both what it shows and its value, and it keeps the field's label under a style decoration that has no label or hint of its own
  • Field.picker grows to fit its text - The box had a fixed containerHeight, so a long choice or a large text size was clipped. containerHeight is now the minimum height, and the field name keeps to one line and the choice to two, ending in an ellipsis
  • Field.chips shows which chips are selected in dark mode - Selected and unselected chips were both drawn in the dark surface color. Selected chips now use the selected color (white by default), and a label or checkmark that would be hard to read on its chip (below 4.5:1 contrast) switches to black or white
  • The password visibility toggle is a labelled button - InputField's show/hide password icon is now an IconButton, at least 48pt square, with a "Show password" / "Hide password" tooltip that screen readers announce (the new nylo.input_field.show_password and nylo.input_field.hide_password keys)
Source: README.md, updated 2026-09-28