remove scroll controller from message view
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
0c9be47e17
commit
b3e11cfffd
|
@ -42,7 +42,6 @@ class _MessageViewState extends State<MessageView> {
|
||||||
final focusNode = FocusNode();
|
final focusNode = FocusNode();
|
||||||
int selectedContact = -1;
|
int selectedContact = -1;
|
||||||
ItemPositionsListener scrollListener = ItemPositionsListener.create();
|
ItemPositionsListener scrollListener = ItemPositionsListener.create();
|
||||||
ItemScrollController scrollController = ItemScrollController();
|
|
||||||
File? imagePreview;
|
File? imagePreview;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -134,7 +133,7 @@ class _MessageViewState extends State<MessageView> {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Provider.of<AppState>(context, listen: false).initialScrollIndex = 0;
|
Provider.of<AppState>(context, listen: false).initialScrollIndex = 0;
|
||||||
Provider.of<AppState>(context, listen: false).unreadMessagesBelow = false;
|
Provider.of<AppState>(context, listen: false).unreadMessagesBelow = false;
|
||||||
scrollController.scrollTo(index: 0, duration: Duration(milliseconds: 600));
|
Provider.of<ContactInfoState>(context).messageScrollController.scrollTo(index: 0, duration: Duration(milliseconds: 600));
|
||||||
})
|
})
|
||||||
: null,
|
: null,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
@ -172,7 +171,6 @@ class _MessageViewState extends State<MessageView> {
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 108.0),
|
padding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 108.0),
|
||||||
child: MessageList(
|
child: MessageList(
|
||||||
scrollController,
|
|
||||||
scrollListener,
|
scrollListener,
|
||||||
)),
|
)),
|
||||||
bottomSheet: _buildComposeBox(),
|
bottomSheet: _buildComposeBox(),
|
||||||
|
|
|
@ -13,9 +13,8 @@ import '../main.dart';
|
||||||
import '../settings.dart';
|
import '../settings.dart';
|
||||||
|
|
||||||
class MessageList extends StatefulWidget {
|
class MessageList extends StatefulWidget {
|
||||||
ItemScrollController scrollController;
|
|
||||||
ItemPositionsListener scrollListener;
|
ItemPositionsListener scrollListener;
|
||||||
MessageList(this.scrollController, this.scrollListener);
|
MessageList(this.scrollListener);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_MessageListState createState() => _MessageListState();
|
_MessageListState createState() => _MessageListState();
|
||||||
|
|
Loading…
Reference in New Issue