-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
bottomSheet is always rebuild #21
Comments
Sorry I did it: builder: (_) => MySheetWidget(title)); instead of, better: final page = MySheetWidget(title)); builder: (_) => page; |
Sorry I reopen it. I need that the bottomSheet no rebuild when I resize it. (builder is always build when scrolling) I want to control when I want to rebuild the bottomsheet Any way to do that? |
Please ask support questions on appropriate channels like stackoverflow. showModalBottomSheet(
context: Get.overlayContext, // rather context
builder: (BuildContext bc){
return Container(
child: new Wrap(
children: <Widget>[
ListTile(
leading: Icon(Icons.music_note),
title: Text('Music'),
onTap: () => {}
),
ListTile(
leading: Icon(Icons.videocam),
title: Text('Video'),
onTap: () => {},
),
],
),
);
}
); So, your issue is not a bug description or a resource request, and I can't help you here. Put your question on the stackoverflow and I can answer you there. I just make it clear here, that the bottomsheet is rebuilt with each dragged pixel. You cannot change this behavior, because without the reconstruction, it would not change in size (it is the size change that causes the reconstruction), so if there is any side effect to this, the problem is in the logic of your code. Advices: 1- Always create a Stateful widget, and call the bottomsheet with it inside:
2- Use Stateful, never Stateless if you want something to remain in a state. Never place controllers inside the build method, but at the beginning of the class. 3- Use If you have questions related to the library, (and not when Flutter widgets work), do not hesitate to open another issue. |
I have a
Get.bottomSheet(
isScrollControlled: true,
builder: (_) => MySheetWidget(title));
MySheetWidget is a statefulwidget
When i move the sheet top/bottom the build method always triggering
The text was updated successfully, but these errors were encountered: