ignaciotcrespo / flip_card

A flutter flip card

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flip_card PRs Welcome Pub Package

A component that provides flip card animation. It could be used for hide and show details of a product.

How to use

import 'package:flip_card/flip_card.dart';

Create a flip card. The card will flip when touched

FlipCard(
  direction: FlipDirection.HORIZONTAL, // default
  front: Container(
        child: Text('Front'),
    ),
    back: Container(
        child: Text('Back'),
    ),
);

You can also configure the card to only flip when desired by using a GlobalKey to toggle the cards:

GlobalKey<FlipCardState> cardKey = GlobalKey<FlipCardState>();

@override
Widget build(BuildContext context) {
  return FlipCard(
    key: cardKey,
    flipOnTouch: false,
    front: Container(
      child: RaisedButton(
        onPressed: () => cardKey.currentState.toggleCard(),
        child: Text('Toggle'),
      ),
    ),
    back: Container(
      child: Text('Back'),
    ),
  );
}

About

A flutter flip card

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Dart 87.9%Language:Objective-C 6.1%Language:Java 5.9%