Merge pull request #82 from KieranLafferty/master
Expose ScrollViewKeyboardDismissBehavior to LIstView
This commit is contained in:
@@ -104,6 +104,7 @@ class MessageListView extends StatefulWidget {
|
|||||||
this.onThreadTap,
|
this.onThreadTap,
|
||||||
this.dateDividerBuilder,
|
this.dateDividerBuilder,
|
||||||
this.scrollPhysics = const AlwaysScrollableScrollPhysics(),
|
this.scrollPhysics = const AlwaysScrollableScrollPhysics(),
|
||||||
|
this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
/// Function used to build a custom message widget
|
/// Function used to build a custom message widget
|
||||||
@@ -128,6 +129,9 @@ class MessageListView extends StatefulWidget {
|
|||||||
/// The ScrollPhysics used by the ListView
|
/// The ScrollPhysics used by the ListView
|
||||||
final ScrollPhysics scrollPhysics;
|
final ScrollPhysics scrollPhysics;
|
||||||
|
|
||||||
|
/// The [ScrollViewKeyboardDismissBehavior] used by the ListView
|
||||||
|
final ScrollViewKeyboardDismissBehavior keyboardDismissBehavior;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_MessageListViewState createState() => _MessageListViewState();
|
_MessageListViewState createState() => _MessageListViewState();
|
||||||
}
|
}
|
||||||
@@ -159,6 +163,7 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
child: ListView.custom(
|
child: ListView.custom(
|
||||||
key: Key('messageListView'),
|
key: Key('messageListView'),
|
||||||
physics: widget.scrollPhysics,
|
physics: widget.scrollPhysics,
|
||||||
|
keyboardDismissBehavior: widget.keyboardDismissBehavior,
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
reverse: true,
|
reverse: true,
|
||||||
childrenDelegate: SliverChildBuilderDelegate(
|
childrenDelegate: SliverChildBuilderDelegate(
|
||||||
|
|||||||
Reference in New Issue
Block a user