scroll_to_hide 2.1.0 copy "scroll_to_hide: ^2.1.0" to clipboard
scroll_to_hide: ^2.1.0 copied to clipboard

Scroll_To_Hide packge to hide widgets on scroll, sometimes you want to hide the navbar for example when you scroll a listView or GrideView.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:scroll_to_hide/scroll_to_hide.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Scroll To Hide Package Example',
      home: HomeScreen(),
    );
  }
}

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

  @override
  State<HomeScreen> createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  final ScrollController _scrollController = ScrollController();
  @override
  void dispose() {
    super.dispose();
    _scrollController.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        controller: _scrollController,
        children: List.generate(
          100,
          (index) => Text(
            index.toString(),
          ),
        ),
      ),
      bottomNavigationBar: ScrollToHide(
        scrollController: _scrollController,
        height: 75,
        hideDirection: Axis.vertical,
        child: BottomNavigationBar(
          items: const [
            BottomNavigationBarItem(
              icon: Icon(
                Icons.home,
                color: Colors.white,
              ),
              label: 'Home',
            ),
            BottomNavigationBarItem(
              icon: Icon(
                Icons.favorite_outline,
                color: Colors.white,
              ),
              label: 'Favourite',
            ),
            BottomNavigationBarItem(
              icon: Icon(
                Icons.settings,
                color: Colors.white,
              ),
              label: 'Setting',
            ),
          ],
          backgroundColor: Colors.black.withOpacity(.7),
        ),
      ),
    );
  }
}
41
likes
160
points
2.58k
downloads

Publisher

unverified uploader

Weekly Downloads

Scroll_To_Hide packge to hide widgets on scroll, sometimes you want to hide the navbar for example when you scroll a listView or GrideView.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on scroll_to_hide