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

Does not work properly with StatefulWidget. #6

Closed
AhmetAY opened this issue Jun 24, 2019 · 3 comments
Closed

Does not work properly with StatefulWidget. #6

AhmetAY opened this issue Jun 24, 2019 · 3 comments

Comments

@AhmetAY
Copy link

AhmetAY commented Jun 24, 2019

When I change Item class from StatelessWidget to StatefulWidget, it does not work properly. A weird situation occurs in ui.
New form of Item class:

class Item extends StatefulWidget {
  Item({
    this.data,
    this.isFirst,
    this.isLast,
    this.draggingMode,
  });

  final ItemData data;
  final bool isFirst;
  final bool isLast;
  final DraggingMode draggingMode;

@override
  State<StatefulWidget> createState() => new _ItemState(data: data, isFirst: isFirst, isLast: isLast, draggingMode: draggingMode);
}

class _ItemState extends State<Item> {
  _ItemState({
    this.data,
    this.isFirst,
    this.isLast,
    this.draggingMode,
  });

  final ItemData data;
  final bool isFirst;
  final bool isLast;
  final DraggingMode draggingMode;
@knopp
Copy link
Owner

knopp commented Jun 25, 2019

Stateless/Stateful shouldn't make any difference here. We have reorderable items with stateful widgets with them. You code doesn't show everything, i.e. the build method is missing.

@AhmetAY
Copy link
Author

AhmetAY commented Jun 25, 2019

Stateless/Stateful shouldn't make any difference here. We have reorderable items with stateful widgets with them. You code doesn't show everything, i.e. the build method is missing.

I just showed the changed part.

@knopp
Copy link
Owner

knopp commented Oct 7, 2019

Closing for inactivity. If you have problem with stateless widgets inside list please provide a working example.

@knopp knopp closed this as completed Oct 7, 2019
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

2 participants