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