appinioGmbH / flutter_packages

Dart and Flutter plugins/packages used and maintained by @appinioGmbH
187 stars 214 forks source link

feature: added background/foreground wrappers #79

Closed simplenotezy closed 1 year ago

simplenotezy commented 1 year ago

Very cool changes in regards to the itemBuilder you've started adding.

This PR introduces optional foreground/background item wrappers, that can be used like so:

AppinioSwiper(
  backgroundItemWrapper: (child) {
    return Container(
      decoration: BoxDecoration(
        color: Colors.black,
      ),
      child: Stack(
        children: [
          child,
          Container(
            child: BackdropFilter(
              filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
              child: Container(
                color: Colors.black.withOpacity(0.5),
              ),
            ),
          )
        ],
      ),
    );
  },

Which allows customising the card, e.g. to create this animation:

https://user-images.githubusercontent.com/3786627/225621439-083f43ae-6698-4cca-aa20-9c9948e77d37.mov

It also sneaked in some auto formats, which I hope you don't mind.