An infinite Scroll View Library with Out of The Box Widgets

Endless

An infinite scroll view library with out of the box widgets for loading using pagination, streams and Firestore streams. Built on top of CustomScrollView.

Pagination

Basic List Example

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless pagination list view')),
        body: EndlessPaginationListView<String>(
          // An async function that returns a list of items to be added to the scroll view. When you scroll past the configurable
          // `extentAfterFactor`, it calls `loadMore` to get more items.
          loadMore: (pageIndex) async => {...},
          // The pagination configuration for the scroll view determines when to stop fetching items.
          // The scroll view will stop fetching more data for either of these reasons:
          // 1. The number of items returned from loadMore is smaller than the given `pageSize`.
          // 2. It has fetched the optional `maxPages` max number of specified pages.
          paginationDelegate: EndlessPaginationDelegate(
            pageSize: 5,
            maxPages: 10,
          ),
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

Basic Grid Example

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless pagination grid view')),
        body: EndlessPaginationGridView<String>(
          loadMore: (pageIndex) async => {...},
          paginationDelegate: EndlessPaginationDelegate(
            pageSize: 5,
            maxPages: 10,
          ),
          // The only difference between the basic list and grid view is that a grid specifies its delegate such as how many items
          // to put in the cross axis.
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 3,
          ),
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

Advanced Example

Endless scroll views support a set of optional builder functions to build complex infinite scrolling lists with the following top-to-bottom UI:

Header -> headerBuilder
Items -> itemBuilder
Empty state -> emptyBuilder
Loading spinner -> loadingBuilder
Load more widget (such as a TextButton) -> loadMoreBuilder
Footer -> footerBuilder
import 'package:flutter/material.dart';
import 'package:endless/endless.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless grid view')),
        body: EndlessPaginationListView<String>(
          loadMore: (pageIndex) async => {...},
          paginationDelegate: EndlessPaginationDelegate(
            pageSize: 5,
            maxPages: 10,
          ),
          headerBuilder: () => Container(
            color: Colors.blue,
            child: const Text('Header'),
          ),
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

In this example, we've added a header to our list. Now what if we only wanted to show our header once we've loaded items? Endless scroll views use the StateProperty pattern found in Flutter Material's core widgets such as Material State Property.

The Material UI uses this pattern to let consumers of core widgets like ElevatedButton style it differently when it is in one more states (hover, pressed, etc). The basic example from the docs looks like this:

ElevatedButton(
  style: ButtonStyle(
    // Use the color green as the background color for all button states.
    backgroundColor: MaterialStateProperty.all<Color>(Colors.green),
  ),
);

ElevatedButton(
  style: ButtonStyle(
    backgroundColor: MaterialStateProperty.resolveWith<Color>(
      // The state property passes all the current states the button is in
      // so that the button style can be customized.
      (Set<MaterialState> states) {
        // Lighten the button color when it is in the pressed state. 
        if (states.contains(MaterialState.pressed))
          return Theme.of(context).colorScheme.primary.withOpacity(0.5);
        return null;
      },
    ),
  ),
);

We use this same pattern to support customization by the state of the scroll view. The possible states are:

enum EndlessState { empty, loading, done }

We can then check the current states of the scroll view to customize our header:

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless pagination list view')),
        body: EndlessPaginationListView<String>(
          loadMore: (pageIndex) async => {...},
          paginationDelegate: EndlessPaginationDelegate(
            pageSize: 5,
            maxPages: 10,
          ),
          // Each builder has a corresponding state property builder for state-dependent UI.
          headerBuilderState: EndlessStateProperty.resolveWith((states) {
            if (states.contains(EndlessState.empty)) {
              return null;
            }

            return Container(
              color: Colors.blue,
              child: const Text('Header'),
            );
          }),
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

The full list of endless state property helpers are given below:

  • EndlessStateProperty.all
  • EndlessStateProperty.loading
  • EndlessStateProperty.empty
  • EndlessStateProperty.done
  • EndlessStateProperty.never
  • EndlessStateProperty.resolveWith

Some builder functions have default state property behaviors. The emptyBuilder parameter for example is automatically wrapped in an emptyStateBuilder defined to only be built if the scroll view is empty and not loading as shown below:

EndlessStateProperty<Widget?> resolveEmptyBuilderToStateProperty(
  Builder<Widget>? builder,
) {
  return _resolveBuilderToStateProperty<Widget>(
    builder,
    (Builder<Widget> builder) =>
        EndlessStateProperty.resolveWith<Widget>((context, states) {
      if (states.contains(EndlessState.empty) &&
          !states.contains(EndlessState.loading)) {
        return builder(context);
      }
      return null;
    }),
  );
}

The goal of these defaults like for the empty state is to provide typical behavior for an endless scroll view. If that's not the default you would like for your empty state, no problem! You can always provide your own emptyBuilderState to override it.

Streams

Basic Example

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

final streamController = StreamController<List<String>>();

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless stream list view')),
        body: EndlessStreamListView<String>(
          // A function called when you scroll past the configurable `extentAfterFactor` to tell the stream to add more items.
          loadMore: () => {...},
          // Items emitted on the stream are added to the scroll view. The scroll view knows to not try and fetch any more items
          // once the stream has completed.
          stream: streamController.stream,
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

All other APIs for streams are the same as in the first examples with pagination, so check out a grid view and advanced example under the pagination section.

3rd Party Extensions

Firestore

The Endless Firestore extension is available as a separate package.

Working Example

Run the example to give it a try and play around with the config options.

Feedback & Extensions

It's pretty straightforward to add support for other scroll view loading patterns (in addition pagination and streaming) or 3rd party extensions endless_firestore so make an issue if you have a new use case you're interested in seeing added.

Happy coding!

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add endless

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  endless: ^1.3.0

Alternatively, your editor might support or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:endless/endless.dart'; 

Download Details:

Author: danReynolds

Source Code: https://github.com/danReynolds/endless

#flutter  

What is GEEK

Buddha Community

An infinite Scroll View Library with Out of The Box Widgets
Display Boxes

Display Boxes

1624963019

Custom Printed Soap Boxes | Wholesale Soap Packaging | Custom Packaging Pro

You have a great quality product in your hand, and now you are thinking of ways to represent it to the customers in a most appealing way. Many brands are afraid of spending money on custom boxes without knowing that it is the most cost-effecting way with various benefits. When designed with proper planning and creativity, custom packaging can result in money. You shouldn’t mind spending a little more to save money in the long run. You may disagree with us, but investment in customization and personalization can open new doors of success for your business.

How Custom Boxes for Soap Are a Cost-Effective Solution?

From our kitchen cabinets to the big supermarkets, custom boxes are everywhere. We are surrounded by customization, even if it is about selling a small cosmetic product. When you deal in the soap market, you have to face a lot of competition. You can’t compete in the market with a strategy of using plain cardboard boxes. Gone are the days when you can use a simple packaging solution. Today is the age of customization, and you have to use custom Boxes for Soap. These are not only affordable but also look good on the shelves and provide an ultimate customer experience. Let’s take a deeper look at how custom packaging is a cost-effective solution with several benefits.

Helps To Reduce Shipping Prices

During this pandemic, the e-commerce industry has grown too fast, and every brand is selling its products online. One thing which is keeping the manufacturer is the high shipping price. But to make the right decision, you need to understand how shipping prices work. It is not only about the weight of the box; consider dimensional weight as well. Even if you are shipping a small item like soap, the box size can increase the shipping cost. So, the firsts step towards price reduction is using the box which is according to the product size and also light in weight.

Maximum Durability Ensures Protection

It is one of the most faced issues which brands face. Damaged and broken products always result in returns which ultimately means additional cost. No brand will ever want to face negative reviews and customer backlash. You can avoid it by using durable and sturdy boxes. When it comes to protection, corrugate and cardboard soap boxers can outclass every other solution. These two materials are quite affordable and readily available in the market. Once again, it is highly recommended to use the right box size to avoid damage and returns. You can also use other packaging materials for added protection.

Increase Your Visibility with Pillow Boxes

When it comes to increasing your visibility and exposure in retail stores, there is no better option other than custom containers. These come in a variety of shapes and styles, which increase the customer’s interest in your product. Custom Pillow Boxes are the right choice to present your soap products on the shelves. You can customize the pillow packaging further with other customization options like window patching, lamination, and gold stamping. Unique solutions always make customers take a closer look at the product, and most probably they will end up buying it.

Right Box Size Help to Save Big

We have mentioned it before, but it needs more repetition. A wrong size box will always cost you more. If you are thinking that you can end up saving by choosing the standard size boxes for all the products, you are wrong. It will cost you more in form of damaged products and returns. Moreover, the bigger will be the size of the box, the more you have to pay for shipping. So, always choose the right size, which suits the product dimensions, and don’t leave too much space in the containers. A bigger size box will also make you use the protective material.

Cardboard And Paperboard Are the Cheapest Options

If you still think that custom boxes are way out of your range, we have still so many options for you. Take a simple corrugate or cardboard box in white or any plain color, print your logo on it, and you have a custom box in your hand. Getting a custom solution for your soap products has never been so easy. Today is the age of minimalism, and you can take advantage of this trend. Use simple customization for a natural and minimal look. Cardboard and corrugated are the most affordable option when it comes to custom material.

Happy Customers Result in Repeat Business and Positive Reviews

When it comes to benefits with custom packaging, there are several benefits that you can get. From product protection to the customer experience, you will get everything with a custom solution. The biggest benefits of providing a personalized experience are repeat business and positive reviews from the customers. When you put your heart and effort into the customization, customers will reward you with positive feedback. A good review from the customers will attract more customers to your business. Satisfied customers will bring business with repeat business and higher brand recall.

Kraft Boxes for Display Improve Sustainability

When it comes to being sustainable, there is no better option than Kraft. Use Kraft packaging boxes to display your products on the shelves. It will attract more and more eco-conscious customers, which will ultimately result in boosted sales. It is not only a cheap option but offers 100% recyclability. The presentation and display of your product have a greater role to play in drawing the attraction. Using the same old-style packaging will not going to help you out. Think of something innovative and try using Kraft boxes for better results. Find a solution that is not unique but meets the customer’s needs.

When it comes to soap packaging, Kraft Boxes for Display are a perfect choice. These are not only cost-efficient but result in customer satisfaction, repeat business, and reduced shipping cost. Find a solution that meets your needs without breaking the budget.

#boxes for soap #boxes for pillow #boxes for display #soap boxes #pillow boxes #display boxes

Rush Packaging

1625040257

Get Custom Printed Lotion Boxes wholesale - Lotion Boxes

Custom Lotion Boxes Wholesale

The lotion is a sweet-smelling skincare product that gives you more relaxation and moisturizes the skin. The lotion is a product that has great sales. Different Packaging Boxes are used to pack the lotions. We offer you Custom Lotion Boxes that are prepared according to user necessities. In the hyper-competitive market, it is difficult to find a unique packaging brand. We Rush Packaging is the high demanding packaging company in the market where you can get your desired packaging and designing boxes. As well as you are in a place that offers you a huge diversity of customization. If you want to get bulk order then we give you these Custom Lotion Boxes at wholesale where you can get these best quality boxes at half price. Avail of this opportunity and represent your brand as a unique identity.

What is the Purpose of Custom Lotion Printed Boxes?

When you go to the market you observe that Lotion Boxes are printed with brand logo and other brand details like company phone number, address, manufacturing and expiry date, etc. These all factors make the packaging more enticing and eye captivating. Moreover, you can increase the brand identity and increase sales. Custom Printed Lotion Boxes are more helpful for customers. They can guess the all factors regarding designing and packaging. As well as these boxes look more attractive and unique. We offer you a huge variety of Custom Printed Lotion Boxes. As well as we give you a larger variety of colors that you can choose for exclusive printing. Choose attractive colors because a user never attracts to boring and less attractive color boxes. We use CMYK and PMS color scheme that is highly demanding in the market and these color patterns have more attractive color schemes.PMS is a bit expensive so you can tell your desire one and get it according to your choice.

Custom Printed Lotion Boxes print with your company logo

Custom Printed Lotion Boxes are eye-catching and best for grasp clients. These boxes are a great way to increase the brand image and boost sales. We offer you customization where you can print your boxes according to your preferred color, design, shape, and size. It is your choice that you can select your favorite printing technique. We offer you:

Digital printing

Offset printing

Screen printing

Moreover, our innovative designing team imprinted these boxes with the company logo that enhances the value of your brand. Customers remember your brand by your logo as well as logo printing is the best for promoting the brand. We offer you pre-define designing templates that you can choose according to you. Moreover, you can tell your desired printing style if you want to customize all kinds of  Cosmetic Boxes Packaging i.e Custom Mascara Boxes, Custom Lip Gloss Boxes, Custom Lipstick Boxes, and all kinds of Cosmetic Boxes Packaging.

Improve your sales with Custom Lotion Boxes

Lotions are used around the globe. Lotions are of different types that are used for various purposes like organic lotions, aromatic and some are plain. Customize the Lotion Boxes by printing the ingredient is the best way to catch the customer's attention and customers easily take their decision. As well as you can improve your sales with Custom Lotion Boxes. Customization is a great opportunity that you can avail of forgetting your favorite style boxes. In the huge competition customization and wholesale are two main factors that enhance your brand value and you can uniquely define your brand. Get our high-quality Custom Lotion Packaging Boxes at an affordable cost and more customized if you require them. Visit our web page and choose your desired style and design of the Lotion Box.

Free shipping on Custom Printed Lotion Boxes

You can get a free shipping service by joining our high-quality packaging company. You can receive your order at your home with free shipping. Lotion Packaging Boxes are more sales in present time because these days everyone is more conscious about their beauty and skin and they want to get long-lasting boxes. Moreover, you can get Lotion Boxes that are more charming and attractive. Hurry up and get these boxes for your excellent practice.

Choose Rush Packaging

Choose Rush Packaging for gaining eco-friendly and biodegradable Custom Lotion Boxes. Moreover, we assist you finest client care services. You can get these services at 24 hours. Get a unique packaging strategy by us for high marketing. Call us by the given number and place your order of Cosmetic Boxes Packaging.

Reference

#custom lotion boxes #lotion packaging boxes #lotion boxes #custom printed lotion boxes #custom lotion packaging #cosmetic boxes packaging

Soap Boxes

1625140857

Lip Gloss Boxes | Custom Lip Gloss Packaging Wholesale - CustomBoxesU

Lip gloss is a great beauty product for enhancing the appearance and prominence of your lips. If you want baby soft and shiny lips then you should consider buying a lip gloss. Many ladies prefer lip gloss over lipsticks and this is why the lip gloss is sold by many brands. The customized lip gloss packaging helps the brands to outshine their rival brands in the market. It also becomes easier for the brands to get noticed easily with the help of a custom packaging. If you want to beat your rival brands in the market, then choosing a durable and high quality packaging for your lips gloss can be helpful.

Customized lip gloss boxes give better look to your lip gloss

We offer classy and appealing lip gloss boxes which will help to enhance the appeal of your lip gloss. If you want to get noticed in the market then choosing a customized packaging solution is the best idea. We make sure that your lip gloss packaging is designed according your desires. Our box designers follow your instructions and design a lip gloss packaging that is according to your specifications.

Design your lip gloss packaging box with assistance from creative designers

Our creative and skillful box designers will help you to bring your imagination to reality. If you have a design in mind then you can discuss it with our box designers. They will give you the best assistance and will help you to create an outstanding box packaging for your business. We design high quality and stylish lip gloss packaging box for your brand. Make sure to get in touch with us if you are looking for creative and stylish lip gloss packaging.

If you want lip gloss boxes in different shape, style, and size then visit our website

If you want to customize your boxes in different designs, shapes, sizes and styles then you must get in touch with us. You can visit our official website and can check out the design and customization options that we are offering. You can create a unique packaging solution for your lip gloss if you get in touch with our box company. We design stylish and unique box packaging which will help you to stand out among your competitor brands in the market.

Get custom lip gloss boxes with free shipping in the USA

You can order custom lip gloss boxes and get them at reasonable rates. We don’t charge you for any shipping fees if your business is located in the USA. We deliver custom lip gloss boxes to your business location free of cost. You don’t have to pay us for any shipping or hidden charges. We are offering custom boxes at affordable prices so make sure to get in touch with us to order your lip gloss packaging.

Why our packaging suitable your products?

Our lip gloss packaging is an ideal packaging solution for your business. We design classy and stylish boxes that will help you to get noticed in the market. Our boxes are also made with high quality materials which make our packaging solution highly durable. Our box designers use customized methods to create your lip gloss packaging in different shapes and sizes. We offer unique and stylish boxes that are also highly durable.

#lip gloss box packaging #lip gloss packaging #lip gloss box #customized lip gloss boxes #lip gloss boxes #lip gloss packaging box

An infinite Scroll View Library with Out of The Box Widgets

Endless

An infinite scroll view library with out of the box widgets for loading using pagination, streams and Firestore streams. Built on top of CustomScrollView.

Pagination

Basic List Example

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless pagination list view')),
        body: EndlessPaginationListView<String>(
          // An async function that returns a list of items to be added to the scroll view. When you scroll past the configurable
          // `extentAfterFactor`, it calls `loadMore` to get more items.
          loadMore: (pageIndex) async => {...},
          // The pagination configuration for the scroll view determines when to stop fetching items.
          // The scroll view will stop fetching more data for either of these reasons:
          // 1. The number of items returned from loadMore is smaller than the given `pageSize`.
          // 2. It has fetched the optional `maxPages` max number of specified pages.
          paginationDelegate: EndlessPaginationDelegate(
            pageSize: 5,
            maxPages: 10,
          ),
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

Basic Grid Example

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless pagination grid view')),
        body: EndlessPaginationGridView<String>(
          loadMore: (pageIndex) async => {...},
          paginationDelegate: EndlessPaginationDelegate(
            pageSize: 5,
            maxPages: 10,
          ),
          // The only difference between the basic list and grid view is that a grid specifies its delegate such as how many items
          // to put in the cross axis.
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 3,
          ),
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

Advanced Example

Endless scroll views support a set of optional builder functions to build complex infinite scrolling lists with the following top-to-bottom UI:

Header -> headerBuilder
Items -> itemBuilder
Empty state -> emptyBuilder
Loading spinner -> loadingBuilder
Load more widget (such as a TextButton) -> loadMoreBuilder
Footer -> footerBuilder
import 'package:flutter/material.dart';
import 'package:endless/endless.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless grid view')),
        body: EndlessPaginationListView<String>(
          loadMore: (pageIndex) async => {...},
          paginationDelegate: EndlessPaginationDelegate(
            pageSize: 5,
            maxPages: 10,
          ),
          headerBuilder: () => Container(
            color: Colors.blue,
            child: const Text('Header'),
          ),
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

In this example, we've added a header to our list. Now what if we only wanted to show our header once we've loaded items? Endless scroll views use the StateProperty pattern found in Flutter Material's core widgets such as Material State Property.

The Material UI uses this pattern to let consumers of core widgets like ElevatedButton style it differently when it is in one more states (hover, pressed, etc). The basic example from the docs looks like this:

ElevatedButton(
  style: ButtonStyle(
    // Use the color green as the background color for all button states.
    backgroundColor: MaterialStateProperty.all<Color>(Colors.green),
  ),
);

ElevatedButton(
  style: ButtonStyle(
    backgroundColor: MaterialStateProperty.resolveWith<Color>(
      // The state property passes all the current states the button is in
      // so that the button style can be customized.
      (Set<MaterialState> states) {
        // Lighten the button color when it is in the pressed state. 
        if (states.contains(MaterialState.pressed))
          return Theme.of(context).colorScheme.primary.withOpacity(0.5);
        return null;
      },
    ),
  ),
);

We use this same pattern to support customization by the state of the scroll view. The possible states are:

enum EndlessState { empty, loading, done }

We can then check the current states of the scroll view to customize our header:

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless pagination list view')),
        body: EndlessPaginationListView<String>(
          loadMore: (pageIndex) async => {...},
          paginationDelegate: EndlessPaginationDelegate(
            pageSize: 5,
            maxPages: 10,
          ),
          // Each builder has a corresponding state property builder for state-dependent UI.
          headerBuilderState: EndlessStateProperty.resolveWith((states) {
            if (states.contains(EndlessState.empty)) {
              return null;
            }

            return Container(
              color: Colors.blue,
              child: const Text('Header'),
            );
          }),
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

The full list of endless state property helpers are given below:

  • EndlessStateProperty.all
  • EndlessStateProperty.loading
  • EndlessStateProperty.empty
  • EndlessStateProperty.done
  • EndlessStateProperty.never
  • EndlessStateProperty.resolveWith

Some builder functions have default state property behaviors. The emptyBuilder parameter for example is automatically wrapped in an emptyStateBuilder defined to only be built if the scroll view is empty and not loading as shown below:

EndlessStateProperty<Widget?> resolveEmptyBuilderToStateProperty(
  Builder<Widget>? builder,
) {
  return _resolveBuilderToStateProperty<Widget>(
    builder,
    (Builder<Widget> builder) =>
        EndlessStateProperty.resolveWith<Widget>((context, states) {
      if (states.contains(EndlessState.empty) &&
          !states.contains(EndlessState.loading)) {
        return builder(context);
      }
      return null;
    }),
  );
}

The goal of these defaults like for the empty state is to provide typical behavior for an endless scroll view. If that's not the default you would like for your empty state, no problem! You can always provide your own emptyBuilderState to override it.

Streams

Basic Example

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

final streamController = StreamController<List<String>>();

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Endless stream list view')),
        body: EndlessStreamListView<String>(
          // A function called when you scroll past the configurable `extentAfterFactor` to tell the stream to add more items.
          loadMore: () => {...},
          // Items emitted on the stream are added to the scroll view. The scroll view knows to not try and fetch any more items
          // once the stream has completed.
          stream: streamController.stream,
          itemBuilder: (
            context, {
            required item,
            required index,
            required totalItems,
          }) {
            return Text(item);
          },
        ),
      ),
    );
  }
}

