Giter Site home page Giter Site logo

matthewstyler / configurable_expansion_tile Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 18.0 149 KB

A Configurable Expansion Tile altered from the flutter material implementation that allows for customization of the internal components.

License: BSD 2-Clause "Simplified" License

Dart 90.94% Java 2.95% Objective-C 6.11%

configurable_expansion_tile's Introduction

โ˜•๏ธ Java | ๐Ÿ’Ž Ruby

configurable_expansion_tile's People

Contributors

matthewstyler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

configurable_expansion_tile's Issues

header widget alignment

It doesn't seem possible to left-align (text) widgets in the header (though it is possible to left-align children items.

Manage Alignment of Header?

Maybe I'm overlooking something simple; however, I can't seem to find a way to align the header contents. For example, I want the header's child to be left aligned and the animation trailing widget to be right aligned.

Is there a way to do this or are they forcibly both centered?

Thanks!

it can be get scrollable child

for example you want seprate the main page to two expanded widget with this widget. you need to the children be scrolable but we have not any way for handle this

Needed to call handleTap() from outside function

First off, this widget saved the day, the standard material ExpansionTileList was way limited and not configurable at all, so big thank you.. It would be so easy for them to add more options into the built in one, but they went for material spec only I guess.
Anyways, for my use case, I needed to toggle the tile manually from my own functions and had some difficulty getting there. Using it for a Comments panel with the likes and posts, and we wanted to open it on a long press, then have the Hide Comments button on the bottom of the expanded panel instead of just the Header. I put the ConfigurableExpansionTile in it's own variable, but when calling it, there was no way to manually toggle it, so I took the liberty of hacking your code a bit, and wanted to share..
Needed to make void _handleTap public, so got rid of the underscore inside the State, but that wasn't enough to access it. Inside the StatefulWidget class, I changed the createState part to this:

  static final Animatable<double> _easeOutTween =
      CurveTween(curve: Curves.easeOut);
// Modified here:
  final _ConfigurableExpansionTileState configurableExpansionTile = _ConfigurableExpansionTileState();

  void handleTap() {
    configurableExpansionTile.handleTap();
  }

  @override
  _ConfigurableExpansionTileState createState() => configurableExpansionTile;
      //_ConfigurableExpansionTileState();
}

Easy enough to do, taught myself something, works good now. I can call it from my own GestureDetector with commentTile.handleTap(); like I wanted. It might be nice to add this in your next version release. Thanks for the needed component, think I'm gonna have a few more usages for it.

make rounded ConfigurableExpansionTile

                              decoration: BoxDecoration(
                                // shape: BoxShape.circle,
                                borderRadius: BorderRadius.all(
                                  Radius.circular(32.0),
                                ),
                                color: Colors.black,
                              ),

i have tried and added container instead of header or the widget ConfigurableExpansionTile outside
but the output is not full rounded ...

if i added outside the widget , thats container height would ++ height, i just want to decoration of header , and body is still transparent

my code tried

Expanded(
                      flex: 0,
                      child: Container(
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.all(
                            Radius.circular(32.0),
                          ),
                          color: kColorLightBlue,
                        ),
                        margin: EdgeInsets.all(16.0),
                        child: ConfigurableExpansionTile(
                          borderColorStart: Colors.transparent,
                          borderColorEnd: Colors.transparent,
                          bottomBorderOn: true,
                          topBorderOn: true,
                          animatedWidgetFollowingHeader: Icon(
                            Icons.expand_more,
                            color: Colors.white,
                          ),
                          headerExpanded: Flexible(
                            child: Row(
                              children: [
                                Container(
                                  padding: EdgeInsets.all(8.0),
                                  decoration: BoxDecoration(
                                    shape: BoxShape.circle,
                                  ),
                                  child: Text(
                                    "HEADER",
                                    style: kTitleText.copyWith(
                                      fontSize: 14.0,
                                    ),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          header: Flexible(
                            child: Row(
                              children: [
                                Container(
                                  padding: EdgeInsets.all(8.0),
                                  child: Text(
                                    "HEADER",
                                    style: kTitleText.copyWith(
                                      fontSize: 14.0,
                                    ),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          // headerBackgroundColorStart: kColorLightBlue,
                          expandedBackgroundColor: Colors.transparent,
                          // headerBackgroundColorEnd: kColorLightBlue,
                          children: [
                            Row(
                              children: [
                                Text("CHILD 1"),
                              ],
                            ),
                            Row(
                              children: [
                                Text("CHILD 2"),
                              ],
                            )
                          ],
                        ),
                      ),
                    ),

three degree expansion

Can this be used to generate three degree list such as below :

  • Header 1
    • sub header 1
    • sub header 2
      • onClickSelect 1
      • onClickSelect 2
    • sub header 3
  • Header 2
    • sub header 1
      • onClickselect1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.