init method

dynamic init({
  1. required BuildContext context,
  2. String theme = 'dark',
})

Initialization of the arcana sdk

Implementation

init({required BuildContext context,
    String theme = 'dark',
    }) {

  _context = context;
  _controller = WebViewController()
    ..setJavaScriptMode(JavaScriptMode.unrestricted)
    ..setBackgroundColor(const Color(0x00000000))
    ..setUserAgent(
        'Mozilla/5.0 (Linux; Android 5.1.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/91.0.4472.164 Mobile Safari/535.19')
    ..addJavaScriptChannel('xarFlutter', onMessageReceived: (message) {
      _handleResponse(message.message);
    })
    ..setNavigationDelegate(
      NavigationDelegate(
        onProgress: (int progress) {},
        onPageStarted: (String url) {},
        onPageFinished: (String url) {},
        onWebResourceError: (WebResourceError error) {},
      ),
    );
}