loadFile method Null safety

Future<void> loadFile(
  1. {required String assetFilePath}

Loads the given assetFilePath.

To be able to load your local files (assets, js, css, etc.), you need to add them in the assets section of the pubspec.yaml file, otherwise they cannot be found!

Example of a pubspec.yaml file:


# The following section is specific to Flutter.

 # The following line ensures that the Material Icons font is
 # included with your application, so that you can use the icons in
 # the material Icons class.
 uses-material-design: true

   - assets/index.html
   - assets/css/
   - assets/images/



controller.loadFile(assetFilePath: "assets/index.html");

Supported Platforms/Implementations:


Future<void> loadFile({required String assetFilePath}) async {
  Map<String, dynamic> args = <String, dynamic>{};
  args.putIfAbsent('assetFilePath', () => assetFilePath);
  await _channel.invokeMethod('loadFile', args);