FLUTTER ECOSYSTEM

WinXaito/scroll_pos

ScrollController के कुछ अतिरिक्त कार्यों को प्रदान करता है जो स्क्रीन के संबंध में आइटम स्थिति को परिभाषित करता है।

scroll_pos प्रोजेक्ट कवर
Stars
11
Forks
0
अंतिम पुश (UTC)
28 मई 2024
प्रोजेक्ट स्थिति
सक्रिय
Kevin Vuilleumier GitHub avatar
भाषाएँC++DartCMakeHTMLCCSS

इस रिपॉज़िटरी के पैकेज

उपयोग की गई निर्भरताएँ

निर्भरता सूची 3 आइटम
  • flutter{"sdk":"flutter"}
  • flutter_testडेवलपमेंट{"sdk":"flutter"}
  • flutter_lintsडेवलपमेंट^1.0.0

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

README खोलें / बंद करें

Scroll Position

Provides some additional functions to ScrollController to define item position relative to the screen.

A live version is available here.

scrollpos_demo

Note: this works on condition that all items have the same height !

Usage

// Create a ScrollPosController (don't forget to set and update itemCount !)
final controller = ScrollPosController(itemCount: itemCount);

// Assign the controller to a scrollable item (like an ListView)
ListView(
  controller: controller,
  children: [
    ...
  ];
);

// Control the controller
TextButton(
  child: Text('To item'),
  onPressed: () {
    setState(() {
      controller.scrollToItem(index);
    });
  },
);

Main methods

  • void scrollTop({bool? animate}) : Go to the first item
  • void scrollBottom({bool? animate}) : Go to the last item
  • void scrollToItem(int index, {bool? animate, bool center = false}) : Makes the item visible on the screen