silky_scroll 2.0.2 copy "silky_scroll: ^2.0.2" to clipboard
silky_scroll: ^2.0.2 copied to clipboard

Silky Scroll is a package developed in Flutter to provide a smooth scrolling experience.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'pages/basic_scroll_page.dart';
import 'pages/nested_scroll_page.dart';
import 'pages/horizontal_scroll_page.dart';
import 'pages/config_scroll_page.dart';
import 'theme/app_colors.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Silky Scroll Example',
      debugShowCheckedModeBanner: false,
      theme: AppTheme.light,
      darkTheme: AppTheme.dark,
      home: const MainScreen(),
    );
  }
}

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

  @override
  State<MainScreen> createState() => _MainScreenState();
}

class _MainScreenState extends State<MainScreen> {
  int _currentIndex = 0;

  static const _pages = <Widget>[
    BasicScrollPage(),
    NestedScrollPage(),
    HorizontalScrollPage(),
    ConfigScrollPage(),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: IndexedStack(index: _currentIndex, children: _pages),
      bottomNavigationBar: NavigationBar(
        selectedIndex: _currentIndex,
        onDestinationSelected: (index) {
          setState(() => _currentIndex = index);
        },
        destinations: const [
          NavigationDestination(
            icon: Icon(Icons.list),
            selectedIcon: Icon(Icons.list_alt),
            label: 'Basic',
          ),
          NavigationDestination(
            icon: Icon(Icons.layers_outlined),
            selectedIcon: Icon(Icons.layers),
            label: 'Nested',
          ),
          NavigationDestination(
            icon: Icon(Icons.swap_horiz),
            selectedIcon: Icon(Icons.swap_horiz_rounded),
            label: 'Horizontal',
          ),
          NavigationDestination(
            icon: Icon(Icons.tune_outlined),
            selectedIcon: Icon(Icons.tune),
            label: 'Config',
          ),
        ],
      ),
    );
  }
}
3
likes
150
points
411
downloads

Publisher

unverified uploader

Weekly Downloads

Silky Scroll is a package developed in Flutter to provide a smooth scrolling experience.

Repository (GitHub)
View/report issues

Topics

#scroll #smooth-scroll #animation #widget

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, web

More

Packages that depend on silky_scroll