diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index ac31642c..f63968ce 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12/","dependencies":[]}],"android":[{"name":"shared_preferences","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+10/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+2/","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+1/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-0.0.1+1/","dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2020-10-07 20:05:17.296552","version":"1.22.0"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12/","dependencies":[]}],"android":[{"name":"shared_preferences","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+10/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+2/","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+1/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-0.0.1+1/","dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/Users/ganeshr/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2020-10-07 20:05:17.296552","version":"1.22.0"} diff --git a/example/.gitignore b/example/.gitignore index 453ce06b..78d07146 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -22,6 +22,7 @@ **/doc/api/ .dart_tool/ .flutter-plugins +.flutter-plugins-dependencies .packages .metadata .pub-cache/ diff --git a/lib/src/foundation/bloc.dart b/lib/src/foundation/bloc.dart index fc8802de..07130b12 100644 --- a/lib/src/foundation/bloc.dart +++ b/lib/src/foundation/bloc.dart @@ -110,7 +110,7 @@ class Bloc { _steps = steps; _stepsToIgnore = await _alreadyCompletedSteps; - _steps = _steps.where((s) => !_stepsToIgnore.contains(s)).toList(); + _steps = _steps?.where((s) => !_stepsToIgnore.contains(s))?.toList() ?? []; _activeStepIndex = -1; await _nextStep(); @@ -156,9 +156,7 @@ class Bloc { Future> get _alreadyCompletedSteps async { if (!recordInSharedPrefs) return {}; final prefs = await SharedPreferences.getInstance(); - return _steps - .where((s) => prefs.getBool('$sharedPrefsPrefix$s') == true) - .toSet(); + return _steps?.where((s) => prefs.getBool('$sharedPrefsPrefix$s') == true)?.toSet() ?? {}; } /// Returns true iff this step has been previously diff --git a/pubspec.yaml b/pubspec.yaml index 0a770d4f..402e9a33 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: >- A Flutter package that implements Material Design Feature discovery to show a description of specific features to new users. See https://tinyurl.com/FeatureDiscovery -version: 0.12.0+2 +version: 0.12.1+3 homepage: https://github.com/ayalma/feature_discovery environment: