diff --git a/lib/themes/opaque.dart b/lib/themes/opaque.dart index 6c4741c4..3cccbc2a 100644 --- a/lib/themes/opaque.dart +++ b/lib/themes/opaque.dart @@ -284,6 +284,5 @@ ThemeData mkThemeData(Settings opaque) { snackBarTheme: SnackBarThemeData( backgroundColor: opaque.current().snackbarBackgroundColor, contentTextStyle: TextStyle(color: opaque.current().snackbarTextColor), - ) - ); + )); } diff --git a/lib/widgets/messagelist.dart b/lib/widgets/messagelist.dart index 88289fe8..0951334b 100644 --- a/lib/widgets/messagelist.dart +++ b/lib/widgets/messagelist.dart @@ -122,39 +122,38 @@ class _MessageListState extends State { image: AssetImage("assets/core/negative_heart_512px.png"), colorFilter: ColorFilter.mode(Provider.of(context).theme.hilightElementColor.withOpacity(0.15), BlendMode.srcIn))), // Don't load messages for syncing server... - child: - Padding( + child: Padding( padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 20.0), child: loadMessages - ? ScrollablePositionedList.builder( - itemPositionsListener: widget.scrollListener, - itemScrollController: Provider.of(outerContext).messageScrollController, - initialScrollIndex: initi > 4 ? initi - 4 : 0, - itemCount: Provider.of(outerContext).totalMessages, - reverse: true, // NOTE: There seems to be a bug in flutter that corrects the mouse wheel scroll, but not the drag direction... - itemBuilder: (itemBuilderContext, index) { - var profileOnion = Provider.of(itemBuilderContext, listen: false).onion; - var contactHandle = Provider.of(itemBuilderContext, listen: false).identifier; - var messageIndex = index; + ? ScrollablePositionedList.builder( + itemPositionsListener: widget.scrollListener, + itemScrollController: Provider.of(outerContext).messageScrollController, + initialScrollIndex: initi > 4 ? initi - 4 : 0, + itemCount: Provider.of(outerContext).totalMessages, + reverse: true, // NOTE: There seems to be a bug in flutter that corrects the mouse wheel scroll, but not the drag direction... + itemBuilder: (itemBuilderContext, index) { + var profileOnion = Provider.of(itemBuilderContext, listen: false).onion; + var contactHandle = Provider.of(itemBuilderContext, listen: false).identifier; + var messageIndex = index; - return FutureBuilder( - future: messageHandler(itemBuilderContext, profileOnion, contactHandle, ByIndex(messageIndex)), - builder: (fbcontext, snapshot) { - if (snapshot.hasData) { - var message = snapshot.data as Message; - // here we create an index key for the contact and assign it to the row. Indexes are unique so we can - // reliably use this without running into duplicate keys...it isn't ideal as it means keys need to be re-built - // when new messages are added...however it is better than the alternative of not having widget keys at all. - var key = Provider.of(itemBuilderContext, listen: false).getMessageKey(contactHandle, messageIndex); - return message.getWidget(fbcontext, key, messageIndex); - } else { - return MessageLoadingBubble(); - } + return FutureBuilder( + future: messageHandler(itemBuilderContext, profileOnion, contactHandle, ByIndex(messageIndex)), + builder: (fbcontext, snapshot) { + if (snapshot.hasData) { + var message = snapshot.data as Message; + // here we create an index key for the contact and assign it to the row. Indexes are unique so we can + // reliably use this without running into duplicate keys...it isn't ideal as it means keys need to be re-built + // when new messages are added...however it is better than the alternative of not having widget keys at all. + var key = Provider.of(itemBuilderContext, listen: false).getMessageKey(contactHandle, messageIndex); + return message.getWidget(fbcontext, key, messageIndex); + } else { + return MessageLoadingBubble(); + } + }, + ); }, - ); - }, - ) - : null))) + ) + : null))) ]))); } }