folding_cell 0.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 92

Simple FoldingCell widget #

Simple folding cell widget implemented in Flutter. Its a widget so add it to any container widget as a child.

pub package

Installation #

Add dependency in pubspec.yaml:

dependencies:
  folding_cell: "^0.1.0"

Import in your project:

import 'package:folding_cell/folding_cell.dart';

Basic usage #

class FoldingCellSimpleDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Color(0xFF2e282a),
      alignment: Alignment.topCenter,
      child: SimpleFoldingCell(
        frontWidget: Container(
            color: Color(0xFFffcd3c),
            alignment: Alignment.center,
            child: Text("CARD",
                style: TextStyle(
                    color: Color(0xFF2e282a), fontFamily: 'OpenSans', fontSize: 20.0, fontWeight: FontWeight.w800))),
        innerTopWidget: Container(
            color: Color(0xFFff9234),
            alignment: Alignment.center,
            child: Text("TITLE",
                style: TextStyle(
                    color: Color(0xFF2e282a), fontFamily: 'OpenSans', fontSize: 20.0, fontWeight: FontWeight.w800))),
        innerBottomWidget: Container(
          color: Color(0xFFecf2f9),
          alignment: Alignment.bottomCenter,
          child: Padding(
            padding: EdgeInsets.only(bottom: 10),
            child: FlatButton(onPressed: (){
              final snackBar = SnackBar(content: Text('Item clicked'), duration: Duration(milliseconds: 600),);
              Scaffold.of(context).showSnackBar(snackBar);
            }, child: Text("FoldingCell Demo",), textColor: Colors.white, color: Colors.indigoAccent, splashColor: Colors.white.withOpacity(0.5),),
          ),
        ),
        cellSize: Size(MediaQuery.of(context).size.width, 125),
        padding: EdgeInsets.all(15),
      ),
    );
  }
}

Examples #

example project contains these two demos

Demo 1 - FoldingCell inside Container #

alt tag

Demo 2 - FoldingCell inside ListView #

alt tag

Bugs/Requests #

Reporting issues and requests for new features are always welcome.

<a href="https://www.buymeacoffee.com/OVQoKHw7q" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

0.1.1 #

Added animationDuration and rounded borderRadius

0.1.0 #

  • Initial version

example/README.md

example/lib/main.dart #

import 'package:flutter/material.dart';
import 'package:folding_cell/folding_cell.dart';

void main() => runApp(MaterialApp(home: SafeArea(child: Scaffold(body: Material(child: FoldingCellSimpleDemo())))));

/// Example 1 folding cell inside [Container]
class FoldingCellSimpleDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Color(0xFF2e282a),
      alignment: Alignment.topCenter,
      child: _buildCell(context, 0),
    );
  }
}

/// Example 2 folding cell inside [ListView]
class FoldingCellListViewDemo extends StatelessWidget {
  @override
  Widget build(BuildContext pcontext) {
    return Container(
      color: Color(0xFF2e282a),
      child: ListView.builder(
          itemCount: 100,
          itemBuilder: (context, index) {
            return _buildCell(pcontext, index);
          }),
    );
  }
}

Widget _buildCell(BuildContext context, int index) {
  return SimpleFoldingCell(
    frontWidget: Container(
        color: Color(0xFFffcd3c),
        alignment: Alignment.center,
        child: Text("CARD - $index",
            style: TextStyle(
                color: Color(0xFF2e282a), fontFamily: 'OpenSans', fontSize: 20.0, fontWeight: FontWeight.w800))),
    innerTopWidget: Container(
        color: Color(0xFFff9234),
        alignment: Alignment.center,
        child: Text("TITLE - $index",
            style: TextStyle(
                color: Color(0xFF2e282a), fontFamily: 'OpenSans', fontSize: 20.0, fontWeight: FontWeight.w800))),
    innerBottomWidget: Container(
      color: Color(0xFFecf2f9),
      alignment: Alignment.bottomCenter,
      child: Padding(
        padding: EdgeInsets.only(bottom: 10),
        child: FlatButton(onPressed: (){
          final snackBar = SnackBar(content: Text('Item $index clicked'), duration: Duration(milliseconds: 600),);
          Scaffold.of(context).showSnackBar(snackBar);
        }, child: Text("FoldingCell Demo",), textColor: Colors.white, color: Colors.indigoAccent, splashColor: Colors.white.withOpacity(0.5),),
      ),
    ),
    cellSize: Size(MediaQuery.of(context).size.width, 125),
    padding: EdgeInsets.all(15),
  );
}


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  folding_cell: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:folding_cell/folding_cell.dart';
  
Version Uploaded Documentation Archive
0.1.1 Feb 8, 2019 Go to the documentation of folding_cell 0.1.1 Download folding_cell 0.1.1 archive
0.1.0 Dec 7, 2018 Go to the documentation of folding_cell 0.1.0 Download folding_cell 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
84
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
92
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13
  • Flutter: 1.2.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/folding_cell/widget.dart.

Run flutter format to format lib/folding_cell/widget.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test