Giter Club home page Giter Club logo

flutter-expandable's People

Contributors

aryzhov avatar ionys320 avatar pawlikmichal25 avatar stefanlobbenmeier avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter-expandable's Issues

Deprecated configurations.

Hello dear, very good component. I tell him that I am trying to use it, I have installed the latest version available, and by implementing a simple test example as shown on the download site, I get two deprecated properties, I can corroborate that this is so and provide a correction of the same? I have not found much information about it. I attach the code and the screenshot. I await any comment, thank you.

Cheers!

CODE:
ExpandablePanel( header: Text('Header'), collapsed: Text('Text Collapsed'), expanded: Text('Expanded'), headerAlignment: , hasIcon: , ),

IMAGE:
Captura de pantalla de 2020-06-02 10-19-04

Build scheduled during frame exception when using the draggable_scrollbar package.

Hey there,
I am using this package and love it, but unfortunately, I keep getting this exception. I am not quite sure if it is because of Expandable, or the draggable_scrollbar package. It only occurs when collapsing a card in my list as seen in the clip below: It doesn't occur, though, if it's the top item being expanded and collapsed.

https://i.imgur.com/v2dxj38.mp4

Here is more of the exception:

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following assertion was thrown during performLayout():
Build scheduled during frame.

While the widget tree was being built, laid out, and painted, a new frame was scheduled to rebuild the widget tree.

This might be because setState() was called from a layout or paint callback. If a change is needed to the widget tree, it should be applied as the tree is being built. Scheduling a change for the subsequent frame instead results in an interface that lags behind by one frame. If this was done to make your build dependent on a size measured at layout time, consider using a LayoutBuilder, CustomSingleChildLayout, or CustomMultiChildLayout. If, on the other hand, the one frame delay is the desired effect, for example because this is an animation, consider scheduling the frame in a post-frame callback using SchedulerBinding.addPostFrameCallback or using an AnimationController to trigger the animation.

The relevant error-causing widget was: 
  ListView file:///E:/_programming/go/src/github.com/instance-id/searcher_installer_go/lib/routes/news.dart:145:49
When the exception was thrown, this was the stack: 
#0      WidgetsBinding._handleBuildScheduled.<anonymous closure> (package:flutter/src/widgets/binding.dart:734:9)
#1      WidgetsBinding._handleBuildScheduled (package:flutter/src/widgets/binding.dart:757:6)
#2      BuildOwner.scheduleBuildFor (package:flutter/src/widgets/framework.dart:2511:23)
#3      Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:4190:11)
#4      State.setState (package:flutter/src/widgets/framework.dart:1253:14)
...
The following RenderObject was being processed when the exception was fired: RenderViewport#3cf44 NEEDS-LAYOUT NEEDS-PAINT
...  needs compositing
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(0.0<=w<=750.6, 0.0<=h<=277.0)
...  layer: OffsetLayer#b4b41
...    engine layer: OffsetEngineLayer#3f7b8
...    offset: Offset(0.0, 0.0)
...  size: Size(750.6, 277.0)
...  axisDirection: down
...  crossAxisDirection: right
...  offset: ScrollPositionWithSingleContext#f0bf4(offset: 186.0, range: 0.0..145.7, viewport: 277.0, ScrollableState, ClampingScrollPhysics, BallisticScrollActivity#acc00(AnimationController#0ab75(▶ 186.000; for BallisticScrollActivity)), ScrollDirection.idle)
...  anchor: 0.0
RenderObject: RenderViewport#3cf44 NEEDS-LAYOUT NEEDS-PAINT
  needs compositing
  parentData: <none> (can use size)
  constraints: BoxConstraints(0.0<=w<=750.6, 0.0<=h<=277.0)
  layer: OffsetLayer#b4b41
    engine layer: OffsetEngineLayer#3f7b8
    offset: Offset(0.0, 0.0)
  size: Size(750.6, 277.0)
  axisDirection: down
  crossAxisDirection: right
  offset: ScrollPositionWithSingleContext#f0bf4(offset: 186.0, range: 0.0..145.7, viewport: 277.0, ScrollableState, ClampingScrollPhysics, BallisticScrollActivity#acc00(AnimationController#0ab75(▶ 186.000; for BallisticScrollActivity)), ScrollDirection.idle)
  anchor: 0.0

