Moved to https://github.com/AlexV525/dartpad_workshops/tree/main/implement_lazy_indexed_stack permanentely.
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
class MainActivity : AppCompatActivity() { | |
private lateinit var swipeFragment: SwipeFragment | |
private lateinit var favoritesFragment: FavoritesFragment | |
private lateinit var newsFragment: NewsFragment | |
private val fragments: Array<out Fragment> get() = arrayOf(swipeFragment, favoritesFragment, newsFragment) | |
private fun selectFragment(selectedFragment: Fragment) { | |
var transaction = supportFragmentManager.beginTransaction() | |
fragments.forEachIndexed { index, fragment -> |