All other APIs for streams are the same as in the first examples with pagination, so check out a grid view and advanced example under the pagination section.

3rd Party Extensions

Firestore

The Endless Firestore extension is available as a separate package.

Working Example

Run the example to give it a try and play around with the config options.

Feedback & Extensions

It's pretty straightforward to add support for other scroll view loading patterns (in addition pagination and streaming) or 3rd party extensions endless_firestore so make an issue if you have a new use case you're interested in seeing added.

Happy coding!

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add endless

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  endless: ^1.3.0

Alternatively, your editor might support or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:endless/endless.dart'; 

Download Details:

Author: danReynolds

Source Code: https://github.com/danReynolds/endless

#flutter  

Ragini Tiwari

1621164654

Best Way to Find Gear Boxes Manufacturers & Exporters

This is image title

Akshi Engineers Pvt. Ltd. is one of the largest industry of Gear Boxes Manufacturers in India. We have the best design, engineering, and manufacture of gearboxes to meet the needs of our customers. The gearbox is an integral part of the driver’s system. We manufacture top-of-the-line automotive gearboxes. We will provide you with the highest-selling brand of the gearbox. Are you looking at the complete list of gearbox manufacturers in India? then, Your search has ended. We are here to provide you with a high-quality, precision-engineered parallel helical gearbox that can be used in any configuration. With gearbox manufacturer India products, you can reduce torque in your industrial solutions or change the direction of RPM, rotate, reverse, or drive shaft.

