Skip to content
Permalink
Browse files

Add flutter getting started (#67)

Wrote details to the flutter getting started part of the readme.
  • Loading branch information...
chrishuppertz authored and leisim committed Oct 3, 2019
1 parent 714fabf commit e9c6515427b5ad0792764c946132a41dcea07eea
Showing with 26 additions and 2 deletions.
  1. +2 −1 .gitattributes
  2. +24 −1 hive/README.md
@@ -1,3 +1,4 @@
# Auto detect text files and perform LF normalization
* text=auto
* text eol=lf
* text eol=lf
*.png binary
@@ -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 {

0 comments on commit e9c6515

Please sign in to comment.
You can’t perform that action at this time.