openNewsArticle static method

Future<void> openNewsArticle({
  1. required String articleId,
  2. required bool showBackButton,
})

openNewsArticle

Opens a news article in the widget

Available Platforms

Web, Android, iOS

Implementation

static Future<void> openNewsArticle(
    {required String articleId, required bool showBackButton}) async {
  if (!kIsWeb && !io.Platform.isAndroid && !io.Platform.isIOS) {
    debugPrint(
      'openNewsArticle is not available for current operating system',
    );
    return;
  }

  await _channel.invokeMethod('openNewsArticle',
      {'articleId': articleId, 'showBackButton': showBackButton});
}