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

Add controller to handle manually from other SlidableAction #356

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {


return MaterialApp(
title: 'Slidable Example',
// ListView.builder(itemBuilder: )
home: Scaffold(
body: ListView(
children: [
Slidable(
// Specify a key if the Slidable is dismissible.
key: const ValueKey(0),
enabled: false,

// The start action pane is the one at the left or the top side.
startActionPane: ActionPane(
Expand Down Expand Up @@ -72,12 +76,15 @@ class MyApp extends StatelessWidget {

// The child of the Slidable is what the user sees when the
// component is not dragged.
child: const ListTile(title: Text('Slide me')),
child:(controller)=> GestureDetector(
onTap: (){
controller.openEndActionPane();
},
child: const ListTile(title: Text('Slide me'))),
),
Slidable(
// Specify a key if the Slidable is dismissible.
key: const ValueKey(1),

// The start action pane is the one at the left or the top side.
startActionPane: const ActionPane(
// A motion is a widget used to control how the pane animates.
Expand Down Expand Up @@ -108,8 +115,7 @@ class MyApp extends StatelessWidget {
motion: const ScrollMotion(),
dismissible: DismissiblePane(onDismissed: () {}),
children: const [
SlidableAction(
// An action can be bigger than the others.
SlidableAction(// An action can be bigger than the others.
flex: 2,
onPressed: doNothing,
backgroundColor: Color(0xFF7BC043),
Expand All @@ -129,7 +135,7 @@ class MyApp extends StatelessWidget {

// The child of the Slidable is what the user sees when the
// component is not dragged.
child: const ListTile(title: Text('Slide me')),
child: (controller)=>const ListTile(title: Text('Slide me')),
),
],
),
Expand Down
Loading