startActivity method

Future<bool> startActivity()

Launches a new activity.

See: https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)

Implementation

Future<bool> startActivity() async {
  assert(Platform.isAndroid);
  final request = <String, dynamic>{
    'action': action,
    'data': data?.toString(),
    'categories': categories,
    'type': type,
    'component': component?.flattenToString(),
    'extras': extras?.mappings,
    'flags': flags,
    'package': package,
  };
  return await _channel.invokeMethod('startActivity', request) as bool;
}