save method
Future<void>
save({
- DateTime? dateTime,
- Function? saved,
- String debugMsg = '',
- bool noSaveTime = false,
- bool saveNotify = true,
override
Save preference to local storage
- Automatically update and save lastSaveTime
debugMsg
: easier to trace callerdateTime
: manually set the save time. Default isnull
and current time is used.noSaveTime
: set totrue
in case you don't want to update the save time. Default isfalse
.saveNotify
: Iftrue
, trigger saveNotifier at end of call. Defaulttrue
.saved
: a callback function to be executed when save is finished. DO NOT ADD saveNotifier here, it is already done for you.- Do not override.
Implementation
@override
Future<void> save({
DateTime? dateTime,
Function? saved,
String debugMsg = '',
bool noSaveTime = false,
bool saveNotify = true,
}) async =>
super.save(
debugMsg: debugMsg,
dateTime: dateTime,
noSaveTime: noSaveTime,
saved: () {
if (saved != null) saved();
_saved(saveNotify);
},
);