Flutter FoldingCell widget

Overview

Simple FoldingCell widget

Simple folding cell widget, pass frontWidget and innerWidget to fold and unfold.

pub package

Installation

Add dependency in pubspec.yaml:

dependencies:
  folding_cell: "^1.0.2"

Import in your project:

import 'package:folding_cell/folding_cell.dart';

Basic usage

class FoldingCellSimpleDemo extends StatelessWidget {
  final _foldingCellKey = GlobalKey<SimpleFoldingCellState>();

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Color(0xFF2e282a),
      alignment: Alignment.topCenter,
      child: SimpleFoldingCell.create(
        key: _foldingCellKey,
        frontWidget: _buildFrontWidget(),
        innerWidget: _buildInnerWidget(),
        cellSize: Size(MediaQuery.of(context).size.width, 140),
        padding: EdgeInsets.all(15),
        animationDuration: Duration(milliseconds: 300),
        borderRadius: 10,
        onOpen: () => print('cell opened'),
        onClose: () => print('cell closed'),
      ),
    );
  }

  Widget _buildFrontWidget() {
    return Container(
      color: Color(0xFFffcd3c),
      alignment: Alignment.center,
      child: Stack(
        children: <Widget>[
          Align(
            alignment: Alignment.center,
            child: Text(
              "CARD TITLE",
              style: GoogleFonts.aldrich(
                color: Color(0xFF2e282a),
                fontSize: 20.0,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          Positioned(
            right: 10,
            bottom: 10,
            child: TextButton(
              onPressed: () => _foldingCellKey?.currentState?.toggleFold(),
              child: Text(
                "OPEN",
              ),
              style: TextButton.styleFrom(
                backgroundColor: Colors.white,
                minimumSize: Size(80, 40),
              ),
            ),
          )
        ],
      ),
    );
  }

  Widget _buildInnerWidget() {
    return Container(
      color: Color(0xFFecf2f9),
      padding: EdgeInsets.only(top: 10),
      child: Stack(
        children: [
          Align(
            alignment: Alignment.topCenter,
            child: Text(
              "CARD TITLE",
              style: GoogleFonts.aldrich(
                color: Color(0xFF2e282a),
                fontSize: 22.0,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          Align(
            alignment: Alignment.center,
            child: Text(
              "CARD DETAIL",
              style: GoogleFonts.aldrich(
                color: Color(0xFF2e282a),
                fontSize: 40.0,
              ),
            ),
          ),
          Positioned(
            right: 10,
            bottom: 10,
            child: TextButton(
              onPressed: () => _foldingCellKey?.currentState?.toggleFold(),
              child: Text(
                "Close",
              ),
              style: TextButton.styleFrom(
                backgroundColor: Colors.white,
                minimumSize: Size(80, 40),
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Examples

example project contains these two demos

Demo 1 - FoldingCell inside Container

alt tag

Demo 2 - FoldingCell inside ListView

alt tag

Changelog

Check Changelog for updates

Bugs/Requests

Reporting issues and requests for new features are always welcome.

Comments
  • Not Working with ListView

    Not Working with ListView

    First, Thank you this package. It's a most beatiful for UI. But i have a question, i can't use this package with ListView class. Cards not opening. If i use key, showing me alert ("Multiple widgets used the same GlobalKey."). Please help me :)

    opened by mfabank 3
  • Card unfold state is not kept in a ListView

    Card unfold state is not kept in a ListView

    In a ListView, if I'll unfold one item and then scroll far down and then back - item state is lost and the card becomes folded again. Is there any way to fix this?

    Otherwise - great plugin!

    opened by livotov 3
  • Multiple widgets used the same GlobalKey.

    Multiple widgets used the same GlobalKey.

    Hi, Folding Cell is a great Widget. But i have a problem, i want to draw multiple cell with ListView.builder() but i am getting an error. This error is "Multiple widgets used the same GlobalKey." If i descripe different Global key, my cards is not open and none show all them. I only see one card. Thank you for your answers :)

    opened by mfabank 1
  • [Suggestion] Parameter for the duration of the animation

    [Suggestion] Parameter for the duration of the animation

    Congratulations on the package! I wanted to suggest to create an optional parameter of the widget, to set the duration of the animation of opening and closing the card. Thank you ;)

    opened by danielemontecchi 1
  • Change the height of innerBottomWidget

    Change the height of innerBottomWidget

    How to increase the size of the bottom widget. When we set cellsize, all three widgets takes the same cell size. But I need more space on the bottom widget. How can I do this? Thanks image

    opened by uisuru 5
  • Expand Inner Bottom Widget after click

    Expand Inner Bottom Widget after click

    It looks like inner top widget and inner bottom widget have the same hight. Is it possible to increase only the hight for the inner bottom wight (to show more data) after click open button? Its a suggestion. Btw I loved your work.

    opened by rakib205 1
  • [Suggestion] More 1 folding and re close folding if other list clicked

    [Suggestion] More 1 folding and re close folding if other list clicked

    Hei, can you provide function it can be more than 1 folding, so i can add 2 more folding cell, and please add boolean optional to make folding cell close if other list of folding cell click to open, thanks

    opened by rriiffaall 2
A simple animated radial menu widget for Flutter.

flutter_radial_menu A radial menu widget for Flutter. . Installation Install the latest version from pub. Quick Start Import the package, create a Rad

Victor Choueiri 434 Jan 7, 2023
Custom widget for Flutter

Flushbar Use this package if you need more customization when notifying your user. For Android developers, it is made to substitute toasts and snackba

Andre Haueisen 899 Dec 30, 2022
flutter stepper_touch widget

stepper_touch the concept of the widget inspired from Nikolay Kuchkarov. i extended the functionality to be more useful in real world applications Tha

Raouf Rahiche 271 Dec 30, 2022
A TypeAhead widget for Flutter, where you can show suggestions to users as they type

Flutter TypeAhead A TypeAhead (autocomplete) widget for Flutter, where you can show suggestions to users as they type Features Shows suggestions in an

null 661 Jan 5, 2023
A highly customisable Flutter widget for entering pin code. Suitable for use cases such as login and OTP.

pin_code_text_field It's a beautiful and highly customizable Flutter widget for entering pin code. Suitable for use cases such as login and OTP. Usage

Liew Jun Tung 309 Dec 28, 2022
A Flutter package that provides an Emoji picker widget with 1500+ emojis in 8 categories.

emoji_picker_flutter Yet another Emoji Picker for Flutter ?? Note: This package is based on emoji_picker which has been deprecated and not maintained

Stefan Humm 99 Dec 24, 2022
A Flutter Widget Approach for using HTML tags & CSS styles in your upcoming Apps.

html_widgets A Flutter Widget Approach for using HTML tags & CSS styles in your upcoming Apps. Text Widgets *text property is required for all the tex

XenonLabz 7 Jul 14, 2022
Flutter widget with pond ripple effect!

Ripple pond effect This project contains Ripple pond effect widget. It makes wave when you click on it! There is still many things to improve in this

null 24 Dec 19, 2021
top-snackbar-flutter - Modern UI snackbar widget

top-snackbar-flutter - Modern UI snackbar widget

null 110 Jan 7, 2023
A flutter widget where a card is expanded ontap.

Expansion card This package provides an easy implementation of a Expansion type card where you can also add gif at the background. How to use import '

null 127 Dec 6, 2022
Scratch card widget which temporarily hides content from user.

scratcher Scratch card widget which temporarily hides content from user. Features Android and iOS support Cover content with full color or custom imag

Kamil Rykowski 405 Dec 27, 2022
A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file.

image_sequence_animator A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file. If you have a G

AliYigitBireroglu 134 Dec 22, 2022
Animated Selection Slide Sezgin BilgetayAnimated Selection Slide An animated selection widget by swiping by Sezgin Bilgetay.

Animated Selection Slide This flutter project allows you to make your choices with animation in inbox. For UI, it's inspired by the great example on d

null 340 Jan 7, 2023
A Very Good Infinite List Widget created by Very Good Ventures. Great for activity feeds, news feeds, etc. πŸ¦„

InfiniteList comes in handy when building features like activity feeds, news feeds, or anywhere else where you need to lazily fetch and render content for users to consume.

Very Good Open Source 102 Dec 12, 2022
Allows widgets to be zoomed in and out by inserting a OverlayEntry which allows the widget to be on the front at all times.

zoom_pinch_overlay An instagram style pinch and zoom widget for all platform completely written in pure dart! All other "zoom_pinch" package doesnt di

Samuel 18 Nov 29, 2022
A customizable shadow for any widget

simple_shadow A customizable shadow for any widget Getting Started import: import 'package:simple_shadow/simple_shadow.dart'; example: SimpleShadow(

Marcelo Pinheiro Montanher 27 Nov 23, 2022
A textField widget to help display different style pin

pin_input_text_field δΈ­ζ–‡η‰ˆη‚Ήζˆ‘ PinInputTextField is a TextField widget to help display different style pin. It supports all the platforms flutter supports

Tino 324 Jan 4, 2023
Movies App UI in Flutter using Simple Widgets without Using API's in Flutter.

Movies App UI in Flutter using Simple Widgets without Using API's in Flutter.

Habib ullah 3 May 15, 2022
A flutter plugin for Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple.

A flutter plugin for Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple.

Urmish Patel 191 Dec 29, 2022