Browse Source

show done all button notiscreen when have data

master
daivph 5 years ago
parent
commit
80dd8bf10b
1 changed files with 18 additions and 6 deletions
  1. +18
    -6
      lib/presentation/screens/notification/sc_notification.dart

+ 18
- 6
lib/presentation/screens/notification/sc_notification.dart View File

@@ -37,12 +37,24 @@ class HoldInfinityWidget extends StatelessWidget {
centerTitle: true,
title: Text("Thông báo"),
actions: <Widget>[
IconButton(
icon: Icon(Icons.done_all),
onPressed: () {
BlocProvider.of<NotiBloc>(context)
.add(MarkAllNotificationUpdate(status: "1"));
})
BlocBuilder<NotiBloc, NotiState>(
builder: (context, state) {
if (state is NotiSuccess) {
if (state.items.length > 0) {
return IconButton(
icon: Icon(Icons.done_all),
onPressed: () {
BlocProvider.of<NotiBloc>(context)
.add(MarkAllNotificationUpdate(status: "1"));
});
} else {
return SizedBox();
}
} else {
return SizedBox();
}
},
)
],
),
body: InfinityView());

Loading…
Cancel
Save