JsonView.asset constructor

JsonView.asset(
  1. String path, {
  2. Key? key,
  3. JsonViewTheme? theme,
})

The constructor creates a widget from a json file in assets

Note: Initially, you must add the correct json file to the assets folder and specify the path to it in pubspec.yaml

Implementation

JsonView.asset(
  String path, {
  Key? key,
  JsonViewTheme? theme,
})  : _assetsPath = path,
      _mapData = null,
      _stringData = null,
      _builder = AssetJsonViewBuilder(
        path,
        jsonViewTheme: theme,
      ),
      super(key: key);