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

centerTitle: true, centerTitle: true,
title: Text("Thông báo"), title: Text("Thông báo"),
actions: <Widget>[ 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()); body: InfinityView());

Loading…
Cancel
Save