v0.1.1
flutter_session
Flutter में सत्र समर्थन जोड़ता है। मोबाइल, वेब और (आशा है) डेस्कटॉप बिल्ड के साथ काम करता है।
216लाइक 4030-दिन डाउनलोड40Pub अंक
प्लेटफ़ॉर्म डेटा नहीं
Flutter में सत्र कार्यक्षमता जोड़ता है। मोबाइल, वेब और (आशा है) डेस्कटॉप ऐप्स पर काम करता है
{"sdk":"flutter"}^2.0.5{"sdk":"flutter"}यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
Adds session support to Flutter. Works with mobile, web and (hopefully) desktop builds. (Don't forget to hit the like button if you find the package helpful.)
await FlutterSession().set("token", myJWTToken);
or
var session = FlutterSession();
await session.set("token", myJWTToken);
await session.set("name", "jhourlad");
await session.set("id", 1);
await session.set("price", 10.50);
await session.set("isOK", true);
Saving objects, make sure that it has the toJson() method. See https://ashamp.github.io/jsonToDartModel:
class Data {
final int id;
final String data;
Data({this.data, this.id});
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
data["id"] = id;
data["data"] = this.data;
return data;
}
}
Data mappedData = Data(id: 1, data: "Lorem ipsum something, something...");
await FlutterSession().set('mappedData', mappedData);
dynamic token = await FlutterSession().get("token");
Session persists throughout the app's lifetime. (Don't forget to hit the like button if you find the package helpful.)