appinioGmbH / flutter_packages

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

Size of AppinioSwiper to fit to the screen #86

Closed Jeanetted3v closed 1 year ago

Jeanetted3v commented 1 year ago

The AppnioSwiper is a delight to use. Is there any way to expand the cards so that it can fit better to the phone screen? I tried using Expanded() widget but the gap is still very big.

khanmujeeb687 commented 1 year ago

Hey @Jeanetted3v , you can wrap it inside a sized box or a container that has the height and width of the screen. and make the padding zero.


  Widget build(BuildContext context) {
    return SizedBox(
      height: MediaQuery.of(context).size.height,
      width: MediaQuery.of(context).size.width,
      child: AppinioSwiper(
        unlimitedUnswipe: true,
        controller: controller,
        unswipe: _unswipe,
        onSwiping: (AppinioSwiperDirection direction){
          print(direction.toString());
        },
        onSwipe: _swipe,
        padding: const EdgeInsets.all(0),
        onEnd: _onEnd,
        cardsCount: candidates.length,
        cardsBuilder: (BuildContext context, int index) {
          return ExampleCard(candidate: candidates[index]);
        },
      ),
    );
  }```
thehannanshaikh commented 1 year ago

@khanmujeeb687 I tried but not working