checkEnabled method

  1. @override
bool checkEnabled(
  1. ExecContext context
)
override

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 firestore = firebase.getAsMap("firestore").get("enable", false);
  final dataconnect = firebase.getAsMap("dataconnect").get("enable", false);
  final authentication =
      firebase.getAsMap("authentication").get("enable", false);
  final logger = firebase.getAsMap("logger").get("enable", false);
  final functions = firebase.getAsMap("functions").get("enable", false);
  final storage = firebase.getAsMap("storage").get("enable", false);
  final hosting = firebase.getAsMap("hosting").get("enable", false);
  final messaging = firebase.getAsMap("messaging").get("enable", false);
  return projectId.isNotEmpty &&
      (firestore ||
          dataconnect ||
          storage ||
          authentication ||
          logger ||
          functions ||
          hosting ||
          messaging);
}