Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/redux_persist_web/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: redux_persist_web_example

environment:
sdk: ">=2.0.0-dev <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
redux_persist_web:
path: ..
redux: "^3.0.0"
redux: ^5.0.0

# Used for development
#dependency_overrides:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AppState {

AppState({this.counter = 0});

AppState copyWith({int counter}) =>
AppState copyWith({int? counter}) =>
AppState(counter: counter ?? this.counter);

static AppState fromJson(dynamic json) =>
Expand All @@ -38,7 +38,7 @@ class AppState {

class IncrementCounterAction {}

AppState reducer(AppState state, Object action) {
AppState reducer(AppState state, dynamic action) {
if (action is IncrementCounterAction) {
// Increment
return state.copyWith(counter: state.counter + 1);
Expand Down
6 changes: 3 additions & 3 deletions packages/redux_persist_web/lib/redux_persist_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class WebStorage implements StorageEngine {

@override
Future<Uint8List> load() =>
Future.value(stringToUint8List(window.localStorage[key]));
Future.value(stringToUint8List(window.localStorage[key] ?? ""));

@override
Future<void> save(Uint8List data) async {
window.localStorage[key] = uint8ListToString(data);
Future<void> save(Uint8List? data) async {
window.localStorage[key] = uint8ListToString(data) ?? "";
}
}
7 changes: 3 additions & 4 deletions packages/redux_persist_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: redux_persist_web
description: Redux Persist Web Integration with custom storage engines (localStorage)
version: 0.8.2
version: 0.9.0
homepage: https://github.com/Cretezy/redux_persist/tree/master/packages/redux_persist_web
author: Charles Crete <[email protected]>

environment:
sdk: ">=1.24.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
redux_persist: "^0.8.2"
redux_persist: "^0.9.0"

# Used for development
#dependency_overrides:
Expand Down