JSON Loader Package to read JSON from asset.
- Load and read JSON from assets.
In the pubspec.yaml
of your flutter project, add the following dependency:
dependencies:
...
jsonloader: ^1.0.1
In your library add the following import:
import 'package:jsonloader/jsonloader.dart';
import 'package:jsonloader/jsonloader.dart';
void main() async {
var jsonString = await JSONLoader().getJsonAsString('assets/login_response.json');
print('jsonString: $jsonString');
}