Skip to content

Commit

Permalink
Add flutter getting started (#67)
Browse files Browse the repository at this point in the history
Wrote details to the flutter getting started part of the readme.
  • Loading branch information
chrisdevh authored and simc committed Oct 3, 2019
1 parent 714fabf commit e9c6515
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Auto detect text files and perform LF normalization
* text=auto
* text eol=lf
* text eol=lf
*.png binary
25 changes: 24 additions & 1 deletion hive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,30 @@ dev_dependencies:
## Hive ❤️ Flutter
Hive was written with Flutter in mind. It is a perfect fit if you need a lightweight datastore for your app. Here is a sample how that may look like:
### Getting started
To get started using Hive in a Flutter project, add the following dependencies to your `pubspec.yaml`. Use the latest version instead of `[version]`.

[![Core version](https://img.shields.io/pub/v/hive?label=hive)](https://pub.dev/packages/hive) [![Generator version](https://img.shields.io/pub/v/hive_generator.svg?label=hive_generator)](https://pub.dev/packages/hive_generator) [![Build runner version](https://img.shields.io/pub/v/build_runner.svg?label=build_runner)](https://pub.dev/packages/build_runner) [![Hive Flutter version](https://img.shields.io/pub/v/hive_flutter?label=hive_flutter)](https://pub.dev/packages/hive_flutter)

```yaml
dependencies:
hive: ^[version]
hive_flutter: ^[version]
dev_dependencies:
hive_generator: ^[version]
build_runner: ^[version]
```

### Example in Flutter
Hive was written with Flutter in mind. It is a perfect fit if you need a lightweight datastore for your app. After adding the required dependencies to your `pubspec.yaml`,you need import the following dependencies:

```dart
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
```

Afterwards, you are able to use Hive in your projects. This may look like:

```dart
class SettingsPage extends StatelessWidget {
Expand Down

0 comments on commit e9c6515

Please # to comment.