Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple widgets used the same GlobalKey. #15

Closed
mfabank opened this issue Aug 26, 2021 · 1 comment
Closed

Multiple widgets used the same GlobalKey. #15

mfabank opened this issue Aug 26, 2021 · 1 comment

Comments

@mfabank
Copy link

mfabank commented Aug 26, 2021

Hi, Folding Cell is a great Widget. But i have a problem, i want to draw multiple cell with ListView.builder() but i am getting an error. This error is "Multiple widgets used the same GlobalKey." If i descripe different Global key, my cards is not open and none show all them. I only see one card. Thank you for your answers :)

@mfabank mfabank closed this as completed Aug 26, 2021
@mfabank mfabank reopened this Aug 26, 2021
@mfabank
Copy link
Author

mfabank commented Aug 26, 2021

Solved.. Example Code:

Widget _buildFrontWidget(String wname) { return Builder(builder: (context) { return InkWell( onTap: () { final _foldingCellState = context.findAncestorStateOfType<SimpleFoldingCellState>(); _foldingCellState?.toggleFold(); }, child: Container( color: Colors.grey, alignment: Alignment.center, child: Stack( children: <Widget>[ Align( alignment: Alignment.center, child: Text( wname.toString(), style: GoogleFonts.aldrich( color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.bold, ), ), ), ], ), ), ); }); }

I used Builder Widget.

@mfabank mfabank closed this as completed Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant