Git Product home page Git Product logo

get_storage's Introduction

get_storage

A fast, extra light and synchronous key-value in memory, which backs up data to disk at each operation. It is written entirely in Dart and easily integrates with Get framework of Flutter.

Supports Android, iOS, Web, Mac, Linux, and fuchsia and Windows**. Can store String, int, double, Map and List

Add to your pubspec:

dependencies:
  get_storage:

Install it

You can install packages from the command line:

with Flutter:

$  flutter packages get

Import it

Now in your Dart code, you can use:

import 'package:get_storage/get_storage.dart';

Initialize storage driver with await:

main() async {
  await GetStorage.init();
  runApp(App());
}

use GetStorage through an instance or use directly GetStorage().read('key')

final box = GetStorage();

To write information you must use write :

box.write('quote', 'GetX is the best');

To read values you use read:

print(box.read('quote'));
// out: GetX is the best

To remove a key, you can use remove:

box.remove('quote');

To listen changes you can use listen:

Function? disposeListen;
disposeListen = box.listen((){
  print('box changed');
});

If you subscribe to events, be sure to dispose them when using:

disposeListen?.call();

To listen changes on key you can use listenKey:

box.listenKey('key', (value){
  print('new key is $value');
});

To erase your container:

box.erase();

If you want to create different containers, simply give it a name. You can listen to specific containers, and also delete them.

GetStorage g = GetStorage('MyStorage');

To initialize specific container:

await GetStorage.init('MyStorage');

SharedPreferences Implementation

class MyPref {
  static final _otherBox = () => GetStorage('MyPref');

  final username = ''.val('username');
  final age = 0.val('age');
  final price = 1000.val('price', getBox: _otherBox);

  // or
  final username2 = ReadWriteValue('username', '');
  final age2 = ReadWriteValue('age', 0);
  final price2 = ReadWriteValue('price', '', _otherBox);
}

...

void updateAge() {
  final age = 0.val('age');
  // or 
  final age = ReadWriteValue('age', 0, () => box);
  // or 
  final age = Get.find<MyPref>().age;

  age.val = 1; // will save to box
  final realAge = age.val; // will read from box
}

Benchmark Result:

GetStorage is not fast, it is absurdly fast for being memory-based. All of his operations are instantaneous. A backup of each operation is placed in a Container on the disk. Each container has its own file.

What GetStorage is:

Persistent key/value storage for Android, iOS, Web, Linux, Mac and Fuchsia and Windows, that combines fast memory access with persistent storage.

What GetStorage is NOT:

A database. Get is super compact to offer you a solution ultra-light, high-speed read/write storage to work synchronously. If you want to store data persistently on disk with immediate memory access, use it, if you want a database, with indexing and specific disk storage tools, there are incredible solutions that are already available, like Hive and Sqflite/Moor.

As soon as you declare "write" the file is immediately written in memory and can now be accessed immediately with box.read(). You can also wait for the callback that it was written to disk using await box.write().

When to use GetStorage:

  • simple Maps storage.
  • cache of http requests
  • storage of simple user information.
  • simple and persistent state storage
  • any situation you currently use sharedPreferences.

When not to use GetStorage:

  • you need indexes.
  • when you need to always check if the file was written to the storage disk before starting another operation (storage in memory is done instantly and can be read instantly with box.read(), and the backup to disk is done in the background. To make sure the backup is complete, you can use await, but if you need to call await all the time, it makes no sense you are using memory storage).

You can use this lib even as a modest persistent state manager using Getx SimpleBuilder

get_storage's People

Contributors

abhishek01039 avatar ascenio avatar davidmartos96 avatar gabriieelreeis avatar hammerhai avatar jonataslaw avatar leekaimun avatar suvadityamuk avatar travishaagen avatar yasinarik avatar yutae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

get_storage's Issues

Cant read Storage on onInit()

so i have this simple controller, and in onInit box.read('citys') is null, i dont know why, is it a bug, how do i get the value in onInit and assign it to something?

with the getter of my controller, i am able to get the value from storage.

(First time this runs, it should be null, but secondtime it should return the stored value, its there i get it from the getter)

controller.dart

import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';

class TestController extends GetxController {
  final box = GetStorage();
  String get stringtext => box.read('citys') ?? "nux";

  @override
  void onInit() {
    print(box.read('citys')); // returns null ?????
    print('write');
    box.write('citys', 'Hallo!!');
    super.onInit();
  }
}

main.dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'controller.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  final TestController testController = Get.put(TestController());

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        body: Center(
          child: SimpleBuilder(
            builder: (_) {
              return Text(testController.stringtext);
            },
          ),
        ),
      ),
    );
  }
}

Flutter 2.0

i got an error in flutter 2

So, because voy depends on both get_storage ^1.4.0 and path_provider ^2.0.1, version solving failed.```

i've followed the next issue 
https://github.com/jonataslaw/get_storage/issues/44

Cannot build on Flutter 2.0

I'm migrating my app to the new Flutter version, but i'm getting the following error:

get_storage ^1.4.0 which depends on path_provider ^1.6.22, path_provider ^1.6.22 is required. So, because example_app depends on path_provider ^2.0.1, version solving failed

@jonataslaw

Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)

As I'm using the get_storage in my app, my app freezes on the startup showing the white screen while building the release apk.
Getting the following error:

[+2458 ms] E/flutter (11801): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception:
MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel        
plugins.flutter.io/path_provider)
[   +2 ms] E/flutter (11801): #0      GetStorage._init (package:get_storage/src/storage_impl.dart:47)        
[   +1 ms] E/flutter (11801): <asynchronous suspension>
[   +1 ms] E/flutter (11801): #1      new GetStorage._internal.<anonymous closure>
(package:get_storage/src/storage_impl.dart:28)
[   +1 ms] E/flutter (11801): <asynchronous suspension>
[   +1 ms] E/flutter (11801): #2      Initializer._initStorage
(package:scm_study/app/common/util/initializer.dart:22)
[   +1 ms] E/flutter (11801): <asynchronous suspension>
[        ] E/flutter (11801): #3      Initializer.init
(package:scm_study/app/common/util/initializer.dart:12)
[   +1 ms] E/flutter (11801): <asynchronous suspension>
[   +1 ms] E/flutter (11801): #4      main (package:scm_study/main.dart:13)
[        ] E/flutter (11801): <asynchronous suspension>
[   +1 ms] E/flutter (11801): 

Corruption occurred while in debugger

While using the debugger on a simulated iOS device, some kind of corruption occurred and after app restart, the corrupted state continued. I had to do a flutter clean and delete the app from the simulated device.

Stacktrace:

[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'String'
#0      GetStorage._init (package:get_storage/src/storage_impl.dart:47:7)
<asynchronous suspension>
#1      new GetStorage._internal.<anonymous closure> (package:get_storage/src/storage_impl.dart:27:13)
#2      new Future.<anonymous closure> (dart:async/future.dart:175:37)
#3      _rootRun (dart:async/zone.dart:1182:47)
#4      _CustomZone.run (dart:async/zone.dart:1093:19)
#5      _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#6      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#7      _rootRun (dart:async/zone.dart:1190:13)
#8      _CustomZone.run (dart:async/zone.dart:1093:19)
#9      _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23)
#10     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#11     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
#12 <…>

The debugger was set for "break on exception" and was in the StorageImpl._readFile method.

Note that I just started using this library, and am only storing a single String value.

I do not have any additional information, and cannot reproduce, but it is concerning that the bad state remained after restarting the app. I would rather the storage be erased than have the app unusable.

Versions:

flutter: 1.20.3
get: 3.10.2
get_storage: 1.3.1

Broken test on master - has been for a while

https://github.com/jonataslaw/get_storage/runs/956543996?check_suite_focus=true

00:43 +0 -1: loading /Users/runner/work/get_storage/get_storage/test/getstorage_test.dart [E]                                                                                                          
  Failed to load "/Users/runner/work/get_storage/get_storage/test/getstorage_test.dart": MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
  package:get_storage/src/storage_impl.dart 48:7   GetStorage._init
  ===== asynchronous gap ===========================
  package:get_storage/src/storage_impl.dart 28:13  new GetStorage._internal.<fn>
  

00:43 +0 -1: Some tests failed.                                                                                                                                                                        
##[error]Process completed with exit code 1.

[Bug?] Unhandled Exception: FormatException: Unexpected character (at character 3)

Hey,

Sometimes, im having a : Unhandled Exception: FormatException: Unexpected character (at character 3)
It append mainly (but not always) when first write is triggered:

GetStorage().write('tabs', _tabController.index);
flutter: GetStorage _init _initialData = null
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: FormatException: Unexpected character (at character 3)
{}tabs":2}
  ^
#0      GetStorage._init
package:get_storage/src/storage_impl.dart:48
<asynchronous suspension>
#1      new GetStorage._internal.<anonymous closure>
package:get_storage/src/storage_impl.dart:27
#2      new Future.<anonymous closure> (dart:async/future.dart:175:37)
#3      _rootRun (dart:async/zone.dart:1182:47)
#4      _CustomZone.run (dart:async/zone.dart:1093:19)
#5      _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#6      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#7      _rootRun (dart:async/zone.dart:1190:13)
#8      _CustomZone.run (dart:async/zone.dart:1093:19)
#9      _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23)
#10     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#11     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
#12     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#13     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Dont understand the {}tabs":2} come from; im trying to write tabs:2
there is a } which replace the first "

Do you face same issue ?
Thank you, and great work

Conflict with google_fonts 2.0.0

A dependency conflict has started with all the updates based on Flutter 2 coming out.

Because get_storage >=1.3.2 depends on path_provider ^1.6.22 and google_fonts 2.0.0 depends on path_provider ^2.0.0, get_storage >=1.3.2 is incompatible with google_fonts 2.0.0.

Add .reload() function to GetStorage

Hi! I'm trying to use GetStorage with AndroidAlarmManager. As you say, I can use GetStorage on any situation you currently use sharedPreferences. However I don't know how to:

  1. Import it on Application.java, with SharedPreferences, I can use import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin; but I don't know how to do that with GetStorage.
  2. When AndroidAlarmManager calls callback, GetStorage.read() returns non updated values. SharedPreferences introduces ".reload()", but how can I reload GetStorage?

Thanks U!

Version conflict

I get following error when running on iOS Simulator:

[ios/.symlinks/plugins/path_provider_linux/example] flutter pub get
Running "flutter pub get" in example...                         
Because pathproviderexample depends on path_provider from path which doesn't exist (could not find package path_provider at "../../path_provider"), version solving failed.
pub get failed (66; Because pathproviderexample depends on path_provider from path which doesn't exist (could not find package path_provider at "../../path_provider"), version solving failed.)

get_storage: ^1.1.6
Flutter 1.20.0-0.0.pre

android is working OK!

Get Storage only reads the first value that was written to it.

I tried to implement a system to check whether the user is logged in or not with Get Storage 1.4.0. When I check with the debugger, it writes all the values. But when I tried reading the values, it read only the first (key, value) written to it. The rest of the keys returns null.

This is how I write the data.

 
   Future saveUserDataToStorage(var _user) async {
     await dataToStorage('user', _user);
     await dataToStorage("k6", 6);;
    }

This is how I read data

 getCurrentUser() async {
    var _user = storageBox.read('user');
    if (_user != null) {
      user = _user;
      return user;
    } else {
      return null;
    }
  }

MissingPluginException

Can't seem to figure this one out. I don't have any problems launching this on an iOS simulator, but launching on either an Android API 29 or API 30 simulator causes the following error and a blank screen. If I comment out await GetStorage.init(); in my code, the app launches, although without storage capabilities. Any ideas on what might be going wrong?

STACK TRACE

E/flutter ( 8379): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
E/flutter ( 8379): #0      GetStorage._init (package:get_storage/src/storage_impl.dart:47:7)
E/flutter ( 8379): <asynchronous suspension>
E/flutter ( 8379): #1      new GetStorage._internal.<anonymous closure> (package:get_storage/src/storage_impl.dart:27:13)
E/flutter ( 8379): #2      new Future.<anonymous closure> (dart:async/future.dart:175:37)
E/flutter ( 8379): #3      _rootRun (dart:async/zone.dart:1182:47)
E/flutter ( 8379): #4      _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 8379): #5      _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter ( 8379): #6      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
E/flutter ( 8379): #7      _rootRun (dart:async/zone.dart:1190:13)
E/flutter ( 8379): #8      _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 8379): #9      _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23)
E/flutter ( 8379): #10     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
E/flutter ( 8379): #11     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
E/flutter ( 8379): #12     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
E/flutter ( 8379): #13     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

pubspec.yaml

name: got_brix
description: Winemakers Management & Cellar Tracking Tool

publish_to: 'none'

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: 0.14.3
  crypto: 2.1.5
  cupertino_icons: 1.0.0
  firebase_analytics: 6.2.0
  firebase_auth: 0.18.3
  firebase_core: 0.5.2
  flutter_facebook_auth: 1.0.0+3
  flutter_svg: 0.19.1
  font_awesome_flutter: '>= 4.7.0'
  get: 3.17.1
  get_storage: 1.3.2
  google_sign_in: 4.5.6
  sign_in_with_apple: 2.5.4
  video_player: 1.0.0

dependency_overrides:
  font_awesome_flutter:
    path: '../font_awesome_flutter'

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true
  assets:
    - assets/images/
    - assets/videos/

I tried adding path_provider as a dependency (yes, did a clean and pub get and rebooted several times) and nothing changed

I'm on Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B29 darwin-x64, locale en-US)

Any suggestions are greatly appreciated. Thanks!

How to listen specific keys to rebuild widgets?

Hi, I tried this package but I get unwanted rebuilds when I wrap widget with SimpleBuilder and update values in box.
is there any option that I can listen only specific keys to rebuild widget tree like flutter hive provides. box.listenable property which is provide this kind functionalty.
if already has this function I must recognize it. any info will be appriciated.
thanks.
Note :
I didnt mean this function

box.listenKey('key', (value){
  print('new key is $value');
});

Error after upgraded getx to 4.0.0-nullsafety.2

Because get_storage >=1.3.2 depends on get ^3.15.0 and viqcorex depends on get ^4.0.0-nullsafety.2, get_storage >=1.3.2 is forbidden.
So, because viqcorex depends on get_storage ^1.4.0, version solving failed.

Persist ThemeMode with Get Storage

I recall being able to persist a theme with HiveDb that this package is inspired on.
I am able to change the theme for my app but I seem to be finding issues in saving the theme to Get Storage.
Below is the current implementation for a RadioListTile I have set up to change the theme:

RadioListTile(
                    title: Text('Dark'),
                     value: ThemeMode.dark,
                    groupValue: _themeMode,
                    onChanged: (value) {
                           Get.changeThemeMode(ThemeMode.dark);
                           GetStorage().write('appTheme', ThemeMode.dark.index);
                          print(value.toString()); // ThemeMode.dark
                          print(ThemeMode.dark.index); // 2
                                },
                              ),

However it seems to return an error as I can neither write the index value which as an int or the value as a string to then persist which can be read in the GetMaterialApp under the theme to load on startup

Any advice,thanks

Whenever I import get_storage it does not compile anymore

Whenever I import get_storage my app does not compile anymore.
Can someone help?
Here are the errors:

../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:513:56: Error: Type 'Uint32' not found.
Uint32 tkSignature, Pointer ppvSig, Pointer pcbSig);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:513:48: Error: Type 'Pointer' not found.
Uint32 tkSignature, Pointer ppvSig, Pointer pcbSig);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:513:48: Error: Expected 0 type arguments.
Uint32 tkSignature, Pointer ppvSig, Pointer pcbSig);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:514:46: Error: Type 'Pointer' not found.
typedef _GetSigFromToken_Dart = int Function(Pointer obj, int tkSignature,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:515:13: Error: Type 'Uint8' not found.
Pointer ppvSig, Pointer pcbSig);
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:515:5: Error: Type 'Pointer' not found.
Pointer ppvSig, Pointer pcbSig);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:515:5: Error: Expected 0 type arguments.
Pointer ppvSig, Pointer pcbSig);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:515:36: Error: Type 'Uint32' not found.
Pointer ppvSig, Pointer pcbSig);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:515:28: Error: Type 'Pointer' not found.
Pointer ppvSig, Pointer pcbSig);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:515:28: Error: Expected 0 type arguments.
Pointer ppvSig, Pointer pcbSig);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:517:37: Error: Type 'Int32' not found.
typedef _GetModuleRefProps_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:518:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:519:5: Error: Type 'Uint32' not found.
Uint32 tkModuleRef,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:520:5: Error: Type 'Pointer' not found.
Pointer szName,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:520:5: Error: Expected 0 type arguments.
Pointer szName,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:521:5: Error: Type 'Uint32' not found.
Uint32 cchName,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:522:13: Error: Type 'Uint32' not found.
Pointer pchName);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:522:5: Error: Type 'Pointer' not found.
Pointer pchName);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:522:5: Error: Expected 0 type arguments.
Pointer pchName);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:523:48: Error: Type 'Pointer' not found.
typedef _GetModuleRefProps_Dart = int Function(Pointer obj, int tkModuleRef,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:524:5: Error: Type 'Pointer' not found.
Pointer szName, int cchName, Pointer pchName);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:524:5: Error: Expected 0 type arguments.
Pointer szName, int cchName, Pointer pchName);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:524:49: Error: Type 'Uint32' not found.
Pointer szName, int cchName, Pointer pchName);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:524:41: Error: Type 'Pointer' not found.
Pointer szName, int cchName, Pointer pchName);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:524:41: Error: Expected 0 type arguments.
Pointer szName, int cchName, Pointer pchName);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:526:34: Error: Type 'Int32' not found.
typedef _EnumModuleRefs_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:527:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:528:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:528:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:528:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:529:13: Error: Type 'Uint32' not found.
Pointer rgModuleRefs,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:529:5: Error: Type 'Pointer' not found.
Pointer rgModuleRefs,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:529:5: Error: Expected 0 type arguments.
Pointer rgModuleRefs,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:530:5: Error: Type 'Uint32' not found.
Uint32 cMax,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:531:13: Error: Type 'Uint32' not found.
Pointer pcModuleRefs);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:531:5: Error: Type 'Pointer' not found.
Pointer pcModuleRefs);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:531:5: Error: Expected 0 type arguments.
Pointer pcModuleRefs);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:532:45: Error: Type 'Pointer' not found.
typedef _EnumModuleRefs_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:532:66: Error: Type 'IntPtr' not found.
typedef _EnumModuleRefs_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:532:58: Error: Type 'Pointer' not found.
typedef _EnumModuleRefs_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:532:58: Error: Expected 0 type arguments.
typedef _EnumModuleRefs_Dart = int Function(Pointer obj, Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:533:13: Error: Type 'Uint32' not found.
Pointer rgModuleRefs, int cMax, Pointer pcModuleRefs);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:533:5: Error: Type 'Pointer' not found.
Pointer rgModuleRefs, int cMax, Pointer pcModuleRefs);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:533:5: Error: Expected 0 type arguments.
Pointer rgModuleRefs, int cMax, Pointer pcModuleRefs);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:533:53: Error: Type 'Uint32' not found.
Pointer rgModuleRefs, int cMax, Pointer pcModuleRefs);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:533:45: Error: Type 'Pointer' not found.
Pointer rgModuleRefs, int cMax, Pointer pcModuleRefs);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:533:45: Error: Expected 0 type arguments.
Pointer rgModuleRefs, int cMax, Pointer pcModuleRefs);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:535:40: Error: Type 'Int32' not found.
typedef _GetTypeSpecFromToken_Native = Int32 Function(Pointer obj,
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:535:55: Error: Type 'Pointer' not found.
typedef _GetTypeSpecFromToken_Native = Int32 Function(Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:536:5: Error: Type 'Uint32' not found.
Uint32 tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:536:32: Error: Type 'Uint8' not found.
Uint32 tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:536:24: Error: Type 'Pointer' not found.
Uint32 tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:536:24: Error: Expected 0 type arguments.
Uint32 tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:536:55: Error: Type 'Uint32' not found.
Uint32 tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:536:47: Error: Type 'Pointer' not found.
Uint32 tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:536:47: Error: Expected 0 type arguments.
Uint32 tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:538:5: Error: Type 'Pointer' not found.
Pointer obj, int tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:538:42: Error: Type 'Uint8' not found.
Pointer obj, int tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:538:34: Error: Type 'Pointer' not found.
Pointer obj, int tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:538:34: Error: Expected 0 type arguments.
Pointer obj, int tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:538:65: Error: Type 'Uint32' not found.
Pointer obj, int tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:538:57: Error: Type 'Pointer' not found.
Pointer obj, int tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:538:57: Error: Expected 0 type arguments.
Pointer obj, int tkTypeSpec, Pointer ppvSig, Pointer pcbSig);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:540:36: Error: Type 'Int32' not found.
typedef _GetNameFromToken_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:541:5: Error: Type 'Pointer' not found.
Pointer obj, Uint32 tk, Pointer pszUtf8NamePtr);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:541:18: Error: Type 'Uint32' not found.
Pointer obj, Uint32 tk, Pointer pszUtf8NamePtr);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:541:37: Error: Type 'Uint8' not found.
Pointer obj, Uint32 tk, Pointer pszUtf8NamePtr);
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:541:29: Error: Type 'Pointer' not found.
Pointer obj, Uint32 tk, Pointer pszUtf8NamePtr);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:541:29: Error: Expected 0 type arguments.
Pointer obj, Uint32 tk, Pointer pszUtf8NamePtr);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:543:5: Error: Type 'Pointer' not found.
Pointer obj, int tk, Pointer pszUtf8NamePtr);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:543:34: Error: Type 'Uint8' not found.
Pointer obj, int tk, Pointer pszUtf8NamePtr);
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:543:26: Error: Type 'Pointer' not found.
Pointer obj, int tk, Pointer pszUtf8NamePtr);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:543:26: Error: Expected 0 type arguments.
Pointer obj, int tk, Pointer pszUtf8NamePtr);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:545:41: Error: Type 'Int32' not found.
typedef _EnumUnresolvedMethods_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:546:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:547:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:547:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:547:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:548:13: Error: Type 'Uint32' not found.
Pointer rgMethods,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:548:5: Error: Type 'Pointer' not found.
Pointer rgMethods,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:548:5: Error: Expected 0 type arguments.
Pointer rgMethods,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:549:5: Error: Type 'Uint32' not found.
Uint32 cMax,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:550:13: Error: Type 'Uint32' not found.
Pointer pcTokens);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:550:5: Error: Type 'Pointer' not found.
Pointer pcTokens);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:550:5: Error: Expected 0 type arguments.
Pointer pcTokens);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:552:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:553:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:553:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:553:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:554:13: Error: Type 'Uint32' not found.
Pointer rgMethods,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:554:5: Error: Type 'Pointer' not found.
Pointer rgMethods,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:554:5: Error: Expected 0 type arguments.
Pointer rgMethods,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:556:13: Error: Type 'Uint32' not found.
Pointer pcTokens);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:556:5: Error: Type 'Pointer' not found.
Pointer pcTokens);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:556:5: Error: Expected 0 type arguments.
Pointer pcTokens);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:558:33: Error: Type 'Int32' not found.
typedef _GetUserString_Native = Int32 Function(Pointer obj, Uint32 tkString,
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:558:48: Error: Type 'Pointer' not found.
typedef _GetUserString_Native = Int32 Function(Pointer obj, Uint32 tkString,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:558:61: Error: Type 'Uint32' not found.
typedef _GetUserString_Native = Int32 Function(Pointer obj, Uint32 tkString,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:559:5: Error: Type 'Pointer' not found.
Pointer szString, Uint32 cchString, Pointer pchString);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:559:5: Error: Expected 0 type arguments.
Pointer szString, Uint32 cchString, Pointer pchString);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:559:30: Error: Type 'Uint32' not found.
Pointer szString, Uint32 cchString, Pointer pchString);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:559:56: Error: Type 'Uint32' not found.
Pointer szString, Uint32 cchString, Pointer pchString);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:559:48: Error: Type 'Pointer' not found.
Pointer szString, Uint32 cchString, Pointer pchString);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:559:48: Error: Expected 0 type arguments.
Pointer szString, Uint32 cchString, Pointer pchString);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:560:44: Error: Type 'Pointer' not found.
typedef _GetUserString_Dart = int Function(Pointer obj, int tkString,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:561:5: Error: Type 'Pointer' not found.
Pointer szString, int cchString, Pointer pchString);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:561:5: Error: Expected 0 type arguments.
Pointer szString, int cchString, Pointer pchString);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:561:53: Error: Type 'Uint32' not found.
Pointer szString, int cchString, Pointer pchString);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:561:45: Error: Type 'Pointer' not found.
Pointer szString, int cchString, Pointer pchString);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:561:45: Error: Expected 0 type arguments.
Pointer szString, int cchString, Pointer pchString);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:563:33: Error: Type 'Int32' not found.
typedef _GetPinvokeMap_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:564:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:565:5: Error: Type 'Uint32' not found.
Uint32 tk,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:566:13: Error: Type 'Uint32' not found.
Pointer pdwMappingFlags,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:566:5: Error: Type 'Pointer' not found.
Pointer pdwMappingFlags,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:566:5: Error: Expected 0 type arguments.
Pointer pdwMappingFlags,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:567:5: Error: Type 'Pointer' not found.
Pointer szImportName,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:567:5: Error: Expected 0 type arguments.
Pointer szImportName,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:568:5: Error: Type 'Uint32' not found.
Uint32 cchImportName,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:569:13: Error: Type 'Uint32' not found.
Pointer pchImportName,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:569:5: Error: Type 'Pointer' not found.
Pointer pchImportName,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:569:5: Error: Expected 0 type arguments.
Pointer pchImportName,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:570:13: Error: Type 'Uint32' not found.
Pointer ptkImportDLL);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:570:5: Error: Type 'Pointer' not found.
Pointer ptkImportDLL);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:570:5: Error: Expected 0 type arguments.
Pointer ptkImportDLL);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:572:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:574:13: Error: Type 'Uint32' not found.
Pointer pdwMappingFlags,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:574:5: Error: Type 'Pointer' not found.
Pointer pdwMappingFlags,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:574:5: Error: Expected 0 type arguments.
Pointer pdwMappingFlags,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:575:5: Error: Type 'Pointer' not found.
Pointer szImportName,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:575:5: Error: Expected 0 type arguments.
Pointer szImportName,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:577:13: Error: Type 'Uint32' not found.
Pointer pchImportName,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:577:5: Error: Type 'Pointer' not found.
Pointer pchImportName,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:577:5: Error: Expected 0 type arguments.
Pointer pchImportName,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:578:13: Error: Type 'Uint32' not found.
Pointer ptkImportDLL);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:578:5: Error: Type 'Pointer' not found.
Pointer ptkImportDLL);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:578:5: Error: Expected 0 type arguments.
Pointer ptkImportDLL);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:580:34: Error: Type 'Int32' not found.
typedef _EnumSignatures_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:581:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:582:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:582:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:582:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:583:13: Error: Type 'Uint32' not found.
Pointer rgSignatures,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:583:5: Error: Type 'Pointer' not found.
Pointer rgSignatures,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:583:5: Error: Expected 0 type arguments.
Pointer rgSignatures,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:584:5: Error: Type 'Uint32' not found.
Uint32 cMax,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:585:13: Error: Type 'Uint32' not found.
Pointer pcSignatures);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:585:5: Error: Type 'Pointer' not found.
Pointer pcSignatures);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:585:5: Error: Expected 0 type arguments.
Pointer pcSignatures);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:586:45: Error: Type 'Pointer' not found.
typedef _EnumSignatures_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:586:66: Error: Type 'IntPtr' not found.
typedef _EnumSignatures_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:586:58: Error: Type 'Pointer' not found.
typedef _EnumSignatures_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:586:58: Error: Expected 0 type arguments.
typedef _EnumSignatures_Dart = int Function(Pointer obj, Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:587:13: Error: Type 'Uint32' not found.
Pointer rgSignatures, int cMax, Pointer pcSignatures);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:587:5: Error: Type 'Pointer' not found.
Pointer rgSignatures, int cMax, Pointer pcSignatures);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:587:5: Error: Expected 0 type arguments.
Pointer rgSignatures, int cMax, Pointer pcSignatures);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:587:53: Error: Type 'Uint32' not found.
Pointer rgSignatures, int cMax, Pointer pcSignatures);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:587:45: Error: Type 'Pointer' not found.
Pointer rgSignatures, int cMax, Pointer pcSignatures);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:587:45: Error: Expected 0 type arguments.
Pointer rgSignatures, int cMax, Pointer pcSignatures);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:589:33: Error: Type 'Int32' not found.
typedef _EnumTypeSpecs_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:590:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:591:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:591:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:591:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:592:13: Error: Type 'Uint32' not found.
Pointer rgTypeSpecs,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:592:5: Error: Type 'Pointer' not found.
Pointer rgTypeSpecs,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:592:5: Error: Expected 0 type arguments.
Pointer rgTypeSpecs,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:593:5: Error: Type 'Uint32' not found.
Uint32 cMax,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:594:13: Error: Type 'Uint32' not found.
Pointer pcTypeSpecs);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:594:5: Error: Type 'Pointer' not found.
Pointer pcTypeSpecs);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:594:5: Error: Expected 0 type arguments.
Pointer pcTypeSpecs);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:595:44: Error: Type 'Pointer' not found.
typedef _EnumTypeSpecs_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:595:65: Error: Type 'IntPtr' not found.
typedef _EnumTypeSpecs_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:595:57: Error: Type 'Pointer' not found.
typedef _EnumTypeSpecs_Dart = int Function(Pointer obj, Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:595:57: Error: Expected 0 type arguments.
typedef _EnumTypeSpecs_Dart = int Function(Pointer obj, Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:596:13: Error: Type 'Uint32' not found.
Pointer rgTypeSpecs, int cMax, Pointer pcTypeSpecs);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:596:5: Error: Type 'Pointer' not found.
Pointer rgTypeSpecs, int cMax, Pointer pcTypeSpecs);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:596:5: Error: Expected 0 type arguments.
Pointer rgTypeSpecs, int cMax, Pointer pcTypeSpecs);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:596:52: Error: Type 'Uint32' not found.
Pointer rgTypeSpecs, int cMax, Pointer pcTypeSpecs);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:596:44: Error: Type 'Pointer' not found.
Pointer rgTypeSpecs, int cMax, Pointer pcTypeSpecs);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:596:44: Error: Expected 0 type arguments.
Pointer rgTypeSpecs, int cMax, Pointer pcTypeSpecs);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:598:35: Error: Type 'Int32' not found.
typedef _EnumUserStrings_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:599:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:600:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:600:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:600:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:601:13: Error: Type 'Uint32' not found.
Pointer rgStrings,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:601:5: Error: Type 'Pointer' not found.
Pointer rgStrings,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:601:5: Error: Expected 0 type arguments.
Pointer rgStrings,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:602:5: Error: Type 'Uint32' not found.
Uint32 cMax,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:603:13: Error: Type 'Uint32' not found.
Pointer pcStrings);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:603:5: Error: Type 'Pointer' not found.
Pointer pcStrings);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:603:5: Error: Expected 0 type arguments.
Pointer pcStrings);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:605:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:606:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:606:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:606:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:607:13: Error: Type 'Uint32' not found.
Pointer rgStrings,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:607:5: Error: Type 'Pointer' not found.
Pointer rgStrings,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:607:5: Error: Expected 0 type arguments.
Pointer rgStrings,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:609:13: Error: Type 'Uint32' not found.
Pointer pcStrings);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:609:5: Error: Type 'Pointer' not found.
Pointer pcStrings);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:609:5: Error: Expected 0 type arguments.
Pointer pcStrings);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:611:42: Error: Type 'Int32' not found.
typedef _GetParamForMethodIndex_Native = Int32 Function(Pointer obj,
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:611:57: Error: Type 'Pointer' not found.
typedef _GetParamForMethodIndex_Native = Int32 Function(Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:612:5: Error: Type 'Uint32' not found.
Uint32 tkMethodDef, Uint32 ulParamSeq, Pointer ptkParamDef);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:612:25: Error: Type 'Uint32' not found.
Uint32 tkMethodDef, Uint32 ulParamSeq, Pointer ptkParamDef);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:612:52: Error: Type 'Uint32' not found.
Uint32 tkMethodDef, Uint32 ulParamSeq, Pointer ptkParamDef);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:612:44: Error: Type 'Pointer' not found.
Uint32 tkMethodDef, Uint32 ulParamSeq, Pointer ptkParamDef);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:612:44: Error: Expected 0 type arguments.
Uint32 tkMethodDef, Uint32 ulParamSeq, Pointer ptkParamDef);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:614:5: Error: Type 'Pointer' not found.
Pointer obj, int tkMethodDef, int ulParamSeq, Pointer ptkParamDef);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:614:59: Error: Type 'Uint32' not found.
Pointer obj, int tkMethodDef, int ulParamSeq, Pointer ptkParamDef);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:614:51: Error: Type 'Pointer' not found.
Pointer obj, int tkMethodDef, int ulParamSeq, Pointer ptkParamDef);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:614:51: Error: Expected 0 type arguments.
Pointer obj, int tkMethodDef, int ulParamSeq, Pointer ptkParamDef);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:616:40: Error: Type 'Int32' not found.
typedef _EnumCustomAttributes_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:617:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:618:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:618:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:618:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:619:5: Error: Type 'Uint32' not found.
Uint32 tk,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:620:5: Error: Type 'Uint32' not found.
Uint32 tkType,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:621:13: Error: Type 'Uint32' not found.
Pointer rgCustomAttributes,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:621:5: Error: Type 'Pointer' not found.
Pointer rgCustomAttributes,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:621:5: Error: Expected 0 type arguments.
Pointer rgCustomAttributes,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:622:5: Error: Type 'Uint32' not found.
Uint32 cMax,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:623:13: Error: Type 'Uint32' not found.
Pointer pcCustomAttributes);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:623:5: Error: Type 'Pointer' not found.
Pointer pcCustomAttributes);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:623:5: Error: Expected 0 type arguments.
Pointer pcCustomAttributes);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:625:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:626:13: Error: Type 'IntPtr' not found.
Pointer phEnum,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:626:5: Error: Type 'Pointer' not found.
Pointer phEnum,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:626:5: Error: Expected 0 type arguments.
Pointer phEnum,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:629:13: Error: Type 'Uint32' not found.
Pointer rgCustomAttributes,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:629:5: Error: Type 'Pointer' not found.
Pointer rgCustomAttributes,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:629:5: Error: Expected 0 type arguments.
Pointer rgCustomAttributes,
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:631:13: Error: Type 'Uint32' not found.
Pointer pcCustomAttributes);
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:631:5: Error: Type 'Pointer' not found.
Pointer pcCustomAttributes);
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:631:5: Error: Expected 0 type arguments.
Pointer pcCustomAttributes);
^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:633:43: Error: Type 'Int32' not found.
typedef _GetCustomAttributeProps_Native = Int32 Function(
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:634:5: Error: Type 'Pointer' not found.
Pointer obj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:635:5: Error: Type 'Uint32' not found.
Uint32 cv,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:636:13: Error: Type 'Uint32' not found.
Pointer ptkObj,
^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:636:5: Error: Type 'Pointer' not found.
Pointer ptkObj,
^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/win32-1.7.1/lib/src/generated/IMetaDataImport.dart:636:5: Error: Expected 0 type arguments.
Pointer

Not properly flagged in pub.dev

Would be nice that in pub.dev the lib gets flagged properly to make it more discoverable.
I'd like to see Android, iOS and Web tags there.

Screenshot from 2020-06-21 01-58-05

Thanks, nice lib!

Accessing hidden method

I dont know if this would be a problem in the future or upon submitting the app.

When using write storage:

 final storage = GetStorage();
 storage.write('Key', 'value');

it logs a warning.

 Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)

flutter doctor:

[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.4 19E287 darwin-x64, locale en-PH)
   • Flutter version 1.22.4 at /Users/mac-home/Documents/Installers/flutter
   • Framework revision 1aafb3a8b9 (4 months ago), 2020-11-13 09:59:28 -0800
   • Engine revision 2c956a31c0
   • Dart version 2.10.4


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
   • Android SDK at /Users/mac-home/Library/Android/sdk
   • Platform android-30, build-tools 28.0.3
   • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
   • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
   • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
   • Xcode at /Applications/Xcode.app/Contents/Developer
   • Xcode 12.2, Build version 12B45b
   • CocoaPods version 1.10.0

[✓] Android Studio (version 3.6)
   • Android Studio at /Applications/Android Studio.app/Contents
   • Flutter plugin version 44.0.2
   • Dart plugin version 192.7761
   • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.53.2)
   • VS Code at /Applications/Visual Studio Code.app/Contents
   • Flutter extension version 3.20.0

Ref: https://stackoverflow.com/questions/50100276/what-is-a-non-sdk-interface

Diffirent type in each time read storage

I have 2 model : House and Room with 4 screen with tree map
List house > Edit house > List room > Edit room / Add room . Problem happens with List room screen.
In List room controller, I get list all room with :
List rooms = GetStorage().read<List>('rooms');
In first time, while start app, I go to List room screen, result of rooms is List of Map, like :
[{id: 1, name: Alpha Room, totalPeople: 1, floor: 1}, {id: 2, name: Beta Room, totalPeople: 2, floor: 1} ....]

but, if I add a new room and save to storage
GetStorage().write('rooms', rooms.toList());
and go back screen Edit house and to screen List room again, i got list of instance of Room.

What is diffirent in 2 situation ?

flutter 2
get: ^3.26.0
get_storage: ^1.4.0

Encryption support

Do you plan any encryption support in the future, or would this be something everyone should do on his own?

Using with Get framework - example request

You mentioned that this widget can be used with Get framework (https://pub.dev/packages/get) but how to make the box values observable variables something like this example?

Widget build(BuildContext buildContext) {
   GetStorage data = GetStorage().obs;

   return Scaffold(
      key: _scaffoldKey,
      appBar: AppBar(
         title: Text('Example'),
      ),
      drawer: Obx(() => Text(
         "${data.read("var1")}"
      )
   )
}

storage Key updates accordingly on Background but when resume old Key is restored.

Hi,
Was reading #20 but does not feel the same issue. Please close the issue if this seems to pushy from my side or do not correspond.

I've my app working as expected with FCM. When app is on background I use storage to save current messages, when resuming (tapping the message) while trying to read the list of messages remains the same as before going on background.

Steps to reproduce

  1. Open App
  2. Load services (included FCM)
  3. Go to foreground
  4. Send / receive Message save into storage Key (can see the storage have the message)
  5. On tap, resume app storage Key list seems as before going on background

I'm assuming I'm missing some action to reflect changes on the the storage. I apologise forehand as don't really know how to make the code as readable as posible.

Main


Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await ServicesSer().dependencies();

  runApp(
    GetMaterialApp(
      title: "Application",
      initialRoute: AppPages.INITIAL,
      // showPerformanceOverlay: true,
      locale: TranslationService.locale,
      fallbackLocale: TranslationService.fallbackLocale,
      translations: TranslationService(),
      theme: theme.light,
      darkTheme: theme.dark,

      themeMode: await Get.find<StorageCtrl>().getSetting(
                settingKey: 'THEME',
                settingValue: 'light',
              ) ==
              'light'
          ? ThemeMode.light
          : ThemeMode.dark,
      getPages: AppPages.routes,

      debugShowCheckedModeBanner: false,
    ),
  );
}

Services


class ServicesSer extends Bindings {
  @override
  Future<void> dependencies() async {

    //storageCtrl
    await Get.putAsync<StorageCtrl>(() async {
      await GetStorage.init();
      final storageCtrl = StorageCtrl();
      await storageCtrl.storageCtrlInit();
      return storageCtrl;
    }, permanent: true);

    //notifications
    await Get.putAsync<NotificationsCtrl>(() async {
      final notificationsCtrl = NotificationsCtrl();
      await notificationsCtrl.notificationsInit();
      return notificationsCtrl;
    }, permanent: true);

    //firebase messaging init
    await Get.putAsync<FirebaseMessageSer>(() async {
      await Firebase.initializeApp();
      final firebaseMessengerSer = FirebaseMessageSer();
      await firebaseMessengerSer.firebaseMessageSerInit();
      return firebaseMessengerSer;
    }, permanent: true);
  }
}


FirebaseMessageSer


class FirebaseMessageSer extends GetxService {
  NotificationsCtrl notificationsCtrl = Get.find<NotificationsCtrl>();
  late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;

  @override
  Future<void> onInit() async {
    super.onInit();
  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    super.onClose();
  }

  Future<void> firebaseMessageSerInit() async {
    await FirebaseMessaging.instance
        .setForegroundNotificationPresentationOptions(
      alert: false,
      badge: false,
      sound: false,
    );
    ;

    FirebaseMessaging.instance.getInitialMessage().then((message) async {
      print('getInitialMessage');
    });

    FirebaseMessaging.onMessage.listen((message) {
      print('onMessage');
      notificationsCtrl.showNotification(message: message);
    });

    FirebaseMessaging.onMessageOpenedApp.listen((message) {
      print('onMessageOpenedApp');
      notificationsCtrl.showNotification(message: message);
    });

    FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);

    print(await FirebaseMessaging.instance.getToken());
  }
}

**//when app is closed or in foreground this function will handle notification**
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
  print('Handling a background message ${message.messageId}');

 ///most probably here is the issue, I need to initiate ctrls again as in foreground they are not longer in memory
 /// creating another instance of storage
 ///showNotification (bellow) saves the message to storage but when I resume the app
 /// the other instance of storage has not been updated
  Get.put(StorageCtrl());
  final notificationsCtrl = Get.put(NotificationsCtrl());
  notificationsCtrl.showNotification(message: message);
}

StorageCtrl


class StorageCtrl extends GetxController {
  final GetStorage storage = GetStorage();

  @override
  Future<void> onInit() async {
    // await storage.erase();
    super.onInit();
  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    super.onClose();
  }

  Future<void> storageCtrlInit() async {
    await initTheme();
  }

  ///////////////////////////////////////////////////////////////////////
  ///THEME
  Future<void> initTheme() async {
    final userTheme = await getSetting(
      settingKey: 'THEME',
      settingValue: 'light',
    );

    ///FIXME status bar on android has wrong color
    if (userTheme == 'light') {
      SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
        statusBarColor: lightPrimaryAppColor,
      ));
      SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
    } else {
      SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
        statusBarColor: darkPrimaryAppColor,
      ));
      SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
    }
  }

  Future<void> changeTheme() async {
    final theme = Get.isDarkMode ? ThemeMode.light : ThemeMode.dark;

    setSetting(
      settingKey: 'THEME',
      settingValue: theme.toString().split('.')[1],
    );
    await initTheme();
    Get.changeThemeMode(theme);
  }

 
  ///////////////////////////////////////////////////////////////////////
  ///STORAGE
  /// settingValue will be a default value return if key is null
  dynamic getSetting(
      {required String settingKey, dynamic settingValue})  {
    final setting = storage.read(settingKey);
    return setting != null ? setting : settingValue;
  }

  Future<void> setSetting(
      {required String settingKey, dynamic settingValue}) async {
    await storage.write(settingKey, settingValue);
    print('settingKey: $settingKey - settingValue: $settingValue');
  }
}

NotificationCtrl
I know there are a lot of async when using storage, was testing if that might have something to do


Future<void> showNotification({required RemoteMessage message}) async {
    print('showNotification');

    final data = message.data;
    
    **//when on background, I can see that adding the message to the storage works as expected**
    await addRemoteMessage(message: message);

    NotificationDetails _notificationDetails;

    switch (data['notificationType']) {
      case 'bigImagePushNotification':
        _notificationDetails =
            await notificationDetailsBigImage(message: message);
        break;
      case 'smallImagePushNotification':
        _notificationDetails =
            await notificationDetailsTileImage(message: message);
        break;
      default:
        _notificationDetails = notificationDetailsNormal(message: message);
    }

    flutterLocalNotificationsPlugin.show(
      message.notification.hashCode,
      data['title'],
      data['excerpt'],
      _notificationDetails,
      payload: message.messageId,
    );
    
  }

Future<void> addRemoteMessage({
    required RemoteMessage message,
  }) async {
    final _message = MessageModel(
      message.messageId!,
      message.data['action'],
      message.data['id'],
      message.data['notificationType'],
      message.data['title'],
      message.data['excerpt'],
      message.data['featuredImage'],
      // DateTim.toIso8601String(),
    );

    var _messages = await getRemoteMessages();
    _messages.add(_message);

    await saveRemoteMessages(messages: _messages);
  }

Future<List<MessageModel>> getRemoteMessages() async {
    var messageList = <MessageModel>[];

    final list = await storageCtrl.getSetting(
      settingKey: 'MESSAGES',
      settingValue: <Map<String, dynamic>>[],
    );

    for (var _message in list) {
      messageList.add(MessageModel.fromJson(_message));
    }

    return messageList;
  }

Future<void> saveRemoteMessages({
    required List<MessageModel> messages,
  }) async {
    var _messagesList = <Map<String, dynamic>>[];

    for (var _message in messages) {
      _messagesList.add(json.decode(jsonEncode(_message)));
    }

    await storageCtrl.setSetting(
      settingKey: 'MESSAGES',
      settingValue: _messagesList,
    );
  }


Future onSelectNotification(String? payload) async {
    print('onSelectNotification');

    **/////When selected notification triggers app Resumes**
    ** //// but getRemoteMessage have the same list before going on background**

    final _message = await getRemoteMessage(messageId: (payload)!);
    await removeRemoteMessage(messageId: payload);
    await notificationHandler(
      message: _message,
    );
  }


Should I use Fenix in order to re create the storageCtrl? Hopefully someone with more experience can point out what I'm missing or tell me if this is default behaviour.

Thanks in advance

FileSystemException on Windows

Hello! Error is thrown on Windows 10.

[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: FileSystemException: lock failed, path = 'C:\Users\win10\Documents/GetStorage.gs'

  • get_storage: 1.4.0
  • flutter: 2.0.1

Error is thrown when calling GetStorage.wrile(...) second and next times after app lauched.

Key is available or not

I did not find any thing to check Key is available or not,
how to check Key is available or not ?

GetStorage init() failed on Android

Hi, i used lib on iOS and i just test my app on a Pixel 3a under AndroidAPI 27 and got this error when i tried to init storage

E/flutter ( 6985): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider) E/flutter ( 6985): #0 GetStorage._init (package:get_storage/src/storage_impl.dart:47:7) E/flutter ( 6985): <asynchronous suspension> E/flutter ( 6985): #1 new GetStorage._internal.<anonymous closure> (package:get_storage/src/storage_impl.dart:27:13) E/flutter ( 6985): #2 new Future.<anonymous closure> (dart:async/future.dart:175:37) E/flutter ( 6985): #3 _rootRun (dart:async/zone.dart:1182:47) E/flutter ( 6985): #4 _CustomZone.run (dart:async/zone.dart:1093:19) E/flutter ( 6985): #5 _CustomZone.runGuarded (dart:async/zone.dart:997:7) E/flutter ( 6985): #6 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23) E/flutter ( 6985): #7 _rootRun (dart:async/zone.dart:1190:13) E/flutter ( 6985): #8 _CustomZone.run (dart:async/zone.dart:1093:19) E/flutter ( 6985): #9 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23) E/flutter ( 6985): #10 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15) E/flutter ( 6985): #11 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19) E/flutter ( 6985): #12 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5) E/flutter ( 6985): #13 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Any ideas ?
Here my code :

    import 'package:Witook/app/routes/app_pages.dart';
  import 'package:Witook/app/services/oauth_handler.dart';
  import 'package:Witook/app/services/uri_handler.dart';
  import 'package:flutter/material.dart';
  import 'package:get/get.dart';
  import 'package:get_storage/get_storage.dart';
  
  import 'app/routes/app_routes.dart';
  port 'app/translations/app_translations.dart';
  
    Future<void> main() async {
      initServices();
      runApp(MyApp());
    }
  
    void initServices() async {
      print('starting services ...');
  
      await GetStorage.init(); ----------------> PROBLEM HERE
      await Get.putAsync(() => UriHelper().init(), tag: 'uri_handler');
      Get.put(OauthHandler(), tag: 'oauth_handler');
  
      //TODO REMOVE FOR PROD
      await GetStorage().remove('auth_token');
  
      /// Here is where you put get_storage, hive, shared_pref initialization.
      /// or moor connection, or whatever that's async.
      //await Get.putAsync(() => DBService.init());
      //await Get.putAsync(SettingsService()).init();
  
      print('All services started...');
    }
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        var storage = GetStorage();
  
        return GetMaterialApp(
            debugShowCheckedModeBanner: false,
            theme: null,
            locale: Locale('fr', 'FR'),
            getPages: AppPages(storage).getPages(),
            defaultTransition: Transition.fade,
            initialRoute:
                storage.hasData('launched') ? Routes.HOME : Routes.ONBOARDING,
            translationsKeys: AppTranslation.translations);
      }
    }

Await asynchronous calls in benchmark

https://github.com/jonataslaw/get_storage/blob/master/storage_benchmark/lib/runners/get_storage.dart#L55

Your writes/deletes are not synchronous. You have to await them, or your benchmark lacks validity. Dart's stopwatch class, right now, is simply measuring the queuing time for a Future + read/write/delete time from an in-memory hashmap.

(Alternatively, you could make writes/deletes synchronous by using File.writeAsStringSync(), but this isn't recommended.)

On another note, I find it vaguely concerning that you awaited every other library's operations (i.e. measured them properly), but exempted your own from proper measurement.

Build widget when box update/write

Error Code

class Screen extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {

final box = GetStorage();
return box.listenKey(
  'key',
  (value) => ListView.builder(
    itemCount: 2,
    itemBuilder: (context, i) => Container(),
  ),
);

}
}

FormatException

flutter: FormatException: Unexpected character (at character 36)
{"language":"nl_NL","theme":"dark"}}

I think there is a problem with this package... it adds an extra } and then it crashes all the time.

Here is the code i use:

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';

main() async {
  await GetStorage.init();
  runApp(MyApp());
}

class SwigTranslations extends Translations {
  @override
  Map<String, Map<String, String>> get keys => {
        'nl_NL': {
          'title': 'Hello World %s NL',
        },
        'en_UK': {
          'title': 'Hello World %s US',
        },
      };
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      theme: ThemeData.light().copyWith(primaryColor: Colors.green),
      darkTheme: ThemeData.dark().copyWith(primaryColor: Colors.purple),
      translations: SwigTranslations(),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final box = GetStorage();

  changeCurrentLanguage() {
    String currentLanguage = box.read('language') ?? 'nl_NL';
    Get.updateLocale(Locale(
        currentLanguage.substring(0, 2), currentLanguage.substring(3, 5)));
  }

  changeCurrentTheme() async {
    if (box.read('theme') == 'dark') {
      Get.changeThemeMode(ThemeMode.light);
      box.write('theme', 'light');
    } else {
      Get.changeThemeMode(ThemeMode.dark);
      box.write('theme', 'dark');
    }
  }

  @override
  void initState() {
    changeCurrentTheme();
    changeCurrentLanguage();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("title".trArgs(['John'])),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(box.read('language') ?? 'Empty'),
            Text("title".trArgs(['John'])),
            Text("title".tr),
            RaisedButton(
              child: Text('Change locale to English'),
              onPressed: () {
                setState(() {
                  box.write('language', 'en_UK');
                  changeCurrentLanguage();
                });
                //  Get.updateLocale(Locale('en', 'UK'));
              },
            ),
            RaisedButton(
              child: Text('Change locale to Netherlands'),
              onPressed: () {
                setState(() {
                  box.write('language', 'nl_NL');
                  changeCurrentLanguage();
                  changeCurrentTheme();
                });
                //  Get.updateLocale(Locale('en', 'UK'));
              },
            ),
          ],
        ),
      ),
      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Please add removeKeyListen back

Hi

Why removeKeyListen was removed?

Since we can use listenKey, then we need the ability to remove this listener right?

Thanks

[ERROR] : Unhandled Exception: Bad state: No element On App starts

[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Bad state: No element
#0      Iterable.first (dart:core/iterable.dart:468:7)
#1      GetStorage.listenKey.<anonymous closure>
package:get_storage/src/storage_impl.dart:83
#2      ListNotifier._notifyUpdate
package:get/…/simple/list_notifier.dart:43
#3      ListNotifier.refresh.<anonymous closure>
package:get/…/simple/list_notifier.dart:36
#4      _rootRun (dart:async/zone.dart:1346:47)
#5      _CustomZone.run (dart:async/zone.dart:1258:19)


GetStorage strange behaviour in unit tests

I am writing unit tests for my implementation of GetStorage shared preferences alongside GetX and it would be so helpful to see how to properly use both GetStorage and GetX controllers in unit tests.
I see some very inconsistent GetStorage behaviour in my unit tests - sometimes the data gets updated, other times not and most of the time the data persists until another test is run, even though I initialize the class from scratch every time .

The unit test does not pick up the correct values inside the variables. For example, both userData.firstName.val, errorController.contactInfoMissing.value inside the test even though I confirmed they are both being set with correct values in the code. This leads me to believe that I may doing something wrong inside the unit test, but there is no documentation on how to do it properly.

P.S. StoredUserData works fine in my app, but for some reason not in the unit test.

Also, I wasn't able to initialize the ErrorController inside the setUp of the unit test. StoredUserData is not finding it in this case, therefore I had to initialize it in the test itself - not sure if proper.

Unit test code

class MockDocumentSnapshot extends Mock implements DocumentSnapshot {
  Map<String, dynamic> mockData;
  MockDocumentSnapshot(this.mockData);

  @override
  Map<String, dynamic> data() {
    return mockData;
  }
  @override
  bool get exists => true;
}

class MockFirestoreService extends Mock implements FirestoreService {
  final MockDocumentSnapshot documentSnapshot;

  MockFirestoreService(this.documentSnapshot);
  @override
  Future<MockDocumentSnapshot> readData(String collectionName, String documentPath) {
    return Future.delayed(Duration(milliseconds: 0)).then((value) => documentSnapshot);
  }
}

void main() {
  setupCloudFirestoreMocks();

  setUpAll(() async {
    TestWidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();
 await GetStorage.init();

  });
 test(
        'update() method test: blank data, lastUpdatedDate is today and force update is true - update should run and contactInfoMissing value should be set to true',
        () {
      ErrorController errorController = Get.put(ErrorController());
      const Map<String, dynamic> blankUserAccountData = {};
      MockDocumentSnapshot mockDocumentSnapshot = MockDocumentSnapshot(blankUserAccountData);

      MockFirestoreService mockFirestoreService = MockFirestoreService(mockDocumentSnapshot);
      final StoredUserData userData = StoredUserData(firestoreService: mockFirestoreService);
await userData.erase();
      String today = DateTime.now().toString();
      userData.lastUpdated.val = today;
      // userData.erase();
      userData.update(true, 'email', 'UID');
      expect(userData.firstName.val, '');
      expect(userData.lastName.val, '');
      expect(userData.aptNumber.val, '');
      expect(userData.streetNumber.val, '');
      expect(userData.streetName.val, '');
      expect(userData.city.val, '');
      expect(userData.loginEmail.val, '');
      expect(userData.contactEmail.val, '');
      expect(userData.phone.val, '');
      expect(userData.visibility.val, {});
      expect(userData.languages.val, []);
      expect(userData.lastUpdated.val, DateTime.utc(2020, DateTime.november, 11).toString());

      expect(errorController.contactInfoMissing.value, true);

      Get.delete<ErrorController>();
    });
}

Code being tested:

class StoredUserData {
  ErrorController _errorController = Get.find<ErrorController>();
  FirestoreService _firestoreService = FirestoreService();
 
 StoredUserData({FirestoreService firestoreService}) : this.firestoreService = firestoreService ?? FirestoreService();
  static final _userDataBox = () => GetStorage('UserData');

  final firstName = ReadWriteValue(kdbFieldFirstName, '', _userDataBox);
  final lastName = ReadWriteValue(kdbFieldLastName, '', _userDataBox);
  final aptNumber = ReadWriteValue(kdbFieldAptNumber, '', _userDataBox);
  final streetNumber = ReadWriteValue(kdbFieldStreetNum, '', _userDataBox);
  final streetName = ReadWriteValue(kdbFieldStreetName, '', _userDataBox);
  final city = ReadWriteValue(kdbFieldCity, '', _userDataBox);
  final loginEmail = ReadWriteValue('loginEmail', '', _userDataBox);
  final contactEmail = ReadWriteValue(kdbFieldEmail, '', _userDataBox);
  final phone = ReadWriteValue(kdbFieldPhone, '', _userDataBox);
  final visibility = ReadWriteValue(kdbFieldVisibility, {}, _userDataBox);
  final languages = ReadWriteValue(kdbFieldLanguages, [], _userDataBox);
  final lastUpdated = ReadWriteValue('lastUpdated', DateTime.utc(2020, DateTime.november, 11).toString(), _userDataBox);

  Future<Map<String, dynamic>> getFreshDataFromDB(String userID) async {
    Map<String, dynamic> _userSnapshotData;
    
    await _firestoreService.readData(kdbCollUserAccounts, userID).then((docSnapshot) => _userSnapshotData = docSnapshot.data()).catchError((error) {
     
      _errorController.errorMessage.value = error.toString();
    });
   
    return _userSnapshotData;
  }

  void update(bool forceUpdate, String userEmail, String userID) async {
    
    
    final DateTime today = DateTime.now();
    final DateTime _lastUpdated = DateTime.parse(lastUpdated.val);
   
    if (_userDataBox.isNullOrBlank || _lastUpdated.difference(today).inDays < -1 || forceUpdate) {
      print('GetX Storage Called: date test is true');
      try {
       
        Map<String, dynamic> _userSnapshotData = await getFreshDataFromDB(userID);
        print('GetX Storage Called: usersnapshotdata after getFreshDataCalled - $_userSnapshotData');
        if (_userSnapshotData != null) {
          lastUpdated.val = DateTime.now().toString();
          Map _address = _userSnapshotData[kdbFieldAddress];
          Map _contactInfo = _userSnapshotData[kdbFieldContactInfo];
          print('GetX Storage Called: first name before update - ${firstName.val}; DateTime: ${DateTime.now().toString()}');
          print('GetX Storage Called: last name before update - ${lastName.val}; DateTime: ${DateTime.now().toString()}');
          firstName.val = _userSnapshotData[kdbFieldFirstName].toString();
          lastName.val = _userSnapshotData[kdbFieldLastName].toString();
         
          if (_address.isNullOrBlank) {
            _errorController.contactInfoMissing.value = true;
            lastUpdated.val = DateTime.utc(2020, DateTime.november, 11).toString();
           } else {
            _errorController.contactInfoMissing.value = false;
            aptNumber.val = !_address.isNullOrBlank ? _address[kdbFieldAptNumber] : '';
            streetNumber.val = !_address.isNullOrBlank ? _address[kdbFieldStreetNum] : '';
            streetName.val = !_address.isNullOrBlank ? _address[kdbFieldStreetName] : '';
            city.val = !_address.isNullOrBlank ? _address[kdbFieldCity] : '';
          }
          loginEmail.val = userEmail;
         if (!_contactInfo.isNullOrBlank) {
            String _email = _contactInfo[kdbFieldEmail];

            contactEmail.val = _email.isNullOrBlank ? userEmail : _email;
            phone.val = _contactInfo[kdbFieldPhone];
          } else {
            contactEmail.val = userEmail;
            phone.val = '';
          }
             visibility.val = _userSnapshotData[kdbFieldVisibility] ?? {};
          languages.val = _userSnapshotData[kdbFieldLanguages] ?? [];
        }
      } catch (e) {
        print('GetX Storage Called: error caught - ${e.toString()}');
        _errorController.errorMessage.value = e.toString();
      }
    } else {
      print('GetX Storage Called: UserData was updated less than one day ago');
    }
 void erase() async {
    await GetStorage('UserData').erase();
    print('GetStorage.erase() called');
  }
   
  }

After upgrade from 1.3.1 to 1.4.0 get_storage i get type 'LastCall' is not a subtype of type 'Map<String, dynamic>' error

After 1.4.0 upgrade, I get
type 'LastCall' is not a subtype of type 'Map<String, dynamic>'
error.
I have a model called LastCall, and I store data as json .
First call of loadLastCallList() function works perfect. Bu second time, third time etc fails.
First time list variable is a [0]: Map
But the other times list variable is a [0]:LastCall
for that fromJson fails to convert list[i]

Why list variable is first time is a Map but the other times is a Model(LastCall)
List list = GetStorage().read("lastCallList");
I am excepting it all the time as a Map variable.

Future<void> loadLastCallList() async {
    var tempList = List<LastCall>();
      List<dynamic> list = GetStorage().read("lastCallList");
      if (list != null) {
        for (var i = 0; i < list.length; i++) {
          LastCall lastCall = LastCall.fromJson(list[i]);
          tempList.add(lastCall);
        }
      } else {
        lastCallList.clear();
      }
      lastCallList.assignAll(tempList);
}

Error: The method 'ValueStorage.change' has more required arguments than those of overridden method 'StateMixin.change'.

event sent after app closed: {id: 0, progressId: null, message: Running "flutter pub get" in woocard...}
event sent after app closed: {id: 0, progressId: null, finished: true}
�[38;5;248mLaunching lib/main.dart on STK L21 in debug mode...�[39;49m
 lib/main.dart
../../../../flutter/.pub-cache/hosted/pub.dartlang.org/get_storage-1.3.1/lib/src/value.dart:8:8: Error: The method 'ValueStorage.change' has more required arguments than those of overridden method 'StateMixin.change'.
  void change(String key, dynamic value) {
       ^
../../../../flutter/.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_state_manager/src/rx_flutter/rx_notifier.dart:50:8: Context: This is the overridden method ('change').
  void change(T newState, {RxStatus status}) {
       ^
../../../../flutter/.pub-cache/hosted/pub.dartlang.org/get_storage-1.3.1/lib/src/value.dart:8:22: Error: The parameter 'key' of the method 'ValueStorage.change' has type 'String', which does not match the corresponding type, 'T', in the overridden method, 'StateMixin.change'.
Change to a supertype of 'T', or, for a covariant parameter, a subtype.
  void change(String key, dynamic value) {
                     ^
../../../../flutter/.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_state_manager/src/rx_flutter/rx_notifier.dart:50:8: Context: This is the overridden method ('change').
  void change(T newState, {RxStatus status}) {
       ^
../../../../flutter/.pub-cache/hosted/pub.dartlang.org/get_storage-1.3.1/lib/src/value.dart:8:8: Error: The method 'ValueStorage.change' has fewer named arguments than those of overridden method 'StateMixin.change'.
  void change(String key, dynamic value) {
       ^
../../../../flutter/.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_state_manager/src/rx_flutter/rx_notifier.dart:50:8: Context: This is the overridden method ('change').
  void change(T newState, {RxStatus status}) {
       ^
../../../../flutter/.pub-cache/hosted/pub.dartlang.org/get_storage-1.3.1/lib/src/value.dart:10:11: Error: Too few positional arguments: 1 required, 0 given.
    update();
          ^

Problem saving and restoring list of string

If I save a List<String> I'm able to use and modify it during app run but at the following restart the app crashes with error:

type 'List<dynamic>' is not a subtype of type 'List<String>?' in type cast

There is something I need to specify during write or read to manage list properly?

My actual code to restore:

  @override
  void initState() {
    super.initState();
    try {
      _savedDevices = box.read('saved_devices') ?? <String>[];
    } catch (e) {
      List<dynamic> tmp = box.read('saved_devices');
      _savedDevices = tmp.map((item) => item.toString()).toList();
    }
  }

where _savedDevices is a List<String> saved as box.write('saved_devices', _savedDevices);

Thanks

Secure storage

is this secure to store credential information like username and password?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.