|
1 |
| -<!-- |
2 |
| -This README describes the package. If you publish this package to pub.dev, |
3 |
| -this README's contents appear on the landing page for your package. |
| 1 | +# shelf_flutter_asset |
4 | 2 |
|
5 |
| -For information about how to write a good package README, see the guide for |
6 |
| -[writing package pages](https://dart.dev/guides/libraries/writing-package-pages). |
| 3 | +[](https://pub.dev/packages/shelf_flutter_asset) |
| 4 | +[](https://pub.dev/packages/shelf_flutter_asset/publisher) |
7 | 5 |
|
8 |
| -For general information about developing packages, see the Dart guide for |
9 |
| -[creating packages](https://dart.dev/guides/libraries/create-library-packages) |
10 |
| -and the Flutter guide for |
11 |
| -[developing packages and plugins](https://flutter.dev/developing-packages). |
12 |
| ---> |
13 |
| - |
14 |
| -TODO: Put a short description of the package here that helps potential users |
15 |
| -know whether this package might be useful for them. |
16 |
| - |
17 |
| -## Features |
18 |
| - |
19 |
| -TODO: List what your package can do. Maybe include images, gifs, or videos. |
20 |
| - |
21 |
| -## Getting started |
22 |
| - |
23 |
| -TODO: List prerequisites and provide or point to information on how to |
24 |
| -start using the package. |
| 6 | +A shelf handler to serve files from Flutter assets. |
25 | 7 |
|
26 | 8 | ## Usage
|
27 | 9 |
|
28 |
| -TODO: Include short and useful examples for package users. Add longer examples |
29 |
| -to `/example` folder. |
30 |
| - |
31 | 10 | ```dart
|
32 |
| -const like = 'sample'; |
33 |
| -``` |
| 11 | +import 'package:shelf/shelf_io.dart' as io; |
| 12 | +import 'package:shelf_flutter_asset/shelf_flutter_asset.dart'; |
34 | 13 |
|
35 |
| -## Additional information |
| 14 | +void main() { |
| 15 | + var handler = createAssetHandler(); |
36 | 16 |
|
37 |
| -TODO: Tell users more about the package: where to find more information, how to |
38 |
| -contribute to the package, how to file issues, what response they can expect |
39 |
| -from the package authors, and more. |
| 17 | + io.serve(handler, 'localhost', 8080); |
| 18 | +} |
| 19 | +``` |
0 commit comments