Search packages, repositories and app categories

Package detailsv2.0.1

flippable_box

A double-sided Container, that flips over, revealing content on both sides.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
66
Likes
29
Pub points
150

Install package

flutter pub add flippable_box

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flippable_box is a Flutter package that provides a double-sided Container capable of flipping between two distinct content sides. It enables smooth, animated transitions between front and back faces, ideal for interactive UI elements like cards or flip effects. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it versatile for cross-platform applications. Built with Flutter's animation system, it offers responsive and customizable flipping behavior.

Use cases

  • Interactive card interfaces
  • Product detail flip cards
  • Quiz or flashcard apps
  • Animated navigation elements
  • Game UI components

Key features

  • Smooth 3D flip animation
  • Customizable front and back content
  • Cross-platform compatibility
  • Easy integration with existing widgets
  • Supports tap and gesture triggers

Suitable for

  • Developers building interactive UIs
  • Educational app creators
  • Gamified application designers
  • Designers seeking dynamic transitions

Considerations

  • May impact performance on low-end devices
  • Requires careful layout management for complex content
  • Limited to container-based flipping only
  • Not suitable for non-interactive static displays

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flippable_box

FlippableBox is a double-sided Container, that holds two pieces of content and automatically re-sizes to match its content, whenever its flipped over.

Usage

First import the package into your class:

import 'package:flippable_box/flippable_box.dart';

Create a FlippableBox with two child Containers. Change the isFlipped property to trigger the internal flip animation.

GestureDetector(
    onTap: () => setState(() => _isFlipped = !_isFlipped),
    child: FlippableBox(
        front: Container(width: 200, height: 200, color: Colors.white),
        back: Container(width: 300, height: 300, color: Colors.white),
        isFlipped: _isFlipped,
    ),
)

NOTE: It is required that the children are Containers, and have their size or constraints set manually, as shown in the example above. This is so the Box knows what its target size is when animating.

To control the flip animation, you can set duration, curve and flipVt which will cause the flip to be in the vertical axis rather than horizontal.

You can also specify a bg which takes a BoxDecoration, and a borderRadius in case you'd like to clip the child contents.

FlippableBox(
    front: child1,
    back: child2,
    isFlipped: _isFlipped,
    borderRadius: 32, //Uses a ClipRRect to clip contents of child containers
    bg: BoxDecoration(color: Colors.white), //Paints the box itself with a shared background
    duration: 0.5, //half second duration
    flipVt: true, //Flip vertically instead of horizontal
    curve: Curves.easeOut,
)

Example

See the example directory for a simple example.

Categories

Source repository

Projects using this package

No data available yet.