Why should choose us?

We are one of the leading Gear Boxes Manufacturer, retailers, and exporters of India. Our most valuable asset is our team of trained and experienced engineers who work tirelessly to provide high-quality goods, equipment, and after-sales support to our valued customers.

Top & Reliable Services of Gear Boxes Manufacturer

Here we provide some of the services listed below:

  • Gearbox maintenance
  • Overhauling and Repair Gearbox
  • Check up on gearbox
  • Reverse engineering is the process of creating something from nothing.
  • A replacement part that can be left inside.
  • Gearbox upgrades and improvements
  • Tech and Design Consultancy
  • Create new products

What are the Benefits and Uses Gear Boxes Manufacturer?

Industrial gearboxes are great tools to enhance the company’s operational performance. If you run an industrial company, this equipment is important for the production of your goods. Industrial gearboxes are beneficial not only in the manufacture of products but also in the maintenance of the system. By allowing smaller motors and drives to be used, the gearbox can help cut down the operation of the machine by multiplying torque, matching inertia, and reducing RPM.

How to Contact Akshi Engineers for immediate assistance via a toll-free number (+91-98106-62353)?

Akshi Engineers Pvt. Ltd. is offering you a great solution for industrial steel manufacturers, suppliers & exporters in India. When you need to repair or replace a low-cost, high-quality gearbox, contact the experts at Akshi Engineers Gear Boxes Service in India, Texas. To learn more about our gearbox repair services, call + 91-98106-62353 or send an email to [email protected]. We would be happy to tell you about all the areas we serve and the high-quality work we can do to repair or replace your drive.

Source: https://sites.google.com/view/akshi-engineers/blogs/gear-boxes-manufacturers

#gear boxes manufacturers #gear boxes manufacturer #gear boxes manufacturer in india #gear boxes in india