| // Copyright 2013 The Flutter Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| /// # Remote Flutter Widgets |
| /// |
| /// Renders a widget tree described in a file, which you can change at runtime. |
| /// |
| /// There are many ways to use a package such as this one. In general, the |
| /// approach looks something like this: |
| /// |
| ///  |
| /// |
| /// The network aspects of this design are out of scope for this package. Remote |
| /// widget libraries and data should be cached locally, to avoid network issues |
| /// causing interface failures. |
| /// |
| /// In the extreme, this package can be combined with a local scripting runtime |
| /// (e.g. [https://pub.dev/packages/hetu_script](hetu_script)) to run |
| /// remotely-fetched logic locally: |
| /// |
| ///  |
| /// |
| /// |
| /// ## Using the [RemoteWidget] widget |
| /// |
| /// To render a remote widget, the [RemoteWidget] widget can be used. It takes a |
| /// [DynamicContent] instance and a [Runtime] instance, which must be configured |
| /// ahead of time. |
| /// |
| /// ## Best practices for handling remote data |
| /// |
| /// The most efficient way to parse remote data is [decodeDataBlob] and the most |
| /// efficient way to parse remote widget libraries is [decodeLibraryBlob]. |
| /// |
| /// The methods for parsing the text format are not exported by |
| /// `package:rfw/rfw.dart` to discourage their use in client-side code. |
| /// |
| /// ## Server-side Dart |
| /// |
| /// This package can be used in non-Flutter environments by importing |
| /// `package:rfw/formats.dart` rather than `package:rfw/rfw.dart`. In the |
| /// [formats] mode, the [Runtime] and [DynamicContent] objects, as well as the |
| /// [RemoteWidget] widget, are not available, but the [parseDataFile] and |
| /// [parseLibraryFile] methods are. They can be used in conjunction with |
| /// [encodeDataBlob] and [encodeLibraryBlob] (respectively) to generate the |
| /// binary files used by client-side code. |
| library rfw; |
| |
| export 'src/dart/binary.dart'; |
| export 'src/dart/model.dart'; |
| export 'src/dart/text.dart' hide parseDataFile, parseLibraryFile; |
| export 'src/flutter/argument_decoders.dart'; |
| export 'src/flutter/content.dart'; |
| export 'src/flutter/core_widgets.dart'; |
| export 'src/flutter/material_widgets.dart'; |
| export 'src/flutter/remote_widget.dart'; |
| export 'src/flutter/runtime.dart'; |