runApp function
void
runApp({
- required FeaturesBuilder features,
- PluginDescriptor? plugins,
- PlatformWidgetBuilder? platformWidgetBuilder,
- String? initialLocation,
The main entry point to kick off the Vyuh Application. This function should be called from the main function of the application. It initializes the Vyuh Platform and runs the application with given features and plugins.
features
: A builder function that returns aFeatures
object. This object configures the features available in the app.plugins
: Optional. A PluginDescriptor object that specifies the plugins to be used. If not provided, defaults to PluginDescriptor.defaultPlugins.platformWidgetBuilder
: Optional. A builder function that returns a platform-specific widget. If not provided, defaults to defaultPlatformWidgetBuilder.initialLocation
: Optional. The initial location to open in the app.
Implementation
void runApp({
required FeaturesBuilder features,
PluginDescriptor? plugins,
PlatformWidgetBuilder? platformWidgetBuilder,
String? initialLocation,
}) async {
WidgetsFlutterBinding.ensureInitialized();
final widgetBuilder = platformWidgetBuilder ?? defaultPlatformWidgetBuilder;
vyuh = _DefaultVyuhPlatform(
featuresBuilder: features,
pluginDescriptor: plugins ?? PluginDescriptor.defaultPlugins,
widgetBuilder: widgetBuilder,
initialLocation: initialLocation,
);
vyuh.run();
}