| 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()); |