Formatting
This commit is contained in:
parent
7febeeadb6
commit
ff55f70bd4
|
@ -284,6 +284,5 @@ ThemeData mkThemeData(Settings opaque) {
|
|||
snackBarTheme: SnackBarThemeData(
|
||||
backgroundColor: opaque.current().snackbarBackgroundColor,
|
||||
contentTextStyle: TextStyle(color: opaque.current().snackbarTextColor),
|
||||
)
|
||||
);
|
||||
));
|
||||
}
|
||||
|
|
|
@ -122,39 +122,38 @@ class _MessageListState extends State<MessageList> {
|
|||
image: AssetImage("assets/core/negative_heart_512px.png"),
|
||||
colorFilter: ColorFilter.mode(Provider.of<Settings>(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<ContactInfoState>(outerContext).messageScrollController,
|
||||
initialScrollIndex: initi > 4 ? initi - 4 : 0,
|
||||
itemCount: Provider.of<ContactInfoState>(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<ProfileInfoState>(itemBuilderContext, listen: false).onion;
|
||||
var contactHandle = Provider.of<ContactInfoState>(itemBuilderContext, listen: false).identifier;
|
||||
var messageIndex = index;
|
||||
? ScrollablePositionedList.builder(
|
||||
itemPositionsListener: widget.scrollListener,
|
||||
itemScrollController: Provider.of<ContactInfoState>(outerContext).messageScrollController,
|
||||
initialScrollIndex: initi > 4 ? initi - 4 : 0,
|
||||
itemCount: Provider.of<ContactInfoState>(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<ProfileInfoState>(itemBuilderContext, listen: false).onion;
|
||||
var contactHandle = Provider.of<ContactInfoState>(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<ContactInfoState>(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<ContactInfoState>(itemBuilderContext, listen: false).getMessageKey(contactHandle, messageIndex);
|
||||
return message.getWidget(fbcontext, key, messageIndex);
|
||||
} else {
|
||||
return MessageLoadingBubble();
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
)
|
||||
: null)))
|
||||
)
|
||||
: null)))
|
||||
])));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue