-
-
Save yaizudamashii/2e2fa2fa9ce1d1008fae99d9b771f682 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package <your.package.name> | |
// import statements | |
// ... | |
class InformationFragment : BaseFragment() { | |
// class and instance variables... | |
companion object { | |
private const val TAG_FLUTTER_FRAGMENT = "flutter_fragment" | |
} | |
private var flutterFragment: FlutterFragment? = null | |
// other functions... | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { | |
// Fragmentをinflateするのは割愛 | |
} | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
// extensionで定義された関数を使用 | |
flutterFragment = createFlutterFragment(TAG_FLUTTER_FRAGMENT, "informationTabFlutterEngine", R.id.information_futter_fragment) | |
} | |
override fun onCreateOptionsMenu(menu: Menu, menuInflater: MenuInflater) { | |
// menuのinflateは割愛 | |
} | |
override fun onAttachFragment(childFragment: Fragment) { | |
super.onAttachFragment(childFragment) | |
pushToFlutterFragment(childFragment, flutterFragment, "/information") // フラターアプリ内でrouteをプッシュして特定の画面を出します | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment