fade_indexed_stack 0.2.2 copy "fade_indexed_stack: ^0.2.2" to clipboard
fade_indexed_stack: ^0.2.2 copied to clipboard

An IndexedStack with FadeTransition and lazy loading.

fade_indexed_stack #

An IndexedStack with FadeTransition and lazy loading.

Inspirations #

Usage #

You can use FadeIndexedStack like you would use an IndexedStack.

class MainPage extends StatefulWidget {
  const MainPage({super.key});

  @override
  State<MainPage> createState() => _MainPageState();
}

class _MainPageState extends State<MainPage> {
  int _currentIndex = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: FadeIndexedStack(
        index: _currentIndex,
        children: [
          FirstPage(),
          SecondPage(),
          ThirdPage(),
        ],
      ),
      bottomNavigationBar: NavigationBar(
        destinations: [
          NavigationDestination(),
          NavigationDestination(),
          NavigationDestination(),
        ],
        selectedIndex: _currentIndex,
        onDestinationSelected: (index) {
          setState(() {
            _currentIndex = index;
          });
        },
      ),
    );
  }
}

For more details, check out the example file.

2
likes
160
points
414
downloads

Publisher

unverified uploader

Weekly Downloads

An IndexedStack with FadeTransition and lazy loading.

Repository

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on fade_indexed_stack