app_management library

Application state management and lifecycle.

Provides state management classes including DesignState, ActionState, and ServerState for managing the application's data and UI state.

Classes

ActionState
State management for action mode and display settings
AppPreferences
Stores all app-wide preferences (assembly handle colors, update preferences, etc.) Singleton to ensure consistent caching across the app.
AssemblyHandleColors
Default assembly handle colors
DesignSaveState
DesignState
State management for the design of the current megastructure Go to the individual mixin files for the bulk of the code
GroupConfiguration
A complete grouping scheme — like a tab of independent group assignments. Each configuration maps every slat to at most one group.
HandleLinkManager
Manages handle linking constraints for assembly handles.
HoverPreview
ParsedDesignResult
Contains all data extracted from a design file by parseDesignInIsolate.
ReleaseInfo
Information about a GitHub release
ServerState
State management for communicating with python server
SlatGroup
A named set of slats with a display color, belonging to a single GroupConfiguration.
SlatUndoStack
UpdateService
Service for checking app updates
UpdateState
State management for app updates
VersionInfo

Enums

SlatColorMode
UpdateStatus
Status of the update check

Mixins

DesignStateCargoMixin
Mixin containing cargo type management and cargo attachment operations for DesignState
DesignStateContract
Contract defining all shared members between DesignState mixins. This enables IDE navigation (Find Usages) to work across mixins by providing a single source of truth for all shared method signatures.
DesignStateCoreMixin
Mixin containing core utility operations for DesignState
DesignStateFileIOMixin
Mixin containing file import/export and undo/redo operations for DesignState
DesignStateFluorophoreMixin
Mixin containing fluorophore library CRUD and per-handle fluorophore assignment for DesignState.
DesignStateGroupingMixin
State management mixin for the slat grouping system.
DesignStateHandleLinkMixin
Mixin providing HandleLinkManager access in DesignState
DesignStateHandleMixin
Mixin containing handle assignment and assembly handle operations for DesignState
DesignStateLayerMixin
Mixin containing layer management operations for DesignState
DesignStatePhantomMixin
Mixin containing phantom slat operations for DesignState
DesignStatePlateMixin
Mixin containing plate import and handle assignment operations for DesignState
DesignStateSeedMixin
Mixin containing seed attachment and removal operations for DesignState
DesignStateSlatColorMixin
Mixin containing slat color management operations for DesignState
DesignStateSlatMixin
Mixin containing slat CRUD operations for DesignState

Constants

cargoLayerPrefix → const String
categoryAssembly → const String
categoryAssemblyAntihandle → const String
categoryAssemblyHandle → const String
categoryCargo → const String
categorySeed → const String
echoConsolidatedTitlePrefix → const String
echoConsolidatedTitleSuffix → const String
echoManualHandlesMarker → const String
echoPlateConsolidatedSheetName → const String
fluorophoreAssignmentsSheetName → const String
handleHighlightHex → const String
handleInterfacePrefix → const String
inputPlateSheetName → const String
inputPlateTitlePrefix → const String
inputPlateTitleSuffix → const String
labMetadataSheetName → const String
metaCellFileFormat → const String
metaCellGridMode → const String
metaCellLayerInterface → const String
metaCellMaxX → const String
metaCellMaxY → const String
metaCellMinX → const String
metaCellMinY → const String
metadataSheetName → const String
metaLayerStartRow → const int
metaSectionCargoInfo → const String
metaSectionFluorophoreInfo → const String
metaSectionGroupColorInfo → const String
metaSectionLayerInfo → const String
metaSectionSlatColorInfo → const String
seedLayerPrefix → const String
slatHandleLinksSheetName → const String
slatLayerPrefix → const String
slatTypesSheetName → const String

Properties

lastOpenDirectory ↔ String?
The last directory used for file operations, or null if none set.
getter/setter pair

Functions

