pagination_scroll_get 0.0.1 copy "pagination_scroll_get: ^0.0.1" to clipboard
pagination_scroll_get: ^0.0.1 copied to clipboard

A Flutter package than allow expand and collapse text dynamically horizontal or vertical.

readmore #

A Flutter package than allow expand and collapse text dynamically horizontal or vertical.

readmore readmore

usage: #

add to your pubspec

pagination_scroll_get: ^0.0.1

and import:

import 'package:pagination_scroll_get/pagination_scroll.dart';
class MyApp extends StatelessWidget {
  MyApp({super.key});

  ScrollController scrollController = ScrollController();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(),
        body: GetBuilder<GetData>(
          init: GetData(),
          builder: (logic) {
            return logic.apiCallStatus == ApiCallStatus.loading
                ? const Center(child: CupertinoActivityIndicator()
            )
                : PaginationScrollScreen(
              showWidget: ListView.separated(
                controller: scrollController,
                itemCount: logic.posts.length,
                scrollDirection: Axis.horizontal,
                itemBuilder: (context, index) => Container(
                  margin: const EdgeInsets.symmetric(
                    horizontal: 16,
                    vertical: 12,
                  ),
                  decoration:
                  BoxDecoration(color: Colors.white, boxShadow: [
                    BoxShadow(color: Colors.grey.withOpacity(0.2)),
                  ]),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      const SizedBox(height: 16),
                      Text(
                        logic.posts[index].title,
                        style: const TextStyle(
                          fontSize: 20,
                          fontWeight: FontWeight.w600,
                        ),
                      ),
                      const SizedBox(height: 16),
                      Text(
                        logic.posts[index].body,
                        style: const TextStyle(
                          fontSize: 16,
                        ),
                      ),
                    ],
                  ),
                ),
                separatorBuilder: (context, index) => const SizedBox(
                  height: 20,
                ),
              ),
              scrollController: scrollController,
              loadingFunction: () => logic.loadMoreData(),
              scrollDirection: Axis.horizontal,
            );
          },
        ),
      ),
    );
  }
}

1
likes
150
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package than allow expand and collapse text dynamically horizontal or vertical.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, get

More

Packages that depend on pagination_scroll_get