Frontend  0.5.1
Loading...
Searching...
No Matches
Widgets

Widgets are currently divided into three categories depending on their intended use.

  • General widgets are used wherever
  • Dialog widgets are displayed by the showDialog function
  • Controller widgets make up the complex locomotive and accessory controllers

General Widgets

General widgets can be used generally and have no predefined use cases. They are often just small wrappers over existing classes or helper widgets that, in turn, accept a child.

Default Animated Size

A wrapper around AnimatedSize with a default duration of 500ms.

Error GIF

A looping GIF with a width of 200px showing the error animation.

Loading GIF

A looping GIF with a width of 200px showing the loading animation.

Persistent Expansion Tile

An ExpansionTile-like class whose expanded state comes from a ValueNotifier. The widget is used in the settings screen. An expand/collapse all button allows all tiles to be expanded or collapsed at once.

PNG Picture

PngPicture does what Image.asset should do on Web. For some reason, this doesn't work on embedded systems. As a workaround, this class uses rootBundle.load and feeds the raw data into Image.memory.

Positioned Draggable

PositionedDraggable wraps Positioned in a GestureDetector to make it draggable. It stores its own offset and updates it when panning.

PowerIcon Button

Wraps the very frequently used power button via IconButton. The track voltage is switched on and off via Z21Service.

Dialog Widgets

Dialog widgets are, as the name suggests, either SimpleDialog or AlertDialog widgets. All dialogs must be launched using the showDialog function. A common use case for dialogs are various updates, such as OTA updates.

AddEdit

AddEditDialog is used to add or edit locomotives or accessories. The class is generic so the type to be edited must be passed when creating the dialog (e.g. AddEditDialog<Loco>). If no type is passed, a query will be made at runtime. Internally, the class uses a FormBuilder that sends a POST request via DccService upon completion and successful validation.

Confirmation

ConfirmationDialog displays the 'Cancel' and 'OK' options. Pressing 'Cancel' returns false and pressing 'OK' returns true.

Delete

DeleteDialog is used to delete locomotives or accessories. The class is generic so the type to be deleted must be passed when creating the dialog (e.g. DeleteDialog<Loco>). If no type is passed it will default to deleting all locomotives and accessories. If a type is passed, you can optionally also pass a specific item that should be deleted, instead of deleting the entire category.

Download

The DownloadDialog downloads files from a URL and displays the progress during the download. If the download is successful, the file is returned as a Uint8List.

Ota

The OtaDialog is an update dialog for OpenRemise boards. OTA stands for over-the-air and is the update mechanism developed by Espressif.

ShortCircuit

ShortCircuitDialog is a popup dialog that informs the user about short circuits. The necessary listener for the status provided by the z21ShortCircuitProvider is created in the initState of the HomeView.

ZIMO

Decup

DecupDialog is a manufacturer-specific dialog for ZIMO MX decoders. It uses the eponymous DECUP protocol to update or load sound via tracks.

Mdu

MduDialog is a manufacturer-specific dialog for ZIMO MS, MN, FS and FN decoders. It uses the eponymous MDU protocol to update or load sound via tracks.

Sound

SoundDialog parses the ZIMO sound database and creates a searchable list of ZPP projects. These projects can then be downloaded directly.

Zusi

ZusiDialog is a manufacturer-specific dialog for ZIMO decoders. It uses the eponymous ZUSI protocol to load sound via SUSI bus.

Controller Widgets

Controller widgets are a collection of widgets that make up the complex throttle or signal box.

Controller

The Controller class creates an input widget for controlling locomotives or accessories. Depending on the screen width, this widget is displayed either full screen instead of the decoder screen or as a draggable MDI overlay above all other screens. In the latter case, multiple controller instances can be open simultaneously. The class ControllerRegistry keeps track of open instances for us.

CV Editing Controller

Todo
document

CV Terminal

Todo
document

Key Press Notifier

Todo
document

Keypad

Todo
document

RailCom

Todo
document
Previous Next
Screens Services