buildDesignWorkbook(Map<String, Slat> slats, Map<String, Map<String, dynamic>> layerMap, Map<String, Cargo> cargoPalette, Map<String, Map<Offset, String>> occupiedCargoPoints, Map<(String, String, Offset), Seed> seedRoster, HandleLinkManager linkManager, double gridSize, String gridMode, String suggestedDesignName, {PlateLayoutState? echoPlateLayoutState, PlateLibrary? plateLibrary, Map<String, GroupConfiguration>? groupConfigurations, Map<String, Fluorophore>? fluorophorePalette}) → Excel
Builds an in-memory .xlsx workbook for the full design state.
cargoSheetName(int layerOrder, String side, String helix) → String
dartToPythonSlatNameConvert(String name, Map<String, Map<String, dynamic>> layerMap) → String
encodePhantomCellValue(int phantomNumericID, int parentNumericID, int position) → String
ensureExtension(String filePath, String ext) → String
Ensures filePath ends with .ext, appending it if missing. Case-insensitive to match Windows filesystem behavior.
exportDesign(Map<String, Slat> slats, Map<String, Map<String, dynamic>> layerMap, Map<String, Cargo> cargoPalette, Map<String, Map<Offset, String>> occupiedCargoPoints, Map<(String, String, Offset), Seed> seedRoster, HandleLinkManager linkManager, double gridSize, String gridMode, String suggestedDesignName, {PlateLayoutState? echoPlateLayoutState, PlateLibrary? plateLibrary, Map<String, GroupConfiguration>? groupConfigurations, Map<String, Fluorophore>? fluorophorePalette}) → Future<void>
Exports the full design state to a .xlsx workbook and prompts the user to save.
exportEvolutionParameters(Map<String, String> parameters) → Future<void>
Exports evolution parameters to a .toml file via a save dialog.
extractAssemblyHandlesFromExcel(Excel excelFile, List<List<List<int>>> slatArray, Map<String, Slat> slats, Map<String, Map<String, dynamic>> layerMap, double minX, double minY, bool rowColFlipped) → bool
Reads assembly handles from excelFile and assigns them as placeholders on slats.
extractHandleLinksFromExcel(Excel excelFile, Map<String, Slat> slats, Map<String, Map<String, dynamic>> layerMap, HandleLinkManager linkManager) → String?
Reads the handle link sheet from excelFile and populates linkManager.
extractSheetRows(Sheet sheet) → List<List>
Extracts all rows from an Excel sheet, converting each cell to a native Dart type.
firstFreeKey(Map<int, String> map, {int start = 1}) → int
Finds the first free integer key in a map
generateLayerString(Map<String, Map<String, dynamic>> layerMap) → String
Builds a compact string describing helix interface orientations across layers.
handleInterfaceSheetName(int layerOrder) → String
importAssemblyHandlesFromFileIntoSlatArray(Map<String, Slat> slats, Map<String, Map<String, dynamic>> layerMap, double gridSize) → Future<bool>
Prompts the user for an Excel file, clears existing assembly handles, and imports new ones.
importDesign({String? inputFileName, Uint8List? inputFileBytes}) → Future<(ParsedDesignResult, String)>
Prompts the user to select a .xlsx design file (or accepts pre-loaded bytes) and parses it in an isolate.
importPlatesFromFile(PlateLibrary plateLibrary) → Future<void>
Prompts the user to select one or more .xlsx plate files and loads them into plateLibrary.
main() → void
nextCapitalLetter(String current) → String
Useful function to generate the next capital letter in the alphabet for slat identifier keys
parseDesignInIsolate(Uint8List fileBytes) → Future<ParsedDesignResult>
Parses raw Excel fileBytes into a complete ParsedDesignResult.
positionalToSide(String positional) → String
pythonToDartSlatNameConvert(String name, Map<String, Map<String, dynamic>> layerMap) → String
readExcelDouble(Sheet workSheet, String cell) → double
Reads a double from cell, coercing IntCellValue to double. Returns 0.0 on type mismatch.
readExcelInt(Sheet workSheet, String cell) → int
Reads an integer from cell (e.g. 'B4'), returning 0 if the cell is not an IntCellValue.
readExcelString(Sheet workSheet, String cell) → String
Reads a string from cell, returning '' if the cell is not a TextCellValue.
seedSheetName(int layerOrder, String side, String helix) → String
selectSaveLocation(String defaultFileName) → Future<String?>
Shows a save dialog for an .xlsx file, returning the chosen path or null if cancelled.
setCellValue(Sheet sheet, int col, int row, dynamic val, {CellStyle? style}) → void
Writes a dynamic value to an Excel cell, choosing the appropriate CellValue subtype.
sideToHelixKey(String side) → String
sideToPositionalName(String side) → String
slatLayerSheetName(int layerOrder) → String
writeHandleLinksToExcel(Excel excel, Map<String, Slat> slats, HandleLinkManager linkManager, Map<String, Map<String, dynamic>> layerMap) → void
Writes handle link data from linkManager to a new sheet in excel.