checkEnabled method
Decide whether to apply this action based on the contents of context
.
Return true
if applicable.
context
の内容を元にこのアクションを適用するかどうかを決定する。
適用する場合true
を返す。
Implementation
@override
bool checkEnabled(ExecContext context) {
final firebase = context.yaml.getAsMap("firebase");
final projectId = firebase.get("project_id", "");
final authentication = firebase.getAsMap("authentication");
final enableAuthentication = authentication.get("enable", false);
final providers = authentication.getAsMap("providers");
final deleteUser = authentication.getAsMap("delete_user");
final apple = providers.getAsMap("apple");
final facebook = providers.getAsMap("facebook");
final google = providers.getAsMap("google");
return projectId.isNotEmpty &&
enableAuthentication &&
(deleteUser.get("enable", false) ||
apple.get("enable", false) ||
facebook.get("enable", false) ||
google.get("enable", false));
}