Comments (8)
I confirmed tapBodyToCollapse
and tapBodyToExpand
don't work. ExpandableThemeData
is created globally and used for all Expandables
:
ExpandableThemeData get expandableTheme => ExpandableThemeData(
tapBodyToCollapse: true,
tapBodyToExpand: true,
);
Expandable(
theme: expandableTheme,
header: ...,
collapsed: ...
expanded:...
),
from flutter-expandable.
@cmorsucci
I believe you need to wrap expandables with ExpandableNotifier
to allow this to work. Just having ExpandablePanel
won't work with tapBodyToExpand
.
For example (tested on 4.1.4):
Widget build(BuildContext context) {
return ExpandableNotifier(
child: ExpandablePanel(
theme: const ExpandableThemeData(
tapBodyToExpand: true,
tapBodyToCollapse: true,
),
collapsed: Text(
loremIpsum,
softWrap: true,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
expanded: Text(loremIpsum, softWrap: true),
),
);
}
from flutter-expandable.
The workaround would be to wrap your collapsed body with ExpandableButton
. I am still not sure why this doesn't work for some people. Would anybody please provide a minimal example: not just a fragment, a complete widget that demonstrates the issue?
from flutter-expandable.
I could not reproduce this problem. The demo has a card with tapBodyToCollapse: true
and it works just fine. I suggest you make a minimally reproducible example.
from flutter-expandable.
I'm on 4.1.3, tapBodyToExpand doesn't work. Regular header behavior works.
from flutter-expandable.
Anybody know a workaround or temp fix I can use?
from flutter-expandable.
The hasIcon and tapHeaderToExpand both have lines through them and the tooltip tells me that they are depreciated. For sure, does not work.
from flutter-expandable.
Same issue, this is my widget @aryzhov :
class PromoTableViewCell extends StatelessWidget {
final bool showShareButton;
final bool showEditButton;
final bool showPublishButton;
PromoTableViewCell({
Key key,
this.showShareButton = false,
this.showEditButton = false,
this.showPublishButton = false,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(top: 20.0),
child: Column(
children: [
Row(
children: [
Expanded(
child: Container(
padding: const EdgeInsets.only(left: 16.0, right: 16, top: 10),
child: ExpandablePanel(
theme: ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
iconColor: MyColors.black,
tapBodyToCollapse: true,
tapBodyToExpand: true,
hasIcon: false,
),
header: Container(
//color: Colors.pink,
child: null,
),
collapsed: Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
style: TextStyle(color: MyColors.black),
softWrap: true,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
expanded: Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
style: TextStyle(color: MyColors.black),
softWrap: true,
),
),
),
),
],
),
],
));
}
}
from flutter-expandable.
Related Issues (20)
- How to set the initial state to expanded? HOT 1
- Is there any methods to create nested ExpandablePanels (for example like with ExpandedTile)
- Logging when expand and collapsed with too much child
- How does the icon of each item change direction when I click on each item separately?
- iOS - overlapped text HOT 2
- Opaque HitTestBehavior option for GestureDetector when useInkWell is false
- Expanded At First HOT 1
- Dart not supporting your "expanded" getter and setter method overloading.
- Example not compiling
- dismiss keyboard when click on expand/collapse icon or header
- Remember if the panel was expanded. HOT 2
- bug on changing the orientation of the screen
- Actively maintained? HOT 1
- how to set margin bottom, it's too big without any reason
- how to use this in gridview?
- Expand arrow is dark when default dark theme HOT 2
- huge performance issue HOT 1
- Remove splash HOT 1
- ExpandableController toggle crash issue caused by impeller in iOS
- from this package How to Expand only one at a time like ExpansionPanelRadio
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-expandable.