Flutter Engine
The Flutter Engine
HiddenLifecycleReference.java
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package io.flutter.embedding.engine.plugins.lifecycle;
6
7import androidx.annotation.Keep;
8import androidx.annotation.NonNull;
9import androidx.lifecycle.Lifecycle;
10
11/**
12 * An {@code Object} that can be used to obtain a {@link Lifecycle} reference.
13 *
14 * <p><strong>DO NOT USE THIS CLASS IN AN APP OR A PLUGIN.</strong>
15 *
16 * <p>This class is used by the flutter_android_lifecycle package to provide access to a {@link
17 * Lifecycle} in a way that makes it easier for Flutter and the Flutter plugin ecosystem to handle
18 * breaking changes in Lifecycle libraries.
19 */
20@Keep
22 @NonNull private final Lifecycle lifecycle;
23
24 public HiddenLifecycleReference(@NonNull Lifecycle lifecycle) {
25 this.lifecycle = lifecycle;
26 }
27
28 @NonNull
29 public Lifecycle getLifecycle() {
30 return lifecycle;
31 }
32}