reset unreadMessages
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
16b1019099
commit
35417a8b24
|
@ -39,20 +39,27 @@ class _MessageViewState extends State<MessageView> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(Provider.of<ContactInfoState>(context).nickname),
|
||||
actions: [
|
||||
IconButton(icon: Icon(Icons.chat), onPressed: _pushContactSettings),
|
||||
IconButton(icon: Icon(Icons.list), onPressed: _pushContactSettings),
|
||||
IconButton(icon: Icon(Icons.push_pin), onPressed: _pushContactSettings),
|
||||
IconButton(icon: Icon(Icons.settings), onPressed: _pushContactSettings),
|
||||
IconButton(icon: Icon(Icons.bug_report_outlined), onPressed: _debugResetContact),
|
||||
],
|
||||
),
|
||||
body: Padding(padding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 108.0), child: MessageList()),
|
||||
bottomSheet: _buildComposeBox(),
|
||||
);
|
||||
return WillPopScope(
|
||||
onWillPop: _onWillPop,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(Provider.of<ContactInfoState>(context).nickname),
|
||||
actions: [
|
||||
IconButton(icon: Icon(Icons.chat), onPressed: _pushContactSettings),
|
||||
IconButton(icon: Icon(Icons.list), onPressed: _pushContactSettings),
|
||||
IconButton(icon: Icon(Icons.push_pin), onPressed: _pushContactSettings),
|
||||
IconButton(icon: Icon(Icons.settings), onPressed: _pushContactSettings),
|
||||
IconButton(icon: Icon(Icons.bug_report_outlined), onPressed: _debugResetContact),
|
||||
],
|
||||
),
|
||||
body: Padding(padding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 108.0), child: MessageList()),
|
||||
bottomSheet: _buildComposeBox(),
|
||||
));
|
||||
}
|
||||
|
||||
Future<bool> _onWillPop() async {
|
||||
Provider.of<ContactInfoState>(context, listen: false).unreadMessages = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void _debugResetContact() {
|
||||
|
|
|
@ -87,6 +87,7 @@ class _ContactRowState extends State<ContactRow> {
|
|||
}
|
||||
|
||||
void _pushMessageView(String handle) {
|
||||
Provider.of<ProfileInfoState>(context).contactList.getContact(handle).unreadMessages = 0;
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (BuildContext builderContext) {
|
||||
|
|
Loading…
Reference in New Issue