mcrovero / rubber

An elastic material bottom sheet implementation for Flutter.
BSD 2-Clause "Simplified" License
562 stars 88 forks source link

Swipe down to get a status listener? #25

Closed ssatz closed 5 years ago

ssatz commented 5 years ago

how to get a status of swipe down using listener?

ssatz commented 5 years ago

I added GestureDetector and it stops on vertical dragdown. This solves the problem for me without the listener

GestureDetector(
      onVerticalDragDown: (details) {},
      child: Container(
        decoration: BoxDecoration(
            color: Colors.white,
            boxShadow: [BoxShadow(color: Colors.white, blurRadius: 5)],
            borderRadius: BorderRadius.only(
                topLeft: Radius.elliptical(100, 50),
                topRight: Radius.elliptical(100, 50))),
        padding: EdgeInsets.all(30),
        child: Stack(
          children: <Widget>[
            Wrap(
              children: <Widget>[
                Center(child: Text('Add a new task')),
                TextFormField(
                  decoration: const InputDecoration(
                    labelText: 'Task *',
                  ),
                  onSaved: (String value) {},
                  validator: (String value) {
                    return value.contains('@')
                        ? 'Do not use the @ char.'
                        : null;
                  },
                ),
              ],
            ),
          ],
        ),
      ),
    );