Formatting
This commit is contained in:
parent
7febeeadb6
commit
ff55f70bd4
|
@ -284,6 +284,5 @@ ThemeData mkThemeData(Settings opaque) {
|
||||||
snackBarTheme: SnackBarThemeData(
|
snackBarTheme: SnackBarThemeData(
|
||||||
backgroundColor: opaque.current().snackbarBackgroundColor,
|
backgroundColor: opaque.current().snackbarBackgroundColor,
|
||||||
contentTextStyle: TextStyle(color: opaque.current().snackbarTextColor),
|
contentTextStyle: TextStyle(color: opaque.current().snackbarTextColor),
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,39 +122,38 @@ class _MessageListState extends State<MessageList> {
|
||||||
image: AssetImage("assets/core/negative_heart_512px.png"),
|
image: AssetImage("assets/core/negative_heart_512px.png"),
|
||||||
colorFilter: ColorFilter.mode(Provider.of<Settings>(context).theme.hilightElementColor.withOpacity(0.15), BlendMode.srcIn))),
|
colorFilter: ColorFilter.mode(Provider.of<Settings>(context).theme.hilightElementColor.withOpacity(0.15), BlendMode.srcIn))),
|
||||||
// Don't load messages for syncing server...
|
// Don't load messages for syncing server...
|
||||||
child:
|
child: Padding(
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 20.0),
|
padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 20.0),
|
||||||
child: loadMessages
|
child: loadMessages
|
||||||
? ScrollablePositionedList.builder(
|
? ScrollablePositionedList.builder(
|
||||||
itemPositionsListener: widget.scrollListener,
|
itemPositionsListener: widget.scrollListener,
|
||||||
itemScrollController: Provider.of<ContactInfoState>(outerContext).messageScrollController,
|
itemScrollController: Provider.of<ContactInfoState>(outerContext).messageScrollController,
|
||||||
initialScrollIndex: initi > 4 ? initi - 4 : 0,
|
initialScrollIndex: initi > 4 ? initi - 4 : 0,
|
||||||
itemCount: Provider.of<ContactInfoState>(outerContext).totalMessages,
|
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...
|
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) {
|
itemBuilder: (itemBuilderContext, index) {
|
||||||
var profileOnion = Provider.of<ProfileInfoState>(itemBuilderContext, listen: false).onion;
|
var profileOnion = Provider.of<ProfileInfoState>(itemBuilderContext, listen: false).onion;
|
||||||
var contactHandle = Provider.of<ContactInfoState>(itemBuilderContext, listen: false).identifier;
|
var contactHandle = Provider.of<ContactInfoState>(itemBuilderContext, listen: false).identifier;
|
||||||
var messageIndex = index;
|
var messageIndex = index;
|
||||||
|
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
future: messageHandler(itemBuilderContext, profileOnion, contactHandle, ByIndex(messageIndex)),
|
future: messageHandler(itemBuilderContext, profileOnion, contactHandle, ByIndex(messageIndex)),
|
||||||
builder: (fbcontext, snapshot) {
|
builder: (fbcontext, snapshot) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
var message = snapshot.data as Message;
|
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
|
// 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
|
// 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.
|
// 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);
|
var key = Provider.of<ContactInfoState>(itemBuilderContext, listen: false).getMessageKey(contactHandle, messageIndex);
|
||||||
return message.getWidget(fbcontext, key, messageIndex);
|
return message.getWidget(fbcontext, key, messageIndex);
|
||||||
} else {
|
} else {
|
||||||
return MessageLoadingBubble();
|
return MessageLoadingBubble();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
);
|
)
|
||||||
},
|
: null)))
|
||||||
)
|
|
||||||
: null)))
|
|
||||||
])));
|
])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue