extrasData static method
dynamic
extrasData({})
check data from page (if onFailure null then page finish)
Implementation
static extrasData(
{required BuildContext context,
required Map? data,
required Function(Map data) onSuccess,
Function? onFailure,
List<String> keys = const <String>[]}) {
if (data != null) {
bool isAllKeyContains = true;
for (String key in keys) {
if (!data.containsKey(key)) {
isAllKeyContains = false;
break;
}
}
if (isAllKeyContains) {
onSuccess(data);
} else {
log("onFailure");
if (onFailure != null) {
onFailure();
} else {
NavigatorName.finish(context);
}
}
} else {
log("onFailure");
if (onFailure != null) {
onFailure();
} else {
NavigatorName.finish(context);
}
}
}