v0.1.1
flutter_session
為 Flutter 添加會話支援。適用於行動裝置、Web 和(希望)桌面建構。
216喜歡 106近 30 天下載40Pub 分數
平台暫無資料
為 Flutter 加入會話功能。可在行動裝置、Web 和(希望)桌面應用上使用
以下為英文專案原文快照,最新內容請造訪 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.)
依賴清單 3 項
{"sdk":"flutter"}^2.0.5{"sdk":"flutter"}先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