Hive: [DOC] - Can't see .initFlutter()

Created on 3 Jun 2020  路  9Comments  路  Source: hivedb/hive

Question
I've seen this: await Hive.initFlutter(); in the documentation, but I can't access that method in my flutter code.

Version

  • Platform: iOS, Android
  • Flutter version: 1.19.0
  • hive: ^1.4.1+1
  • hive_flutter: ^0.3.0+2
question

Most helpful comment

It worked after manually adding:

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

All 9 comments

Bildschirmfoto 2020-06-03 um 14 48 47

@Ahmadre you need to import "package:hive_flutter" to import the extension method.

I don't see it exactly :(

Bildschirmfoto 2020-06-03 um 15 07 37

Ok, I am getting tons of this:

Because hive_flutter >=0.3.0-dev depends on path >=1.6.0 <1.7.0 and every version of flutter_localizations from sdk depends on path 1.7.0, hive_flutter >=0.3.0-dev is incompatible with flutter_localizations from sdk.

So, because app depends on both flutter_localizations any from sdk and hive_flutter ^0.3.0+2, version solving failed.
pub get failed (1; So, because app depends on both flutter_localizations any from sdk and hive_flutter ^0.3.0+2, version solving failed.)
exit code 1

So I have to fix a lot of dependecies here before it's working

Is there any plan when the dependecy fixes will come? Or any dependecy_override recommendations?

ok here's how it's working:

dependency_overrides:
  dartx: ">=0.2.0 <1.0.0"
  path: ">=1.6.0 <2.0.0"

Is there any plan when the dependecy fixes will come?

I need to fix the CI first. Hopefully tomorrow...

no stress @leisim :)

It worked after manually adding:

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kthecoder picture kthecoder  路  3Comments

Hopheylalal picture Hopheylalal  路  4Comments

ProfileID picture ProfileID  路  4Comments

rupamking1 picture rupamking1  路  3Comments

sergiyvergun picture sergiyvergun  路  4Comments