Dn-a / flutter_inner_drawer

Inner Drawer is an easy way to create an internal side section (left/right) where you can insert a list-menu or other.
https://pub.dartlang.org/packages/flutter_inner_drawer
MIT License
514 stars 129 forks source link

can't using left/right gesture #37

Open programmerElephant opened 4 years ago

programmerElephant commented 4 years ago

when i set offset:IDOffset.horizontal(1), i can't use gesture to swipe back can you help me thanks

Dn-a commented 4 years ago

@programmerElephant more details please. Share your code

akashicrecorder commented 4 years ago

@Dn-a i have the same issue. how to use gesture to swipe back when offset is 1 and leftChild is opened

@override
  Widget build(BuildContext context) {
    return InnerDrawer(
      offset: IDOffset.only(left: 1),
      leftChild: Container(
        alignment: Alignment.center,
        child: Text("data"),
      ),
      scaffold: Scaffold(
        body: Container(
          alignment: Alignment.center,
          child: Text("body"),
        ),
      ),
    );
  }
Dn-a commented 4 years ago

@akashicrecorder

InnerDrawer(key: _innerDrawerKey,...);

  final GlobalKey<InnerDrawerState> _innerDrawerKey = GlobalKey<InnerDrawerState>();    

You have three possibilities

_innerDrawerKey.currentState.open(              
        direction: InnerDrawerDirection.end  // optional
       );

    _innerDrawerKey.currentState.close();

    _innerDrawerKey.currentState.toggle();