flutter_slidable icon indicating copy to clipboard operation
flutter_slidable copied to clipboard

Can't create SlidableController according to documentation

Open kwarnkham opened this issue 1 year ago • 3 comments

Here, the docs said

final controller = SlidableController();

// ...

Slidable(
  controller: controller,
  // ...
);

// ...

// Open the actions
void _handleOpen() {
  controller.openEndActionPane();
  // OR
  //controller.openStartActionPane();
}

void _handleOpen() {
  controller.close();
}

But thie SlidableController() got error 1 positional argument expected by 'SlidableController.new', but 0 found.

kwarnkham avatar Jul 18 '24 10:07 kwarnkham

I have same problem.

image

Sunghee2 avatar Jul 23 '24 12:07 Sunghee2

For me work this

In definition of class: class _MyAppState extends State<OrderListPage> with SingleTickerProviderStateMixin

and late final slidableController = SlidableController(this);

froccawork avatar Aug 21 '24 14:08 froccawork

Thanks, @froccawork . It worked for me.

The widget has to be a Stateful(StatefulWidget / ConsumerStatefulWidget).

MasatoKaneko0124 avatar Aug 24 '24 00:08 MasatoKaneko0124