|
1 | 1 | # jsonloader
|
2 | 2 |
|
3 | | -JSON Loader Package |
| 3 | +JSON Loader Package to read JSON from asset. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +* Load and read JSON from assets. |
4 | 8 |
|
5 | 9 | ## Getting Started
|
6 | 10 |
|
7 | | -This project is a starting point for a Dart |
8 | | -[package](https://flutter.dev/developing-packages/), |
9 | | -a library module containing code that can be shared easily across |
10 | | -multiple Flutter or Dart projects. |
| 11 | +In the `pubspec.yaml` of your flutter project, add the following dependency: |
| 12 | + |
| 13 | +```yaml |
| 14 | +dependencies: |
| 15 | + ... |
| 16 | + jsonloader: "^1.0.0" |
| 17 | +``` |
| 18 | + |
| 19 | +In your library add the following import: |
| 20 | + |
| 21 | +```dart |
| 22 | +import 'package:jsonloader/jsonloader.dart'; |
| 23 | +``` |
| 24 | + |
| 25 | +## Super Simple To Use |
| 26 | +```dart |
| 27 | +import 'package:jsonloader/jsonloader.dart'; |
11 | 28 |
|
12 | | -For help getting started with Flutter, view our |
13 | | -[online documentation](https://flutter.dev/docs), which offers tutorials, |
14 | | -samples, guidance on mobile development, and a full API reference. |
| 29 | +void main() async { |
| 30 | + var jsonString = await JSONLoader().getJsonAsString('assets/login_response.json'); |
| 31 | + print('jsonString: $jsonString'); |
| 32 | +} |
| 33 | +``` |
0 commit comments