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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return WillPopScope(
|
||||||
appBar: AppBar(
|
onWillPop: _onWillPop,
|
||||||
title: Text(Provider.of<ContactInfoState>(context).nickname),
|
child: Scaffold(
|
||||||
actions: [
|
appBar: AppBar(
|
||||||
IconButton(icon: Icon(Icons.chat), onPressed: _pushContactSettings),
|
title: Text(Provider.of<ContactInfoState>(context).nickname),
|
||||||
IconButton(icon: Icon(Icons.list), onPressed: _pushContactSettings),
|
actions: [
|
||||||
IconButton(icon: Icon(Icons.push_pin), onPressed: _pushContactSettings),
|
IconButton(icon: Icon(Icons.chat), onPressed: _pushContactSettings),
|
||||||
IconButton(icon: Icon(Icons.settings), onPressed: _pushContactSettings),
|
IconButton(icon: Icon(Icons.list), onPressed: _pushContactSettings),
|
||||||
IconButton(icon: Icon(Icons.bug_report_outlined), onPressed: _debugResetContact),
|
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(),
|
),
|
||||||
);
|
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() {
|
void _debugResetContact() {
|
||||||
|
|
|
@ -87,6 +87,7 @@ class _ContactRowState extends State<ContactRow> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _pushMessageView(String handle) {
|
void _pushMessageView(String handle) {
|
||||||
|
Provider.of<ProfileInfoState>(context).contactList.getContact(handle).unreadMessages = 0;
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute<void>(
|
MaterialPageRoute<void>(
|
||||||
builder: (BuildContext builderContext) {
|
builder: (BuildContext builderContext) {
|
||||||
|
|
Loading…
Reference in New Issue