createMaterialWidgets function

LocalWidgetLibrary createMaterialWidgets()

A widget library for Remote Flutter Widgets that defines widgets that are implemented on the client in terms of Flutter widgets from the material Dart library.

The following widgets are implemented:

For each, every parameter is implemented using the same name. Parameters that take structured types are represented using maps, with each named parameter of that type's default constructor represented by a key. The conventions edscribed for createCoreWidgets are reused here.

In addition, the following conventions are introduced:

Some features have changed in the underlying Flutter's material library and are therefore no longer supported, including:

  • The ButtonBar widget in the Flutter's material library is planned to be deprecated in favor of the OverflowBar widget. The ButtonBar widget in rfw package uses the OverflowBar widget internally for backward compatibility. The ButtonBar widget in rfw package is not deprecated and will continue to be supported. As a result, the following ButtonBar parameters are no longer supported:

    • buttonMinWidth
    • buttonHeight
    • buttonAlignedDropdown

    It is recommended to use the OverflowBar widget.

Some features are not supported:

  • AppBars do not support AppBar.bottom, AppBar.flexibleSpace, and related properties. Also, AppBar.systemOverlayStyle is not suported.

  • Theming in general is not currently supported.

  • Properties whose values are Animations or based on MaterialStateProperty are not supported.

  • Features related to focus or configuring mouse support are not implemented.

  • Callbacks such as Scafford.onDrawerChanged are not exposed.

  • The Scaffold's floating action button position and animation features are not supported.

  • DropdownButton takes a items object which contains a list of DropdownMenuItem configuration objects. Each object may contain onTap, value, enabled and child. The child parameter is required.

In general, the trend will all of these unsupported features is that this library doesn't support features that can't be trivially expressed using the JSON-like structures of RFW. For example, MaterialStateProperty is designed to be used with code to select the values, which doesn't work well in the RFW structure.

Implementation

LocalWidgetLibrary createMaterialWidgets() => LocalWidgetLibrary(_materialWidgetsDefinitions);