Closed nmacherey closed 4 years ago
Can you give me a small demo project I can play with? I haven't used the web library very much, and would like to make sure I can fix it properly for you
Hi Charles,
Thanks for your reply, I've tried removing the external declarations in the files and It successfuly compiles and work in a web environment.
I don't know why there should be these declarations. I will trye to set up a project for you
Thanx
@nmacherey what did you mean with this?
I've tried removing the external declarations in the files and It successfuly compiles and work in a web environment.
I'm experiencing the same issue, really don't know what to do.
I wonder if the import part is correct
import 'package:redux_persist/redux_persist.dart';
import 'package:redux_persist_flutter/redux_persist_flutter.dart' if (dart.library.io) 'package:redux_persist_flutter/redux_persist_flutter.dart';
import 'package:redux_persist_web/redux_persist_web.dart' if (dart.library.html) 'package:redux_persist_web/redux_persist_web.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
class AtStore {
static Future<Store<AppState>> createStore() async {
final persistor = Persistor<AppState>(
storage: kIsWeb == true ? WebStorage() : FlutterStorage(location: FlutterSaveLocation.documentFile), // Or use other engines
serializer: JsonSerializer<AppState>(AppState.fromJson), // Or use other serializers
);
AppState initialState;
initialState = await persistor.load();
return Store(
appReducer,
initialState: initialState,
middleware: [
persistor.createMiddleware()
],
);
}
}
flutter_redux: ^0.6.0
redux_persist: ^0.8.2
redux_persist_flutter: ^0.8.2
redux_persist_web: ^0.8.2
I have released redux_persist 0.8.4 with a fix for this. Thanks for the report!
Hi @Cretezy could you please upgrade the redux_persist_web ?
No need for redux_persist_web for Flutter, use redux_persist_flutter (see README for instructions)
Hi I am trying to compile a web version of my application and it seams to have some compilation errors comming from the package.
Could you help on this ?
initial-state.dart:
Web Version:
IO Version