A widget that displays Beagle’s contents. This is the entry point to load server-driven screens and server-driven UI components to your Flutter application. The
BeagleWidget is a
StatefulWidget that renders widgets through a local JSON or an HTTP request.
See how the structure is represented:
|key||Key||Identifier for Widgets, Elements and SemanticsNodes.|
|screenRequest||BeagleScreenRequest||Provides the url, method, headers and body to the request.|
|screenJson||String||Represents a local screen to be shown.|
|onCreateView||OnCreateViewListener||Function that returns the current BeagleView.|
It’s a class used to make requests in Beagle Flutter. It implements the
BeagleNetworkOptions which brings the
strategy attributes. Also, the
BeagleScreenRequest class has the
body properties. See the structure below:
|url||String||✓||Represents the request relative server URL.|
|body||String||Content that will be deliver with the request.|
|headers||Map<String, String>||Headers to be used in the request.|
|method||BeagleHttpMethod||Http method to indicate the desired action to be performed for a given resource. This could be |
|strategy||BeagleNetworkStrategy||Cache strategy applied to the request. This could be |
A function that follows the struct
void Function(BeagleView view) and provides the current
BeagleView when it’s available.
You can use it wherever you want to show server-driven content.
BeagleWidgetthere informing at least a local JSON or a
urlof your BFF.
In the example below, you will see it in the
Scaffold widget body:
Scaffold( appBar: AppBar( title: const Text('Beagle Sample'), ), body: BeagleWidget( screenRequest: BeagleScreenRequest('components'), ), );
BeagleSdk.initpassing at least the
baseUrlproperty before using the
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.