Here is the code from the widget:

  @override
  Widget build(BuildContext context) {
    news = Provider.of<NewsDataProvider>(context).newsData;

    return Container(
      alignment: Alignment.center,
      width: MediaQuery.of(context).size.width,
      height: MediaQuery.of(context).size.height,
      child: Container(
        margin: EdgeInsets.fromLTRB(0, 22, 0, 30),
        alignment: Alignment.center,
        width: MediaQuery.of(context).size.width * 0.9,
        child: Column(
          children: <Widget> [
            CustomCard(
              borderRadius: [10, 10, 0, 0],
              elevation: 3,
              color: Colors.black87,
              child: Container(
                  height: 25,
                  width: context.widthPx,
                  child: Text(
                    "News",
                    textAlign: TextAlign.center,
                  )),
            ),
            Expanded(
              flex: 1,
              child: CustomCard(
                padding: [0, 6, 0, 0],
                borderRadius: [0, 0, 10, 10],
                elevation: 10,
                shadowColor: Colors.black,
                color: Color.fromRGBO(35, 47, 52, 0.8),
                child: Column(
                  children: [
                    Expanded(
                      flex: 1,
                      child: Scaffold(
                        body: (news == null)
                            ? Center(child: CircularProgressIndicator())
                            : DraggableScrollbar.arrows(
                                alwaysVisibleScrollThumb: true,
                                backgroundColor: Color.fromRGBO(35, 35, 35, 0.9),
                                padding: EdgeInsets.only(right: 2),
                                controller: _scrollController,
                                child: ListView.separated(
                                  controller: _scrollController,
                                  itemCount: news.length,
                                  separatorBuilder: (context, __) => SizedBox(height: 8),
                                  itemBuilder: (context, index) {
                                    return (news[index].isDynamic)
                                        ? Center(child: CircularProgressIndicator())
                                        : FadeInVertical(
                                            delay: (index.toDouble() * 0.3) + 0.3,
                                            distance: -75,
                                            duration: 500,
                                            child: Padding(
                                              padding: EdgeInsets.fromLTRB(10, 0, 23, 0),
                                              child: ExpansionNews(news[index], index),
                                            ),
                                          );
                                  },
                                ),
                                heightScrollThumb: 48.0,
                              ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
            SizedBox(height: 35),
          ],
        ),
      ),
    );
  }

I am hoping that you might be able to at least help point me in the right direction? I will probably post this same message over in the draggable_scrollbar github as well, just in case this ends up being something on their end.

Thanks!
-MH

tapBodyToExpand and tapBodyToCollapse are not working

Hi,

I'm using version 4.1.2 and I cannot get tapBodyToCollapse and tapBodyToCollapse to work.

I used the following theme data:

 theme: ExpandableThemeData(
            tapBodyToExpand: true,
            tapHeaderToExpand: true,
            tapBodyToCollapse: true),

I confirm that passing tapHeaderToExpand will work. But the body stuff does not work.

Any idea?

Flickering on icon/header tap

While tapping on header or icon the text inside is moved to left and then to right on couple of pixels which creates flickering.

AndroidManifest.xml could not be found.

Hi, I'm trying to run an example (after git cloning ).
Getting following error:

Launching lib/main.dart on Android SDK built for x86 64 in debug mode... AndroidManifest.xml could not be found. Please check /home/dominik/Flutter_projects/flutter-expandable/example/android/AndroidManifest.xml for errors. No application found for TargetPlatform.android_x64. Is your project missing an android/AndroidManifest.xml? Consider running "flutter create ." to create one.

How can I run it?

[Question] Header text same height as icon

Hi,
is there a reason, why the header text is not at the same height as the expand icon?
The text starts a bit above the icon at the moment..
simple solution: change line 180 to crossAxisAlignment: CrossAxisAlignment.center,..

Pub release 1.2.0+4

Hi :)
looks like even though you bumped the version here, the latest version on pub is still 1.2.0+3.

[Question:] Why does the header loses its collapse-state on setState

Hi,
I have the following app in which the default example is wrapped in an expandable-panel. Initially the panel is collapsed but i can expand it by clicking the header.
Now everytime i press the increment button, the panel gets collapsed again. How can i prevent that?

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: ExpandablePanel(
            initialExpanded: false,
            header: Text("Header"),
            expanded: Text('You have pushed the button this many times: $_counter')
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Leak of documentation for migration

Hi! I used tapHeaderToExpand, tapHeaderToCollapse, hasIcon everywhere. Now they are deprecated. So what alternatives are exist for migration without loss of current functionality of my deployed app?

Compiler errors

I'm using AndroidStudio, just hit this problem:

  1. Added expandable ^4.0.0 to pubspec.yaml (no issue)
  2. Imported (not yet called) -->
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...

Compiler message:
../../.pub-cache/hosted/pub.dartlang.org/expandable-4.0.0/lib/expandable.dart:147:19: Error: The method 'dependOnInheritedWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/usr/local/Cellar/flutter/stable/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'dependOnInheritedWidgetOfExactType'.
        ? context.dependOnInheritedWidgetOfExactType<_ExpandableThemeNotifier>()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/expandable-4.0.0/lib/expandable.dart:148:19: Error: The method 'findAncestorWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/usr/local/Cellar/flutter/stable/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'findAncestorWidgetOfExactType'.
        : context.findAncestorWidgetOfExactType<_ExpandableThemeNotifier>();
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/expandable-4.0.0/lib/expandable.dart:169:42: Error: The method 'dependOnInheritedWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/usr/local/Cellar/flutter/stable/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'dependOnInheritedWidgetOfExactType'.
    _ExpandableThemeNotifier n = context.dependOnInheritedWidgetOfExactType<_ExpandableThemeNotifier>();
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/expandable-4.0.0/lib/expandable.dart:284:19: Error: The method 'dependOnInheritedWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/usr/local/Cellar/flutter/stable/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'dependOnInheritedWidgetOfExactType'.
        ? context.dependOnInheritedWidgetOfExactType<_ExpandableControllerNotifier>()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/expandable-4.0.0/lib/expandable.dart:285:19: Error: The method 'findAncestorWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/usr/local/Cellar/flutter/stable/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'findAncestorWidgetOfExactType'.
        : context.findAncestorWidgetOfExactType<_ExpandableControllerNotifier>();
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compiler failed on /flutter_project/lib/main.dart
Error launching application on iPhone 11 Pro Max.

Expansion does not fit into full view like example

Hi Aryzhov,
I saw the small sample gif when you click the arrow button it expand and cover the whole possible view page. But when I tried the example codes it does not work like the example. Any idea is there any other settings ?

Body text alignment

How to align text in "collapsed" and "expanded" to left, so far I can only align header and icon.

My code is shown below:

ExpandablePanel(
header: Text("Waranty Type",style: TextStyle(fontSize: 15, color: AlleColors.marketMain),),
headerAlignment: ExpandablePanelHeaderAlignment.center,
collapsed: Text("No Warranty",style: TextStyle(color: AlleColors.textBody,),
textAlign: TextAlign.left,maxLines: 2,overflow: TextOverflow.ellipsis,softWrap: true,),
expanded: Text("No Warranty", style: TextStyle(color: AlleColors.textBody),softWrap: true),
tapHeaderToExpand: true,
tapBodyToCollapse: true,
iconPlacement: ExpandablePanelIconPlacement.right,
hasIcon: true,
iconColor: AlleColors.marketMain,
),

1

Re-enable iconColor?

Hi, any plans to re-enable iconColor now that we are way past 1.7.3 on stable?

Icon Color

Hello,

How do I specify a color for the icon? the default color is inherited to be black, and I want it to be another one.

toggle() doesn't work

When I try to call method toggle on the controller in this way (the controller is null):

var controller = ExpandableController.of(context);
controller.toggle();

and in this (the controller isn't null) but the toggle function is not executed:

expandablePanel.controller.toggle();

I instantiate the panel in this way:

ExpandablePanel expandablePanel = ExpandablePanel(
  controller: ExpandableController(),
  expanded: ProductDetailContent(
    product: product,
  )
);

Does flutter expandable recycle views?

I building an app that have a screen with ExpandablePanel inside another ExpandablePanel with big lists of Strings (Images (small sizes) and texts), I would like to know if expandable recycle views or my app will probably crash, but in that screen I'm building I needed to show all data.

ExpandablePanel -> ExpandablePanel -> Header -> Expanded

Rows (Images and texts) -> Rows (Images and texts) -> Description (big and small texts)

Thank you.

Q: onExpanded() callback?

Is there some kind of callback to when an ExpandablePanel was expanded/toggled? An onExpanded() prop would be ideal for my use case.
Thanks!

Button in expanded panel

Wondering if there is a special way to handle a button in the expanded panel, now it does not work and sometimes sends it to blank screen and I am just trying to run print statement right now.

ExpandableButton doesn't inherit controller

class _HomePageState extends State<HomePage> {
    ExpandableController _expandableController = ExpandableController(
        initialExpanded: false,
        animationDuration: Duration(milliseconds: 600),
    );

    @override
    Widget build(BuildContext context) {
        ExpandableNotifier(
            controller: _expandableController,
            child: Column(
                children: <Widget>[
                    ExpandableButton(
                        Text("test"),
                    ),
                    ExpandIcon(
                        isExpanded: _expandableController.expanded,
                        onPressed: (exp) {
                          _expandableController.toggle();
                          this.setState(() {});
                        },
                    ),
                ],
            )
        )
    }
}

when I click ExpandableButton, It doesn't change expanded variable to true or false of my local _expandableController.

but It's toggling(expand, collapse) is works.

I think it's because of using he's default controller.

How to combine Expandable with BottomNavigationBar

This is the good widget, but I have a request, can we combine this widget with BottomNavigationBar?

For example, I have a class to show BottomNavigationBar :

class DashBoardPage extends StatefulWidget {
  @override
  _DashBoardPageState createState() => _DashBoardPageState();
}

class _DashBoardPageState extends State<DashBoardPage> {

  int _page = 0;

  final List<Widget> _list = [
    HomePage(),
    DummyTest(),
    DummyTest(),
    Profile(),
    DummyTest(),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      bottomNavigationBar: BottomNavigationBar(
        type: BottomNavigationBarType.fixed,
        items: <BottomNavigationBarItem>[
          BottomNavigationBarItem(
            title: Text("Home"),
            icon: Icon(Icons.home),
          ),
          BottomNavigationBarItem(
            title: Text("Search"),
            icon: Icon(Icons.search),
          ),
          BottomNavigationBarItem(
            title: Text("Post"),
            icon: Icon(Icons.add),
          ),
          BottomNavigationBarItem(
            title: Text("Profile"),
            icon: Icon(Icons.account_circle),
          ),
          BottomNavigationBarItem( //<== When I clicked this menu, showing bottomSheet beneath bottomNavigationBar using Expandable
            title: Text("More"),
            icon: Icon(Icons.more_horiz),
          ),
        ],
        onTap: _onTapped,
        currentIndex: _page,
      ),
      body: _list[_page],
    );
  }

  void _onTapped(int index) {
    setState(() {
      _page = index;
    });
  }

}

This class is running well, but how if I want to show bottomSheet beneath bottomNavigationBar using Expandable when I clicked More in last of BottomNavigationBarItem. It's possible to do?

Specifying controller for ExpandablePanel causes runtime error

If ExpandablePanel gets initialized with an external controller, the build causes a runtime error as ExpandableButton cannot find a controller ancestor and tries to call a method on null.

This is caused by a small error in the _ExpandableNotifierState:initState() method, where the code checks for widget.controller null value and fails to initialize the state's controller field. The solution is to remove the if statement around the controller initialization:

void initState() {
    super.initState();
    //if (widget.controller == null) {
    controller = widget.controller ??
        ExpandableController(initialExpanded: widget.initialExpanded ?? false);
    //}
  }

Please let me know if you need a PR for this.

usage

hi
thank you for good project but i want use it and i can't import package in my project!
in android with java be required add dependency in gradle but in flutter i don't know what do i do?
thank you in advance

Have an item open to start with

Hi,

This is a great package, I wanted to know if its possible to have the item expanded to start with and then the user can click the header to hide?

Thank you
Billy

Question: Is there a way to specify our own icon?

I would like to specify my own icon and also the direction in which the icon faces.

image
image

It would also be great to have the ability to change the color of the Expandable Panels as well as covering the icon in that color.

Auto expand or default expand

I am not seeing way to keep the Expandable expanded. There should we a way to expand the widget automatically or programatically.

All of the ExpandablePanels expands when it was intended to extend only one

I wanted to have a custom widget with custom button in ExpandablePanels header, so the solution was to handle the controllers value from a separate widget. But the controller`s value changes for all of the ExpandablePanels. How it can be fixed?

import 'package:animated/animated.dart';
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
import 'package:skiller/models/test.dart';
import 'package:skiller/ui/themes/app_theme.dart';

ExpandableController controller = ExpandableController();

class ExpandableTestItem extends StatelessWidget {
  final Test test;

  ExpandableTestItem({Key key, this.test}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(bottom: 8.0),
      child: ExpandableNotifier(
        key: key,
        controller: controller,
        child: ExpandablePanel(
          tapHeaderToExpand: true,
          hasIcon: false,
          header: CollapsedPart(
            test: test,
          ),
          expanded: ExpandedPart(key: key),
        ),
      ),
    );

//      CollapsedPart(test: test);
  }
}

class CollapsedPart extends StatefulWidget {
  final Test test;

  const CollapsedPart({Key key, this.test}) : super(key: key);

  @override
  _CollapsedPartState createState() => _CollapsedPartState();
}

class _CollapsedPartState extends State<CollapsedPart> {
  bool isExpanded = false;

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        setState(() {
          controller.value = !controller.value;
          isExpanded = !isExpanded;
        });
      },
      child: Container(
        height: 60,
        child: Row(
          children: <Widget>[
            Container(
              margin: EdgeInsets.only(left: 15, right: 20),
              width: 40,
              height: 40,
              decoration: BoxDecoration(
                  shape: BoxShape.circle,
                  color: (widget.test.isDone)
                      ? Color(0xff21a121)
                      : Color(0xffd12121)),
              child: (widget.test.isDone)
                  ? Icon(
                      Icons.done,
                      color: Color.fromRGBO(0, 0, 0, 40),
                    )
                  : Transform.rotate(
                      child: Icon(
                        Icons.add_circle,
                        color: Color.fromRGBO(0, 0, 0, 40),
                      ),
                      angle: 3.14 / 4,
                    ),
            ),
            Text(
              widget.test.title,
              style: TextStyles().testTitle,
            ),
            Container(width: 10),
            Text('(${widget.test.progress.toString()}%)',
                style: TextStyles().expandableTestProgress),
            Container(width: 0),
            Spacer(),
            Padding(
                padding: EdgeInsets.only(right: 15),
                child: Animated(
                    duration: Duration(milliseconds: 250),
                    curve: Curves.fastOutSlowIn,
                    value: (isExpanded) ? -1 : 0,
                    builder: (context, child, animation) {
                      return Transform.rotate(
                        angle: animation.value * 3.14,
                        child: child,
                      );
                    },
                    child: Icon(Icons.arrow_drop_down))),
          ],
        ),
      ),
    );
  }
}

class ExpandedPart extends StatelessWidget {
  ExpandedPart({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.grey[200],
      height: 200,
    );
  }
}

Nested ExpandablePanels Misbehaving

Tried to nest multiple ExpandablePanels inside each other today, and discovered a bit of a hiccup: if you expand the root panel, all of its children are expanded as well. Likewise, if you collapse any of the child panels, the whole tree collapses.

Is this something I could circumvent with a custom Expandable Widget?

ScrollOnExpand unexpected behaviour

I'm wrapping my card widget using the following method. The card widget has an expandable as one of its children. This widget represents an item in a list, but what happens some times is the list is scrolled to the wrong widget. Any reason why this is happening?

  Widget _buildExpandableAwareWidget({@required Widget child}) {
    // Scroll to show expanded item.
    var scrollOnExpand = ScrollOnExpand(
      child: child,
      scrollOnExpand: true,
      scrollOnCollapse: false,
    );
    return ExpandableNotifier(
      controller: _expandableController,
      child: scrollOnExpand,
    );
  }

Change the position of the icon

I wish to change the position of the arrow icon. Currently it comes in the next line of the specified text. Is there any way i can align it in the same line as of text, to the right of it ?
I'll give an example!
home screen-2 multiple media in one post – 8

tapBodyToCollapse to expand body problem

Hello, I have a problem with the tapBodyToCollapse property. I can't expand by clicking on the body if I click on any container. To minimize it works normal.

Controller.toggle not working in flutter web

controller.toggle is not reflecting inside async function.

How to reproduce ?

Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  Builder(
                    builder: (context) {
                      var controller = ExpandableController.of(context);
                      return FlatButton(
                        child: Text(
                          controller.expanded ? "COLLAPSE" : "EXPAND",
                          style: Theme.of(context)
                              .textTheme
                              .button
                              .copyWith(color: Colors.deepPurple),
                        ),
                        onPressed: () {
                          onExpand(controller);
                        },
                      );
                    },
                  ),


onExand(ExpandableController controller) async{
   await makeAPICall();
    controller.toggle();
}

I checked the value inside the controller.toggle method its setting the value as true. But its not reflecting in the UI

Splash effect not clippable/cannot be rounded

A small cosmetic issue, but it seems that there is no way to round the corners of the splash effect on the header of the expandable panel. Placing a ClipRRect above the expandable panel widget will only clip the content, but the splash effect is not clipped. Setting useInkWell = false in ExpandableThemeData seems to have no effect, with the splash effect still showing.

image

Open one expandable at a time

Looked through the code doesn't look like there is an option to when expanding collapse other expanded panels. Is this something you would be keen on adding in the future?

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.