expandable_card 0.0.3+1

Expandable Card #

This is a Flutter Widget that makes it easy to build a page with a bottom Card that can be expanded on user drag.

GIF Animation

How to use it #

Use ExpandableCardPage for the body of your Scaffold. This widget will take two attributes:

  • Widget page: which is the default page in the background
  • ExpandableCard expandableCard: which is the bottom card itself. You can call the ExpandableCard constructor to build one.

ExpandableCard constructor has a few attributes:

  • EdgeInsetsGeometry padding: padding inside the card. Default value is EdgeInsets.all(15)
  • double minHeight: default height of the card when it's not expanded. Default value is 200
  • double maxHeight: height of the card when it's fully expanded. Default value is 500
  • bool hasShadow: determines whether the card has box shadow or not. Default is true
  • Color backgroundColor: background color of the card. Default is Colors.blueGrey
  • bool hasRoundedCorners: determines whether the card has rounded corners or not. Default is false
  • bool hasHandle: will add a little handle icon. Default is true
  • List<Widget> Children: Widgets that make the actual content of the card

Future Implementations: #

  • AnimatedExpandableCard: will allow animation between closed state and expanded state.
  • Add suport for scrolling card when its fully expanded

[0.0.1] - 10/05/2019.

Basic card functionality added

[0.0.2] - 10/05/2019.

ExpandableCard now takes a list of widgets as children for the content, instead of a widget. Added hasHandle attribute, which will add a handle icon to the card.

[0.0.3] - 10/05/2019.

Added example

example/example.dart

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

void main() => runApp(ExampleApp());

class ExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: ExpandableCardPage(
          page: Center(
            child: Text("Background page"),
          ),
          expandableCard: ExpandableCard(
            children: <Widget>[Text("Hello world")],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  expandable_card: ^0.0.3+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:expandable_card/expandable_card.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
73
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/expandable_card.dart. (-1.49 points)

Analysis of lib/expandable_card.dart reported 3 hints:

line 166 col 19: The for, if and spread elements were not supported until version 2.2.2, but this code is required to be able to run on earlier versions.

line 178 col 21: The for, if and spread elements were not supported until version 2.2.2, but this code is required to be able to run on earlier versions.

line 180 col 21: The for, if and spread elements were not supported until version 2.2.2, but this code is required to be able to run on earlier versions.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.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

Admin