jhourlad / flutter_session Goto Github PK
View Code? Open in Web Editor NEWAdds session functionality to Flutter. Works on both mobile, web and (hopefully) desktop apps
License: MIT License
Adds session functionality to Flutter. Works on both mobile, web and (hopefully) desktop apps
License: MIT License
Possibility to remove all sessions?
SharedPreferences preferences = await SharedPreferences.getInstance();
await preferences.clear();
Is there an option currently?
am building a Flutter web app and I wanted to add sessions, so I tried adding the flutter_session package using flutter pub add flutter_session
but I get this error
Because shared_preferences_linux >=0.0.4-nullsafety <2.0.0 depends on shared_preferences_platform_interface ^2.0.0-nullsafety and shared_preferences_linux <=0.0.2 depends on path_provider ^1.6.11, shared_preferences_linux <0.0.2+1 or >=0.0.4-nullsafety <2.0.0-โ requires shared_preferences_platform_interface ^2.0.0-nullsafety or path_provider ^1.6.11.
And because shared_preferences_linux >=0.0.2+1 <0.0.4-nullsafety depends on path_provider_linux ^0.0.1 and shared_preferences >=0.5.8 <2.0.0-nullsafety depends on shared_preferences_linux ^0.0.2, shared_preferences >=0.5.8 <2.0.0-nullsafety requires path_provider_linux ^0.0.1 or shared_preferences_platform_interface ^2.0.0-nullsafety or path_provider ^1.6.11.
And because shared_preferences >=0.5.4+8 <2.0.0-nullsafety depends on shared_preferences_platform_interface ^1.0.0 and path_provider >=2.0.0 depends on path_provider_linux ^2.0.0, path_provider >=2.0.0 is incompatible with shared_preferences >=0.5.8 <2.0.0-nullsafety.
And because google_fonts >=2.0.0 depends on path_provider ^2.0.0 and every version of flutter_session depends on shared_preferences ^0.5.8, google_fonts >=2.0.0 is incompatible with flutter_session.
So, because admin depends on both google_fonts ^2.0.0 and flutter_session any, version solving failed.
i tried removing google_fonts package but the same issue remained but this time with other packages.
this one after removing google_fonts
(1) So, because path_provider_platform_interface <2.0.0-nullsafety depends on plugin_platform_interface ^1.0.1, cloud_firestore >=2.2.2 is incompatible with path_provider_platform_interface <2.0.0-nullsafety.
Because shared_preferences_linux >=0.0.2+1 <0.0.4-nullsafety depends on path_provider_linux ^0.0.1 and shared_preferences_linux <=0.0.2 depends on path_provider ^1.6.11, shared_preferences_linux <0.0.4-nullsafety requires path_provider_linux ^0.0.1 or path_provider ^1.6.11.
And because path_provider_linux <0.2.0-nullsafety depends on path_provider_platform_interface ^1.0.1 and path_provider >=1.6.4 <2.0.0-nullsafety depends on path_provider_platform_interface ^1.0.1, shared_preferences_linux <0.0.4-nullsafety requires path_provider_platform_interface ^1.0.1.
(2) So, because cloud_firestore >=2.2.2 is incompatible with path_provider_platform_interface <2.0.0-nullsafety (1), cloud_firestore >=2.2.2 is incompatible with shared_preferences_linux <0.0.4-nullsafety.
Because shared_preferences_linux >=0.0.4-nullsafety <2.0.0 depends on shared_preferences_platform_interface ^2.0.0-nullsafety and shared_preferences >=0.5.8 <2.0.0-nullsafety depends on shared_preferences_linux ^0.0.2, shared_preferences >=0.5.8 <2.0.0-nullsafety requires shared_preferences_platform_interface ^2.0.0-nullsafety or shared_preferences_linux >=0.0.2 <0.0.4-nullsafety.
And because shared_preferences >=0.5.4+8 <2.0.0-nullsafety depends on shared_preferences_platform_interface ^1.0.0, shared_preferences >=0.5.8 <2.0.0-nullsafety requires shared_preferences_linux >=0.0.2 <0.0.4-nullsafety.
And because cloud_firestore >=2.2.2 is incompatible with shared_preferences_linux <0.0.4-nullsafety (2), cloud_firestore >=2.2.2 is incompatible with shared_preferences >=0.5.8 <2.0.0-nullsafety.
And because every version of flutter_session depends on shared_preferences ^0.5.8, cloud_firestore >=2.2.2 is incompatible with flutter_session.
So, because admin depends on both cloud_firestore ^2.2.2 and flutter_session any, version solving failed.
pub finished with exit code 65
If I create a session variabel like this:
FlutterSession().set('token', '12345');
then on web, the token will be stored like an integer and not a string.
Is it probable a issue with the webbuild and not your package?
I use the session to store adminId in one of my apps but after the app *web browser) closes, the session is not cleared (user always logged in)
Hello guys, i need helpe.
how add multiple maps ?
Exemple: {id:1,name:test},{id:2,name:test2}
List data = List();
data.add('${map['id']}:${map['valor']}');
await FlutterSession().set("beneficios", data);
Exception has occurred.
NoSuchMethodError (NoSuchMethodError: Class 'List' has no instance method 'toJson'.
Receiver: Instance(length:1) of '_GrowableList'
Tried calling: toJson())
// List<String>
case List:
{
this.prefs.setStringList(key, value);
}
currently the package doesn't support to check if session contains any particular key.
for example:
bool isset = await FlutterSession().contains('key')
Hello sir.
flutter_session seems to be incompatible with other third-party libraries.
Can you schedule an update to the null safe version recently?
[study] flutter pub get
Running "flutter pub get" in study...
Because study depends on flutter_session ^0.1.1 which depends on shared_preferences ^0.5.8, shared_preferences ^0.5.8 is required.
So, because study depends on shared_preferences ^2.0.3, version solving failed.
pub get failed (1; So, because study depends on shared_preferences ^2.0.3, version solving failed.)
exit code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.