swipeable_tinder_card 1.0.0 copy "swipeable_tinder_card: ^1.0.0" to clipboard
swipeable_tinder_card: ^1.0.0 copied to clipboard

A card stack that can be swiped left and right

swipeable_tinder_card #

A card stack that can be swiped left and right

Usage #

dependencies:
    swipeable_tinder_card: 1.0.0    

#Install It You can install packages from the command line: with flutter:

$ flutter pub get

#Import it

import 'package:swipeable_tinder_card/swipeable_tinder_card.dart';

#Usage

  void loadCards(){
    cards = [
      SwipeableCard card = SwipeableCard(child: Stack(children: <Widget>[
        ClipRRect(child: Image(image: NetworkImage(picture), fit: BoxFit.cover, width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height,), borderRadius: BorderRadius.circular(15),),
        Positioned(bottom: 10, left: 0, child: Container(padding: EdgeInsets.all(10), child: Row(children: <Widget>[Text(name, style: TextStyle(color: Colors.white, fontSize: 30),), Text(age.toString(), style: TextStyle(color: Colors.white70, fontSize: 25),)])))
      ],),
      callback: (result, card){
          print("User swiped " + result.toString() + " on " + card.toString());
      })
    ];
  }
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Color(0xEE363636),
        body: CardStack(
            cards: cards,
            height: MediaQuery.of(context).size.height * 0.9,
            width: MediaQuery.of(context).size.width,
          ),
        );
  }


2
likes
10
pub points
0%
popularity

Publisher

unverified uploader

A card stack that can be swiped left and right

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on swipeable_tinder_card