remove scroll controller from message view
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2022-06-10 12:24:38 -07:00
parent 0c9be47e17
commit b3e11cfffd
2 changed files with 2 additions and 5 deletions

View File

@ -42,7 +42,6 @@ class _MessageViewState extends State<MessageView> {
final focusNode = FocusNode();
int selectedContact = -1;
ItemPositionsListener scrollListener = ItemPositionsListener.create();
ItemScrollController scrollController = ItemScrollController();
File? imagePreview;
@override
@ -134,7 +133,7 @@ class _MessageViewState extends State<MessageView> {
onPressed: () {
Provider.of<AppState>(context, listen: false).initialScrollIndex = 0;
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,
appBar: AppBar(
@ -172,7 +171,6 @@ class _MessageViewState extends State<MessageView> {
body: Padding(
padding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 108.0),
child: MessageList(
scrollController,
scrollListener,
)),
bottomSheet: _buildComposeBox(),

View File

@ -13,9 +13,8 @@ import '../main.dart';
import '../settings.dart';
class MessageList extends StatefulWidget {
ItemScrollController scrollController;
ItemPositionsListener scrollListener;
MessageList(this.scrollController, this.scrollListener);
MessageList(this.scrollListener);
@override
_MessageListState createState() => _MessageListState();